Robert Haas <robertmh...@gmail.com> wrote:

> Wow, so I wouldn't have to do this any more?
> 
> IF (TG_OP = 'UPDATE') THEN
>     IF (OLD.foo IS NOT DISTINCT FROM NEW.foo AND OLD.bar IS NOT
> DISTINCT FROM NEW.bar
>          AND OLD.baz IS NOT DISTINCT FROM NEW.baz) THEN
>         RETURN NULL;
>     END IF;
> END IF;

Sure, and I found there might be difference between "UPDATE" and
"UPDATE OF {all-columns}" triggers. UPDATE trigger is always fired
when a row is updated even if none of the columns are actually
modified, but UPDATE OF {all-columns} trigger is fired only when
at least one of the columns is modified.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to