@@ -89,7 +89,7 @@ typedef enum UpperRelationKind
8989 * planned.
9090 *
9191 * Not all fields are printed. (In some cases, there is no print support for
92- * the field type.)
92+ * the field type; in others, doing so would lead to infinite recursion .)
9393 *----------
9494 */
9595typedef struct PlannerGlobal
@@ -177,7 +177,8 @@ typedef struct PlannerGlobal
177177 * either here or in that header, whichever is read first.
178178 *
179179 * Not all fields are printed. (In some cases, there is no print support for
180- * the field type.)
180+ * the field type; in others, doing so would lead to infinite recursion or
181+ * bloat dump output more than seems useful.)
181182 *----------
182183 */
183184#ifndef HAVE_PLANNERINFO_TYPEDEF
@@ -220,22 +221,24 @@ struct PlannerInfo
220221 * does not correspond to a base relation, such as a join RTE or an
221222 * unreferenced view RTE; or if the RelOptInfo hasn't been made yet.
222223 */
223- struct RelOptInfo * * simple_rel_array pg_node_attr (read_write_ignore );
224+ struct RelOptInfo * * simple_rel_array pg_node_attr (array_size ( simple_rel_array_size ) );
224225 /* allocated size of array */
225- int simple_rel_array_size pg_node_attr ( read_write_ignore ) ;
226+ int simple_rel_array_size ;
226227
227228 /*
228229 * simple_rte_array is the same length as simple_rel_array and holds
229230 * pointers to the associated rangetable entries. Using this is a shade
230- * faster than using rt_fetch(), mostly due to fewer indirections.
231+ * faster than using rt_fetch(), mostly due to fewer indirections. (Not
232+ * printed because it'd be redundant with parse->rtable.)
231233 */
232234 RangeTblEntry * * simple_rte_array pg_node_attr (read_write_ignore );
233235
234236 /*
235237 * append_rel_array is the same length as the above arrays, and holds
236238 * pointers to the corresponding AppendRelInfo entry indexed by
237239 * child_relid, or NULL if the rel is not an appendrel child. The array
238- * itself is not allocated if append_rel_list is empty.
240+ * itself is not allocated if append_rel_list is empty. (Not printed
241+ * because it'd be redundant with append_rel_list.)
239242 */
240243 struct AppendRelInfo * * append_rel_array pg_node_attr (read_write_ignore );
241244
@@ -273,6 +276,9 @@ struct PlannerInfo
273276 * join_cur_level is the current level. New join-relation RelOptInfos are
274277 * automatically added to the join_rel_level[join_cur_level] list.
275278 * join_rel_level is NULL if not in use.
279+ *
280+ * Note: we've already printed all baserel and joinrel RelOptInfos above,
281+ * so we don't dump join_rel_level or other lists of RelOptInfos.
276282 */
277283 /* lists of join-relation RelOptInfos */
278284 List * * join_rel_level pg_node_attr (read_write_ignore );
@@ -403,8 +409,8 @@ struct PlannerInfo
403409 /*
404410 * Fields filled during create_plan() for use in setrefs.c
405411 */
406- /* for GroupingFunc fixup */
407- AttrNumber * grouping_map pg_node_attr (array_size ( update_colnos ), read_write_ignore );
412+ /* for GroupingFunc fixup (can't print: array length not known here) */
413+ AttrNumber * grouping_map pg_node_attr (read_write_ignore );
408414 /* List of MinMaxAggInfos */
409415 List * minmax_aggs ;
410416
@@ -458,7 +464,7 @@ struct PlannerInfo
458464 /* PARAM_EXEC ID for the work table */
459465 int wt_param_id ;
460466 /* a path for non-recursive term */
461- struct Path * non_recursive_path pg_node_attr ( read_write_ignore ) ;
467+ struct Path * non_recursive_path ;
462468
463469 /*
464470 * These fields are workspace for createplan.c
@@ -470,7 +476,9 @@ struct PlannerInfo
470476
471477 /*
472478 * These fields are workspace for setrefs.c. Each is an array
473- * corresponding to glob->subplans.
479+ * corresponding to glob->subplans. (We could probably teach
480+ * gen_node_support.pl how to determine the array length, but it doesn't
481+ * seem worth the trouble, so just mark them read_write_ignore.)
474482 */
475483 bool * isAltSubplan pg_node_attr (read_write_ignore );
476484 bool * isUsedSubplan pg_node_attr (read_write_ignore );
@@ -928,16 +936,17 @@ typedef struct RelOptInfo
928936 * Number of partitions; -1 if not yet set; in case of a join relation 0
929937 * means it's considered unpartitioned
930938 */
931- int nparts pg_node_attr ( read_write_ignore ) ;
939+ int nparts ;
932940 /* Partition bounds */
933941 struct PartitionBoundInfoData * boundinfo pg_node_attr (read_write_ignore );
934942 /* True if partition bounds were created by partition_bounds_merge() */
935943 bool partbounds_merged ;
936944 /* Partition constraint, if not the root */
937- List * partition_qual pg_node_attr ( read_write_ignore ) ;
945+ List * partition_qual ;
938946
939947 /*
940948 * Array of RelOptInfos of partitions, stored in the same order as bounds
949+ * (don't print, too bulky and duplicative)
941950 */
942951 struct RelOptInfo * * part_rels pg_node_attr (read_write_ignore );
943952
@@ -948,6 +957,12 @@ typedef struct RelOptInfo
948957 Bitmapset * live_parts ;
949958 /* Relids set of all partition relids */
950959 Relids all_partrels ;
960+
961+ /*
962+ * These arrays are of length partkey->partnatts, which we don't have at
963+ * hand, so don't try to print
964+ */
965+
951966 /* Non-nullable partition key expressions */
952967 List * * partexprs pg_node_attr (read_write_ignore );
953968 /* Nullable partition key expressions */
@@ -1042,30 +1057,26 @@ struct IndexOptInfo
10421057 int nkeycolumns ;
10431058
10441059 /*
1045- * array fields aren't really worth the trouble to print
1046- */
1047-
1048- /*
1049- * column numbers of index's attributes both key and included columns, or
1050- * 0
1060+ * table column numbers of index's columns (both key and included
1061+ * columns), or 0 for expression columns
10511062 */
1052- int * indexkeys pg_node_attr (read_write_ignore );
1063+ int * indexkeys pg_node_attr (array_size ( ncolumns ) );
10531064 /* OIDs of collations of index columns */
1054- Oid * indexcollations pg_node_attr (read_write_ignore );
1065+ Oid * indexcollations pg_node_attr (array_size ( nkeycolumns ) );
10551066 /* OIDs of operator families for columns */
1056- Oid * opfamily pg_node_attr (read_write_ignore );
1067+ Oid * opfamily pg_node_attr (array_size ( nkeycolumns ) );
10571068 /* OIDs of opclass declared input data types */
1058- Oid * opcintype pg_node_attr (read_write_ignore );
1069+ Oid * opcintype pg_node_attr (array_size ( nkeycolumns ) );
10591070 /* OIDs of btree opfamilies, if orderable */
1060- Oid * sortopfamily pg_node_attr (read_write_ignore );
1071+ Oid * sortopfamily pg_node_attr (array_size ( nkeycolumns ) );
10611072 /* is sort order descending? */
1062- bool * reverse_sort pg_node_attr (read_write_ignore );
1073+ bool * reverse_sort pg_node_attr (array_size ( nkeycolumns ) );
10631074 /* do NULLs come first in the sort order? */
1064- bool * nulls_first pg_node_attr (read_write_ignore );
1075+ bool * nulls_first pg_node_attr (array_size ( nkeycolumns ) );
10651076 /* opclass-specific options for columns */
10661077 bytea * * opclassoptions pg_node_attr (read_write_ignore );
10671078 /* which index cols can be returned in an index-only scan? */
1068- bool * canreturn pg_node_attr (read_write_ignore );
1079+ bool * canreturn pg_node_attr (array_size ( ncolumns ) );
10691080 /* OID of the access method (in pg_am) */
10701081 Oid relam ;
10711082
@@ -1098,19 +1109,19 @@ struct IndexOptInfo
10981109
10991110 /*
11001111 * Remaining fields are copied from the index AM's API struct
1101- * (IndexAmRoutine). We don't bother to dump them.
1112+ * (IndexAmRoutine).
11021113 */
1103- bool amcanorderbyop pg_node_attr ( read_write_ignore ) ;
1104- bool amoptionalkey pg_node_attr ( read_write_ignore ) ;
1105- bool amsearcharray pg_node_attr ( read_write_ignore ) ;
1106- bool amsearchnulls pg_node_attr ( read_write_ignore ) ;
1114+ bool amcanorderbyop ;
1115+ bool amoptionalkey ;
1116+ bool amsearcharray ;
1117+ bool amsearchnulls ;
11071118 /* does AM have amgettuple interface? */
1108- bool amhasgettuple pg_node_attr ( read_write_ignore ) ;
1119+ bool amhasgettuple ;
11091120 /* does AM have amgetbitmap interface? */
1110- bool amhasgetbitmap pg_node_attr ( read_write_ignore ) ;
1111- bool amcanparallel pg_node_attr ( read_write_ignore ) ;
1121+ bool amhasgetbitmap ;
1122+ bool amcanparallel ;
11121123 /* does AM have ammarkpos interface? */
1113- bool amcanmarkpos pg_node_attr ( read_write_ignore ) ;
1124+ bool amcanmarkpos ;
11141125 /* AM's cost estimator */
11151126 /* Rather than include amapi.h here, we declare amcostestimate like this */
11161127 void (* amcostestimate ) () pg_node_attr (read_write_ignore );
@@ -1184,12 +1195,9 @@ typedef struct StatisticExtInfo
11841195 Oid statOid ;
11851196
11861197 /* includes child relations */
1187- bool inherit pg_node_attr ( read_write_ignore ) ;
1198+ bool inherit ;
11881199
1189- /*
1190- * back-link to statistic's table; don't print, infinite recursion on plan
1191- * tree dump
1192- */
1200+ /* back-link to statistic's table; don't print, else infinite recursion */
11931201 RelOptInfo * rel pg_node_attr (read_write_ignore );
11941202
11951203 /* statistics kind of this entry */
0 commit comments