Skip site navigation (1) Skip section navigation (2)

BUG #2393: update fails with unique constraint violation

From: "Laurence Dawson" <larry(dot)dawson(at)vanderbilt(dot)edu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2393: update fails with unique constraint violation
Date: 2006-04-13 22:14:22
Message-ID: 200604132214.k3DMEMk5054415@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2393
Logged by:          Laurence Dawson
Email address:      larry(dot)dawson(at)vanderbilt(dot)edu
PostgreSQL version: 8.1.3
Operating system:   Ubuntu Dapper Drake
Description:        update fails with unique constraint violation
Details: 

Here is the table definition:

CREATE TABLE test.test
(
  a int4 NOT NULL DEFAULT nextval('test.test_a_seq'::regclass),
  CONSTRAINT pk PRIMARY KEY (a)
) 
WITHOUT OIDS;
ALTER TABLE test.test OWNER TO lstore;


And then try an update:
lstore=> select * from test.test;
 a
----
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
(10 rows)

lstore=> update test.test set a = a + 2 where a >= 3;
ERROR:  duplicate key violates unique constraint "pk"
lstore=>

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-04-14 00:41:06
Subject: Re: Permission denied on fsync / Win32 (was right
Previous:From: Dave PageDate: 2006-04-13 20:38:01
Subject: Re: BUG #2386: pg_restore doesn't restore large objects

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group