Re: SERIAL behaviour

Поиск
Список
Период
Сортировка
От Christoph Dalitz
Тема Re: SERIAL behaviour
Дата
Msg-id 20020715151004.707cc9ea.christoph.dalitz@hs-niederrhein.de
обсуждение исходный текст
Ответ на SERIAL behaviour  (Eugene <foo@bar.com>)
Список pgsql-general
> 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
Дата:
Сообщение: Re: I am being interviewed by OReilly