Re: A question about PL/pgSQL

Поиск
Список
Период
Сортировка
От K Parker
Тема Re: A question about PL/pgSQL
Дата
Msg-id FBKOCEMBHJDHBAAA@shared1-mail.whowhere.com
обсуждение исходный текст
Ответ на A question about PL/pgSQL  (Warren Vanichuk <pyber@street-light.com>)
Список pgsql-general
Doesn't the following allow a race condition?

>declare foo record;
>begin
> select into foo * from overview...
> if not found
>   insert...
> else ...
> end if;
>end;

ISTM 2 or more clients could attempt to insert the same row, based on the select failing, if all were issued at the
sametime.  I've always assumed that, there being no row to lock in a _failed_ search, even saying SELECT ... FOR UPDATE
inthis case is no help. 


Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at http://www.eudoramail.com

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Raw Newbie: Can't start PGSQL
Следующее
От: "Sergei O . Naumov"
Дата:
Сообщение: Help in chosing Db: hierarchical data in tables