Re: Remove no-op PlaceHolderVars - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Remove no-op PlaceHolderVars
Date
Msg-id CAMbWs4-qJGVHLonakB+5C_DvhA0i7Wua4StzG4n0F42i+dB+oA@mail.gmail.com
Whole thread Raw
In response to Re: Remove no-op PlaceHolderVars  (Richard Guo <guofenglinux@gmail.com>)
List pgsql-hackers
On Fri, Jan 16, 2026 at 11:49 AM Richard Guo <guofenglinux@gmail.com> wrote:
> Attached is a draft patch for the code changes.  It currently causes
> plan changes in 28 regression test queries, which is a surprisingly
> high number.  We'll have to go through these tests one by one, but
> before doing that, I would like to hear others' thoughts on this
> patch.

I went through those tests one by one, and AFAICS the plan changes are
all positive.

However, these plan changes resulted in a loss of coverage in tests
specifically designed to verify the planner's handling of PHVs.  So
I've modified the affected queries to force the preservation of PHVs
by changing the target expressions into forms that the new logic
considers "unsafe to strip".  Please see attached.

- Richard

Attachment

pgsql-hackers by date:

Previous
From: "zengman"
Date:
Subject: Re: tuple radix sort
Next
From: Steven Niu
Date:
Subject: Re: file_fdw: Support multi-line HEADER option.