Re: Getting OID after Insert

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Getting OID after Insert
Дата
Msg-id 20011024233922.A3440@svana.org
обсуждение исходный текст
Ответ на Re: Getting OID after Insert  (Kevin HaleBoyes <kcboyes@yahoo.com>)
Ответы Re: Getting OID after Insert  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-general
On Tue, Oct 23, 2001 at 02:38:04PM -0400, Kevin HaleBoyes wrote:
> Is this actually guaranteed to work?
> What happens if another call to append_test() is made such that
> the insert takes place in the first call, then the insert takes place
> in the second call before the select currval().

Yes, it's guarenteed to work. If you examine the documentation for
currval(), you will get the last value returned by nextval() *in this
session*. Whatever happens in other sessions is irrelevent.

I think this needs to be highlighted more in the documentation since many
people miss this very important point.
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.

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

Предыдущее
От: Antonio Sergio de Mello e Souza
Дата:
Сообщение: Index on wide varchar column
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: Disable Transaction - plans ?