Re: Getting table name/tuple from OID - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Getting table name/tuple from OID
Date
Msg-id 20051111140405.GG13177@svana.org
Whole thread Raw
In response to Re: Getting table name/tuple from OID  (huaxin zhang <uwcssa@gmail.com>)
List pgsql-hackers
On Fri, Nov 11, 2005 at 08:37:07AM -0500, huaxin zhang wrote:
> Hi all,
>
> I am interested in the answer as well -- how to get a table name (or
> an operator name) from an OID.  the parser must know how to do this,
> but the segment of code is hard to locate.

For the purposes of error messages, RelationGetRelationName() does what
you want. Otherwise maybe RelationIdGetRelation(Oid relationId). Check
out utils/cache/relcache.c for a variety of functions to extract basic
data like this.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: someone working to add merge?
Next
From: Guillaume LELARGE
Date:
Subject: server closed connection on a select query