X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 04C03D1B4BD for ; Thu, 15 Jan 2004 12:48:14 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 47174-06 for ; Thu, 15 Jan 2004 08:47:45 -0400 (AST) Received: from biglumber.com (biglumber.com [207.228.252.42]) by svr1.postgresql.org (Postfix) with SMTP id 79043D1B4C5 for ; Thu, 15 Jan 2004 08:47:41 -0400 (AST) Received: (qmail 23898 invoked from network); 15 Jan 2004 12:47:39 -0000 Received: from unknown (HELO localhost) (207.228.252.42) by 0 with SMTP; 15 Jan 2004 12:47:39 -0000 From: "Greg Sabino Mullane" To: pgsql-sql@postgresql.org Subject: Re: Atomic query and update of sequence generators X-PGP-Key: 2529 DF6A B8F7 9407 E944 45B4 BC9B 9067 1496 4AC8 X-Request-PGP: http://www.biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 In-Reply-To: <4005E425.2070706@comcast.net> Date: Thu, 15 Jan 2004 12:47:39 -0000 X-Mailer: JoyMail 1.45 Message-ID: <84b4154c70a56ad7bc38057f6d5dd224@biglumber.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/128 X-Sequence-Number: 16521 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > The goal is to get a sequence of 20 values that are > all +1 from each other. If you don't care about the rest of the values being +1 from each other, you could create the sequence with an INTERVAL of 20. Other than that, you would probably have to create your own "sequence" generator. Another alternative would be a function like this: get nextval as x set sequence to x+20 get nextval as y repeat if y != x+20 (i.e. someone else grabbed a value) - -- Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200401150746 -----BEGIN PGP SIGNATURE----- iD8DBQFABovdvJuQZxSWSsgRAnxeAKCWK3tFCE3u8NfXG5LG3H0smDLyhACglrr7 08ke6k8B8MSKVipRb2aSWQg= =PSzM -----END PGP SIGNATURE-----