From: | Bernd Helmle <mailings(at)oopsware(dot)de> |
---|---|
To: | Merlin Moncure <mmoncure(at)gmail(dot)com> |
Cc: | vivek(at)staff(dot)ownmail(dot)com, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Dynamic views |
Date: | 2006-11-29 16:35:59 |
Message-ID: | 58a1faaabaaef8e257910b0ffa42b96f@oopsware.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, 29 Nov 2006 18:38:22 +0530, "Merlin Moncure" <mmoncure(at)gmail(dot)com> wrote:
> On 11/29/06, vivek(at)staff(dot)ownmail(dot)com <vivek(at)staff(dot)ownmail(dot)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 and recreate it.
>> Is there a way that i can see the new column without dropping and
> recreating the view ?
>>
No, not easy. Do you have to change your database schema that often?
>> 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.
>
But that requires to adjust all SELECTs which uses this table function, since
SETOF RECORD requires you to specify a column list. Maybe you can build
something like that using a table's implicit type.
Thanks,
Bernd
From | Date | Subject | |
---|---|---|---|
Next Message | John McCawley | 2006-11-29 16:36:25 | Re: Development of cross-platform GUI for Open Source DBs |
Previous Message | Joshua D. Drake | 2006-11-29 16:30:42 | Re: Only MONO/WinForms is a way to go |