| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | "Greg Sabino Mullane" <greg(at)turnstep(dot)com> |
| Cc: | pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: Wanted: RelationIsVisible interface |
| Date: | 2002-08-10 04:35:17 |
| Message-ID: | 20811.1028954117@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
"Greg Sabino Mullane" <greg(at)turnstep(dot)com> writes:
>> we'd write something like
>> select ... from pg_class p, ...
>> where relname like 'foo%' and pg_relation_is_visible(p.oid) and ...
> I see what you are saying, and this is fine for those cases in which the user
> has supplied the schema, but I don't see how it solves the ordering problem.
> If I have a table public.foo and greg.foo, and both are "visible", how will
> psql know which one to show?
By definition, only one can be visible: a table named "foo" hides any
other "foo" that's later in the search path. This is exactly the point
that the is_visible tests cover, while there isn't any easy way to
handle it in SQL by comparison of a relnamespace value to a
current_schemas list --- that comparison doesn't tell you anything
about possible conflicting names elsewhere in the search path.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2002-08-10 04:49:17 | Re: Proposal for psql wildcarding behavior w/schemas |
| Previous Message | Bruce Momjian | 2002-08-10 02:17:44 | Re: [COMMITTERS] pgsql-server/src backend/tcop/postgres.cbacke |