Mike Rylander <mrylander(at)gmail(dot)com> writes:
> IIRC, the reason for this is that the entire IF test is passed to the
> SQL engine as a SELECT statement after replacing the TG_* identifiers
> with their respective values.
> In this case, since OLD.name does not exist during INSERT it cannot be
> replaced. Perhaps someone else can shed a little more light on this.
Nope, that's about all there is to say about it ...
regards, tom lane