Re: NEW and OLD as ROWS - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: NEW and OLD as ROWS
Date
Msg-id 20050804133823.GA87839@winnie.fuhr.org
Whole thread Raw
In response to NEW and OLD as ROWS  (Craig Servin <cservin@cromagnon.com>)
List pgsql-sql
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/


pgsql-sql by date:

Previous
From: Craig Servin
Date:
Subject: NEW and OLD as ROWS
Next
From: Jeff Boes
Date:
Subject: Re: Breakdown results by month