Return serial from insert

Поиск
Список
Период
Сортировка
От Rory Campbell-Lange
Тема Return serial from insert
Дата
Msg-id 20021108152936.GB15280@campbell-lange.net
обсуждение исходный текст
Ответы Re: Return serial from insert
Список pgsql-novice
I would like to return the autoincremented serial number resulting from
a new insert into a table, ideally as a result from the insert
statement.

Presumably this is the way to avoid race conditions between inserts into
the database, because if I do 1) insert then 2) get max sequence val, 2
might be wrong.

Thanks
Rory

--
Rory Campbell-Lange
<rory@campbell-lange.net>
<www.campbell-lange.net>

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

Предыдущее
От: "Retzlaw Heinrich"
Дата:
Сообщение: creating table with an encrypted filed
Следующее
От: Rod Kreisler
Дата:
Сообщение: Re: Return serial from insert