Re: SERIAL behaviour

From: Christoph Dalitz <christoph(dot)dalitz(at)hs-niederrhein(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: SERIAL behaviour
Date: 2002-07-15 13:10:04
Message-ID: 20020715151004.707cc9ea.christoph.dalitz@hs-niederrhein.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Beutin 2002-07-15 13:16:53 Re: help (maybe i'm a little stupid)
Previous Message Joe Block 2002-07-15 13:09:50 Re: OSX Install Instructions