Inherits and triggers

From: "Fangbing Wu" <fangbingw(at)gmail(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Inherits and triggers
Date: 2006-03-14 01:25:46
Message-ID: 6619c3340603131725w3a5b72a8y1324f9274ec2ab45@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

Browse pgsql-interfaces by date

  From Date Subject
Next Message Christopher Kings-Lynne 2006-03-14 02:53:19 Re: [PATCHES] Proposed patch for error locations
Previous Message Tom Lane 2006-03-13 21:28:38 Re: [PATCHES] Proposed p.tch for error locations