Re: Getting table name/tuple from OID

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: huaxin zhang <uwcssa(at)gmail(dot)com>
Cc: Paresh Bafna <paresh(at)it(dot)iitb(dot)ac(dot)in>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Getting table name/tuple from OID
Date: 2005-11-11 14:04:06
Message-ID: 20051111140405.GG13177@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-11-11 14:12:32 Re: 8.1 substring bug?
Previous Message Jaime Casanova 2005-11-11 14:03:19 someone working to add merge?