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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Sequences, defaults and getting a new key



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group