From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gary Stainburn <gary.stainburn@ringways.co.uk>
Cc: 'Pgsql Interfaces' <pgsql-interfaces@postgreSQL.org>
Subject: Re: [INTERFACES] locking on database updates
Date: Mon, 06 Dec 1999 20:14:21 -0500
Message-ID: <20458.944529261@sss.pgh.pa.us> (raw)
In-Reply-To: <01BF400D.C8C88440@garys.ringways.co.uk>
Gary Stainburn <gary.stainburn@ringways.co.uk> writes:
> My question is this. Is there a safe way of retrieving the next
> number from the parameter table in such a way that the same number
> cannot be retrieved twice.
Use a SEQUENCE object for each "parameter table". This gives you
a well-tested, efficient generator mechanism. It may be "auto
generated" but you do have the option of resetting the sequence's
nextval and so forth, so I don't see that there is a good reason
to build a SEQUENCE substitute by hand.
regards, tom lane
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-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, gary.stainburn@ringways.co.uk
Subject: Re: [INTERFACES] locking on database updates
In-Reply-To: <20458.944529261@sss.pgh.pa.us>
* 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