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

Re: [GENERAL] using Oids to retrieve a row

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] using Oids to retrieve a row
Date: 1999-03-28 16:01:52
Message-ID: l0311070ab324025b16cd@[] (view raw, whole thread or download thread mbox)
Lists: pgsql-general
At 18:32 +0200 on 26/03/1999, Karl DeBisschop wrote:

> are you doing this in psql?
> Or perl, php, or some other?
> perl and php both have methods for getting the oid of the last
> inserted row (use "$oid = $sth->{'pg_oid_status'};"
>  in perl and "$oid = pg_GetLastOid($result_id);" in php )
> Look at the php documentation, or do 'perldoc DBD::Pg'
> to see more details.

A word of warning, though: retrieving a row by its oid doesn't make
retrieval faster. You have to create an index on the oid column, otherwise
it's plain sequential search. Personally, I prefer defining an indexed
serial field and using currval.


Herouth Maoz, Internet developer.
Open University of Israel - Telem project

In response to

pgsql-general by date

Next:From: Herouth MaozDate: 1999-03-28 17:24:50
Subject: Re: [GENERAL] Determining if "in a text set"
Previous:From: Thomas FrickeDate: 1999-03-28 14:38:58
Subject: Contrib of an array based type to postgres

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