Re: Dynamic views

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Dynamic views
Дата
Msg-id b42b73150611290508h2e7ef0b4n37d1ca3feee19244@mail.gmail.com
обсуждение исходный текст
Ответ на Dynamic views  (<vivek@staff.ownmail.com>)
Ответы Re: Dynamic views
Список pgsql-general
On 11/29/06, vivek@staff.ownmail.com <vivek@staff.ownmail.com> wrote:
> Hello friends,
> I have a view defined as:-
>
> CREATE VIEW vivek_testview AS SELECT vivek_test.* , users.username AS name from users, vivek_test where
vivek_test.username=users.username;
>
> Now, when I add a new column in vivek_test, I cant see the new column in the view. Currently we have to drop the view
andrecreate it. 
> Is there a way that i can see the new column without dropping and recreating the view ?
>
> Thanks for reading this. Thanks for your replies in advance.

no, queries using * are expanded when the plan is created.  for views,
the plan is created when you create the view (also the original query
string to create the view is not stored).  however, you could however
create a function that returns setof record, because plans for
functions are created when they are first run in a session.  this
isn't a perfect solution, but it might work for you.

merlin

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

Предыдущее
От: Marc Evans
Дата:
Сообщение: Looking for pgsql sysadmin
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Looking for pgsql sysadmin