From: Fangbing Wu <fangbingw@gmail.com>
To: pgsql-interfaces@postgresql.org
Subject: Inherits and triggers
Date: Mon, 13 Mar 2006 20:25:46 -0500
Message-ID: <6619c3340603131725w3a5b72a8y1324f9274ec2ab45@mail.gmail.com> (raw)
I have a situation where I want all of my tables to have a timestamp field
that is updated to the
current_timestamp whenever a column in a row is updated. For a single table,
I could do this
with a trigger. So I thought of using table inheritance and created the
trigger on the base
table. But then, the trigger is not fired when updating rows in children
tables.
Does anyone knows of a better way to achieve this without having to create
the trigger
for every table? I'm writing a library and the tables are not known at the
time of writing
the library.
Any suggestions are appreciated!
Fangbing Wu
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-interfaces@postgresql.org
Cc: fangbingw@gmail.com
Subject: Re: Inherits and triggers
In-Reply-To: <6619c3340603131725w3a5b72a8y1324f9274ec2ab45@mail.gmail.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