Re: remove_useless_joins vs. bug #19560 - Mailing list pgsql-hackers

From Richard Guo
Subject Re: remove_useless_joins vs. bug #19560
Date
Msg-id CAMbWs4_CsfOstpFR3yj_3=-YpV-65Fr_Y3DM2+bGR1vW3OMnvA@mail.gmail.com
Whole thread
In response to Re: remove_useless_joins vs. bug #19560  (Richard Guo <guofenglinux@gmail.com>)
Responses Re: remove_useless_joins vs. bug #19560
List pgsql-hackers
On Wed, Sep 16, 2026 at 1:56 PM Richard Guo <guofenglinux@gmail.com> wrote:
> I think we have to insist that the preprocessing happens after join
> alias expansion, which is what my v2 patch in [1] did.  But that patch
> was not complete: as I explained in [2], it doesn't handle copies that
> were pushed into a SubLink's subselect.  I think we can cover those by
> also running the preprocessing in preprocess_expression, right before
> SS_process_sublinks.  That way each upper-level PHV is preprocessed
> exactly once, at the level it belongs to, and always after join alias
> expansion.
>
> Hence, the attached fix.

I've pushed this patch and back-patched it to v16.

- Richard



pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: Regression tests failures due to concurrent grants
Next
From: Nick Ivanov
Date:
Subject: Re: Possible race condition in pg_basebackup