Andreas Heiduk <Andreas(dot)Heiduk(at)web(dot)de> writes:
> If a view which calls a function is LEFT JOINed to a table but not all
> result rows are matched by some criteria, then the function is called
> for each row of the view nevertheless.
> Note that this seems to happen only for left joins, not for a inner join.
I believe that's because the column is required to go to NULL in an
unjoined row. With a non-strict function, evaluating it after the join
could yield wrong answers. Try making the function strict.
regards, tom lane