Re: Update through views? - Mailing list pgsql-general

From Tom Lane
Subject Re: Update through views?
Date
Msg-id 14398.984005356@sss.pgh.pa.us
Whole thread Raw
In response to Re: Update through views?  (dev@archonet.com)
Responses Re: Update through views?  ("Roderick A. Anderson" <raanders@tincan.org>)
List pgsql-general
dev@archonet.com writes:
> Nope - and I'm not sure how Postgres is ever going to figure out how to
> update/insert on a view in the general case. The view might use UNION,
> GROUP BY and CASE and effectively be read-only.

I can guarantee that we won't ever support these things on an arbitrary
view; there'll always be a need for hand-made rules in cases where the
system is too dumb to figure out a plausible rule for updating a view,
but the programmer knows what he wants to have happen.

The SQL spec calls out a set of conditions for a view being "updatable",
which essentially means that the view is simple enough that a DBMS
should be able to derive update rules for it automatically.  At some
point we'll probably try to build machinery to implement automatic rule
creation for those sorts of views.  But it'll always be possible to
write your own rules if you don't like the automatic ones or the view
is too complex for automatic rule creation.

            regards, tom lane

pgsql-general by date:

Previous
From: "Simon Crute"
Date:
Subject: Re: How robust is postgresql ?
Next
From: Flemming Frøkjær
Date:
Subject: Data types?