From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Lance Campbell <lance@illinois.edu>
To: pgsql-admin@postgresql.org
Subject: Re: on update of table set timestamp
Date: Tue, 22 Jun 2010 09:55:16 -0500
Message-ID: <4C20888402000025000327DB@gw.wicourts.gov> (raw)
In-Reply-To: <B10E6810AC2A2F4EA7550D072CDE876004B2E5C0@SAB-FENWICK.sab.uiuc.edu>
References: <B10E6810AC2A2F4EA7550D072CDE876004B2E5C0@SAB-FENWICK.sab.uiuc.edu>
"Campbell, Lance" <lance@illinois.edu> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, lance@illinois.edu
Subject: Re: on update of table set timestamp
In-Reply-To: <4C20888402000025000327DB@gw.wicourts.gov>
References: <B10E6810AC2A2F4EA7550D072CDE876004B2E5C0@SAB-FENWICK.sab.uiuc.edu> <4C20888402000025000327DB@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox