Re: serial type; race conditions

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: serial type; race conditions
Дата
Msg-id 200103262147.QAA27340@candle.pha.pa.us
обсуждение исходный текст
Ответ на serial type; race conditions  (jkakar@expressus.com)
Ответы Re: serial type; race conditions  ("postgresql" <pgsql@symcom.com>)
Список pgsql-sql
> Hi,
> 
> I'm using serial fields to generate IDs for almost all object in my
> database.  I insert an empty row, get the CURRVAL() of the sequence
> and then update to that value.
> 
> I had understood (and now, I can't find the reference to back this up)
> that serial is implemented in such a way that race conditions between
> DB connections can't happen.
> 
> Is this true?

Safe.  See FAQ item.  currval is for your backend only.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Function Vanished
Следующее
От: "S.F. Lee"
Дата:
Сообщение: ÁY¼gªº§t¸q