From: Greg Sabino Mullane <greg@turnstep.com>
To: pgsql-sql@postgresql.org
Subject: Re: Atomic query and update of sequence generators
Date: Thu, 15 Jan 2004 12:47:39 -0000
Message-ID: <84b4154c70a56ad7bc38057f6d5dd224@biglumber.com> (raw)
In-Reply-To: <4005E425.2070706@comcast.net>
-----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-----
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: greg@turnstep.com
Subject: Re: Atomic query and update of sequence generators
In-Reply-To: <84b4154c70a56ad7bc38057f6d5dd224@biglumber.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