Re: Wanted: RelationIsVisible interface

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Wanted: RelationIsVisible interface
Дата
Msg-id 20811.1028954117@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Wanted: RelationIsVisible interface  ("Greg Sabino Mullane" <greg@turnstep.com>)
Список pgsql-hackers
"Greg Sabino Mullane" <greg@turnstep.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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [COMMITTERS] pgsql-server/src backend/tcop/postgres.cbacke
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Proposal for psql wildcarding behavior w/schemas