Re: Insert Data and autonumeric field

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Insert Data and autonumeric field
Дата
Msg-id 20070201181305.GC7985@phlogiston.dyndns.org
обсуждение исходный текст
Ответ на Insert Data and autonumeric field  (André José Guergolet <AGuergolet@compugraf.com.br>)
Список pgsql-sql
On Thu, Feb 01, 2007 at 04:09:22PM -0300, André José Guergolet wrote:
> PROBLEM: Many clients are getting duplicated IDs.
>
> What is the best way of doing this?

Use a sequence.  You can get the current value of the sequence with
SELECT currval('seqname').  No, there's not a race condition; see the
docs.

A

--
Andrew Sullivan  | ajs@crankycanuck.ca
Information security isn't a technological problem.  It's an economics
problem.    --Bruce Schneier


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

Предыдущее
От: André José Guergolet
Дата:
Сообщение: Insert Data and autonumeric field
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Insert Data and autonumeric field