Received: from smtp0.mindspring.com (smtp0.mindspring.com [207.69.200.30]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA33097 for ; Fri, 14 May 1999 13:49:36 -0400 (EDT) (envelope-from postgres@mindspring.com) Received: from dyounger.internal.mindspring.com (bronx-yz.fw.mindspring.net [207.69.192.4]) by smtp0.mindspring.com (8.8.5/8.8.5) with SMTP id NAA18369 for ; Fri, 14 May 1999 13:49:34 -0400 (EDT) Message-Id: <4.1.19990514135041.009646d0@proxy> X-Sender: (Unverified) X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1 Date: Fri, 14 May 1999 13:50:51 -0400 To: pgsql-sql@postgresql.org From: Doug Younger Subject: Create Rule problems Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I'm trying to set up some rules and was following the examples in the Programmer's guide form the docs, and it gives an example similar to this: CREATE RULE log_shoelace AS ON UPDATE TO shoelace_data WHERE NEW.sl_avail != OLD.sl_avail DO INSERT INTO shoelace_log VALUES ( NEW.sl_name, NEW.sl_avail, getpgusername(). 'now'::text ); What I want to do is very similar: CREATE RULE update_login AS ON UPDATE TO user_info WHERE NEW.login != OLD.login DO UPDATE user_dept SET login = NEW.login WHERE login = OLD.login; I get an error: "ERROR: Table old does not exist." What's going on? Also, the docs say you can do multiple actions in a rule... what is the syntax? I tried putting the actions in parens separated by semicolons or commas wit no luck... There wasn't an example in the docs that did more than on action. Thanks, Doug.