From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com> |
Cc: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, iharding(at)destinydata(dot)com, CSN <cool_screen_name90001(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: POSS. FEATURE REQ: "Dynamic" Views |
Date: | 2005-08-27 14:48:32 |
Message-ID: | 1285.1125154112@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
"Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
>> How is this different from materialized views, which is already on the
>> TODO list?
> The idea behind the DYNAMIC VIEW is that if you made a DDL change in the
> table it could be reflected in the view. So for example, if you defined
> a view as SELECT * FROM table; and then added a field to the table that
> field would also show up in the view.
But why exactly is this a good idea? It seems like an absolutely
horrible idea to me. It is oft-repeated advice that you don't use
"SELECT *" ever in production programming, because your applications
will break as soon as any columns are added (or removed, even if they
don't make any use of those columns). The proposed dynamic view
facility would move that instability of results right into the views.
What's more, I cannot see any benefit to be gained over just issuing
the expanded query directly. You couldn't layer a normal view over
a dynamic view (not having any idea what columns it'll return), nor
even a prepared statement, because those things nail down specific
result columns too. So it's just an awkwardly expressed form of
query macro that can only be used in interactively-issued commands.
I think the burden of proof is on the proponents of this idea to show
that it's sensible, and it doesn't deserve to be in TODO just because
one or two people think it'd be nice.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tang Tim Hei | 2005-08-27 15:00:07 | A strange problem |
Previous Message | Bruce Momjian | 2005-08-27 14:31:35 | Re: Postgresql Function Cookbook/General howto |