From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>
Cc: pgsql-interfaces@postgreSQL.org
Subject: Re: [INTERFACES] locking on database updates
Date: Wed, 08 Dec 1999 01:53:30 -0500
Message-ID: <25814.944636010@sss.pgh.pa.us> (raw)
In-Reply-To: <19991207132411.B7090@rice.edu>
"Ross J. Reedstrom" <reedstrm@wallace.ece.rice.edu> writes:
> Tom -
> I'm surprised: that one's been beat to death in earlier incarnations
> of this FAQ. The currval() function is part of backend state: it
> always returns the last value sent to _this connection_.
Yeah, sure, I knew that ... in one brain cell or another, but evidently
not the ones on call today ;-)
A fairly weak rejoinder: if you've got triggers or rules doing things
to your tables behind-your-back, you might still not be able to assume
that the sequence's nextval() will be called only once during any one
SQL query that you issue. So I still say the nextval-first approach
is sounder than currval-afterwards. But I must agree it wouldn't
become an issue unless you had some pretty convoluted database
programming going on.
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, reedstrm@wallace.ece.rice.edu
Subject: Re: [INTERFACES] locking on database updates
In-Reply-To: <25814.944636010@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