Bug #508: update not atomic

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Bug #508: update not atomic
Дата
Msg-id 200111040357.fA43vHT16077@postgresql.org
обсуждение исходный текст
Список pgsql-bugs
John Havard (enigma@sevensages.org) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
update not atomic

Long Description
Version tested: 7.2b1, all 7.1

Update is not atomic.  This really is not a problem, unless updating a field with a unique index.





Sample Code
jhavard=# CREATE TABLE blah (num int unique);
NOTICE:  CREATE TABLE/UNIQUE will create implicit index 'blah_num_key' for table 'blah'
CREATE
jhavard=# INSERT INTO blah VALUES (1);
INSERT 278477 1
jhavard=# INSERT INTO blah VALUES (2);
INSERT 278478 1
jhavard=# INSERT INTO blah VALUES (3);
INSERT 278479 1
jhavard=# INSERT INTO blah VALUES (4);
INSERT 278480 1
jhavard=# INSERT INTO blah VALUES (5);
INSERT 278481 1
jhavard=# UPDATE blah set num = num+2;
ERROR:  Cannot insert a duplicate key into unique index blah_num_key


No file was uploaded with this report

В списке pgsql-bugs по дате отправления:

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #507: Granting insert on a table does not grant update to the ralated sequence
Следующее
От: Michael Meskes
Дата:
Сообщение: Re: recent ECPG 7.1->7.2 incompatibility ( interval('0sec') = syntax error )