view rules - Mailing list pgsql-sql

From Oleg Lebedev
Subject view rules
Date
Msg-id 3C0FD268.DFFA9CB8@waterford.org
Whole thread Raw
Responses Re: view rules
List pgsql-sql
Hi everybody,
I am trying to create an update rule for a view. It's created fine, and
I can find it in pg_rules, but when I try to update the view, I get the
usual error:
ERROR: Cannot update a view without an appropriate rule.

My rule definitions is as follows:
CREATE RULE update_priority AS ON UPDATE TO progress_report
WHERE NEW.priority != OLD.priority
DO INSTEAD UPDATE activity SET priority=NEW.priority
WHERE activity.productcode = OLD.product_code
AND activity.actname=OLD.component;

I am trying to update the view as follows:
update progress_report set priority=2 where product_code='m3' and
component='act';

activity is a table. I can't figure out what's wrong. Please help.
thanks,

Oleg



pgsql-sql by date:

Previous
From: Joachim Trinkwitz
Date:
Subject: type casting bpchar
Next
From: Bruno Wolff III
Date:
Subject: Re: update with RE