Re: [SQL] begin/end/abort work for sequences? - Mailing list pgsql-sql

From Bruce Momjian
Subject Re: [SQL] begin/end/abort work for sequences?
Date
Msg-id 199907010326.XAA05930@candle.pha.pa.us
Whole thread Raw
In response to Re: [SQL] begin/end/abort work for sequences?  (José Soares <jose@sferacarta.com>)
List pgsql-sql
> > The sequence po_seq is advancing to the next value even though the
> > transaction was aborted.  If I put other things like updates, inserts, etc.
> > inside the transaction, they seem to be rolled back OK, but not the
> > update of the sequence.
> >
> > Am I doing something wrong?
> 
> No. I can't explain you why but AFAIK sequences don't  rollback.

If we rolled back sequence numbers, we would have to lock the table
until the transaction commited or was rolled back.  That is too much
locking so was not worth it.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-sql by date:

Previous
From: Chris Bitmead
Date:
Subject: Re: [SQL] Beginner's headache of joins
Next
From: Bruce Momjian
Date:
Subject: Re: [SQL] String concat operator???