Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] locking on database updates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] locking on database updates
Date: 1999-12-08 06:53:30
Message-ID: 25814.944636010@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
"Ross J. Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)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

pgsql-interfaces by date

Next:From: Peter MountDate: 1999-12-08 07:26:29
Subject: RE: [INTERFACES] Transaction support in 6.5.3/JDBC
Previous:From: Tom LaneDate: 1999-12-08 06:40:16
Subject: Re: [INTERFACES] sql question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group