Re: sequence skips 30 values, how?

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: sequence skips 30 values, how?
Date: 2007-01-31 13:33:22
Message-ID: 20070131133322.GK11721@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

am Wed, dem 31.01.2007, um 7:43:05 -0500 mailte Geoffrey folgendes:
> dies. We've tracked this to an unusual situation where a sequence value
> that is being created during the process that is causing the core file
> generation. The thing that is bizarre is that the sequence value skips
> 30+ entries.
>
> How is this even possible? Any suggestions would be greatly appreciated.

A sequence don't guaranteed a gapless behavior.

Simple example:

test=# create table gap (id serial);
NOTICE: CREATE TABLE will create implicit sequence "gap_id_seq" for
serial column "gap.id"
CREATE TABLE
test=*# insert into gap values (default)
test-# ;
INSERT 0 1
test=*# commit;
COMMIT
test=# insert into gap values (default);
INSERT 0 1
test=*# insert into gap values (default);
INSERT 0 1
test=*# rollback;
ROLLBACK
test=# insert into gap values (default);
INSERT 0 1
test=*# commit;
COMMIT
test=# select * from gap;
id
----
1
4
(2 rows)

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2007-01-31 13:36:53 Re: sequence skips 30 values, how?
Previous Message Geoffrey 2007-01-31 12:43:05 sequence skips 30 values, how?