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

From Andrij Korud
Subject Re: [HACKERS] Get OID of just inserted record
Date
Msg-id Pine.BSF.3.96.991102091217.71755A-100000@NetSurfer.lp.lviv.ua
Whole thread Raw
In response to Re: [HACKERS] Get OID of just inserted record  (wieck@debis.com (Jan Wieck))
Responses Re: [HACKERS] Get OID of just inserted record  ("Aaron J. Seigo" <aaron@gtv.ca>)
List 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




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Regression Testing on REL6_5_PATCHES
Next
From: Hannu Krosing
Date:
Subject: Re: [HACKERS] sort on huge table