Re: [GENERAL] unnest with generate_subscripts and same array

2011-05-26 Thread David Fetter
On Thu, May 26, 2011 at 05:17:06PM -0700, Carlos Fuentes wrote: > Hello, > Given that these are the only one array_col in play, is > select unnest(array_col), generate_subscripts(array_col) from > table_with_array_col ; > guaranteed to gave the subscripts match the array element? In all the >

Re: [GENERAL] copy record?

2011-05-26 Thread Jasen Betts
On 2011-05-26, Bosco Rama wrote: > select * into temp table foo from maintable where primcol=123; > update foo set primcol = 456; > insert into maintable select * from foo; > > You also may need this is if you intend to use the same sequence of > calls on within the same session: > > drop

[GENERAL] Feature request: Replicate only parts of a database

2011-05-26 Thread A B
Hi there! I have a small problem, in a database I need to export parts of a database table to another server, and I could easily accomplish ( I hope) that by creating a view and select * from the view and send it over to the other server or use triggers to record what rows are inserted and delete

Re: [GENERAL] "full_page_writes" makes no difference?

2011-05-26 Thread Tian Luo
Thanks Jeff. It makes sense now. I did a test with DBT2 by turning the "full_page_write" on and off. The argument is set to "-d 200 -w 1 -c 10" for a short test. There is a 7 times difference in the number of pages written. When the option is on, 1066 pages are written; When the option is off, 15

Re: [GENERAL] Access to postgres conversion

2011-05-26 Thread Jasen Betts
On 2011-05-25, akp geek wrote: > --000e0cd22f6cd3829104a41ee636 > Content-Type: text/plain; charset=ISO-8859-1 > > Dear all - > > I would like to know if any one has migrated database from MS > access to Postgres . We use postgres 9.0.2 on solaris . Are there any open > source tools t

Re: [GENERAL] 500KB PDF saving into large object , what is the table size?

2011-05-26 Thread Jasen Betts
On 2011-05-18, Emi Lu wrote: > Hello, > > A question about large object column type in postgresql8.3. > > A pdf file=500KB. 8.3 has bytea and largeobject. Largeoibject isn't stored to the table, only a smaller OID is (looks like an integer). largeobject has a stream interface, but not a value in

Re: [GENERAL] unnest with generate_subscripts and same array

2011-05-26 Thread David Johnston
Can't speak to guarantees but arrays, unlike tuples / rows, are inherently ordered and so any operation that decomposes/iterates them will do so in the internal order. So, yes. (without looking at code) But, since you do not have an "ORDER BY on table_with_array_col" so the order in whi

[GENERAL] unnest with generate_subscripts and same array

2011-05-26 Thread Carlos Fuentes
Hello, Given that these are the only one array_col in play, is select unnest(array_col), generate_subscripts(array_col) from table_with_array_col ; guaranteed to gave the subscripts match the array element? In all the testing I've done it's worked, but I don't know if I was just lucky :) Than

Re: [GENERAL] max_connections proposal

2011-05-26 Thread Tom Lane
Craig Ringer writes: > On 05/26/2011 09:48 PM, Tom Lane wrote: >> Craig Ringer writes: >>> max_connections = 100 # (change requires restart) >>> # WARNING: If you're about to increase max_connections above 100, you >>> # should probably be using a connection pool instead. See: >

Re: [GENERAL] max_connections proposal

2011-05-26 Thread Craig Ringer
On 05/26/2011 09:48 PM, Tom Lane wrote: Craig Ringer writes: max_connections = 100 # (change requires restart) # WARNING: If you're about to increase max_connections above 100, you # should probably be using a connection pool instead. See: # http://wiki.postgresql.org/max_

Re: [GENERAL] trigger - dynamic WHERE clause

2011-05-26 Thread Tarlika Elisabeth Schmitz
On Sun, 22 May 2011 20:39:01 +0200 Pavel Stehule wrote: >Hello > >2011/5/22 Tarlika Elisabeth Schmitz : >> EXECUTE 'SELECT 1 FROM ' || TG_TABLE_NAME || ' WHERE ' || whereclause >> || ' FOR UPDATE;'; >> >> I am generating the whereclause dynamically as the number of columns >> queried varies. >> >

Re: [GENERAL] copy record?

2011-05-26 Thread Bosco Rama
Gauthier, Dave wrote: > Well, I found a better way, but still open to suggestions. > > This is what I have so far... > > create temporary table foo as select * from maintable where 1-0; -- Credit 4 > this goes to a post in the PG archives > insert into foo (select * from maintable where primcol

Re: [GENERAL] Miidpoint between two long/lat points? (earthdistance?)

2011-05-26 Thread Merlin Moncure
On Thu, May 26, 2011 at 3:39 PM, Brent Wood wrote: > Why not install PostGIS with full ellipsoidal & projection support & use the > azimuth & distance functions available in SQL? installing postgis is a bit much if all you need to do are simple distance calculations etc. merlin -- Sent via pgs

Re: [GENERAL] copy record?

2011-05-26 Thread Gauthier, Dave
Well, I found a better way, but still open to suggestions. This is what I have so far... create temporary table foo as select * from maintable where 1-0; -- Credit 4 this goes to a post in the PG archives insert into foo (select * from maintable where primcol=123); update foo, set primcol=456;

Re: [GENERAL] Miidpoint between two long/lat points? (earthdistance?)

2011-05-26 Thread Brent Wood
Why not install PostGIS with full ellipsoidal & projection support & use the azimuth & distance functions available in SQL? Brent Wood Brent Wood DBA/GIS consultant NIWA, Wellington New Zealand >>> Carlo Stonebanks 05/27/11 8:20 AM >>> Nicely done, Merlin! Hope others with the same problem can

[GENERAL] copy record?

2011-05-26 Thread Gauthier, Dave
Hi: >From within a perl/DBI script, I want to be able to make a copy of a record in >a table, changing only the value of the primary key. I don't know in advance >what all the columns are, just the table name. I suppose I could pull the column names for the table from the metadata, query the

[GENERAL] #PgWest 2011: CFP now open

2011-05-26 Thread Joshua D. Drake
Hello, The CFP for #PgWest is now open. We are holding it at the San Jose Convention Center from September 27th - 30th. We look forward to seeing your submissions. http://www.postgresqlconference.org/ Joshua D. Drake -- Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Support,

Re: [GENERAL] syntax for updating an aliased table

2011-05-26 Thread Bosco Rama
Andy Chambers wrote: > I'm confused about the correct syntax for updating an aliased table. I want > to update triple from triple_updates > where the data is different and tried to use the following > > update triple old >set > old.obl

Re: [GENERAL] syntax for updating an aliased table

2011-05-26 Thread Rick Genter
The UPDATE statement when multiple tables are involved always drives me nuts. I think what you need to do is remove all of the "old." from the SET clause and use "triple." in the WHERE clause instead of "old." - and remove the old table alias from the UPDATE. On Thu, May 26, 2011 at 9:38 AM, Andy

[GENERAL] syntax for updating an aliased table

2011-05-26 Thread Andy Chambers
I'm confused about the correct syntax for updating an aliased table. I want to update triple from triple_updates where the data is different and tried to use the following update triple old set old.obln = new.obln, old.ointv = new.oint

Re: [GENERAL] Miidpoint between two long/lat points? (earthdistance?)

2011-05-26 Thread Carlo Stonebanks
Nicely done, Merlin! Hope others with the same problem can find this post. Thanks a lot. -Original Message- From: Merlin Moncure [mailto:mmonc...@gmail.com] Sent: May 26, 2011 9:53 AM To: Carlo Stonebanks Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Miidpoint between two long/l

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-26 Thread Tom Lane
Per-Olov Esgard writes: > This is a silly and simple example but it works. The size of the payload > is approximately the same as the one in my real system. [ scratches head... ] I see absolutely no process growth whatsoever when running this test program, on either HEAD or 9.0.4. Backend and

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-26 Thread Merlin Moncure
On Thu, May 26, 2011 at 11:17 AM, Per-Olov Esgard wrote: > This is a silly and simple example but it works. The size of the payload is > approximately the same as the one in my real system. > > It is easy to see the difference when using/not using the notify by just > comment out the pg_notify cal

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-05-26 Thread Scott Marlowe
On Thu, May 26, 2011 at 10:27 AM, Alexander Farber wrote: > > On Thu, May 26, 2011 at 6:23 PM, Scott Marlowe > wrote: >> You need to log more stuff.  Look at the log_line_prefix setting, and >> add things like pid, username, database name, etc. > Actually I have 1 db user accessing 1 db name >

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-05-26 Thread Alexander Farber
Actually I have 1 db user accessing 1 db name (through PHP scripts and 1 game daemon in Perl) On Thu, May 26, 2011 at 6:23 PM, Scott Marlowe wrote: > You need to log more stuff.  Look at the log_line_prefix setting, and > add things like pid, username, database name, etc. > -- Sent via pgsq

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-05-26 Thread Scott Marlowe
On Thu, May 26, 2011 at 10:02 AM, Alexander Farber wrote: > I've switched duration and SQL 'all' logging on, > but I have hard time to identify which SQL statement > has had which duration. You need to log more stuff. Look at the log_line_prefix setting, and add things like pid, username, databa

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-26 Thread Per-Olov Esgard
This is a silly and simple example but it works. The size of the payload is approximately the same as the one in my real system. It is easy to see the difference when using/not using the notify by just comment out the pg_notify call below. The client code is a small perl program which goes on

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-05-26 Thread Alexander Farber
But when I try to look at that wrong index it seems to be ok? # psql psql (8.4.8) Type "help" for help. pref=> \d pref_match Table "public.pref_match" Column | Type |Modifiers ---+---+--

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-05-26 Thread Alexander Farber
I've switched duration and SQL 'all' logging on, but I have hard time to identify which SQL statement has had which duration. For example which SQL statement please has the duration of 13 seconds (13025.016 ms) below? LOG: statement: SELECT 1 AS expression FROM drupal_sessions s

Re: [GENERAL] When is commited data available

2011-05-26 Thread Merlin Moncure
On Thu, May 26, 2011 at 9:33 AM, Fredric Fredricson wrote: > Hi, > I wonder when the committed data is available to other connections, or more > specifically if there is a delay after COMMIT return successfully and the > data will appear in SELECTs made by other connections. > > A more detailed de

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-05-26 Thread Tomas Vondra
Dne 26.5.2011 16:39, Merlin Moncure napsal(a): > On Thu, May 26, 2011 at 9:01 AM, Tomas Vondra wrote: >> Dne 26.5.2011 11:41, Alexander Farber napsal(a): >>> Also I wonder, how's shared memory used by PostgreSQL. >>> I'm irritated - how it could work with 32MB, >>> but now I've got suggestion to i

Re: [GENERAL] When is commited data available

2011-05-26 Thread Vick Khera
On Thu, May 26, 2011 at 10:33 AM, Fredric Fredricson wrote: > I wonder when the committed data is available to other connections, or more > specifically if there is a delay after COMMIT return successfully and the > data will appear in SELECTs made by other connections. Check what your isolation

Re: [GENERAL] When is commited data available

2011-05-26 Thread Tom Lane
Fredric Fredricson writes: > I wonder when the committed data is available to other connections, or > more specifically if there is a delay after COMMIT return successfully > and the data will appear in SELECTs made by other connections. No, there's no delay. regards, t

[GENERAL] When is commited data available

2011-05-26 Thread Fredric Fredricson
Hi, I wonder when the committed data is available to other connections, or more specifically if there is a delay after COMMIT return successfully and the data will appear in SELECTs made by other connections. A more detailed description of my problem: I use postgresql as backend to a REST ser

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-05-26 Thread Merlin Moncure
On Thu, May 26, 2011 at 9:01 AM, Tomas Vondra wrote: > Dne 26.5.2011 11:41, Alexander Farber napsal(a): >> Thank you, I'll try your suggestions. >> >> I'm just slow in doing so, because it's just a >> (sometimes pretty time consuming) hobby-project. >> >> I'm missing knowledge on how to monitor my

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-05-26 Thread Tomas Vondra
Dne 26.5.2011 11:41, Alexander Farber napsal(a): > Thank you, I'll try your suggestions. > > I'm just slow in doing so, because it's just a > (sometimes pretty time consuming) hobby-project. > > I'm missing knowledge on how to monitor my DB status, > i.e. how to check some of the things you've ask

Re: [GENERAL] Miidpoint between two long/lat points? (earthdistance?)

2011-05-26 Thread Merlin Moncure
On Thu, May 26, 2011 at 12:05 AM, Merlin Moncure wrote: > Converted from javascript from here: http://en.wikipedia.org/wiki/Atan2 whoops! meant to say here: http://www.movable-type.co.uk/scripts/latlong.html merlin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make c

Re: [GENERAL] max_connections proposal

2011-05-26 Thread Tom Lane
Craig Ringer writes: > max_connections = 100 # (change requires restart) > # WARNING: If you're about to increase max_connections above 100, you > # should probably be using a connection pool instead. See: > # http://wiki.postgresql.org/max_connections This gives the impress

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-26 Thread Merlin Moncure
On Thu, May 26, 2011 at 7:26 AM, Per-Olov Esgard wrote: > In my environment  which is linux on the server side and both windows and > linux on the client side I have noticed that the introduction of pg_notify > (with payload) makes the size of the postgres processes on the server side > increase m

Re: [GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-26 Thread Tom Lane
Per-Olov Esgard writes: > In my environment which is linux on the server side and both windows and > linux on the client side I have noticed that the introduction of pg_notify > (with payload) makes the size of the postgres processes on the server side > increase much more than before I used t

[GENERAL] Is there any problem with pg_notify and memory consumption?

2011-05-26 Thread Per-Olov Esgard
In my environment which is linux on the server side and both windows and linux on the client side I have noticed that the introduction of pg_notify (with payload) makes the size of the postgres processes on the server side increase much more than before I used the notifiy calls. My server inte

[GENERAL] Cross-compiling problem with pthread test

2011-05-26 Thread Cyberman Wu
When I try to cross-compiling PostgreSQL for TILEPro, it can't figure out libpthread: checking for the pthreads library -lpthreads... no checking whether pthreads work without any flags... no checking whether pthreads work with -Kthread... no checking whether pthreads work with -kthread... no chec

Re: [GENERAL] PostgreSQL 8.4.8 bringing my website down every evening

2011-05-26 Thread Alexander Farber
Thank you, I'll try your suggestions. I'm just slow in doing so, because it's just a (sometimes pretty time consuming) hobby-project. I'm missing knowledge on how to monitor my DB status, i.e. how to check some of the things you've asked. Also I wonder, how's shared memory used by PostgreSQL. I'