Re: Serial Jumping - Mailing list pgsql-general

From Jasen Betts
Subject Re: Serial Jumping
Date
Msg-id gm3t32$8nf$1@reversiblemaps.ath.cx
Whole thread Raw
In response to Serial Jumping  (db.subscriptions@shepherdhill.biz)
List pgsql-general
On 2009-01-27, db.subscriptions@shepherdhill.biz <db.subscriptions@shepherdhill.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)


pgsql-general by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: Pet Peeves
Next
From: Grzegorz Jaśkiewicz
Date:
Subject: Re: ALTER TABLE with TYPE serial does not work