Re: set-level update fails with unique constraint violation

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: set-level update fails with unique constraint violation
Дата
Msg-id 9837222c0912310752w1a5c22ddr38a3023dcc65b064@mail.gmail.com
обсуждение исходный текст
Ответ на set-level update fails with unique constraint violation  (neuhauser+pgsql-general#postgresql.org@sigpipe.cz)
Список 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 по дате отправления:

Предыдущее
От: neuhauser+pgsql-general#postgresql.org@sigpipe.cz
Дата:
Сообщение: set-level update fails with unique constraint violation
Следующее
От: David Fetter
Дата:
Сообщение: Re: set-level update fails with unique constraint violation