Return serial from insert - Mailing list pgsql-novice

From Rory Campbell-Lange
Subject Return serial from insert
Date
Msg-id 20021108152936.GB15280@campbell-lange.net
Whole thread Raw
Responses Re: Return serial from insert
List pgsql-novice
I would like to return the autoincremented serial number resulting from
a new insert into a table, ideally as a result from the insert
statement.

Presumably this is the way to avoid race conditions between inserts into
the database, because if I do 1) insert then 2) get max sequence val, 2
might be wrong.

Thanks
Rory

--
Rory Campbell-Lange
<rory@campbell-lange.net>
<www.campbell-lange.net>

pgsql-novice by date:

Previous
From: "Retzlaw Heinrich"
Date:
Subject: creating table with an encrypted filed
Next
From: Rod Kreisler
Date:
Subject: Re: Return serial from insert