Sequences, defaults and getting a new key

Поиск
Список
Период
Сортировка
От Jeff Willden
Тема Sequences, defaults and getting a new key
Дата
Msg-id 086B21D2-E8D2-402A-83E8-967EEF455879@pavanell.com
обсуждение исходный текст
Ответы Re: Sequences, defaults and getting a new key  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Sequences, defaults and getting a new key  (Raimon Fernandez <coder@montx.com>)
Список pgsql-novice
When the primary key of a table defaults to the nextval() of a
sequence, if you insert a new record into the table and accept the
default, how do you then select the value that was just used as the
new primary key and guarantee that you don't accidentally get the
value that another user just generated at about the same instant?

Thanks,

Jeff Willden

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

Предыдущее
От: "Greg Cocks"
Дата:
Сообщение: Re: Wondering how to get the name of the name of the user logged on to 'my' https:// site via PHP
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Sequences, defaults and getting a new key