Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id UAA22753 for ; Mon, 6 Dec 1999 20:14:56 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id UAA20460; Mon, 6 Dec 1999 20:14:21 -0500 (EST) To: Gary Stainburn cc: "'Pgsql Interfaces'" Subject: Re: [INTERFACES] locking on database updates In-reply-to: Your message of Mon, 6 Dec 1999 17:16:27 -0000 <01BF400D.C8C88440@garys.ringways.co.uk> Date: Mon, 06 Dec 1999 20:14:21 -0500 Message-ID: <20458.944529261@sss.pgh.pa.us> From: Tom Lane Gary Stainburn 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