BUG #2393: update fails with unique constraint violation - Mailing list pgsql-bugs

From Laurence Dawson
Subject BUG #2393: update fails with unique constraint violation
Date
Msg-id 200604132214.k3DMEMk5054415@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #2393: update fails with unique constraint violation  ("Harald Armin Massa" <haraldarminmassa@gmail.com>)
Re: BUG #2393: update fails with unique constraint violation  ("T.J. Ferraro" <tjtoocool@phreaker.net>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      2393
Logged by:          Laurence Dawson
Email address:      larry.dawson@vanderbilt.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=>

pgsql-bugs by date:

Previous
From: "Martin"
Date:
Subject: BUG #2396: SELECT to_number('6500', '999,999.99') != 650
Next
From: "Harald Armin Massa"
Date:
Subject: Re: BUG #2393: update fails with unique constraint violation