Received: from mail.netizen.co.za (situs.netizen.co.za [216.156.254.66]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA42634 for ; Fri, 22 Oct 1999 12:11:01 -0400 (EDT) (envelope-from grant@situs.netizen.co.za) Received: from grant by mail.netizen.co.za with local (Exim 3.03 #2) id 11ehGM-0001Mi-00 for pgsql-sql@postgreSQL.org; Fri, 22 Oct 1999 12:09:54 -0400 Date: Fri, 22 Oct 1999 12:09:54 -0400 From: Grant Kaufmann To: pgsql-sql@postgresql.org Subject: Re: [SQL] Adding a rule to update a last_changed field Message-ID: <19991022120954.B5228@intekom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i Sender: Grant > > I'm trying to use a rule to maintain a last_changed field. > > Use a trigger, not a rule. You can adjust the last_changed > field before the tuple is stored that way. There's an example > in the manual's discussion of triggers. My original choice was to use a trigger, but I don't want to introduce C code when I don't have to. I don't believe that making external calls should be necessary for a query that can be so simply expressed in SQL. And from the manual: "The procedure name is the C function called" If triggers can use SQL, I'd be happy to use them, but I can't find a single example or description on how to do this.