dbTalk Databases Forums  

Re: Value of serial data type after insert.

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss Re: Value of serial data type after insert. in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: Value of serial data type after insert. - 11-13-2004 , 11:29 PM






On Wed, Nov 10, 2004 at 02:34:22PM -0500, Ernest Kim wrote:

Quote:
I was wondering if there was a way to get the value of serial data
type after an insert.
Use currval():

http://www.postgresql.org/docs/7.4/s...-sequence.html

Race condtions aren't a problem:

"Notice that because this is returning a session-local value, it
gives a predictable answer even if other sessions are executing
nextval meanwhile."

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.