[GENERAL] select where not exists returning multiple rows?

2011-11-02 Thread Chris Dumoulin
We're using postgresql 9.1, and we've got a table that looks like this: testdb=# \d item Table public.item Column | Type | Modifiers ---+--+--- sig | bigint | not null type | smallint | data | text | Indexes: item_pkey PRIMARY KEY, btree (sig) And

Re: [GENERAL] select where not exists returning multiple rows?

2011-11-02 Thread Merlin Moncure
On Wed, Nov 2, 2011 at 6:22 AM, Chris Dumoulin ch...@blaze.io wrote: We're using postgresql 9.1, and we've got a table that looks like this: testdb=# \d item Table public.item  Column   |   Type   | Modifiers ---+--+---  sig   | bigint   | not null  type  | smallint |  

Re: [GENERAL] select where not exists returning multiple rows?

2011-11-02 Thread Chris Dumoulin
On 11-11-02 08:49 AM, Merlin Moncure wrote: On Wed, Nov 2, 2011 at 6:22 AM, Chris Dumoulinch...@blaze.io wrote: We're using postgresql 9.1, and we've got a table that looks like this: testdb=# \d item Table public.item Column | Type | Modifiers ---+--+--- sig |

Re: [GENERAL] select where not exists returning multiple rows?

2011-11-02 Thread Martijn van Oosterhout
On Wed, Nov 02, 2011 at 07:22:09AM -0400, Chris Dumoulin wrote: And we're doing an insert like this: INSERT INTO Item (Sig, Type, Data) SELECT $1,$2,$3 WHERE NOT EXISTS ( SELECT NULL FROM Item WHERE Sig=$4) In this case $1 and $4 should always be the same. FWIW, If they're always going to

Re: [GENERAL] select where not exists returning multiple rows?

2011-11-02 Thread Chris Dumoulin
On 11-11-02 09:13 AM, Martijn van Oosterhout wrote: On Wed, Nov 02, 2011 at 07:22:09AM -0400, Chris Dumoulin wrote: And we're doing an insert like this: INSERT INTO Item (Sig, Type, Data) SELECT $1,$2,$3 WHERE NOT EXISTS ( SELECT NULL FROM Item WHERE Sig=$4) In this case $1 and $4 should

Re: [GENERAL] select where not exists returning multiple rows?

2011-11-02 Thread Merlin Moncure
On Wed, Nov 2, 2011 at 8:20 AM, Chris Dumoulin ch...@blaze.io wrote: On 11-11-02 09:13 AM, Martijn van Oosterhout wrote: On Wed, Nov 02, 2011 at 07:22:09AM -0400, Chris Dumoulin wrote: And we're doing an insert like this: INSERT INTO Item (Sig, Type, Data) SELECT $1,$2,$3 WHERE NOT EXISTS (

Re: [GENERAL] does reindex need exclusive table access?

2011-11-02 Thread Vincent de Phily
On Tuesday 01 November 2011 12:00:33 Craig Ringer wrote: A workaround for reindexing while live is to begin a transaction, create the new index with a new name, drop the old one, rename the new one to the old one, and commit. This only requires an exclusive lock for the period of the drop and

Re: [GENERAL] does reindex need exclusive table access?

2011-11-02 Thread Tom Lane
Vincent de Phily vincent.deph...@mobile-devices.fr writes: The technique kinda works (with some changes) using unique indexes however. Is there a functional difference between a unique index and a primary key index (knowing that my column is not null) ? Or is it just for documentation and

[GENERAL] equivalent to replication_timeout on standby server

2011-11-02 Thread Samba
Hi all, The postgres manual explains the replication_timeout to be used to Terminate replication connections that are inactive longer than the specified number of milliseconds. This is useful for the primary server to detect a standby crash or network outage Is there a similar configuration

Re: [GENERAL] Regarding the shared disk fail over cluster configuration

2011-11-02 Thread Debasis Mishra
Thanks a lot Ondrej Ivanic.I have few more doubts. 1)While installing the postgress it asks for the data directory,which i refer to SAN volume(Shared LUN)-(example - /dbdata/pgsqldata). After that i am exporting $PGDATA= SAN Volume(example - /dbdata/pgsqldata). Where /dbdata is the shared LUN .

Re: [GENERAL] Server move using rsync

2011-11-02 Thread Robert Treat
On Tue, Nov 1, 2011 at 11:08 AM, Alan Hodgson ahodg...@simkin.ca wrote: On October 31, 2011 03:01:19 PM Stephen Denne wrote: I'm wondering whether it's worth doing anyway, simply to check that it doesn't do something completely unexpected, which would presumably alert us to something we hadn't

[GENERAL] OOM Killer / PG9 / RHEL 6.1

2011-11-02 Thread David Kerr
Howdy, just a quick check, is vm.overcommit_memory = 2 vm.swappiness = 0 Still the way to go with PG9.0 / RHEL 6.1 (64bit) ? I know we gained some control over the OOM Killer in newer kernels and remember reading that maybe postgres could handle it in a different way now. Thanks Dave --

[GENERAL] Recommendations for SSDs in production?

2011-11-02 Thread Benjamin Smith
Well, After reading several glowing reviews of the new OCZ Vertex3 SSD last spring, we did some performance testing in dev on RHEL6. (CentOS) The results were nothing short of staggering. Complex query results returned in 1/10th the time as a pessimistic measurement. System loads dropped

Re: [GENERAL] Recommendations for SSDs in production?

2011-11-02 Thread Merlin Moncure
On Wed, Nov 2, 2011 at 12:01 PM, Benjamin Smith li...@benjamindsmith.com wrote: Well, After reading several glowing reviews of the new OCZ Vertex3 SSD last spring, we did some performance testing in dev on RHEL6. (CentOS) The results were nothing short of staggering. Complex query results

Re: [GENERAL] Why is there no 8.3.16 rpm with _id ?

2011-11-02 Thread Robert Treat
2011/10/30 Devrim GÜNDÜZ dev...@gunduz.org: [Moving to pgsql-general] On Sun, 2011-10-30 at 07:24 +0100, hubert depesz lubaczewski wrote: we'd like to upgrade to newest 8.3, and we're on 8.3.11 _id, but it looks like 8.3.11 is the newest version of 8.3 built with integer datetimes:

Re: [GENERAL] Regarding the shared disk fail over cluster configuration

2011-11-02 Thread Alan Hodgson
On November 2, 2011 08:55:39 AM Debasis Mishra wrote: My doubt is - Whether cluster should start the postgres service in secondary node during failover or postgress will be running always. My undersatnding was in both the node postgress will be running and pointing to shared dbdata. And if

Re: [GENERAL] Recommendations for SSDs in production?

2011-11-02 Thread David Boreham
On 11/2/2011 11:01 AM, Benjamin Smith wrote: 2) Intel X25E - good reputation, significantly slower than the Vertex3. We're buying some to reduce downtime. If you don't mind spending money, look at the new 710 Series from Intel. Not SLC like the X25E, but still specified with a very high

Re: [GENERAL] Regarding the shared disk fail over cluster configuration

2011-11-02 Thread Scott Mead
On Wed, Nov 2, 2011 at 11:55 AM, Debasis Mishra debasis1...@gmail.comwrote: Thanks a lot Ondrej Ivanic.I have few more doubts. 1)While installing the postgress it asks for the data directory,which i refer to SAN volume(Shared LUN)-(example - /dbdata/pgsqldata). After that i am exporting

Re: [GENERAL] Recommendations for SSDs in production?

2011-11-02 Thread John R Pierce
you really need to watch out for excess write caching on SSDs. only a few are safe against power failures while under heavy database write activity. -- john r pierceN 37, W 122 santa cruz ca mid-left coast -- Sent via pgsql-general

[GENERAL] 9.1 replication on different arch

2011-11-02 Thread Martín Marqués
I have two servers, one a x86 32bit server, and the other one is a x86 64 bit server. We want to use synchronous replication and make the 32 bit be a master and the 64bit be a read-only stand-by. Do I have to install 32bit postgresql on the 64bit server to be able to use wal replication? --

Re: [GENERAL] 9.1 replication on different arch

2011-11-02 Thread Adam Cornett
2011/11/2 Martín Marqués martin.marq...@gmail.com I have two servers, one a x86 32bit server, and the other one is a x86 64 bit server. We want to use synchronous replication and make the 32 bit be a master and the 64bit be a read-only stand-by. Do I have to install 32bit postgresql on the

Re: [GENERAL] OOM Killer / PG9 / RHEL 6.1

2011-11-02 Thread Alex Hunsaker
On Wed, Nov 2, 2011 at 10:42, David Kerr d...@mr-paradox.net wrote: Howdy, just a quick check, is vm.overcommit_memory = 2 vm.swappiness = 0 Still the way to go with PG9.0 / RHEL 6.1 (64bit) ? IMHO yes (although I never touch swappiness...) I know we gained some control over the OOM

[GENERAL] variable not found in subplan target list

2011-11-02 Thread Roger Niederland
Hello, I stripped down the original query to what is below. I am not saying that the query below is useful except to show an error I am getting in Postgresql 9.1.1 on both SL6.1 (64 bit) and Windows 2008 server 9.1.1 (32-bit and 64-bit). The error I am getting is: ERROR: variable not

[GENERAL] postgresql-9.1.1 PQescapeByteaConn() generating incorrectly quoted output.

2011-11-02 Thread Graham Murray
Since upgrading test systems to postgresql 9.1, I am seeing some inserts to bytea fields giving errors such as ERROR: invalid byte sequence for encoding UTF8: 0xf9 Where the insert is from a C program using libpq and is of the form insert into xxx values(E'%s') where the value is the return of

[GENERAL] select where not exists returning multiple rows?

2011-11-02 Thread Chris Dumoulin
We're using postgresql 9.1, and we've got a table that looks like this: testdb=# \d item Table public.item Column | Type | Modifiers ---+--+--- sig | bigint | not null type | smallint | data | text | Indexes: item_pkey PRIMARY KEY, btree (sig) And

Re: [GENERAL] installation problems on OSX Lion

2011-11-02 Thread adamaltman
sean, could you share your solution in a little more detail. im having the exact problem now... -- View this message in context: http://postgresql.1045698.n5.nabble.com/installation-problems-on-OSX-Lion-tp4627419p4957366.html Sent from the PostgreSQL - general mailing list archive at

Re: [GENERAL] 9.1 replication on different arch

2011-11-02 Thread Martín Marqués
Don't worry, they are both x86 arch, so I'll just install 32bit postgresql on the 64 bit server. That should make it work, right? El día 2 de noviembre de 2011 14:55, Adam Cornett adam.corn...@gmail.com escribió: 2011/11/2 Martín Marqués martin.marq...@gmail.com I have two servers, one a x86

Re: [GENERAL] postgresql-9.1.1 PQescapeByteaConn() generating incorrectly quoted output.

2011-11-02 Thread Tom Lane
Graham Murray gmur...@webwayone.co.uk writes: Since upgrading test systems to postgresql 9.1, I am seeing some inserts to bytea fields giving errors such as ERROR: invalid byte sequence for encoding UTF8: 0xf9 Where the insert is from a C program using libpq and is of the form insert into xxx

Re: [GENERAL] 9.1 replication on different arch

2011-11-02 Thread John R Pierce
On 11/02/11 11:21 AM, Martín Marqués wrote: Don't worry, they are both x86 arch, so I'll just install 32bit postgresql on the 64 bit server. That should make it work, right? yes, that should work fine. -- john r pierceN 37, W 122 santa cruz ca

Re: [GENERAL] Recommendations for SSDs in production?

2011-11-02 Thread Thomas Strunz
Vertex 3 and ocz in general has a very bad reputation in the enthusiast scene. Sudden issues, hard locks, data loss and so on. Just go and look in the OCZ forums. I would not dare by on Vertex 3 for my desktop...have 2 Intel ones. I have no idea what you do but just the fact that you bought

[GENERAL] Error On Slony Replication

2011-11-02 Thread Prashant Bharucha
Hello All For replication ,Created cluster and after I run Slon command  getting error on PQconnectdb(dbname=XYZ host= user=cls password=1) failed - could not translate host name Could you please help ? Thx Prashant

Re: [GENERAL] Error On Slony Replication

2011-11-02 Thread Brandon Phelps
Why do you have host= without a hostname? Where is your closing ? Brandon Phelps Global Linking Solutions O: (704) 973-6855 C: (704) 222-2103 E: bphe...@gls.com On 11/02/2011 02:34 PM, Prashant Bharucha wrote: Hello All For replication ,Created cluster and after I run Slon command getting

Re: [GENERAL] Error On Slony Replication

2011-11-02 Thread Raymond O'Donnell
On 02/11/2011 18:34, Prashant Bharucha wrote: Hello All For replication ,Created cluster and after I run Slon command getting error on PQconnectdb(dbname=XYZ host= user=cls password=1) failed - could not translate host name The host is missing from the above. Ray. -- Raymond

Re: [GENERAL] Recommendations for SSDs in production?

2011-11-02 Thread John R Pierce
On 11/02/11 11:39 AM, Thomas Strunz wrote: For database I assume random read and writes are by way the most important thing and any recent ssd is orders of magnitude faster in that are compared to HDD even the slow Intel drives. actually, SSD's have issues with committed small block (8K)

Re: [GENERAL] Error On Slony Replication

2011-11-02 Thread Scott Mead
On Wed, Nov 2, 2011 at 2:55 PM, Raymond O'Donnell r...@iol.ie wrote: On 02/11/2011 18:34, Prashant Bharucha wrote: Hello All For replication ,Created cluster and after I run Slon command getting error on PQconnectdb(dbname=XYZ host= user=cls password=1) failed - could not

Re: [GENERAL] Server move using rsync

2011-11-02 Thread Venkat Balaji
We're not doing this long-term, in order to have a backup server we can fail-over to, but rather as a one-off low impact move of our database. Consequently, instead of using pg_start_backup and pg_stop_backup, and keeping all WAL, we're stopping the database, rsync of everything, and

Re: [GENERAL] Error On Slony Replication

2011-11-02 Thread Prashant Bharucha
But Host Address should take automatically, same thing is working good on other machine. --- On Wed, 11/2/11, Raymond O'Donnell r...@iol.ie wrote: From: Raymond O'Donnell r...@iol.ie Subject: Re: [GENERAL] Error On Slony Replication To: Prashant Bharucha prashantbharu...@yahoo.ca Cc:

Re: [GENERAL] Recommendations for SSDs in production?

2011-11-02 Thread Yeb Havinga
On 2011-11-02 18:01, Benjamin Smith wrote: So after months of using this SSD without any issues at all, we tentatively rolled this out to production, and had blissful, sweet beauty until about 2 weeks ago, now we are running into sudden death scenarios. Could you tell a bit more about the

Re: [GENERAL] OOM Killer / PG9 / RHEL 6.1

2011-11-02 Thread Scott Marlowe
On Wed, Nov 2, 2011 at 10:42 AM, David Kerr d...@mr-paradox.net wrote: Howdy, just a quick check, is vm.overcommit_memory = 2 vm.swappiness = 0 Still the way to go with PG9.0 / RHEL 6.1 (64bit) ? If you've got lots of ram, it's better off to throw a swapoff -a at the end of rc.local, as I

Re: [GENERAL] 9.1 replication on different arch

2011-11-02 Thread Martín Marqués
2011/11/2 John R Pierce pie...@hogranch.com: On 11/02/11 11:21 AM, Martín Marqués wrote: Don't worry, they are both x86 arch, so I'll just install 32bit postgresql on the 64 bit server. That should make it work, right? yes, that should work fine. Sad thing is that it's not so easy on

Re: [GENERAL] variable not found in subplan target list

2011-11-02 Thread Tom Lane
Roger Niederland ro...@niederland.com writes: I stripped enough out of the database that it is only good for a test case. Here is a public url for getting at the database backup: I've committed a fix for this: