Re: [HACKERS] Get OID of just inserted record

From: "Andrij Korud" <akorud(at)polynet(dot)lviv(dot)ua>
To: "Jan Wieck" <wieck(at)debis(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Get OID of just inserted record
Date: 1999-11-02 07:15:14
Message-ID: Pine.BSF.3.96.991102091217.71755A-100000@NetSurfer.lp.lviv.ua
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2 Nov 1999, Jan Wieck wrote:

> >
> > Hi,
> > Is there any way to obtain an OID of record just inserted by SPI_execp?
>
> How should that work consistenty? What do you expect as
> return if the query executed was an
>
> INSERT INTO t2 SELECT * FROM t1;
>
> The first, a random one or the last of the two million rows
> inserted?
>
>
My question is:
"CREATE TABLE t1 (word text)"
"INSERT INTO t1 VALUES('xxx')" (using SPI_execp)

So, is there any way to obtain OID of word 'xxx' just after insertion
without doing "SELECT oid FROM t1 WHERE word='xxx'"?

Thanks in advance,
Andriy Korud, Lviv, Ukraine

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 1999-11-02 08:11:55 A bug in NOT IN (SELECT ...
Previous Message Hannu Krosing 1999-11-02 07:03:55 Re: [HACKERS] sort on huge table