Re: [HACKERS] Get OID of just inserted record

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Aaron J(dot) Seigo" <aaron(at)gtv(dot)ca>
Cc: "Andrij Korud" <akorud(at)polynet(dot)lviv(dot)ua>, "Jan Wieck" <wieck(at)debis(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Get OID of just inserted record
Date: 1999-11-02 19:14:01
Message-ID: 16487.941570041@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Aaron J. Seigo" <aaron(at)gtv(dot)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

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-11-02 19:20:05 Re: [HACKERS] file descriptors leak?
Previous Message Peter Eisentraut 1999-11-02 18:48:41 Re: [HACKERS] Get OID of just inserted record