Albert <oo_O2_oo(at)hotmail(dot)com> writes:
> *i get:*
> Syntax error at or near 'WHEN'
> LINE 1: ... check_update AFTER UPDATE ON accounts FOR EACH ROW WHEN
> (OLD.balance IS DISTINCT FROM NEW.balance) ....
Does the BEFORE case work for you either? I'm suspicious that you
are using a PG version that predates WHEN-clause support in triggers.
regards, tom lane