General Trigger Functions

Started by Nonameover 25 years ago2 messagesgeneral
Jump to latest
#1Noname
mjp@ornl.gov

Hi,

Is there a way to write a "generic" trigger function in postgres
that can loop thru a table's cloumns (using TG_RELNAME)
and perform certain activities based on, say, certain column-types?
In other words, is it possible to assign OLD.<column_name>
and NEW.<column_name> to a variable inside triggers?

Thanks,
Morey Parang
ORNL

#2'JanWieck@t-online.de'
JanWieck@t-online.de
In reply to: Noname (#1)
Re: General Trigger Functions

mjp@ornl.gov wrote:

Hi,

Is there a way to write a "generic" trigger function in postgres
that can loop thru a table's cloumns (using TG_RELNAME)
and perform certain activities based on, say, certain column-types?
In other words, is it possible to assign OLD.<column_name>
and NEW.<column_name> to a variable inside triggers?

PL/pgSQL has the pseudo type RECORD. And at least it'd be
possible with PL/Tcl.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #