Tom Lane wrote:
>
> Fernando Nasser <fnasser@cygnus.com> writes:
> > BTW, it seems we have a SQL non-conformance issue here: views that are
> > only projections+selections of a single base table are SQL-updatable.
>
> Indeed. In Postgres terms I think this means that if a CREATE VIEW
> describes a view that meets the spec's constraints to be "updatable",
> we should automatically create a default set of insert/update/delete
> rules for it. This is (or should be) on the TODO list.
>
Agreed.
We should also emit an error if someone tries to update a non-updatable view
(i.e., it is a view and there is no user defined rules for that update operation).
Silently ignoring the update scares me and I bet it is not what the standard
would tell us to do. Any suggestion on how can we do this? I thought of
adding default rules for those cases so they generate the error. But we would
need an error() function or something to invoke from there.
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9