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 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 on slave . This err

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

[GENERAL] "duplicate key violates unique constraint" error

2009-11-12 Thread tamanna madaan
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 on slave . This error is thrown while Slon is inserting a row in a table on slave. This

Re: [GENERAL] duplicate key violates unique constraint

2009-08-08 Thread Filip Rembiałkowski
2009/8/8 > Hello all, > > I have a table named "t_i_shift_shadow" with following spec > > > Column | Type | > Modifiers > > -+---+--- > cid | character varyi

[GENERAL] duplicate key violates unique constraint

2009-08-08 Thread sweta
Hello all, I have a table named "t_i_shift_shadow" with following spec Column | Type | Modifiers -+---+--- cid | character vary

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

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-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 stat

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 de

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"

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

[GENERAL] duplicate key violates unique constraint

2006-09-18 Thread vtaquette
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 '', PRIMARY KEY ("project_id") ) ; The problem is that somet

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 yo

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. -- Rich

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.

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 can

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 unk

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
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 aft

[GENERAL] duplicate key violates unique constraint

2005-06-13 Thread ON.KG
Hi All! I have table: CREATE TABLE table1 ( ip char(15) NOT NULL, hits integer NOT NULL default '1', PRIMARY KEY (ip) ); So it's counting hits per each IP for current day and every day trancated by cron: TRUNCATE TABLE table1; before inserting or updating this table there're some check

[GENERAL] duplicate key violates unique constraint "pg_class_oid_index"

2004-05-08 Thread David Garamond
postgresql 7.4.0, redhat 7.3 (under vmware 4.0 on win2k) Windows crashed and some of the files on Redhat got corrupted, including some files in /var/lib/pgsql/data/pg_xlog/. When I tried to start postmaster, it fails with message "Invalid primary checkPoint record". I think it was trying to look f