Re: SERIAL behaviour

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: SERIAL behaviour
Дата
Msg-id 20020716000712.A21882@svana.org
обсуждение исходный текст
Ответ на Re: SERIAL behaviour  (Adrian 'Dagurashibanipal' von Bidder <avbidder@fortytwo.ch>)
Ответы Re: SERIAL behaviour  (Adrian 'Dagurashibanipal' von Bidder <avbidder@fortytwo.ch>)
Список pgsql-general
On Mon, Jul 15, 2002 at 03:47:28PM +0200, Adrian 'Dagurashibanipal' von Bidder wrote:
> On Sun, 2002-07-14 at 03:59, Eugene wrote:
> [ SERIAL type / SEQUENCEs and transactions ]
>
> Closely related: what's the official/preferred way if I'm inserting rows
> into a table with a auto assigned id (SERIAL), to get the newly created
> id? asking the sequence obviously will not work - as the sequence will
> advance when the next value is inserted from another transaction.

You read the documentation and notice that currval() is not affected by
nextval()s executed upon other connections. In other words, it's a complete
non-issue and works exectly the way that is useful.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

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

Предыдущее
От: Steve Brett
Дата:
Сообщение: Re: SERIAL behaviour
Следующее
От: Jim Caley
Дата:
Сообщение: Re: PostgreSQL included in ZDNet article...