From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Stuart <sfbarbee@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Auto-update a field when record is changed
Date: Fri, 22 Aug 2003 21:53:48 -0700 (PDT)
Message-ID: <20030822215217.L6822-100000@megazone.bigpanda.com> (raw)
In-Reply-To: <200308222332.47526.sfbarbee@yahoo.com>
On Fri, 22 Aug 2003, Stuart wrote:
> Folks,
>
> I was wandering if there was a feasible way to automatically update a field
> in a table, say 'revision_date' in a record whenever any other field in the
> record is changed. My attempts to use a trigger caused repeating loops and
> bombed with error. I would like to be able to update such a field
> automatically anytime a record was updated. Any help would be appreciated.
That seems like a job for a before trigger and changing the to be
update/inerted record before the action occurs in general. Don't
use an update statement but change the record variables given as the NEW
row.
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sszabo@megazone.bigpanda.com, sfbarbee@yahoo.com
Subject: Re: Auto-update a field when record is changed
In-Reply-To: <20030822215217.L6822-100000@megazone.bigpanda.com>
* 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