public inbox for [email protected]  
help / color / mirror / Atom feed
From: Richard Guo <[email protected]>
To: Tom Lane <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: Remove no-op PlaceHolderVars
Date: Fri, 16 Jan 2026 15:21:06 +0900
Message-ID: <CAMbWs49B8KrvYvRQfhkFvBb_rRyBHv61S29sYO7W+gP3Cve3eQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAMbWs48biJp-vof82PNP_LzzFkURh0W+RKt4phoML-MyYavgdg@mail.gmail.com>
	<[email protected]>
	<CAMbWs48vC37+j0V1SnHGRTP55AAaFyAYEbYGzh7UBKoWfh=E0w@mail.gmail.com>
	<CAMbWs4-_fDPOiYJWj330pJS++kKbTw_EfO5-pC8nPKHUAScMWw@mail.gmail.com>
	<[email protected]>

On Fri, Jan 16, 2026 at 12:37 PM Tom Lane <[email protected]> wrote:
> My immediate reaction is "how sure are you that they're no-ops"?
> I recall that there are places where we intentionally insert PHVs
> to preserve the separate identity of the contained expression
> (so that, for example, it can be matched to a subquery output
> later).

The new phpreserved flag is used for that purpose, as explained in the
commit message and the code comments.

> Do we generate a PHV at all in that case?  Seems like we could
> deal with that by adding to the Var's varnullingrels instead of
> making a wrapper node.

The Var can be a reference to something outside the subquery being
pulled up.  If it is a reference to the non-nullable side, we'll have
to wrap it in a PHV to ensure that it is forced to null when the outer
join should do so.

- Richard






view thread (3+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Remove no-op PlaceHolderVars
  In-Reply-To: <CAMbWs49B8KrvYvRQfhkFvBb_rRyBHv61S29sYO7W+gP3Cve3eQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox