Consider a Result node's relids in ExplainPreScanNode.
authorRobert Haas <[email protected]>
Mon, 21 Apr 2025 17:35:28 +0000 (13:35 -0400)
committerRobert Haas <[email protected]>
Mon, 19 May 2025 15:02:50 +0000 (11:02 -0400)
commitea5fb810cab564dfef22e6065d05b414185f3cf1
tree3a507b8ca2d989df28dc3fa228e90a601b87f7a4
parent9733f433fe23372b0b7522f384a88825cf59050e
Consider a Result node's relids in ExplainPreScanNode.

Now that a Result node has a relids set, add the relids that it
carries the set accumulated by ExplainPreScanNode so that we
generate unique relation aliases for all of the referenced relations
when it calls select_rtable_names_for_explain. The effect of this
changes is that a few things get schema-qualified in the regression
test outputs that previously were not. In similar cases not involving
a Result node, we were already schema-qualifying, so this appears to
be an improvement.

XXX. I have broken this out as a separate commit for now; however,
it could be merged with the commit to add 'relids' to 'Result'; or
the patch series could even be rejiggered to present this as the
primary benefit of that change, leaving the EXPLAIN changes as a
secondary benefit, instead of the current organization, which does
the reverse.
src/backend/commands/explain.c
src/test/regress/expected/generated_virtual.out
src/test/regress/expected/join.out
src/test/regress/expected/partition_join.out