Re: views to behave differently according to user and schema

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: views to behave differently according to user and schema
Дата
Msg-id 42F0AFA9.4000202@archonet.com
обсуждение исходный текст
Ответ на views to behave differently according to user and schema  (Samuel Thoraval <samuel.thoraval@librophyt.com>)
Список pgsql-general
Samuel Thoraval wrote:
>
> Is it possible to change this behavior so that the VIEW will dynamically
> use the search_path variable (when the schema was not specifically set) ?
> In this case, when user nsp2 loggs in, the VIEW vtest would be using
> VIEW nsp2.test, when user nsp3 loggs in it would use VIEW nsp3.test, for
> user nsp1 TABLE nsp1.test ...

I don't think so. There's no guarantee that nsp1 and nsp2 have the same
definition, which means the view could break depending on search_path.

You could create a separate view in each schema of course.

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: "Vahe Ghorghorian"
Дата:
Сообщение: Hello
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Hello