"Rajshekar" <riyer@kc.rr.com> writes:
> create rule rule_update AS on update to shek_view
> where old.age = 24
> do update shek_tab set age = new.age where old.age = 24 ;
Try
create rule rule_update AS on update to shek_view
where old.age = 24
do update shek_tab set age = new.age where age = old.age;
Your form of the rule reduces to
update shek_tab set age = new.age where true;
which unsurprisingly updates all rows of the table.
I do not exactly see the point of the conditional rule, either.
Why not just
create rule rule_update AS on update to shek_view
do update shek_tab set age = new.age where age = old.age;
The view already restricts visibility of rows, you do not need to
do it twice more in the rules.
regards, tom lane