On Thu, Sep 16, 2010 at 10:00 PM, Mladen Gogala
> I always wandered why would anybody want to update a view? View is, by
> definition, a stored query which is executed frequently enough to be given
> its own first name, middle name and a family name. If the view is being
> updated, the middle name is F, just as in the case of Bucky Dent. I don't
> see any database design pattern which would necessitate updating a view.
> That is a perversion, not unlike putting ketchup on a hot dog.
See C.J. Date's "SQL and Relational Theory", a good read. Page 195,
"SQL and Views: Update Operations" talks about this. Quote:
>> The Principle of Interchangeability implies that views must be
>> updatable (i.e., assignable to) ... [snip] ... updates on base relvars can
>> always fail on integrity constraint violations—and the same is true
>> for updates on views. In other words, it isn’t that some views are
>> inherently nonupdatable, but rather that some updates on some
>> views will fail on integrity constraint violations (i.e., violations of
>> The Golden Rule).
On page 197 Date gives an excerpt from SQL99 that defines when a view
is updatable, see page 269 of SQL99 here:
In response to
pgsql-novice by date
|Next:||From: Mladen Gogala||Date: 2010-09-17 15:19:22|
|Subject: Re: Unable to use VIEWS (Ok button remains shaded)|
|Previous:||From: Tom Lane||Date: 2010-09-17 13:57:06|
|Subject: Re: List of User Defined Types? |