Re: [INTERFACES] locking on database updates

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [INTERFACES] locking on database updates
Дата
Msg-id 20458.944529261@sss.pgh.pa.us
обсуждение исходный текст
Ответ на locking on database updates  (Gary Stainburn <gary.stainburn@ringways.co.uk>)
Список pgsql-interfaces
Gary Stainburn <gary.stainburn@ringways.co.uk> writes:
> My question is this.  Is there a safe way of retrieving the next
> number from the parameter table in such a way that the same number
> cannot be retrieved twice.

Use a SEQUENCE object for each "parameter table".  This gives you 
a well-tested, efficient generator mechanism.  It may be "auto
generated" but you do have the option of resetting the sequence's
nextval and so forth, so I don't see that there is a good reason
to build a SEQUENCE substitute by hand.
        regards, tom lane


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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: [INTERFACES] locking on database updates
Следующее
От: Joseph Shraibman
Дата:
Сообщение: Re: [INTERFACES] locking on database updates