Re: SERIAL behaviour

Поиск
Список
Период
Сортировка
Искать
От
Christoph Dalitz
Тема
Re: SERIAL behaviour
Дата
Msg-id
20020715151004.707cc9ea.christoph.dalitz@hs-niederrhein.de
Список
Дерево обсуждения
Re: SERIAL behaviour Steve Brett <SBrett@e-mis.com>
> However, I am quite dismayed by the behavior of the 
> SERIAL type, or, more specifically, the PostgreSQL sequences.
>
> The problem is that on a rollback, the value of the sequence does not go 
> back to its previous value!
>
If I understand SEQUENCEs right, that should be the expected behaviour:
Sequences generate values that are unique both in space (ie. other users/transactions)
and time. Thus they must not be rescrewed in case of ROLLBACK.

> Also, how can I ensure 
> consistency when multiple clients are changing the same tables? (sequence 
> doesn't seem to be part of the transaction...)
>
That sequences are not "part of the transaction" actually guarantees
consistency among multiple clients.

Christoph Dalitz
В списке pgsql-general по дате отправления
От: Steve Brett
Дата:
Сообщение: Re: SERIAL behaviour
От: Jan Wieck
Дата:
FAQ