Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 5730D9FB4CB for ; Mon, 6 Aug 2007 04:00:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 54768-01 for ; Mon, 6 Aug 2007 04:00:26 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.187]) by postgresql.org (Postfix) with ESMTP id F24A89FB2B2 for ; Mon, 6 Aug 2007 04:00:33 -0300 (ADT) Received: by mu-out-0910.google.com with SMTP id i10so1960377mue for ; Mon, 06 Aug 2007 00:00:32 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=SRHHEmChO1LV4KdPLzpFzRBrhl5L9VrPS/LkwHSGFZFczhit9JpQRHorluPcsAKYgOQhswg1ZiNf7mT4G5sgodfTsmuabWOtEeLEN+Fxqi99waG4iQ2hvIjySDN9vehj+zTHiTMJ2H2N2Boxhqk/kj273rZn9ORzS/IXlS7I+GA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=bNLlP/wM843lnWSzqve9ZW0nM3LIg21Gp9/vjgdJw7mlhBBNQY+mllhqK1pC3cItYQ/JuOd+qTj8doEMq5mlPq3J47VrXTBjs7pkmL81U+FuEg6o0qm3O1pm6gFyWgmQ4HU9RD7aGG/Bhjqt2nE4tN+9B/p59zIH565WHcjZoxY= Received: by 10.78.37.7 with SMTP id k7mr1374300huk.1186383632064; Mon, 06 Aug 2007 00:00:32 -0700 (PDT) Received: by 10.78.150.17 with HTTP; Mon, 6 Aug 2007 00:00:31 -0700 (PDT) Message-ID: Date: Mon, 6 Aug 2007 08:00:31 +0100 From: "Peter Childs" To: "Michael Glaesemann" Subject: Re: Increment a sequence by more than one Cc: "Erik Jones" , "Steve Midgley" , pgsql-sql@postgresql.org In-Reply-To: <6137A8C5-187D-46E8-B9C2-822D05C5DFC2@seespotcode.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_63542_9727115.1186383631813" References: <20070803165058.020509FBF2F@postgresql.org> <6137A8C5-187D-46E8-B9C2-822D05C5DFC2@seespotcode.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/32 X-Sequence-Number: 28970 ------=_Part_63542_9727115.1186383631813 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 03/08/07, Michael Glaesemann 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 ------=_Part_63542_9727115.1186383631813 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

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
------=_Part_63542_9727115.1186383631813--