This is an incorrect statement (as pointed out in the FAQ) 4.16.3) Don't currval() and nextval() lead to a race condition with other users? No. This is handled by the backends. More info: http://www.postgresql.org/users-lounge/docs/7.0/user/sql-createsequence.htm When calling currval, you recieve the last value used by *your backend* (regardless of what others have done). Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio On Fri, 2 Mar 2001, Gregory Wood wrote: > SELECT currval('Table_SerialField_SEQ'); > > Note: This selects the last value of the sequence defined by your SERIAL > sequence, not necessarily the value in your INSERT. For example: > > 1. User A INSERTs. > 2. User B INSERTs. > 3. User A performs SELECT currval, which returns the value for User B's > INSERT. > > If this could be a potential problem, I recommend peforming a: > > SELECT nextval('Table_SerialField_SEQ'); > > *before* you perform the INSERT, and explicitly using that value. > > Greg > > ----- Original Message ----- > From: "Kostis Mentzelos" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, March 01, 2001 5:53 PM > Subject: SERIAL values > > > > Hi all, > > > > how can I get the current values from SERIAL types after an INSERT using > > > > libpq? > > > > > > Thanks, > > kostis. > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED] > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED] > ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
