Re: question on update/delete rules on views - Mailing list pgsql-sql

From Tom Lane
Subject Re: question on update/delete rules on views
Date
Msg-id 18953.958600033@sss.pgh.pa.us
Whole thread Raw
In response to Re: question on update/delete rules on views  (Kyle Bateman <kyle@actarg.com>)
List pgsql-sql
Kyle Bateman <kyle@actarg.com> writes:
> BTW, do you have an equally sensible explanation of how the "where
> condition" that is part of the rule syntax differs from the where
> clause that comes after the "do instead"?

The rule WHERE condition determines *whether* the rule is fired for
update of a given view tuple.  (If it isn't, then that tuple is
processed as if there were no rule.)  Assuming that the rule fires,
a WHERE inside its action will determine which tuples it actually
acts on.

I think there are some examples in the docs of uses of nonempty rule
WHERE conditions.  If not, you could try looking at the rules regression
test for examples ...
        regards, tom lane


pgsql-sql by date:

Previous
From: Brook Milligan
Date:
Subject: Re: question on update/delete rules on views
Next
From: Daniel Mendyke
Date:
Subject: Automatic index numbers