Re: Increment a sequence by more than one - Mailing list pgsql-sql

From Peter Childs
Subject Re: Increment a sequence by more than one
Date
Msg-id a2de01dd0708060000k504525bdt99177726bb7af529@mail.gmail.com
Whole thread Raw
In response to Re: Increment a sequence by more than one  (Michael Glaesemann <grzm@seespotcode.net>)
List pgsql-sql


On 03/08/07, Michael Glaesemann <grzm@seespotcode.net> wrote:

On Aug 3, 2007, at 15:27 , Erik Jones wrote:

> Is there actually a requirement that the block of 5000 values not
> have gaps?

Good point.

> If not, why not make the versioned table's id column default to
> nextval from the same sequence?

Of course, the ids of the two tables could be interleaved in this
case. This might not be an issue, of course.


Michael Glaesemann
grzm seespotcode net


It seams to me that one should use the cache feature of a sequence is there just for this purpose.

That way when you get the next value your session caches and any other sessions will get one after your cache range.

Peter

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] could not [extend relation|write block N of temporary file|write to hash-join temporary file]
Next
From: Steve Midgley
Date:
Subject: Re: Increment a sequence by more than one