Skip site navigation (1) Skip section navigation (2)

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 (view raw, whole thread or download thread mbox)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group