Received: from wolff.to (wolff.to [66.92.219.49]) by postgresql.org (8.11.3/8.11.4) with SMTP id g1BFoFE86148 for ; Mon, 11 Feb 2002 10:50:15 -0500 (EST) (envelope-from bruno@wolff.to) Received: (qmail 4661 invoked by uid 500); 11 Feb 2002 15:51:37 -0000 Date: Mon, 11 Feb 2002 09:51:37 -0600 From: Bruno Wolff III To: "Hunter, Ray" Cc: pgsql-sql@postgresql.org Subject: Re: Sequences Message-ID: <20020211155137.GA4605@wolff.to> Mail-Followup-To: "Hunter, Ray" , pgsql-sql@postgresql.org References: <59358A738F45D51186A30008C74CE250E81378@slc-exc1.ctron.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59358A738F45D51186A30008C74CE250E81378@slc-exc1.ctron.com> User-Agent: Mutt/1.3.25i X-Archive-Number: 200202/112 X-Sequence-Number: 6540 On Mon, Feb 11, 2002 at 10:12:33AM -0500, "Hunter, Ray" wrote: > The only problem with this solution is that I have already incremented the > sequence and need to use the current value? Is there a way to assign the > value to a variable and then use it in an insert statement? You should be doing this in one transaction in which case currval should work. If you aren't doing it in one transaction, then your application will need to remember the current value.