Re: [GENERAL] duplicate key violates unique constraint error

2009-11-12 Thread Richard Huxton
tamanna madaan wrote: I am getting this error duplicate key violates unique constraint in my slon.log on slave . This error is thrown while Slon is inserting a row in a table on slave. This must be because of the reason that duplicate rows are being returned while querying sl_log_1

Re: [GENERAL] duplicate key violates unique constraint error

2009-11-12 Thread Scott Marlowe
On Wed, Nov 11, 2009 at 10:12 PM, tamanna madaan tamanna.ma...@globallogic.com wrote:  Hi All I have a cluster setup with one master and one slave . Replication from master to slave is not taking place. I am getting this error  “duplicate key violates unique constraint”  in my slon.log

Re: [GENERAL] duplicate key violates unique constraint

2009-08-08 Thread Filip Rembiałkowski
2009/8/8 sw...@opspl.com Hello all, I have a table named t_i_shift_shadow with following spec Column | Type | Modifiers -+---+--- cid | character

Re: [GENERAL] duplicate key violates unique constraint

2006-09-19 Thread Alban Hertroys
Ron Johnson wrote: # select * from projects; project_id | username | project_name - +--+-- 1 | foo | 2 | bar | (2 rows) dupe_filenames=# insert into projects (project_name, username ) dupe_filenames-# values ('foo', 'bar'); ERROR:

Re: [GENERAL] duplicate key violates unique constraint

2006-09-19 Thread vtaquette
Hey, I've just find out what's happening. The problem is the serial datatype creates a sequence in the background (project_id_seq). If the sequence current numeber is 1, and I manually insert a new entry whit ID=2, the sequence doesn't know it. So when I try the INSERT statement, the next value in

Re: [GENERAL] duplicate key violates unique constraint

2006-09-18 Thread Jeff Davis
On Mon, 2006-09-18 at 19:47 -0300, [EMAIL PROTECTED] wrote: Hi, I'm trying to create a table with a PRIMARY KEY. The CREATE statement looks like this: CREATE TABLE projects ( project_id serial, username varchar(30) NOT NULL default '', project_name varchar(30) NOT NULL default

Re: [GENERAL] duplicate key violates unique constraint

2006-09-18 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/18/06 19:25, Jeff Davis wrote: On Mon, 2006-09-18 at 19:47 -0300, [EMAIL PROTECTED] wrote: Hi, I'm trying to create a table with a PRIMARY KEY. The CREATE statement looks like this: CREATE TABLE projects ( project_id serial,

Re: [GENERAL] duplicate key violates unique constraint

2006-09-18 Thread brian
Ron Johnson wrote: On 09/18/06 19:25, Jeff Davis wrote: On Mon, 2006-09-18 at 19:47 -0300, [EMAIL PROTECTED] wrote: Hi, I'm trying to create a table with a PRIMARY KEY. The CREATE statement looks like this: CREATE TABLE projects ( project_id serial, username varchar(30) NOT NULL default

Re: [GENERAL] duplicate key violates unique constraint

2006-09-18 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/18/06 21:19, brian wrote: Ron Johnson wrote: On 09/18/06 19:25, Jeff Davis wrote: On Mon, 2006-09-18 at 19:47 -0300, [EMAIL PROTECTED] wrote: Hi, I'm trying to create a table with a PRIMARY KEY. The CREATE statement looks like this:

Re: [GENERAL] duplicate key violates unique constraint

2005-06-14 Thread Meder
Thanx to Richard Huxton and Csaba. I will upgrade PostgreSQL up to 8.0 and use: 2. Catch the error on the insert and try the update again. This requires version 8.0 or higher. Best regards ---(end of broadcast)--- TIP 8: explain analyze is

Re: [GENERAL] duplicate key violates unique constraint

2005-06-13 Thread Csaba Nagy
Your problem is that the trigger's found check will not see the row inserted by a concurrent transaction. In other words, your insert actually fails, the record what you see was inserted by another concurrent transaction, and the found check didn't work because the other transaction started after

Re: [GENERAL] duplicate key violates unique constraint

2005-06-13 Thread Richard Huxton
ON.KG wrote: before inserting or updating this table there're some checkings, logs, etc., so I'm using PL/PgSQL for that after all checkings and logs I have: UPDATE table1 SET hits = hits + 1 WHERE ip = some_ip; IF NOT FOUND THEN INSERT INTO table1

Re: [GENERAL] duplicate key violates unique constraint

2005-06-13 Thread Csaba Nagy
[snip] If you have more than one client, this can always happen. You have two choices: 1. Use a lock to stop two clients interacting like this This won't work unless you make all the clients serialized, or you have all the ip's already inserted in the data base... you can't lock on an

Re: [GENERAL] duplicate key violates unique constraint

2005-06-13 Thread Richard Huxton
Csaba Nagy wrote: [snip] If you have more than one client, this can always happen. You have two choices: 1. Use a lock to stop two clients interacting like this This won't work unless you make all the clients serialized, or you have all the ip's already inserted in the data base... you

Re: [GENERAL] duplicate key violates unique constraint

2005-06-13 Thread Csaba Nagy
That would work indeed. Bit I guess the savepoint solution will be the simplest and fastest if the OP has or can install 8.0 version. Cheers, Csaba. On Mon, 2005-06-13 at 17:49, Richard Huxton wrote: Csaba Nagy wrote: [snip] If you have more than one client, this can always happen. You

Re: [GENERAL] duplicate key violates unique constraint

2005-06-13 Thread Richard Huxton
Csaba Nagy wrote: That would work indeed. Bit I guess the savepoint solution will be the simplest and fastest if the OP has or can install 8.0 version. I'd say so. Otherwise you'll just sit on the lock, and then still have to deal with an error later anyway when the lock times out. --