Re: SQL-question: returning the id of an insert querry - Mailing list pgsql-general

From Scott Chapman
Subject Re: SQL-question: returning the id of an insert querry
Date
Msg-id 200311091026.51404.scott_list@mischko.com
Whole thread Raw
In response to Re: SQL-question: returning the id of an insert querry  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: SQL-question: returning the id of an insert querry
List pgsql-general
On Sunday 09 November 2003 03:13, Martijn van Oosterhout wrote:
> After you've done the insert on the address table, you can use
> currval('address_id_seq') (or equivalent) to get the ID. Ofcourse you
> have to have used nextval() for the original insert.

What if someone else inserts another address before I get the currval?
I'm out of luck then, right?



pgsql-general by date:

Previous
From: Rajesh Kumar Mallah
Date:
Subject: Re: Question on Select
Next
From: Doug McNaught
Date:
Subject: Re: SQL-question: returning the id of an insert querry