Re: BUG #18429: Inconsistent results on similar queries with join lateral

Richard Guo <guofenglinux@gmail.com>

From: Richard Guo <guofenglinux@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>, "b.ryder@ateme.com" <b.ryder@ateme.com>, "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2024-04-14T09:15:24Z
Lists: pgsql-bugs
On Fri, Apr 12, 2024 at 10:50 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> "git bisect" fingers this commit as the first one producing correct
> answers:
>
> commit 2489d76c4906f4461a364ca8ad7e0751ead8aa0d
> Author: Tom Lane <tgl@sss.pgh.pa.us>
> Date:   Mon Jan 30 13:16:20 2023 -0500
>
>     Make Vars be outer-join-aware.
>
> This is kind of exciting for me, as IIRC it's the first field-detected
> bug that that work fixes.


+1.  As a big fan of the outer-join-aware-Var work, I'm so excited to
see field-detected bugs it fixes.

Thanks
Richard

Commits

  1. Ensure generated join clauses for child rels have correct relids.

  2. Fix generation of EC join conditions at the wrong plan level.

  3. Make Vars be outer-join-aware.