I want to create a generic update trigger for all
tables in a DB using plpgsql. I'm thinking that having
one big trigger is more efficient than having a table
fire many triggers for each update.
To do this I need to know if an attribute exists in
the current table. For example, most of my tables
have an updated (datetime) field. I'd like to do
something like:
if (AttributeExists(new.updated))
{ new.updated = 'now'::datetime;}
I'd like to be able to use this trigger on
all tables - even if they don't have an
'updated' attribute.
Is there a way to do this?
-Pat Marchant