Can a view use a schema search_path?

Поиск
Список
Период
Сортировка
От Adam Mackler
Тема Can a view use a schema search_path?
Дата
Msg-id CAFC21Lo8d0bcE0Ce08TjmqHhv71hhhoimAkY6ZBrVKYRuLt=pg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Can a view use a schema search_path?  (Thomas Kellerer <spam_eater@gmx.net>)
Re: Can a view use a schema search_path?  (Chris Angelico <rosuav@gmail.com>)
Re: Can a view use a schema search_path?  (Alban Hertroys <haramrae@gmail.com>)
Список pgsql-general
I have the feeling the answer is no, but I would like an authoritative answer before I give up.

My plan was to have two schemas: one for the live data, and one for staging, training, and testing.  Both schemas would have identically-named tables.  I wanted to create a single view in the public schema, and have that one view refer to the tables in one or the other schema depending on my search_path setting at the time I query the view.

But it seems that at the time the view is created it decides which schema's table it's referring to, even if I don't explicitly qualify the table names with the schema name.

Am I correct in concluding that there's no way to have a single view in the public schema that selects data from tables in different other schemas depending on my search_path at the time I execute a query involving that view?

Thanks.
--
Adam Mackler

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: foreign key from array element
Следующее
От: Rafal Pietrak
Дата:
Сообщение: Re: foreign key from array element