Re: sequences and Transactions

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Elmar(dot)Haneke(at)gmx(dot)de
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: sequences and Transactions
Date: 2000-04-27 11:39:50
Message-ID: 200004271139.HAA05216@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Hi!
>
> how can I setup sequences to have the current-value reset in case
> of an Transaction rollback.
>
> My intension is to get an contignous numbering of the rows.
> Currently in case of an Rollback one number is skipped since
> the record itself is not inserted but the counter is not reset.

People have asked this before. If we did that rollback, we would have
to lock the sequence value for the duration of the transaction, which is
not good. No real way to do this, sorry.

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Ansley 2000-04-27 11:39:58 RE: sequences and Transactions
Previous Message Bruce Momjian 2000-04-27 11:35:19 Re: Revisited: Transactions, insert unique.