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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: set-level update fails with unique constraint violation



2009/12/31 neuhauser+pgsql-general#postgresql.org
<neuhauser+pgsql-general#postgresql(dot)org(at)sigpipe(dot)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/



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group