On Wed, Aug 03, 2005 at 12:52:24PM -0500, Craig Servin wrote: > Is there a way to do: > > NEW IS DISTINCT FROM OLD > > in a trigger? > > This would help me not have to write a specific trigger for each table.
One way would be to write the trigger function in a language other than PL/pgSQL (PL/Tcl, PL/Perl, PL/Python, etc., depending on whether the language in question supports triggers in the version of PostgreSQL you're using). Some languages' trigger functions receive NEW and OLD in variables that can be inspected without knowing the table structure in advance, so you can write generic functions that will work on any table. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match