Re: Schema search_path and views

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Schema search_path and views
Дата
Msg-id b42b73150611060853p63c8ee31l4ceac133b615e239@mail.gmail.com
обсуждение исходный текст
Ответ на Schema search_path and views  ("Just Someone" <just.some@gmail.com>)
Ответы Re: Schema search_path and views  ("Just Someone" <just.some@gmail.com>)
Список pgsql-general
On 11/6/06, Just Someone <just.some@gmail.com> wrote:
> I have a database with multiple schemas all with the same structure
> (but of course different data...).
>
> I want to create a view that will be created in a shared schema, and
> when executed will be executed against the current schema. Whenever I
> try it, it seems the view is linked to a specific schema used when
> creating it, and doesn't reevaluates based on the current schema.

no, or not exactly.  views resolve the search path when they are
generated.  this is a fundemental part of how they work.  functions,
however, are a bit different.  the plans are lazily generated and
'stick' to the tables that are resolved in the search path when the
plan is generated, which is basically the first time you run them in a
session.  so, you could in theory do what you want with a view if it
called functions for all the switchable parts.

merlin

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

Предыдущее
От: "William Leite Araújo"
Дата:
Сообщение: Re: Schema search_path and views
Следующее
От: Florian Weimer
Дата:
Сообщение: Re: DISTINCT is not quite distinct