Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Sequences, defa...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 3009 of 3323
Post > Topic >>

Sequences, defaults and getting a new key

by jeff@[EMAIL PROTECTED] (Jeff Willden) Feb 21, 2008 at 09:28 PM

When the primary key of a table defaults to the nextval() of a  
sequence, if you insert a new record into the table and accept the  
default, how do you then select the value that was just used as the  
new primary key and guarantee that you don't accidentally get the  
value that another user just generated at about the same instant?

Thanks,

Jeff Willden

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
 




 3 Posts in Topic:
Sequences, defaults and getting a new key
jeff@[EMAIL PROTECTED] (  2008-02-21 21:28:13 
Re: Sequences, defaults and getting a new key
tgl@[EMAIL PROTECTED] (T  2008-02-22 00:16:44 
Re: Sequences, defaults and getting a new key
coder@[EMAIL PROTECTED]   2008-02-23 08:05:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 4:55:16 CST 2008.