Received: from mail.mailstart.com (ns1.mailstart.com [207.231.76.65]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA27983 for ; Fri, 22 Oct 1999 11:03:03 -0400 (EDT) (envelope-from grant@intekom.com) From: grant@intekom.com Received: from yellow [207.231.76.48] by mail.mailstart.com (SMTPD32-5.05) id ACA624FD01F8; Fri, 22 Oct 1999 08:03:02 -0700 To: pgsql-sql@postgresql.org CC: Subject: Adding a rule to update a last_changed field Message-Id: <221099295.28982@212.53.64.128> Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Fri, 22 Oct 1999 08:03:05 -0700 I'm trying to use a rule to maintain a last_changed field. Using something like: CREATE RULE rule1 AS ON UPDATE TO thetable DO UPDATE thetable SET last_changed = now() WHERE id = new.id; This obviously doesn't work as the DO UPDATE triggers the rule again, thus looping meaninglessly. Is there a neat way to work around this? I'd like to just assign now() to the last_changed field before the actual SQL update code is run. Thanks ----- Sent using MailStart.com ( http://MailStart.Com/welcome.html ) The FREE way to access your mailbox via any web browser, anywhere!