Richard Guo <guofenglinux@gmail.com> writes:
> I haven't got too much time looking into it. But the comment near the
> assertion failure that says
> * Unlike the LEFT/RIGHT cases, we just Assert that there are
> * no PHVs that need to be evaluated at the semijoin's RHS,
> * since the rest of the query couldn't reference any outputs
> * of the semijoin's RHS.
> I doubt this is true as a semijoin's qual can actually reference its
> RHS. In this case the assertion failure happens because there is PHV in
> the join's qual.
Yeah, the possibility of a PHV in the qual refutes that argument.
So we need to make the test honestly, as in the other arms of that
switch. Will fix.
regards, tom lane