From f2bae51dfd5b2edc460c86071c577a45a1acbfd7 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 23 Sep 2025 09:07:55 -0400 Subject: Keep track of what RTIs a Result node is scanning. Result nodes now include an RTI set, which is only non-NULL when they have no subplan, and is taken from the relid set of the RelOptInfo that the Result is generating. ExplainPreScanNode now takes notice of these RTIs, which means that a few things get schema-qualified in the regression tests that previously did not. This makes the output more consistent between cases where some part of the plan tree is replaced by a Result node and those where this does not happen. Likewise, pg_overexplain's EXPLAIN (RANGE_TABLE) now displays the RTIs stored in a Result node just as it already does for other RTI-bearing node types. Result nodes also now include a result_reason, which tells us something about why the Result node was inserted. Using that information, EXPLAIN now emits, where relevant, a "Replaces" line describing the origin of a Result node. The purpose of these changes is to allow code that inspects a Plan tree to understand the origin of Result nodes that appear therein. Discussion: http://postgr.es/m/CA+TgmoYeUZePZWLsSO+1FAN7UPePT_RMEZBKkqYBJVCF1s60=w@mail.gmail.com Reviewed-by: Alexandra Wang Reviewed-by: Richard Guo Reviewed-by: Tom Lane Reviewed-by: Junwang Zhao --- src/tools/pgindent/typedefs.list | 1 + 1 file changed, 1 insertion(+) (limited to 'src/tools') diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index e90af5b2ad3..3c80d49b67e 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -2568,6 +2568,7 @@ RestrictInfo Result ResultRelInfo ResultState +ResultType RetainDeadTuplesData RetainDeadTuplesPhase ReturnSetInfo -- cgit v1.2.3