Re: Unqualified relations in views

Поиск
Список
Период
Сортировка
От Pete O'Such
Тема Re: Unqualified relations in views
Дата
Msg-id CAEdngj-aP_KgDHqKMeasSSxgZ272GbKkh4-_-8LiWNeMrEmDDg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Unqualified relations in views  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-general
> PostgreSQL resolves tables and other objects according to the setting of
> "search_path" at CREATE VIEW time.  The query itself is stored in parsed form.
>
> pg_get_viewdef() deparses the query and only prepends a schema name if the
> schema is not on the "search_path".  So the solution is to set "search_path"
> empty:
>
>   SET search_path = '';
>
>   SELECT pg_get_viewdef('myschema.myview');

Thank you!  That is the perfect answer to my question!

Is Postgres hiding the ball a bit here?  Is there a reason that obscuring the
known and static schema is better than showing it?  In my case (tracking down
execution differences between local and FDW view use) this has occupied a lot of
time.

Thanks again,
Pete O'Such

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

Предыдущее
От: Anthony Apollis
Дата:
Сообщение: Re: Making Sure Primary and Secondary Keys Alligns
Следующее
От: Sándor Daku
Дата:
Сообщение: Re: Making Sure Primary and Secondary Keys Alligns