Re: [HACKERS] Get OID of just inserted record - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Get OID of just inserted record
Date
Msg-id 16487.941570041@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Get OID of just inserted record  ("Aaron J. Seigo" <aaron@gtv.ca>)
List pgsql-hackers
"Aaron J. Seigo" <aaron@gtv.ca> writes:
> would it be possible to add a RETURN clause to INSERT? e.g.
>
> INSERT into t1 VALUES('xxx') RETURN oid;

Not necessary --- the backend already does return the OID of the
inserted tuple (if just one is inserted).  You can see it in psql,
for example.  The problem here is just that not all frontend libraries
make it possible to get at that value :-(.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] file descriptors leak?
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] file descriptors leak?