=== Applying patches on top of PostgreSQL commit ID 972c14fb9134fdfd76ea6ebcf98a55a945bbc988 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Wed Apr 15 12:04:31 UTC 2026 On branch cf/5359 nothing to commit, working tree clean === using 'git am' to apply patch ./0001-Add-a-new-option-STATS-to-EXPLAIN-command.patch === Applying: Add a new option STATS to EXPLAIN command Using index info to reconstruct a base tree... M doc/src/sgml/ref/explain.sgml M src/backend/commands/explain.c M src/backend/commands/explain_state.c M src/backend/nodes/makefuncs.c M src/backend/optimizer/plan/createplan.c M src/backend/optimizer/util/relnode.c M src/backend/optimizer/util/restrictinfo.c M src/backend/statistics/extended_stats.c M src/backend/utils/adt/selfuncs.c M src/backend/utils/cache/lsyscache.c M src/include/commands/explain_state.h M src/include/nodes/makefuncs.h M src/include/nodes/parsenodes.h M src/include/nodes/pathnodes.h M src/include/nodes/plannodes.h M src/include/optimizer/restrictinfo.h M src/include/utils/lsyscache.h Falling back to patching base and 3-way merge... Auto-merging src/include/utils/lsyscache.h CONFLICT (content): Merge conflict in src/include/utils/lsyscache.h Auto-merging src/include/optimizer/restrictinfo.h Auto-merging src/include/nodes/plannodes.h CONFLICT (content): Merge conflict in src/include/nodes/plannodes.h Auto-merging src/include/nodes/pathnodes.h CONFLICT (content): Merge conflict in src/include/nodes/pathnodes.h Auto-merging src/include/nodes/parsenodes.h Auto-merging src/include/nodes/makefuncs.h Auto-merging src/include/commands/explain_state.h Auto-merging src/backend/utils/cache/lsyscache.c CONFLICT (content): Merge conflict in src/backend/utils/cache/lsyscache.c Auto-merging src/backend/utils/adt/selfuncs.c Auto-merging src/backend/statistics/extended_stats.c Auto-merging src/backend/optimizer/util/restrictinfo.c Auto-merging src/backend/optimizer/util/relnode.c Auto-merging src/backend/optimizer/plan/createplan.c Auto-merging src/backend/nodes/makefuncs.c Auto-merging src/backend/commands/explain_state.c Auto-merging src/backend/commands/explain.c CONFLICT (content): Merge conflict in src/backend/commands/explain.c Auto-merging doc/src/sgml/ref/explain.sgml error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Add a new option STATS to EXPLAIN command When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". === using patch(1) to apply patch ./0001-Add-a-new-option-STATS-to-EXPLAIN-command.patch === patching file doc/src/sgml/ref/explain.sgml Hunk #2 succeeded at 255 (offset 5 lines). patching file src/backend/commands/explain.c Hunk #1 succeeded at 89 (offset 2 lines). Hunk #2 succeeded at 362 (offset 6 lines). Hunk #3 succeeded at 1993 (offset 13 lines). Hunk #4 succeeded at 2015 (offset 13 lines). Hunk #5 FAILED at 2047. Hunk #6 succeeded at 2129 (offset 15 lines). Hunk #7 succeeded at 2249 (offset 16 lines). Hunk #8 succeeded at 2271 (offset 16 lines). Hunk #9 succeeded at 2608 (offset 17 lines). 1 out of 9 hunks FAILED -- saving rejects to file src/backend/commands/explain.c.rej patching file src/backend/commands/explain_state.c Hunk #1 succeeded at 106 (offset 3 lines). patching file src/backend/nodes/makefuncs.c patching file src/backend/optimizer/plan/createplan.c Hunk #1 succeeded at 5359 (offset -202 lines). Hunk #2 succeeded at 5368 (offset -202 lines). patching file src/backend/optimizer/util/relnode.c Hunk #1 succeeded at 312 (offset 25 lines). Hunk #2 succeeded at 908 (offset 135 lines). Hunk #3 succeeded at 1110 (offset 149 lines). patching file src/backend/optimizer/util/restrictinfo.c patching file src/backend/statistics/extended_stats.c Hunk #1 succeeded at 1883 (offset 29 lines). patching file src/backend/utils/adt/selfuncs.c Hunk #1 succeeded at 4689 (offset 343 lines). Hunk #2 succeeded at 4737 (offset 343 lines). Hunk #3 succeeded at 4768 (offset 343 lines). Hunk #4 succeeded at 4779 (offset 343 lines). patching file src/backend/utils/cache/lsyscache.c Hunk #1 succeeded at 39 (offset 3 lines). Hunk #2 succeeded at 3971 with fuzz 2 (offset 116 lines). patching file src/include/commands/explain_state.h Hunk #1 succeeded at 57 with fuzz 2 (offset 2 lines). patching file src/include/nodes/makefuncs.h patching file src/include/nodes/parsenodes.h Hunk #1 succeeded at 258 (offset 4 lines). patching file src/include/nodes/pathnodes.h Hunk #1 FAILED at 1075. 1 out of 1 hunk FAILED -- saving rejects to file src/include/nodes/pathnodes.h.rej patching file src/include/nodes/plannodes.h Hunk #1 succeeded at 254 (offset 15 lines). Hunk #2 succeeded at 1876 with fuzz 2 (offset 81 lines). patching file src/include/optimizer/restrictinfo.h patching file src/include/utils/lsyscache.h Hunk #1 succeeded at 216 with fuzz 2 (offset 5 lines). Unstaged changes after reset: M doc/src/sgml/ref/explain.sgml M src/backend/commands/explain.c M src/backend/commands/explain_state.c M src/backend/nodes/makefuncs.c M src/backend/optimizer/plan/createplan.c M src/backend/optimizer/util/relnode.c M src/backend/optimizer/util/restrictinfo.c M src/backend/statistics/extended_stats.c M src/backend/utils/adt/selfuncs.c M src/backend/utils/cache/lsyscache.c M src/include/commands/explain_state.h M src/include/nodes/makefuncs.h M src/include/nodes/parsenodes.h M src/include/nodes/plannodes.h M src/include/optimizer/restrictinfo.h M src/include/utils/lsyscache.h Removing src/backend/commands/explain.c.rej Removing src/include/nodes/pathnodes.h.rej === using 'git apply' to apply patch ./0001-Add-a-new-option-STATS-to-EXPLAIN-command.patch === Applied patch to 'doc/src/sgml/ref/explain.sgml' cleanly. Applied patch to 'src/backend/commands/explain.c' with conflicts. Applied patch to 'src/backend/commands/explain_state.c' cleanly. Applied patch to 'src/backend/nodes/makefuncs.c' cleanly. Applied patch to 'src/backend/optimizer/plan/createplan.c' cleanly. Applied patch to 'src/backend/optimizer/util/relnode.c' cleanly. Applied patch to 'src/backend/optimizer/util/restrictinfo.c' cleanly. Applied patch to 'src/backend/statistics/extended_stats.c' cleanly. Applied patch to 'src/backend/utils/adt/selfuncs.c' cleanly. Applied patch to 'src/backend/utils/cache/lsyscache.c' with conflicts. Applied patch to 'src/include/commands/explain_state.h' cleanly. Applied patch to 'src/include/nodes/makefuncs.h' cleanly. Applied patch to 'src/include/nodes/parsenodes.h' cleanly. Applied patch to 'src/include/nodes/pathnodes.h' with conflicts. Applied patch to 'src/include/nodes/plannodes.h' with conflicts. Applied patch to 'src/include/optimizer/restrictinfo.h' cleanly. Applied patch to 'src/include/utils/lsyscache.h' with conflicts. U src/backend/commands/explain.c U src/backend/utils/cache/lsyscache.c U src/include/nodes/pathnodes.h U src/include/nodes/plannodes.h U src/include/utils/lsyscache.h diff --cc src/backend/commands/explain.c index 112c17b0d64,53593775939..00000000000 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@@ -2032,7 -2047,12 +2061,16 @@@ ExplainNode(PlanState *planstate, List planstate, es); if (IsA(plan, CteScan)) show_ctescan_info(castNode(CteScanState, planstate), es); ++<<<<<<< ours + show_scan_io_usage((ScanState *) planstate, es); ++======= + + if (es->stats) + show_scan_stats(plan->app_extstats->applied_stats, + plan->app_extstats->applied_clauses, + plan->app_extstats->applied_clauses_or, + planstate, ancestors, es); ++>>>>>>> theirs break; case T_Gather: { diff --cc src/backend/utils/cache/lsyscache.c index fa9fe9ffa26,562ee4a8f9c..00000000000 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@@ -3935,38 -3856,50 +3936,87 @@@ get_subscription_name(Oid subid, bool m return subname; } ++<<<<<<< ours +char * +get_propgraph_label_name(Oid labeloid) +{ + HeapTuple tuple; + char *labelname; + + tuple = SearchSysCache1(PROPGRAPHLABELOID, labeloid); + if (!tuple) + { + elog(ERROR, "cache lookup failed for label %u", labeloid); + return NULL; + } + labelname = pstrdup(NameStr(((Form_pg_propgraph_label) GETSTRUCT(tuple))->pgllabel)); + ReleaseSysCache(tuple); + + return labelname; +} + +char * +get_propgraph_property_name(Oid propoid) +{ + HeapTuple tuple; + char *propname; + + tuple = SearchSysCache1(PROPGRAPHPROPOID, propoid); + if (!tuple) + { + elog(ERROR, "cache lookup failed for property %u", propoid); + return NULL; + } + propname = pstrdup(NameStr(((Form_pg_propgraph_property) GETSTRUCT(tuple))->pgpname)); + ReleaseSysCache(tuple); + + return propname; ++======= + /* + * get_statistics_name + * Returns the name of a given extended statistics + * + * Returns a palloc'd copy of the string, or NULL if no such name. + */ + char * + get_statistics_name(Oid stxid) + { + HeapTuple tp; + + tp = SearchSysCache1(STATEXTOID, ObjectIdGetDatum(stxid)); + if (HeapTupleIsValid(tp)) + { + Form_pg_statistic_ext stxtup = (Form_pg_statistic_ext) GETSTRUCT(tp); + char *result; + + result = pstrdup(NameStr(stxtup->stxname)); + ReleaseSysCache(tp); + return result; + } + else + return NULL; + } + + /* + * get_statistics_namespace + * Returns the namespace OID of a given extended statistics + */ + Oid + get_statistics_namespace(Oid stxid) + { + HeapTuple tp; + + tp = SearchSysCache1(STATEXTOID, ObjectIdGetDatum(stxid)); + if (HeapTupleIsValid(tp)) + { + Form_pg_statistic_ext stxtup = (Form_pg_statistic_ext) GETSTRUCT(tp); + Oid result; + + result = stxtup->stxnamespace; + ReleaseSysCache(tp); + return result; + } + else + return InvalidOid; ++>>>>>>> theirs } diff --cc src/include/nodes/pathnodes.h index 693b879f76d,081546cc771..00000000000 --- a/src/include/nodes/pathnodes.h +++ b/src/include/nodes/pathnodes.h @@@ -1215,9 -1076,10 +1215,16 @@@ typedef struct RelOptInf /* Nullable partition key expressions */ List **nullable_partexprs pg_node_attr(read_write_ignore); ++<<<<<<< ours + /* extension state */ + void **extension_state pg_node_attr(read_write_ignore); + int extension_state_allocated; ++======= + /* info about applied extended statistics */ + List *applied_stats; /* list of StatisticExtInfo */ + List *applied_clauses; /* list of lists of clauses */ + List *applied_clauses_or; /* are the clauses AND, OR, or Comma */ ++>>>>>>> theirs } RelOptInfo; /* diff --cc src/include/nodes/plannodes.h index 14a1dfed2b9,aba7b29eb21..00000000000 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@@ -1843,34 -1796,15 +1846,47 @@@ typedef enum MonotonicFunctio } MonotonicFunction; /* ++<<<<<<< ours + * SubPlanRTInfo + * + * Information about which range table entries came from which subquery + * planning cycles. + */ +typedef struct SubPlanRTInfo +{ + NodeTag type; + char *plan_name; + Index rtoffset; + bool dummy; +} SubPlanRTInfo; + +/* + * ElidedNode + * + * Information about nodes elided from the final plan tree: trivial subquery + * scans, and single-child Append and MergeAppend nodes. + * + * plan_node_id is that of the surviving plan node, the sole child of the + * one which was elided. + */ +typedef struct ElidedNode +{ + NodeTag type; + int plan_node_id; + NodeTag elided_type; + Bitmapset *relids; +} ElidedNode; ++======= + * Applied_ExtStats - Information to show applied Extend Statistics + * + */ + typedef struct Applied_ExtStats + { + NodeTag type; + List *applied_stats; + List *applied_clauses; + List *applied_clauses_or; + } Applied_ExtStats; ++>>>>>>> theirs #endif /* PLANNODES_H */ diff --cc src/include/utils/lsyscache.h index 2e0258d877e,88b8f9c1bd6..00000000000 --- a/src/include/utils/lsyscache.h +++ b/src/include/utils/lsyscache.h @@@ -213,8 -211,8 +213,13 @@@ extern char *get_publication_name(Oid p extern Oid get_subscription_oid(const char *subname, bool missing_ok); extern char *get_subscription_name(Oid subid, bool missing_ok); ++<<<<<<< ours +extern char *get_propgraph_label_name(Oid labeloid); +extern char *get_propgraph_property_name(Oid propoid); ++======= + extern char *get_statistics_name(Oid stxid); + extern Oid get_statistics_namespace(Oid stxid); ++>>>>>>> theirs #define type_is_array(typid) (get_element_type(typid) != InvalidOid) /* type_is_array_domain accepts both plain arrays and domains over arrays */