Re: Column Specific Update Trigger Routine - Mailing list pgsql-sql

From Tom Lane
Subject Re: Column Specific Update Trigger Routine
Date
Msg-id 24219.1273180420@sss.pgh.pa.us
Whole thread Raw
In response to Re: Column Specific Update Trigger Routine  ("Plugge, Joe R." <JRPlugge@west.com>)
List pgsql-sql
"Plugge, Joe R." <JRPlugge@west.com> writes:
> This is what I have and it seems to work:

>             IF OLD.password != NEW.password

It'd be better to write "IF OLD.password IS DISTINCT FROM NEW.password".
The way with != will not do what you want if one value is null and the
other isn't.  It's possible this doesn't matter in this particular case
(if password can't ever be null in this table), but being careful about
nulls is a good habit to cultivate.
        regards, tom lane


pgsql-sql by date:

Previous
From: "Plugge, Joe R."
Date:
Subject: Re: Column Specific Update Trigger Routine
Next
From: Nicholas I
Date:
Subject: help