Re: How to specify that a trigger should fire when column is NOT in SET-clause?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to specify that a trigger should fire when column is NOT in SET-clause?
Дата
Msg-id 1160652.1608915441@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How to specify that a trigger should fire when column is NOT in SET-clause?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 12/25/20 5:52 AM, Andreas Joseph Krogh wrote:
>> Or - is it possible to check for this in the trigger-function?

> As David Johnson mentioned you can check whether the value for the 
> column is changed:

> NEW.animal <> OLD.animal

Better to use IS DISTINCT FROM, to get sane behavior when one or
the other value is NULL.

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: How to specify that a trigger should fire when column is NOT in SET-clause?
Следующее
От: Andreas Joseph Krogh
Дата:
Сообщение: Re: How to specify that a trigger should fire when column is NOT in SET-clause?