Home » U++ Library support » U++ SQL » PostgreSQL GetInsertedId()
Re: PostgreSQL GetInsertedId() [message #16734 is a reply to message #16723] |
Tue, 08 July 2008 21:58 |
captainc
Messages: 278 Registered: December 2006 Location: New Jersey, USA
|
Experienced Member |
|
|
zsolt wrote on Tue, 08 July 2008 10:56 |
luzr wrote on Tue, 08 July 2008 15:57 |
What if other client inserts a record between your INSERT and SELECT?
|
In PostgreSQL, curval returns the value after last "nextval" in current session.
If some other clients call "nextval" after yours, you will see your original value got from your last "nextval".
|
Also, curval and nextval are session specific (session safe). So unless you inserted another item in your session, you will get back the id expected. Other sessions will not interfere with this even if they add information to the database in between.
|
|
|
|
|
PostgreSQL GetInsertedId()
|
|
|
Re: PostgreSQL GetInsertedId()
|
|
|
Re: PostgreSQL GetInsertedId()
By: mirek on Wed, 02 July 2008 23:17
|
|
|
Re: PostgreSQL GetInsertedId()
|
|
|
Re: PostgreSQL GetInsertedId()
By: mirek on Fri, 04 July 2008 13:49
|
|
|
Re: PostgreSQL GetInsertedId()
|
|
|
Re: PostgreSQL GetInsertedId()
By: unodgs on Mon, 07 July 2008 22:15
|
|
|
Re: PostgreSQL GetInsertedId()
By: mirek on Mon, 07 July 2008 22:17
|
|
|
Re: PostgreSQL GetInsertedId()
By: unodgs on Mon, 07 July 2008 22:46
|
|
|
Re: PostgreSQL GetInsertedId()
By: zsolt on Mon, 07 July 2008 22:49
|
|
|
Re: PostgreSQL GetInsertedId()
By: mirek on Tue, 08 July 2008 07:22
|
|
|
Re: PostgreSQL GetInsertedId()
By: zsolt on Tue, 08 July 2008 08:55
|
|
|
Re: PostgreSQL GetInsertedId()
By: zsolt on Mon, 07 July 2008 22:48
|
|
|
Re: PostgreSQL GetInsertedId()
By: mirek on Tue, 08 July 2008 15:57
|
|
|
Re: PostgreSQL GetInsertedId()
By: zsolt on Tue, 08 July 2008 16:56
|
|
|
Re: PostgreSQL GetInsertedId()
|
Goto Forum:
Current Time: Mon May 13 22:17:51 CEST 2024
Total time taken to generate the page: 0.01337 seconds
|