Re: Serial Jumping

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Serial Jumping
Date: 2009-02-01 10:21:22
Message-ID: gm3t32$8nf$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2009-01-27, db(dot)subscriptions(at)shepherdhill(dot)biz <db(dot)subscriptions(at)shepherdhill(dot)biz> wrote:
> Hi,
>
> I have a table with BIG SERIAL field as Primary KEY. During high load,
> entries in the BIG SERIAL field are jumped. One could see a row with
> 1367 and expecting the next INSERT to be 1368, one would end up
> getting 1369.
>
> Please is this normal?

if an insert that would have used 1368 failed or is in an unfinished
transaction that's entirely normal.

if you care about the value you are inserting make sure you know it as
the time it is inserted (use returning or use nextval beforehand)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-02-01 10:36:40 Re: ALTER TABLE with TYPE serial does not work
Previous Message Dean Rasheed 2009-02-01 10:20:50 Re: Pet Peeves