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

From Tom Lane
Subject Re: How to specify that a trigger should fire when column is NOT in SET-clause?
Date
Msg-id 1160652.1608915441@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to specify that a trigger should fire when column is NOT in SET-clause?  (Adrian Klaver <adrian.klaver@aklaver.com>)
List 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 by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: How to specify that a trigger should fire when column is NOT in SET-clause?
Next
From: Andreas Joseph Krogh
Date:
Subject: Re: How to specify that a trigger should fire when column is NOT in SET-clause?