Re: Updates not atomic with respect to indexes

Поиск
Список
Период
Сортировка
Искать
От
Manfred Koizar
Тема
Re: Updates not atomic with respect to indexes
Дата
Msg-id
ncuu809i4hk7bt2qd644mp79icsprdhbkv@email.aon.at
Ответ на
Список
Дерево обсуждения
Updates not atomic with respect to indexes Ben Young <ben@transversal.com>
Re: Updates not atomic with respect to indexes "John Sidney-Woollett" <johnsw@wardbrook.com>
Re: Updates not atomic with respect to indexes Manfred Koizar <mkoi-pg@aon.at>
Re: Updates not atomic with respect to indexes Tom Lane <tgl@sss.pgh.pa.us>
Re: Updates not atomic with respect to indexes Ben Young <ben@transversal.com>
On Wed, 28 Apr 2004 09:33:34 +0100, Ben Young 
wrote:
>UPDATE temp SET num = num+1;
>ERROR:  duplicate key violates unique constraint "temp_num_key"

>Is this [...] a known problem in Posgresql,

Yes.

> or bug which will be fixed sometime.

Don't know.

If you need a workaround for now, do it in two steps:

	UPDATE temp SET num = -num;
	UPDATE temp SET num = -num+1;

This assumes you have a range of numbers that is normally not used.

Servus
 Manfred
В списке pgsql-general по дате отправления
От: John Sidney-Woollett
Дата:
От: Ian Ribas
Дата:
FAQ