Re: [HACKERS] [GENERAL] Bug with sequence

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] [GENERAL] Bug with sequence
Дата
Msg-id 13787.1037907014@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] Bug with sequence  (Thomas O'Connell <tfo@monsterlabs.com>)
Список pgsql-sql
"Thomas O'Connell" <tfo@monsterlabs.com> writes:
> It seems worth pointing out, too, that some SQL purists propose not 
> relying on product-specific methods of auto-incrementing.
> I.e., it is possible to do something like:
> insert into foo( col, ... )
> values( coalesce( ( select max( col ) from foo ), 0 ) + 1, ... );
> and this is easily placed in a trigger.

... but that approach is entirely unworkable if you want any concurrency
of insert operations.  (Triggers are a tad product-specific, too :-()
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] [GENERAL] Bug with sequence
Следующее
От: Rod Taylor
Дата:
Сообщение: Re: [HACKERS] [GENERAL] Bug with sequence