Received: from mail1.waterford.org (mail1.waterford.org [205.124.117.6]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB6Jv1m93777 for ; Thu, 6 Dec 2001 14:57:01 -0500 (EST) (envelope-from olebedev@waterford.org) Received: from waterford.org ([205.124.138.93]) by mail1.waterford.org (Netscape Messaging Server 3.56) with ESMTP id 653 for ; Thu, 6 Dec 2001 12:47:24 -0700 Message-ID: <3C0FD268.DFFA9CB8@waterford.org> Date: Thu, 06 Dec 2001 13:17:44 -0700 From: Oleg Lebedev X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Postgres SQL Mailing List Subject: view rules Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-Archive-Number: 200112/80 X-Sequence-Number: 5903 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