Re: how to determine OID of the row I just inserted???

From: "Jules Alberts" <jules(dot)alberts(at)arbodienst-limburg(dot)nl>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: how to determine OID of the row I just inserted???
Date: 2003-02-07 07:53:41
Message-ID: 20030207075408.0A2471CB1B9@koshin.dsl.systemec.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Op 6 Feb 2003 (10:08), schreef Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> "Jules Alberts" <jules(dot)alberts(at)arbodienst-limburg(dot)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!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message will trillich 2003-02-07 08:45:50 Re: "Cannot insert a duplicate key..." -- SOLVED
Previous Message Shridhar Daithankar 2003-02-07 07:50:20 Re: PGconn thread safety