Re: [SQL] begin/end/abort work for sequences?

From: Kyle Bateman <kyle(at)actarg(dot)com>
To: pgsql-sql(at)postgreSQL(dot)org
Cc: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, "[Jos_] Soares" <jose(at)sferacarta(dot)com>
Subject: Re: [SQL] begin/end/abort work for sequences?
Date: 1999-07-01 14:24:47
Message-ID: 377B7A2F.26209427@actarg.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bruce Momjian wrote:

> > > 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.
>

That seems like a pretty big thing to sacrifice. Did sequence locking work before
6.5? It was my impression that it did.

Do you know if there is a workaround? In my particular situation, it is critical
that all instances of the sequence actually get used. If a transaction is
aborted, I lose an instance and everything gets messed up.

--
----------------------------------------------------
Kyle Bateman President, Action Target Inc.
"Viva Yo!" kyle(at)actarg(dot)com (801)377-8033x101
----------------------------------------------------

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Steven Pennie 1999-07-01 14:43:12 Index on Type Numeric
Previous Message Bruce Momjian 1999-07-01 03:41:05 Re: [SQL] String concat operator???