How do I find the table that an oid belongs to

From: Roland Roberts <roberts(at)panix(dot)com>
To: hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: How do I find the table that an oid belongs to
Date: 1998-08-06 04:07:03
Message-ID: x6ww8m3g9k.fsf@tycho.rlent.pnet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm trying to get Keystone (http://www.stonekeep.com/) to work and
have to emulate some MySQL functions. One of these is the ability to
return the value of a column that is an auto-increment column after a
row was inserted, updated, or deleted. The interface I have to work
with is PHP. PHP has a function, pg_getlastoid, that lets me find the
oid of the last insert, update, or delete. I've looked at psql.c to
find out how to get the column attributes so I can figure out which
one(s) are auto increment (or rather, which ones are coming from a
sequence definition via "default nextval ('seqname')").

What I can't figure out is, given an oid, how can I figure out what
table it belongs to?

roland
--
Roland B. Roberts, PhD Custom Software Solutions
roberts(at)panix(dot)com 101 West 15th St #4NN
New York, NY 10011

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-08-06 04:10:29 Re: [HACKERS] OR clause status
Previous Message Bruce Momjian 1998-08-06 03:53:58 Large objects names