Re: Getting last inserted SERIAL - Mailing list pgsql-general

From Dennis Björklund
Subject Re: Getting last inserted SERIAL
Date
Msg-id Pine.LNX.4.44.0309010600320.4053-100000@zigo.dhs.org
Whole thread Raw
In response to Getting last inserted SERIAL  (mgarriss <mgarriss@earthlink.net>)
List pgsql-general
On Sun, 31 Aug 2003, mgarriss wrote:

> First thought is "SELECT CURRVAL('test_id_seq');" but this assumes that
> there is only one connection inserting into this table, bad assumption.

That is what you should use, and it works for concurrent sessions. It's
all described in the manual:

http://www.postgresql.org/docs/7.3/static/functions-sequence.html

--
/Dennis


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: About GPL and proprietary software
Next
From: Bruce Momjian
Date:
Subject: Re: Getting last inserted SERIAL