Re: set-level update fails with unique constraint violation - Mailing list pgsql-general

From Magnus Hagander
Subject Re: set-level update fails with unique constraint violation
Date
Msg-id 9837222c0912310752w1a5c22ddr38a3023dcc65b064@mail.gmail.com
Whole thread Raw
In response to set-level update fails with unique constraint violation  (neuhauser+pgsql-general#postgresql.org@sigpipe.cz)
List pgsql-general
2009/12/31 neuhauser+pgsql-general#postgresql.org
<neuhauser+pgsql-general#postgresql.org@sigpipe.cz>:
> Hello,
>
> this fails with "duplicate key value":
>
>    CREATE TABLE x (
>      i INT NOT NULL UNIQUE
>    );
>    INSERT INTO x (i) VALUES (1), (2), (3);
>    UPDATE x SET i = i + 1;
>
> are there any plans to make this work?

Sure. 8.5 (current alpha release included) will let you do
i INT NOT NULL UNIQUE DEFERRABLE

which will make that work.

(you might want to consider using an actual email address if you want
to get responses to your questions in the future)

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

pgsql-general by date:

Previous
From: neuhauser+pgsql-general#postgresql.org@sigpipe.cz
Date:
Subject: set-level update fails with unique constraint violation
Next
From: David Fetter
Date:
Subject: Re: set-level update fails with unique constraint violation