Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9B607687F79 for ; Tue, 22 Jun 2010 11:55:28 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 55238-06 for ; Tue, 22 Jun 2010 14:55:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 6287F687F74 for ; Tue, 22 Jun 2010 11:55:21 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 22 Jun 2010 09:55:19 -0500 Message-Id: <4C20888402000025000327DB@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 22 Jun 2010 09:55:16 -0500 From: "Kevin Grittner" To: "Lance Campbell" , Subject: Re: on update of table set timestamp References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.311 tagged_above=-10 required=5 tests=BAYES_40=-0.001, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/158 X-Sequence-Number: 34936 "Campbell, Lance" wrote: > I want to add a timestamp column to some of my important table > such that whenever an SQL "update" command is executed on the > table the "updated_timestamp" timestamp column would be set with > "now()". I would write one function which I would bind as a BEFORE UPDATE trigger to all the tables with the updated_timestamp column. You don't need to write a separate function for each table. -Kevin