Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque
Date
Msg-id 824291.1732937102@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque  (Richard Guo <guofenglinux@gmail.com>)
List pgsql-committers
Richard Guo <guofenglinux@gmail.com> writes:
> This patch can also simplify my other patch, which is to avoid
> unnecessary wrapping for plain Vars/PHVs.  We can check the new
> nullingrel_info to see if the nullingrels of the subquery RTE are a
> subset of the nullingrels of the lateral referenced rel, to determine
> if the referenced rel is under the same lowest nulling outer join.
> And this eliminates the need to introduce lowest_nullable_side.

Right, because that's more or less the same problem.  Or indeed
it's exactly the same problem, we're just making fast paths for
the easiest cases.

Another thought: the reason I made get_nullingrels return a new
struct rather than tying it directly to filling some fields in
pullup_replace_vars_context was that I think we might want to
reconsider where to call it from.  Perhaps it'd be useful to
have the info during is_simple_subquery, for example.

            regards, tom lane



pgsql-committers by date:

Previous
From: Richard Guo
Date:
Subject: Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque
Next
From: Peter Eisentraut
Date:
Subject: pgsql: doc: Fix typo