Received: from websales.com (root@websales.com [192.153.125.97]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA27691 for ; Fri, 24 Sep 1999 11:39:13 -0400 (EDT) (envelope-from cgriffin@websales.com) Received: from [207.67.207.131] (webcc-isdn-131.webcc.net [207.67.207.131]) by websales.com (8.8.8/8.8.5) with ESMTP id IAA06178 for ; Fri, 24 Sep 1999 08:39:13 -0700 Message-Id: <199909241539.IAA06178@websales.com> X-Mailer: Microsoft Outlook Express Macintosh Edition - 4.5 (0410) Date: Fri, 24 Sep 1999 08:39:13 -0700 Subject: Creating rules From: "Chris Griffin" To: pgsql-sql@hub.org Mime-version: 1.0 X-Priority: 3 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit I am trying to create a rule that will set the 'date_created' field of a newly inserted record to 'now'. When I try to write something like the example in the book... create rule example_5 as on insert to EMP where new.salary > 5000 do update newset salary = 5000 as create rule test_rule as on insert to candidate do update newset date_created = current_date; that gives me an error of: ERROR: parser: parse error at or near "date_created" if I change it to this: create rule test_rule as on insert to candidate do update candidate set date_created=current_date; it creates the rule but when I do an insert it looks like it is updating all the records except the one I'm inserting. So what's the best way to do this. I have about 6 tables I would like to do this for. Thanks...