Re: [GENERAL] Storing blobs in PG DB

2007-04-06 Thread Dave Page
Thomas Kellerer wrote: Merlin Moncure wrote on 05.04.2007 23:24: I think most reasons why not to store binaries in the database boil down to performance. Having implemented an application where the files were stored in the filesystem instead of the database I have to say, with my experience

Re: [GENERAL] Storing blobs in PG DB

2007-04-06 Thread Peter Wilson
Nikolay Moskvichev wrote: Hi All! Question is : How suitable PG for storing about 2 000 000 binary files 0,5-2,0 Mb size each ? It is not planned the big number of clients or a plenty of updatings. Like photoalbum on local host. In our CMS we store all page data in the database - either

Re: RES: [GENERAL] Order by behaviour

2007-04-06 Thread Martijn van Oosterhout
On Thu, Apr 05, 2007 at 06:46:27PM -0300, Carlos H. Reimer wrote: Hi, I was trying to find the docs about the collating sequence standards but could not find. Would like to know for example which characters are ignored by the order by in some of the collating types. There are no

Re: [GENERAL] problem selecting from function

2007-04-06 Thread Michael Fuhr
On Fri, Apr 06, 2007 at 03:52:17AM +0200, Rikard Pavelic wrote: When I select from this function I get an error ERROR: record red has no field id [...] create function select_ex1(out id int, out name1 varchar, out value1 int) returns setof record as $$ declare red record; begin for

[GENERAL] Database replication.

2007-04-06 Thread Dominik Żyła
Hi! I need to make database synchronization. I know slone-i to deal with it, but I need real time replication, without any trigers with db structure setup. Can someone recommend me some alternative for slone-i? It can be some commercial stuff too. Thanks a lot.

[GENERAL] SQL WHERE: many sql or large IN()

2007-04-06 Thread tom
I'm wondering where the differences are in running two different types of SQL statements. Given ~300 tokens/words I can either run 1 sql statement with a large list in a WHERE foo IN (...300 tokens...) or I can run ~300 statements, one for each token. In the first case, the SQL is not

Re: [GENERAL] SQL WHERE: many sql or large IN()

2007-04-06 Thread Oleg Bartunov
Tom, have you seen contrib/intarray ? Oleg On Fri, 6 Apr 2007, tom wrote: I'm wondering where the differences are in running two different types of SQL statements. Given ~300 tokens/words I can either run 1 sql statement with a large list in a WHERE foo IN (...300 tokens...) or I can run

Re: [GENERAL] SQL WHERE: many sql or large IN()

2007-04-06 Thread tom
If I read this right, intarray is for reading values from an array data type. I don't have this. I have a varchar() field that is indexed (unique), call it 'foo' I have a choice of running: SELECT bar FROM tokens WHERE foo IN ('apple','orange','biscuit') for up to ~300 words OR

Re: [GENERAL] SQL WHERE: many sql or large IN()

2007-04-06 Thread Oleg Bartunov
Aha, then why not use gin index for text[] ? see, for example, my testing http://www.sai.msu.su/~megera/wiki/GinTest oleg On Fri, 6 Apr 2007, tom wrote: If I read this right, intarray is for reading values from an array data type. I don't have this. I have a varchar() field that is indexed

Re: [GENERAL] SQL WHERE: many sql or large IN()

2007-04-06 Thread Listmail
I have a choice of running: SELECT bar FROM tokens WHERE foo IN ('apple','orange','biscuit') for up to ~300 words OR SELECT bar FROM tokens WHERE foo = 'apple' up to ~300 times as a prepared/cached SQL statements. With new PG versions you can also use VALUES which will save you

Re: [GENERAL] simple coordinate system

2007-04-06 Thread Bruno Wolff III
On Fri, Mar 16, 2007 at 15:55:15 +0100, Robin Ericsson [EMAIL PROTECTED] wrote: On 3/16/07, Tom Lane [EMAIL PROTECTED] wrote: Robin Ericsson [EMAIL PROTECTED] writes: Yes, I've looked at those, I was thinking that point looked like a good type, but it's only 2d, so maybe I need a hint on

Re: [GENERAL] Storing blobs in PG DB

2007-04-06 Thread Nikolay Moskvichev
Postgres User пишет: I recently heard from Josh Berkus that at least one major CMS application uses Postgres to store entire HTML pages (including image files) in order to support full versioning. As a general rule, I prefer not to store BLOBS in a DB- I'd rather leave the BLOB in the file

[GENERAL] Help!! Crash recovery

2007-04-06 Thread Jaime Silvela
I know you've probably discussed this in many places, but I have a crash right now I need to recover from, and I'm not finding documentation that fast. Where should I go? Here are the details on starting, after a kill -9 of a process brought Postgres down. Is there a page/s with information

[GENERAL] How to suppress NOTICE messages

2007-04-06 Thread O.B.
How does one suppress NOTICE messages from appearing in stderr? I have the following command and it appears that setting client_min_messages to WARNING does not work. psql -U postgres -d mytestdb -f mytest.sql -v client_min_messages=WARNING -W ---(end of

[GENERAL] One database serveral schemas and group roles

2007-04-06 Thread joachim.sommer
Hallo List, I am bit stuck as a postgresql newbie with the definition of schemas. I am setting up a geodatabase with postgis under windows plattform - wapp strategy - and I would like to have several schemas within one database. Schema names should corresponde to the name of a group roles each

Re: [GENERAL] Storing blobs in PG DB

2007-04-06 Thread Nikolay Moskvichev
Naz Gassiep пишет: This doesn't answer your question, but I thought I'd throw my opinion in anyway. My personal view is that in general, binary files have no place in databases. Filesystems are for files, databases are for data. My design choice is to store the files in a fileystem and use

Re: [GENERAL] a couple of newbie question - deferrable, varchar vs text, 2 dbs

2007-04-06 Thread Sergei Shelukhin
Thanks :) As for pt3, I don't have the database I will use yet so it's hard to test :( ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Storing blobs in PG DB

2007-04-06 Thread Nikolay Moskvichev
You don't like filesystems ? You know file system which supports SQL, referential integrity, and managed transactions ? ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Storing blobs in PG DB

2007-04-06 Thread Nikolay Moskvichev
Harvey, Allan AC пишет: I find it fine. Bit different usage though. I store about 200 50MB items. Thanks ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

[GENERAL] 8.2.3 AutoVacuum not running

2007-04-06 Thread Schwenker, Stephen
Hello, I've just compiled an instance of Postgresql 8.2.3 on a new linux box and have added some databases to it. I've noticed however that the autovacuum is not running. I have turned on the autovacuum, stats_start_collector, and stats_row_level and still the autovacuum is not running. Can

Re: [GENERAL] Storing blobs in PG DB

2007-04-06 Thread Nikolay Moskvichev
This doesn't answer your question, but I thought I'd throw my opinion in anyway. My personal view is that in general, binary files have no place in databases. Filesystems are for files, databases are for data. My design choice is to store the files in a fileystem and use the database to

[GENERAL] YTA Time Zone Question

2007-04-06 Thread Danny Armstrong
Hi, I have a question regarding postgres 8.2 handling of timezones. I receive posts of unix timestamps and convert them and save them to a timestamptz(0). I've read the docs on this, timestamptz stores internally as utc. The date is formatted per local time on display. If ruby and python tell

Re: [GENERAL] newid() in postgres

2007-04-06 Thread marcel.beutner
Hello, Thanks a lot for your answers! But I don't need a sequence which only will be incremented. I need a _real_ GUID just as the newid() function. Is there no way to generate such a GUID? I need a real GUID because I use them further in my host app. And my host app relies on it. Thanks for

Re: [GENERAL] Anyone know where I can get an 8.2.3 binary for ubuntu?

2007-04-06 Thread Leonel
On 4/5/07, Listmail [EMAIL PROTECTED] wrote: On 4/5/07, Michelle Konzack [EMAIL PROTECTED] wrote: Am 2007-04-01 12:05:44, schrieb Leonel: and once you downloaded the packages do a : apt-get build-deps postgresql-8.1 Are you sure? -- It should be: You don't have the build-dep

Re: [GENERAL] SQL WHERE: many sql or large IN()

2007-04-06 Thread Markus Schiltknecht
Hi, tom wrote: Initially it seems that the WHERE IN (...) approach takes a turn for the worse when the list gets very large. What version do you use? PostgreSQL 8.2 had great improvements for that specific issue. Did you try EXPLAIN? Regards Markus ---(end of

[GENERAL] No of triggers of one single table

2007-04-06 Thread Harpreet Dhaliwal
Hi, Can i have more than one trigger on one single table. Actually I want 2 different events to take place simultaneously and independently after insert. ~Harpreet.

Re: [GENERAL] How to suppress NOTICE messages

2007-04-06 Thread Tom Lane
O.B. [EMAIL PROTECTED] writes: How does one suppress NOTICE messages from appearing in stderr? I have the following command and it appears that setting client_min_messages to WARNING does not work. psql -U postgres -d mytestdb -f mytest.sql -v client_min_messages=WARNING -W You seem to be

Re: [GENERAL] YTA Time Zone Question

2007-04-06 Thread Tom Lane
Danny Armstrong [EMAIL PROTECTED] writes: What am I misunderstanding and how do I get it to interpret the value as utc and then not offset it when I view it, like python and ruby do? What you're misunderstanding is that you messed up the data when you put it into the database, probably by

Re: [GENERAL] 8.2.3 AutoVacuum not running

2007-04-06 Thread Tom Lane
Schwenker, Stephen [EMAIL PROTECTED] writes: I've just compiled an instance of Postgresql 8.2.3 on a new linux box and have added some databases to it. I've noticed however that the autovacuum is not running. How sure are you of that? Check pg_stat_all_tables to see if the last_autovacuum

Re: [GENERAL] YTA Time Zone Question

2007-04-06 Thread Michael Fuhr
On Thu, Apr 05, 2007 at 05:52:02PM -0700, Danny Armstrong wrote: If ruby and python tell me the value I just inserted into the db, 1174773136, is Sat Mar 24 21:52:16 UTC 2007, then I expect that set time zone 0; -- format as though I'm in utc select measurement_time from table will also

Re: [GENERAL] No of triggers of one single table

2007-04-06 Thread Michael Fuhr
On Fri, Apr 06, 2007 at 01:10:13PM -0400, Harpreet Dhaliwal wrote: Can i have more than one trigger on one single table. Actually I want 2 different events to take place simultaneously and independently after insert. What happened when you tried it? -- Michael Fuhr

Re: [GENERAL] SQL WHERE: many sql or large IN()

2007-04-06 Thread Listmail
On Fri, 06 Apr 2007 18:45:15 +0200, Markus Schiltknecht [EMAIL PROTECTED] wrote: Hi, tom wrote: Initially it seems that the WHERE IN (...) approach takes a turn for the worse when the list gets very large. Since I use this a lot on webpages, I thought maybe a little benchmark is in

Re: [GENERAL] SQL WHERE: many sql or large IN()

2007-04-06 Thread tom
I've never seen this before. Is this PG specific or generic SQL that I've never been exposed to? On Apr 6, 2007, at 10:08 AM, Listmail wrote: I have a choice of running: SELECT bar FROM tokens WHERE foo IN ('apple','orange','biscuit') for up to ~300 words OR SELECT bar FROM

Re: [GENERAL] SQL WHERE: many sql or large IN()

2007-04-06 Thread Listmail
I've never seen this before. Is this PG specific or generic SQL that I've never been exposed to? http://www.postgresql.org/docs/8.2/interactive/sql-values.html VALUES conforms to the SQL standard, except that LIMIT and OFFSET are PostgreSQL extensions. It doesn't seem like much

Re: [GENERAL] SQL WHERE: many sql or large IN()

2007-04-06 Thread Tom Lane
tom [EMAIL PROTECTED] writes: I've never seen this before. Is this PG specific or generic SQL that I've never been exposed to? It's in the SQL standard. SQL92 saith table value constructor ::= VALUES table value constructor list table value constructor list

[GENERAL] reindexing keys in postgres

2007-04-06 Thread Harpreet Dhaliwal
Hi, Lately i was searching for a way I could reindex all my keys. Primary Keys in particular. Really didn't find any manual that could guide me through. Reason i wanted to reindex my PK is that whenever i insert a record in the table, even though that record is unique, i get an error saying

Re: [GENERAL] reindexing keys in postgres

2007-04-06 Thread Bill Moran
In response to Harpreet Dhaliwal [EMAIL PROTECTED]: Hi, Lately i was searching for a way I could reindex all my keys. Primary Keys in particular. Really didn't find any manual that could guide me through. Reason i wanted to reindex my PK is that whenever i insert a record in the table,

Re: [GENERAL] Help!! Crash recovery

2007-04-06 Thread Bill Moran
In response to Jaime Silvela [EMAIL PROTECTED]: I know you've probably discussed this in many places, but I have a crash right now I need to recover from, and I'm not finding documentation that fast. Where should I go? Here are the details on starting, after a kill -9 of a process

[GENERAL] performance; disk bad or something?

2007-04-06 Thread Marcus Engene
Hi, There are some performance issues I am still confused over. I've got a Linux box, raid1, 1GB memory CPU-wise the server is mostly idle PG 8.0.10, shared_buffers = 1 work_mem = 16348 maintenance_work_mem = 65536 Parameters are tweaked without much difference. The following query is

Re: [GENERAL] Database replication.

2007-04-06 Thread Jeff Davis
On Fri, 2007-04-06 at 12:47 +0200, Dominik Żyła wrote: Hi! I need to make database synchronization. I know slone-i to deal with it, but I need real time replication, without any trigers with db structure setup. Can someone recommend me some alternative for slone- i? It can be some commercial

Re: [GENERAL] performance; disk bad or something?

2007-04-06 Thread Tom Lane
Marcus Engene [EMAIL PROTECTED] writes: - Index Scan using apa_item_common_x1 on apa_item_common aic (cost=0.00..4956.68 rows=1174 width=8) (actual time=19.854..9557.606 rows=1226 loops=1) If the table only has 12000 rows then it should never have used an index scan here at all

[GENERAL] New to concurrency

2007-04-06 Thread John D. Burger
For the first time, I find myself wanting to use some of PG's concurrency control stuff, and I could use some advice. I have requests showing up in a database, and I have one or more servers picking these up with listen/notice. The requests go into a table with a status column, which is

Re: [GENERAL] SQL WHERE: many sql or large IN()

2007-04-06 Thread tom
This is some good stuff and I can use the explain analyze going forward. But I can't get these VALUES queries to work. I checked and I am on version 8.1. but I think from the docs that I should still be able to do this. queue= select t.* from test t, (values(4, 23,84884,1,324234)) as v