Re: how to determine OID of the row I just inserted??? - Mailing list pgsql-general

From Jules Alberts
Subject Re: how to determine OID of the row I just inserted???
Date
Msg-id 20030207075408.0A2471CB1B9@koshin.dsl.systemec.nl
Whole thread Raw
In response to Re: how to determine OID of the row I just inserted???  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Op 6 Feb 2003 (10:08), schreef Tom Lane <tgl@sss.pgh.pa.us>:
> "Jules Alberts" <jules.alberts@arbodienst-limburg.nl> writes:
> > Something like lastval() IMHO is way too risky.
>
> currval() is what you want, and it is *not* risky.  Read the sequence
> documentation.

I did that, and currval() _is_ the answer :-)

It operates on the current process only (out of curiosity I tested it),
so it's safe.

Thanks a lot!

pgsql-general by date:

Previous
From: Shridhar Daithankar
Date:
Subject: Re: PGconn thread safety
Next
From: will trillich
Date:
Subject: Re: "Cannot insert a duplicate key..." -- SOLVED