Janne Annala <janne(dot)annala(at)forenom(dot)com> writes:
> Here's the minimum case to reproduce the issue:
> CREATE FUNCTION x()
> RETURNS trigger
> LANGUAGE plpgsql
> AS $function$
> BEGIN
> IF ROW(NEW.*) IS DISTINCT FROM ROW(OLD.*) THEN
Try dropping the ROW() bit, that is just
IF NEW.* IS DISTINCT FROM OLD.* THEN
or even
IF NEW IS DISTINCT FROM OLD THEN
I think what is happening is that the ROW() notation is getting
expanded at parse time to
ROW(NEW.id, NEW.old_column, NEW.updated)
and then there's no dependency on the original rowtype that would
lead to that expansion getting reconsidered. Arguably that's a
bug, but it's not clear to me what the consequences of changing
that behavior would be.
regards, tom lane