Richard Guo <[email protected]> writes:
> I looked into it. What happens here is that outer-join identity 3
> permits the join to t3 to commute with the a/b left join, so we
> generate multiple clones of "b.q1 = t3.cnt", differing in the
> nullingrels of b.q1. Only one of them should be applied in any given
> plan. However, when movable join clauses are pushed down into a
> parameterized path, we fail to choose among the clones.
Yup, clearly an oversight. Your fix LGTM. I'm not sure that we
should push it into stable branches: it might destabilize queries that
people are happy with, and we don't have field complaints about it.
But v19 should still be fair game at this point.
regards, tom lane