Re: BUG #18123: The execution plan for the left join is incorrect, returning incorrect rows of data.

Sergei Kornilov <sk@zsrv.org>

From: Sergei Kornilov <sk@zsrv.org>
To: dafoer_x@163.com, pgsql-bugs@lists.postgresql.org
Date: 2023-09-21T11:30:12Z
Lists: pgsql-bugs
Hello
Usual query error, not a bug.

"where a2.a=3" turns left join to inner join because a2.a can not be null here.

This way the conditions contradict each other and it is possible to immediately get an empty set as a result without actually executing the query.

regards, Sergei