From: Oleg Lebedev <olebedev@waterford.org>
To: Postgres SQL Mailing List <pgsql-sql@postgresql.org>
Subject: view rules
Date: Thu, 06 Dec 2001 13:17:44 -0700
Message-ID: <3C0FD268.DFFA9CB8@waterford.org> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: olebedev@waterford.org
Subject: Re: view rules
In-Reply-To: <3C0FD268.DFFA9CB8@waterford.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox