Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4086F4759D8 for ; Tue, 6 Aug 2002 14:34:16 -0400 (EDT) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id 369FE475835 for ; Tue, 6 Aug 2002 14:34:15 -0400 (EDT) Received: from [66.219.92.2] (HELO chocolate-mousse) by davinci.ethosmedia.com (CommuniGate Pro SMTP 3.5.9) with ESMTP id 1602326; Tue, 06 Aug 2002 11:34:14 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Tom Lane Subject: Re: problem fetching currval of sequence Date: Tue, 6 Aug 2002 11:35:20 -0700 X-Mailer: KMail [version 1.4] Cc: Charles Hauser , pgsql-sql@postgresql.org References: <20611.1028651144@sss.pgh.pa.us> In-Reply-To: <20611.1028651144@sss.pgh.pa.us> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200208061135.20799.josh@agliodbs.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/114 X-Sequence-Number: 8960 Tom, > Huh? AFAIR it's always worked the way it does now (and a quick review > of the CVS logs for sequence.c backs up my recollection). No, back in 7.1.0 I was able to call CURRVAL without having previously call= ed=20 NEXTVAL, and it would give me the "current" sequence value; that is, the sa= me=20 result value as (NEXTVAL() - 1); I wouldn't mind having a new function th= at=20 does this; I can understand making a distinction between the pre-session=20 CURRVAL, and the general current value. > Such a front end would be too broken to consider using anyway: if you > cannot wrap several related commands into a transaction, you cannot use > a database the way it's intended to be used. The connection-pooling > front ends that I know about all give you dedicated use of a connection > for at least the length of a transaction block, so the secret to using > currval is "do it in the same transaction block as you call nextval in". Me, I use functions. --=20 -Josh Berkus Aglio Database Solutions San Francisco