pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Childs <peterachilds@gmail.com>
To: Michael Glaesemann <grzm@seespotcode.net>
Cc: Erik Jones <erik@myemma.com>
Cc: Steve Midgley <public@misuse.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: Increment a sequence by more than one
Date: Mon, 6 Aug 2007 08:00:31 +0100
Message-ID: <a2de01dd0708060000k504525bdt99177726bb7af529@mail.gmail.com> (raw)
In-Reply-To: <6137A8C5-187D-46E8-B9C2-822D05C5DFC2@seespotcode.net>
References: <20070803165058.020509FBF2F@postgresql.org>
	<BA0AEA3C-A9C1-462E-9F86-34755121673D@myemma.com>
	<6137A8C5-187D-46E8-B9C2-822D05C5DFC2@seespotcode.net>

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

view thread (11+ messages)  latest in thread

Message-ID: <a2de01dd0708060000k504525bdt99177726bb7af529@mail.gmail.com>
Permalink:  ../a2de01dd0708060000k504525bdt99177726bb7af529@mail.gmail.com/
Also on:    postgresql.org/message-id/a2de01dd0708060000k504525bdt99177726bb7af529@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: peterachilds@gmail.com, grzm@seespotcode.net, erik@myemma.com, public@misuse.org
  Subject: Re: Increment a sequence by more than one
  In-Reply-To: <a2de01dd0708060000k504525bdt99177726bb7af529@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox