Re: Sequence skipping values

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Jean-Christophe Roux <jcxxr(at)yahoo(dot)com>
Cc: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Sequence skipping values
Date: 2006-02-10 17:50:13
Message-ID: 1139593813.24321.432.camel@coppola.muc.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You likely roll back some transactions which insert. The sequence values
don't get rolled back, once allocated, it's gone, even if you won't keep
it. For concurrency/performance reasons sequence values are not
transactional.

Cheers,
Csaba.

On Fri, 2006-02-10 at 18:44, Jean-Christophe Roux wrote:
> Hello,
> I have a table with and id field (primary key) which default value is
> the result of a sequence (increment explicitly set to 1).
> To my surprise, the real increment on insert is the total number of
> rows of the table. For instance, with 41 rows and a sequence
> last_value of 1141, the next insert row will have a value of 1182. It
> is not a big problem but I don't like skipping and wasting values in a
> sequence. Also, I'd like to understand what's going on!
> If someone could give me a clue that wold be greatly appreciated
> thanks
> JC
>
>
> ______________________________________________________________________
> Brings words and photos together (easily) with
> PhotoMail - it's free and works with Yahoo! Mail.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2006-02-10 17:53:33 Re: Sequence skipping values
Previous Message Jean-Christophe Roux 2006-02-10 17:44:28 Sequence skipping values