Re: Getting last inserted SERIAL

Поиск
Список
Период
Сортировка
От Dennis Björklund
Тема Re: Getting last inserted SERIAL
Дата
Msg-id Pine.LNX.4.44.0309010600320.4053-100000@zigo.dhs.org
обсуждение исходный текст
Ответ на Getting last inserted SERIAL  (mgarriss <mgarriss@earthlink.net>)
Список pgsql-general
On Sun, 31 Aug 2003, mgarriss wrote:

> First thought is "SELECT CURRVAL('test_id_seq');" but this assumes that
> there is only one connection inserting into this table, bad assumption.

That is what you should use, and it works for concurrent sessions. It's
all described in the manual:

http://www.postgresql.org/docs/7.3/static/functions-sequence.html

--
/Dennis


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: About GPL and proprietary software
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Getting last inserted SERIAL