From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Ramanujam H S Iyengar" <hals_ramu(at)hotmail(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: How to get RelationName ?? |
Date: | 2004-03-11 06:04:49 |
Message-ID: | 16367.1078985089@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
"Ramanujam H S Iyengar" <hals_ramu(at)hotmail(dot)com> writes:
> iam in need of a function through which i can get a Relation Node given its
> name ..
> precisely the same one equivalent to " RelationSysNameGetRelation " .. which
> works for all types of relations (system and user tables)
The reason RelationSysNameGetRelation only works for system relations is
that it assumes the schema name is "pg_catalog". For non-system
relations you cannot do a lookup based only on relation name, because
there's no certainty that the result is unique.
There are some functions in catalog/namespace.c that can do lookup of an
unqualified name relative to the current schema search path, if that's
what you want.
> Iam trying to test for some patch in the code of the Optimizer(planner) and
> so I need some C functions, which does the job.
The optimizer has no need, ever, to find a relation by name; all it ever
sees are predigested relation OIDs. So you are not making a lot of
sense here. You certainly cannot assume that a search-path lookup is
appropriate for a relation that the optimizer is dealing with.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Kris Jurka | 2004-03-11 06:13:28 | Re: grants |
Previous Message | Neil Conway | 2004-03-11 06:03:31 | Re: unsafe floats |