Re: NEW and OLD as ROWS

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: NEW and OLD as ROWS
Дата
Msg-id 20050804133823.GA87839@winnie.fuhr.org
обсуждение исходный текст
Ответ на NEW and OLD as ROWS  (Craig Servin <cservin@cromagnon.com>)
Список 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 по дате отправления:

Предыдущее
От: Craig Servin
Дата:
Сообщение: NEW and OLD as ROWS
Следующее
От: Jeff Boes
Дата:
Сообщение: Re: Breakdown results by month