How do I find the table that an oid belongs to - Mailing list pgsql-hackers

From Roland Roberts
Subject How do I find the table that an oid belongs to
Date
Msg-id x6ww8m3g9k.fsf@tycho.rlent.pnet
Whole thread Raw
List 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@panix.com                           101 West 15th St #4NN
                                               New York, NY 10011

pgsql-hackers by date:

Previous
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] OR clause status
Next
From: "Dr. Michael Meskes"
Date:
Subject: Declare Cursor question again