Re: Hard problem with concurrency

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Hard problem with concurrency
Дата
Msg-id 20030217134131.GA17947@wolff.to
обсуждение исходный текст
Ответ на Re: Hard problem with concurrency  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
On Sun, Feb 16, 2003 at 23:51:49 -0500, Greg Stark <gsstark@mit.edu> wrote:
> 
> Hm, odd, nobody mentioned this solution:
> 
> If you don't have a primary key already, create a unique index on the
> combination you want to be unique. Then:
> 
> . Try to insert the record
> . If you get a duplicate key error
>   then do update instead

I think this solution depends on records not being deleted. Otherwise
a record could be deleted between the insert attempt and the update attempt.


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

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: client_encoding directive is ignored in
Следующее
От: Christoph Haller
Дата:
Сообщение: IpcSemaphoreKill: ...) failed: Invalid argument