Search Postgresql Archives

Re: Sequences change in a rolled-back transactions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alvaro Herrera wrote:
> Erwin Moller wrote:
> 
>> I thought a transaction that is rolled back, rolls back *everything*  
>> done in that transaction.
>> Appearantly sequences are not included.
> 
> Yes.  This is actually a desirable property, because it allows sequences
> to work fine in concurrent scenarios (which are, after all, the whole
> point of sequences).
> 
> If you actually need an incremental number with no gaps (which is rare
> but not unseen), you need to use some other mechanism, which will
> probably involve a lock to prevent concurrency.

If so, search the list archives for "gapless sequence". You'll see lots
of explanations of options and of the problems with them.

--
Craig Ringer

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux