PostgreSQL Source Code  git master
outfuncs.c
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * outfuncs.c
4  * Output functions for Postgres tree nodes.
5  *
6  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  *
10  * IDENTIFICATION
11  * src/backend/nodes/outfuncs.c
12  *
13  * NOTES
14  * Every node type that can appear in stored rules' parsetrees *must*
15  * have an output function defined here (as well as an input function
16  * in readfuncs.c). In addition, plan nodes should have input and
17  * output functions so that they can be sent to parallel workers.
18  *
19  * For use in debugging, we also provide output functions for nodes
20  * that appear in raw parsetrees and planner Paths. These node types
21  * need not have input functions. Output support for raw parsetrees
22  * is somewhat incomplete, too; in particular, utility statements are
23  * almost entirely unsupported. We try to support everything that can
24  * appear in a raw SELECT, though.
25  *
26  *-------------------------------------------------------------------------
27  */
28 #include "postgres.h"
29 
30 #include <ctype.h>
31 
32 #include "lib/stringinfo.h"
33 #include "miscadmin.h"
34 #include "nodes/extensible.h"
35 #include "nodes/pathnodes.h"
36 #include "nodes/plannodes.h"
37 #include "utils/datum.h"
38 #include "utils/rel.h"
39 
40 static void outChar(StringInfo str, char c);
41 
42 
43 /*
44  * Macros to simplify output of different kinds of fields. Use these
45  * wherever possible to reduce the chance for silly typos. Note that these
46  * hard-wire conventions about the names of the local variables in an Out
47  * routine.
48  */
49 
50 /* Write the label for the node type */
51 #define WRITE_NODE_TYPE(nodelabel) \
52  appendStringInfoString(str, nodelabel)
53 
54 /* Write an integer field (anything written as ":fldname %d") */
55 #define WRITE_INT_FIELD(fldname) \
56  appendStringInfo(str, " :" CppAsString(fldname) " %d", node->fldname)
57 
58 /* Write an unsigned integer field (anything written as ":fldname %u") */
59 #define WRITE_UINT_FIELD(fldname) \
60  appendStringInfo(str, " :" CppAsString(fldname) " %u", node->fldname)
61 
62 /* Write an unsigned integer field (anything written with UINT64_FORMAT) */
63 #define WRITE_UINT64_FIELD(fldname) \
64  appendStringInfo(str, " :" CppAsString(fldname) " " UINT64_FORMAT, \
65  node->fldname)
66 
67 /* Write an OID field (don't hard-wire assumption that OID is same as uint) */
68 #define WRITE_OID_FIELD(fldname) \
69  appendStringInfo(str, " :" CppAsString(fldname) " %u", node->fldname)
70 
71 /* Write a long-integer field */
72 #define WRITE_LONG_FIELD(fldname) \
73  appendStringInfo(str, " :" CppAsString(fldname) " %ld", node->fldname)
74 
75 /* Write a char field (ie, one ascii character) */
76 #define WRITE_CHAR_FIELD(fldname) \
77  (appendStringInfo(str, " :" CppAsString(fldname) " "), \
78  outChar(str, node->fldname))
79 
80 /* Write an enumerated-type field as an integer code */
81 #define WRITE_ENUM_FIELD(fldname, enumtype) \
82  appendStringInfo(str, " :" CppAsString(fldname) " %d", \
83  (int) node->fldname)
84 
85 /* Write a float field --- caller must give format to define precision */
86 #define WRITE_FLOAT_FIELD(fldname,format) \
87  appendStringInfo(str, " :" CppAsString(fldname) " " format, node->fldname)
88 
89 /* Write a boolean field */
90 #define WRITE_BOOL_FIELD(fldname) \
91  appendStringInfo(str, " :" CppAsString(fldname) " %s", \
92  booltostr(node->fldname))
93 
94 /* Write a character-string (possibly NULL) field */
95 #define WRITE_STRING_FIELD(fldname) \
96  (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
97  outToken(str, node->fldname))
98 
99 /* Write a parse location field (actually same as INT case) */
100 #define WRITE_LOCATION_FIELD(fldname) \
101  appendStringInfo(str, " :" CppAsString(fldname) " %d", node->fldname)
102 
103 /* Write a Node field */
104 #define WRITE_NODE_FIELD(fldname) \
105  (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
106  outNode(str, node->fldname))
107 
108 /* Write a bitmapset field */
109 #define WRITE_BITMAPSET_FIELD(fldname) \
110  (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
111  outBitmapset(str, node->fldname))
112 
113 #define WRITE_ATTRNUMBER_ARRAY(fldname, len) \
114  do { \
115  appendStringInfoString(str, " :" CppAsString(fldname) " "); \
116  for (int i = 0; i < len; i++) \
117  appendStringInfo(str, " %d", node->fldname[i]); \
118  } while(0)
119 
120 #define WRITE_OID_ARRAY(fldname, len) \
121  do { \
122  appendStringInfoString(str, " :" CppAsString(fldname) " "); \
123  for (int i = 0; i < len; i++) \
124  appendStringInfo(str, " %u", node->fldname[i]); \
125  } while(0)
126 
127 #define WRITE_INDEX_ARRAY(fldname, len) \
128  do { \
129  appendStringInfoString(str, " :" CppAsString(fldname) " "); \
130  for (int i = 0; i < len; i++) \
131  appendStringInfo(str, " %u", node->fldname[i]); \
132  } while(0)
133 
134 #define WRITE_INT_ARRAY(fldname, len) \
135  do { \
136  appendStringInfoString(str, " :" CppAsString(fldname) " "); \
137  for (int i = 0; i < len; i++) \
138  appendStringInfo(str, " %d", node->fldname[i]); \
139  } while(0)
140 
141 #define WRITE_BOOL_ARRAY(fldname, len) \
142  do { \
143  appendStringInfoString(str, " :" CppAsString(fldname) " "); \
144  for (int i = 0; i < len; i++) \
145  appendStringInfo(str, " %s", booltostr(node->fldname[i])); \
146  } while(0)
147 
148 
149 #define booltostr(x) ((x) ? "true" : "false")
150 
151 
152 /*
153  * outToken
154  * Convert an ordinary string (eg, an identifier) into a form that
155  * will be decoded back to a plain token by read.c's functions.
156  *
157  * If a null or empty string is given, it is encoded as "<>".
158  */
159 void
160 outToken(StringInfo str, const char *s)
161 {
162  if (s == NULL || *s == '\0')
163  {
164  appendStringInfoString(str, "<>");
165  return;
166  }
167 
168  /*
169  * Look for characters or patterns that are treated specially by read.c
170  * (either in pg_strtok() or in nodeRead()), and therefore need a
171  * protective backslash.
172  */
173  /* These characters only need to be quoted at the start of the string */
174  if (*s == '<' ||
175  *s == '"' ||
176  isdigit((unsigned char) *s) ||
177  ((*s == '+' || *s == '-') &&
178  (isdigit((unsigned char) s[1]) || s[1] == '.')))
179  appendStringInfoChar(str, '\\');
180  while (*s)
181  {
182  /* These chars must be backslashed anywhere in the string */
183  if (*s == ' ' || *s == '\n' || *s == '\t' ||
184  *s == '(' || *s == ')' || *s == '{' || *s == '}' ||
185  *s == '\\')
186  appendStringInfoChar(str, '\\');
187  appendStringInfoChar(str, *s++);
188  }
189 }
190 
191 /*
192  * Convert one char. Goes through outToken() so that special characters are
193  * escaped.
194  */
195 static void
197 {
198  char in[2];
199 
200  in[0] = c;
201  in[1] = '\0';
202 
203  outToken(str, in);
204 }
205 
206 static void
208 {
209  const ListCell *lc;
210 
211  appendStringInfoChar(str, '(');
212 
213  if (IsA(node, IntList))
214  appendStringInfoChar(str, 'i');
215  else if (IsA(node, OidList))
216  appendStringInfoChar(str, 'o');
217 
218  foreach(lc, node)
219  {
220  /*
221  * For the sake of backward compatibility, we emit a slightly
222  * different whitespace format for lists of nodes vs. other types of
223  * lists. XXX: is this necessary?
224  */
225  if (IsA(node, List))
226  {
227  outNode(str, lfirst(lc));
228  if (lnext(node, lc))
229  appendStringInfoChar(str, ' ');
230  }
231  else if (IsA(node, IntList))
232  appendStringInfo(str, " %d", lfirst_int(lc));
233  else if (IsA(node, OidList))
234  appendStringInfo(str, " %u", lfirst_oid(lc));
235  else
236  elog(ERROR, "unrecognized list node type: %d",
237  (int) node->type);
238  }
239 
240  appendStringInfoChar(str, ')');
241 }
242 
243 /*
244  * outBitmapset -
245  * converts a bitmap set of integers
246  *
247  * Note: the output format is "(b int int ...)", similar to an integer List.
248  */
249 void
251 {
252  int x;
253 
254  appendStringInfoChar(str, '(');
255  appendStringInfoChar(str, 'b');
256  x = -1;
257  while ((x = bms_next_member(bms, x)) >= 0)
258  appendStringInfo(str, " %d", x);
259  appendStringInfoChar(str, ')');
260 }
261 
262 /*
263  * Print the value of a Datum given its type.
264  */
265 void
266 outDatum(StringInfo str, Datum value, int typlen, bool typbyval)
267 {
268  Size length,
269  i;
270  char *s;
271 
272  length = datumGetSize(value, typbyval, typlen);
273 
274  if (typbyval)
275  {
276  s = (char *) (&value);
277  appendStringInfo(str, "%u [ ", (unsigned int) length);
278  for (i = 0; i < (Size) sizeof(Datum); i++)
279  appendStringInfo(str, "%d ", (int) (s[i]));
280  appendStringInfoChar(str, ']');
281  }
282  else
283  {
284  s = (char *) DatumGetPointer(value);
285  if (!PointerIsValid(s))
286  appendStringInfoString(str, "0 [ ]");
287  else
288  {
289  appendStringInfo(str, "%u [ ", (unsigned int) length);
290  for (i = 0; i < length; i++)
291  appendStringInfo(str, "%d ", (int) (s[i]));
292  appendStringInfoChar(str, ']');
293  }
294  }
295 }
296 
297 
298 /*
299  * Stuff from plannodes.h
300  */
301 
302 static void
304 {
305  WRITE_NODE_TYPE("PLANNEDSTMT");
306 
307  WRITE_ENUM_FIELD(commandType, CmdType);
308  WRITE_UINT64_FIELD(queryId);
309  WRITE_BOOL_FIELD(hasReturning);
310  WRITE_BOOL_FIELD(hasModifyingCTE);
311  WRITE_BOOL_FIELD(canSetTag);
312  WRITE_BOOL_FIELD(transientPlan);
313  WRITE_BOOL_FIELD(dependsOnRole);
314  WRITE_BOOL_FIELD(parallelModeNeeded);
315  WRITE_INT_FIELD(jitFlags);
316  WRITE_NODE_FIELD(planTree);
317  WRITE_NODE_FIELD(rtable);
318  WRITE_NODE_FIELD(resultRelations);
319  WRITE_NODE_FIELD(appendRelations);
320  WRITE_NODE_FIELD(subplans);
321  WRITE_BITMAPSET_FIELD(rewindPlanIDs);
322  WRITE_NODE_FIELD(rowMarks);
323  WRITE_NODE_FIELD(relationOids);
324  WRITE_NODE_FIELD(invalItems);
325  WRITE_NODE_FIELD(paramExecTypes);
326  WRITE_NODE_FIELD(utilityStmt);
327  WRITE_LOCATION_FIELD(stmt_location);
328  WRITE_INT_FIELD(stmt_len);
329 }
330 
331 /*
332  * print the basic stuff of all nodes that inherit from Plan
333  */
334 static void
336 {
337  WRITE_FLOAT_FIELD(startup_cost, "%.2f");
338  WRITE_FLOAT_FIELD(total_cost, "%.2f");
339  WRITE_FLOAT_FIELD(plan_rows, "%.0f");
340  WRITE_INT_FIELD(plan_width);
341  WRITE_BOOL_FIELD(parallel_aware);
342  WRITE_BOOL_FIELD(parallel_safe);
343  WRITE_BOOL_FIELD(async_capable);
344  WRITE_INT_FIELD(plan_node_id);
345  WRITE_NODE_FIELD(targetlist);
346  WRITE_NODE_FIELD(qual);
347  WRITE_NODE_FIELD(lefttree);
348  WRITE_NODE_FIELD(righttree);
349  WRITE_NODE_FIELD(initPlan);
350  WRITE_BITMAPSET_FIELD(extParam);
351  WRITE_BITMAPSET_FIELD(allParam);
352 }
353 
354 /*
355  * print the basic stuff of all nodes that inherit from Scan
356  */
357 static void
359 {
360  _outPlanInfo(str, (const Plan *) node);
361 
362  WRITE_UINT_FIELD(scanrelid);
363 }
364 
365 /*
366  * print the basic stuff of all nodes that inherit from Join
367  */
368 static void
370 {
371  _outPlanInfo(str, (const Plan *) node);
372 
373  WRITE_ENUM_FIELD(jointype, JoinType);
374  WRITE_BOOL_FIELD(inner_unique);
375  WRITE_NODE_FIELD(joinqual);
376 }
377 
378 
379 static void
381 {
382  WRITE_NODE_TYPE("PLAN");
383 
384  _outPlanInfo(str, (const Plan *) node);
385 }
386 
387 static void
389 {
390  WRITE_NODE_TYPE("RESULT");
391 
392  _outPlanInfo(str, (const Plan *) node);
393 
394  WRITE_NODE_FIELD(resconstantqual);
395 }
396 
397 static void
399 {
400  WRITE_NODE_TYPE("PROJECTSET");
401 
402  _outPlanInfo(str, (const Plan *) node);
403 }
404 
405 static void
407 {
408  WRITE_NODE_TYPE("MODIFYTABLE");
409 
410  _outPlanInfo(str, (const Plan *) node);
411 
412  WRITE_ENUM_FIELD(operation, CmdType);
413  WRITE_BOOL_FIELD(canSetTag);
414  WRITE_UINT_FIELD(nominalRelation);
415  WRITE_UINT_FIELD(rootRelation);
416  WRITE_BOOL_FIELD(partColsUpdated);
417  WRITE_NODE_FIELD(resultRelations);
418  WRITE_NODE_FIELD(updateColnosLists);
419  WRITE_NODE_FIELD(withCheckOptionLists);
420  WRITE_NODE_FIELD(returningLists);
421  WRITE_NODE_FIELD(fdwPrivLists);
422  WRITE_BITMAPSET_FIELD(fdwDirectModifyPlans);
423  WRITE_NODE_FIELD(rowMarks);
424  WRITE_INT_FIELD(epqParam);
425  WRITE_ENUM_FIELD(onConflictAction, OnConflictAction);
426  WRITE_NODE_FIELD(arbiterIndexes);
427  WRITE_NODE_FIELD(onConflictSet);
428  WRITE_NODE_FIELD(onConflictCols);
429  WRITE_NODE_FIELD(onConflictWhere);
430  WRITE_UINT_FIELD(exclRelRTI);
431  WRITE_NODE_FIELD(exclRelTlist);
432 }
433 
434 static void
436 {
437  WRITE_NODE_TYPE("APPEND");
438 
439  _outPlanInfo(str, (const Plan *) node);
440 
441  WRITE_BITMAPSET_FIELD(apprelids);
442  WRITE_NODE_FIELD(appendplans);
443  WRITE_INT_FIELD(nasyncplans);
444  WRITE_INT_FIELD(first_partial_plan);
445  WRITE_NODE_FIELD(part_prune_info);
446 }
447 
448 static void
450 {
451  WRITE_NODE_TYPE("MERGEAPPEND");
452 
453  _outPlanInfo(str, (const Plan *) node);
454 
455  WRITE_BITMAPSET_FIELD(apprelids);
456  WRITE_NODE_FIELD(mergeplans);
457  WRITE_INT_FIELD(numCols);
458  WRITE_ATTRNUMBER_ARRAY(sortColIdx, node->numCols);
459  WRITE_OID_ARRAY(sortOperators, node->numCols);
460  WRITE_OID_ARRAY(collations, node->numCols);
461  WRITE_BOOL_ARRAY(nullsFirst, node->numCols);
462  WRITE_NODE_FIELD(part_prune_info);
463 }
464 
465 static void
467 {
468  WRITE_NODE_TYPE("RECURSIVEUNION");
469 
470  _outPlanInfo(str, (const Plan *) node);
471 
472  WRITE_INT_FIELD(wtParam);
473  WRITE_INT_FIELD(numCols);
474  WRITE_ATTRNUMBER_ARRAY(dupColIdx, node->numCols);
475  WRITE_OID_ARRAY(dupOperators, node->numCols);
476  WRITE_OID_ARRAY(dupCollations, node->numCols);
477  WRITE_LONG_FIELD(numGroups);
478 }
479 
480 static void
482 {
483  WRITE_NODE_TYPE("BITMAPAND");
484 
485  _outPlanInfo(str, (const Plan *) node);
486 
487  WRITE_NODE_FIELD(bitmapplans);
488 }
489 
490 static void
492 {
493  WRITE_NODE_TYPE("BITMAPOR");
494 
495  _outPlanInfo(str, (const Plan *) node);
496 
497  WRITE_BOOL_FIELD(isshared);
498  WRITE_NODE_FIELD(bitmapplans);
499 }
500 
501 static void
503 {
504  WRITE_NODE_TYPE("GATHER");
505 
506  _outPlanInfo(str, (const Plan *) node);
507 
508  WRITE_INT_FIELD(num_workers);
509  WRITE_INT_FIELD(rescan_param);
510  WRITE_BOOL_FIELD(single_copy);
511  WRITE_BOOL_FIELD(invisible);
512  WRITE_BITMAPSET_FIELD(initParam);
513 }
514 
515 static void
517 {
518  WRITE_NODE_TYPE("GATHERMERGE");
519 
520  _outPlanInfo(str, (const Plan *) node);
521 
522  WRITE_INT_FIELD(num_workers);
523  WRITE_INT_FIELD(rescan_param);
524  WRITE_INT_FIELD(numCols);
525  WRITE_ATTRNUMBER_ARRAY(sortColIdx, node->numCols);
526  WRITE_OID_ARRAY(sortOperators, node->numCols);
527  WRITE_OID_ARRAY(collations, node->numCols);
528  WRITE_BOOL_ARRAY(nullsFirst, node->numCols);
529  WRITE_BITMAPSET_FIELD(initParam);
530 }
531 
532 static void
534 {
535  WRITE_NODE_TYPE("SCAN");
536 
537  _outScanInfo(str, node);
538 }
539 
540 static void
542 {
543  WRITE_NODE_TYPE("SEQSCAN");
544 
545  _outScanInfo(str, (const Scan *) node);
546 }
547 
548 static void
550 {
551  WRITE_NODE_TYPE("SAMPLESCAN");
552 
553  _outScanInfo(str, (const Scan *) node);
554 
555  WRITE_NODE_FIELD(tablesample);
556 }
557 
558 static void
560 {
561  WRITE_NODE_TYPE("INDEXSCAN");
562 
563  _outScanInfo(str, (const Scan *) node);
564 
565  WRITE_OID_FIELD(indexid);
566  WRITE_NODE_FIELD(indexqual);
567  WRITE_NODE_FIELD(indexqualorig);
568  WRITE_NODE_FIELD(indexorderby);
569  WRITE_NODE_FIELD(indexorderbyorig);
570  WRITE_NODE_FIELD(indexorderbyops);
571  WRITE_ENUM_FIELD(indexorderdir, ScanDirection);
572 }
573 
574 static void
576 {
577  WRITE_NODE_TYPE("INDEXONLYSCAN");
578 
579  _outScanInfo(str, (const Scan *) node);
580 
581  WRITE_OID_FIELD(indexid);
582  WRITE_NODE_FIELD(indexqual);
583  WRITE_NODE_FIELD(indexorderby);
584  WRITE_NODE_FIELD(indextlist);
585  WRITE_ENUM_FIELD(indexorderdir, ScanDirection);
586 }
587 
588 static void
590 {
591  WRITE_NODE_TYPE("BITMAPINDEXSCAN");
592 
593  _outScanInfo(str, (const Scan *) node);
594 
595  WRITE_OID_FIELD(indexid);
596  WRITE_BOOL_FIELD(isshared);
597  WRITE_NODE_FIELD(indexqual);
598  WRITE_NODE_FIELD(indexqualorig);
599 }
600 
601 static void
603 {
604  WRITE_NODE_TYPE("BITMAPHEAPSCAN");
605 
606  _outScanInfo(str, (const Scan *) node);
607 
608  WRITE_NODE_FIELD(bitmapqualorig);
609 }
610 
611 static void
613 {
614  WRITE_NODE_TYPE("TIDSCAN");
615 
616  _outScanInfo(str, (const Scan *) node);
617 
618  WRITE_NODE_FIELD(tidquals);
619 }
620 
621 static void
623 {
624  WRITE_NODE_TYPE("TIDRANGESCAN");
625 
626  _outScanInfo(str, (const Scan *) node);
627 
628  WRITE_NODE_FIELD(tidrangequals);
629 }
630 
631 static void
633 {
634  WRITE_NODE_TYPE("SUBQUERYSCAN");
635 
636  _outScanInfo(str, (const Scan *) node);
637 
638  WRITE_NODE_FIELD(subplan);
639 }
640 
641 static void
643 {
644  WRITE_NODE_TYPE("FUNCTIONSCAN");
645 
646  _outScanInfo(str, (const Scan *) node);
647 
649  WRITE_BOOL_FIELD(funcordinality);
650 }
651 
652 static void
654 {
655  WRITE_NODE_TYPE("TABLEFUNCSCAN");
656 
657  _outScanInfo(str, (const Scan *) node);
658 
659  WRITE_NODE_FIELD(tablefunc);
660 }
661 
662 static void
664 {
665  WRITE_NODE_TYPE("VALUESSCAN");
666 
667  _outScanInfo(str, (const Scan *) node);
668 
669  WRITE_NODE_FIELD(values_lists);
670 }
671 
672 static void
674 {
675  WRITE_NODE_TYPE("CTESCAN");
676 
677  _outScanInfo(str, (const Scan *) node);
678 
679  WRITE_INT_FIELD(ctePlanId);
680  WRITE_INT_FIELD(cteParam);
681 }
682 
683 static void
685 {
686  WRITE_NODE_TYPE("NAMEDTUPLESTORESCAN");
687 
688  _outScanInfo(str, (const Scan *) node);
689 
690  WRITE_STRING_FIELD(enrname);
691 }
692 
693 static void
695 {
696  WRITE_NODE_TYPE("WORKTABLESCAN");
697 
698  _outScanInfo(str, (const Scan *) node);
699 
700  WRITE_INT_FIELD(wtParam);
701 }
702 
703 static void
705 {
706  WRITE_NODE_TYPE("FOREIGNSCAN");
707 
708  _outScanInfo(str, (const Scan *) node);
709 
710  WRITE_ENUM_FIELD(operation, CmdType);
711  WRITE_UINT_FIELD(resultRelation);
712  WRITE_OID_FIELD(fs_server);
713  WRITE_NODE_FIELD(fdw_exprs);
714  WRITE_NODE_FIELD(fdw_private);
715  WRITE_NODE_FIELD(fdw_scan_tlist);
716  WRITE_NODE_FIELD(fdw_recheck_quals);
717  WRITE_BITMAPSET_FIELD(fs_relids);
718  WRITE_BOOL_FIELD(fsSystemCol);
719 }
720 
721 static void
723 {
724  WRITE_NODE_TYPE("CUSTOMSCAN");
725 
726  _outScanInfo(str, (const Scan *) node);
727 
728  WRITE_UINT_FIELD(flags);
729  WRITE_NODE_FIELD(custom_plans);
730  WRITE_NODE_FIELD(custom_exprs);
731  WRITE_NODE_FIELD(custom_private);
732  WRITE_NODE_FIELD(custom_scan_tlist);
733  WRITE_BITMAPSET_FIELD(custom_relids);
734  /* CustomName is a key to lookup CustomScanMethods */
735  appendStringInfoString(str, " :methods ");
736  outToken(str, node->methods->CustomName);
737 }
738 
739 static void
741 {
742  WRITE_NODE_TYPE("JOIN");
743 
744  _outJoinPlanInfo(str, (const Join *) node);
745 }
746 
747 static void
749 {
750  WRITE_NODE_TYPE("NESTLOOP");
751 
752  _outJoinPlanInfo(str, (const Join *) node);
753 
754  WRITE_NODE_FIELD(nestParams);
755 }
756 
757 static void
759 {
760  int numCols;
761 
762  WRITE_NODE_TYPE("MERGEJOIN");
763 
764  _outJoinPlanInfo(str, (const Join *) node);
765 
766  WRITE_BOOL_FIELD(skip_mark_restore);
767  WRITE_NODE_FIELD(mergeclauses);
768 
769  numCols = list_length(node->mergeclauses);
770 
771  WRITE_OID_ARRAY(mergeFamilies, numCols);
772  WRITE_OID_ARRAY(mergeCollations, numCols);
773  WRITE_INT_ARRAY(mergeStrategies, numCols);
774  WRITE_BOOL_ARRAY(mergeNullsFirst, numCols);
775 }
776 
777 static void
779 {
780  WRITE_NODE_TYPE("HASHJOIN");
781 
782  _outJoinPlanInfo(str, (const Join *) node);
783 
784  WRITE_NODE_FIELD(hashclauses);
785  WRITE_NODE_FIELD(hashoperators);
786  WRITE_NODE_FIELD(hashcollations);
787  WRITE_NODE_FIELD(hashkeys);
788 }
789 
790 static void
791 _outAgg(StringInfo str, const Agg *node)
792 {
793  WRITE_NODE_TYPE("AGG");
794 
795  _outPlanInfo(str, (const Plan *) node);
796 
797  WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
798  WRITE_ENUM_FIELD(aggsplit, AggSplit);
799  WRITE_INT_FIELD(numCols);
800  WRITE_ATTRNUMBER_ARRAY(grpColIdx, node->numCols);
801  WRITE_OID_ARRAY(grpOperators, node->numCols);
802  WRITE_OID_ARRAY(grpCollations, node->numCols);
803  WRITE_LONG_FIELD(numGroups);
804  WRITE_UINT64_FIELD(transitionSpace);
805  WRITE_BITMAPSET_FIELD(aggParams);
806  WRITE_NODE_FIELD(groupingSets);
807  WRITE_NODE_FIELD(chain);
808 }
809 
810 static void
812 {
813  WRITE_NODE_TYPE("WINDOWAGG");
814 
815  _outPlanInfo(str, (const Plan *) node);
816 
817  WRITE_UINT_FIELD(winref);
818  WRITE_INT_FIELD(partNumCols);
819  WRITE_ATTRNUMBER_ARRAY(partColIdx, node->partNumCols);
820  WRITE_OID_ARRAY(partOperators, node->partNumCols);
821  WRITE_OID_ARRAY(partCollations, node->partNumCols);
822  WRITE_INT_FIELD(ordNumCols);
823  WRITE_ATTRNUMBER_ARRAY(ordColIdx, node->ordNumCols);
824  WRITE_OID_ARRAY(ordOperators, node->ordNumCols);
825  WRITE_OID_ARRAY(ordCollations, node->ordNumCols);
826  WRITE_INT_FIELD(frameOptions);
827  WRITE_NODE_FIELD(startOffset);
828  WRITE_NODE_FIELD(endOffset);
829  WRITE_OID_FIELD(startInRangeFunc);
830  WRITE_OID_FIELD(endInRangeFunc);
831  WRITE_OID_FIELD(inRangeColl);
832  WRITE_BOOL_FIELD(inRangeAsc);
833  WRITE_BOOL_FIELD(inRangeNullsFirst);
834 }
835 
836 static void
838 {
839  WRITE_NODE_TYPE("GROUP");
840 
841  _outPlanInfo(str, (const Plan *) node);
842 
843  WRITE_INT_FIELD(numCols);
844  WRITE_ATTRNUMBER_ARRAY(grpColIdx, node->numCols);
845  WRITE_OID_ARRAY(grpOperators, node->numCols);
846  WRITE_OID_ARRAY(grpCollations, node->numCols);
847 }
848 
849 static void
851 {
852  WRITE_NODE_TYPE("MATERIAL");
853 
854  _outPlanInfo(str, (const Plan *) node);
855 }
856 
857 static void
859 {
860  WRITE_NODE_TYPE("MEMOIZE");
861 
862  _outPlanInfo(str, (const Plan *) node);
863 
864  WRITE_INT_FIELD(numKeys);
865  WRITE_OID_ARRAY(hashOperators, node->numKeys);
866  WRITE_OID_ARRAY(collations, node->numKeys);
867  WRITE_NODE_FIELD(param_exprs);
868  WRITE_BOOL_FIELD(singlerow);
869  WRITE_UINT_FIELD(est_entries);
870 }
871 
872 static void
874 {
875  _outPlanInfo(str, (const Plan *) node);
876 
877  WRITE_INT_FIELD(numCols);
878  WRITE_ATTRNUMBER_ARRAY(sortColIdx, node->numCols);
879  WRITE_OID_ARRAY(sortOperators, node->numCols);
880  WRITE_OID_ARRAY(collations, node->numCols);
881  WRITE_BOOL_ARRAY(nullsFirst, node->numCols);
882 }
883 
884 static void
886 {
887  WRITE_NODE_TYPE("SORT");
888 
889  _outSortInfo(str, node);
890 }
891 
892 static void
894 {
895  WRITE_NODE_TYPE("INCREMENTALSORT");
896 
897  _outSortInfo(str, (const Sort *) node);
898 
899  WRITE_INT_FIELD(nPresortedCols);
900 }
901 
902 static void
904 {
905  WRITE_NODE_TYPE("UNIQUE");
906 
907  _outPlanInfo(str, (const Plan *) node);
908 
909  WRITE_INT_FIELD(numCols);
910  WRITE_ATTRNUMBER_ARRAY(uniqColIdx, node->numCols);
911  WRITE_OID_ARRAY(uniqOperators, node->numCols);
912  WRITE_OID_ARRAY(uniqCollations, node->numCols);
913 }
914 
915 static void
917 {
918  WRITE_NODE_TYPE("HASH");
919 
920  _outPlanInfo(str, (const Plan *) node);
921 
922  WRITE_NODE_FIELD(hashkeys);
923  WRITE_OID_FIELD(skewTable);
924  WRITE_INT_FIELD(skewColumn);
925  WRITE_BOOL_FIELD(skewInherit);
926  WRITE_FLOAT_FIELD(rows_total, "%.0f");
927 }
928 
929 static void
931 {
932  WRITE_NODE_TYPE("SETOP");
933 
934  _outPlanInfo(str, (const Plan *) node);
935 
937  WRITE_ENUM_FIELD(strategy, SetOpStrategy);
938  WRITE_INT_FIELD(numCols);
939  WRITE_ATTRNUMBER_ARRAY(dupColIdx, node->numCols);
940  WRITE_OID_ARRAY(dupOperators, node->numCols);
941  WRITE_OID_ARRAY(dupCollations, node->numCols);
942  WRITE_INT_FIELD(flagColIdx);
943  WRITE_INT_FIELD(firstFlag);
944  WRITE_LONG_FIELD(numGroups);
945 }
946 
947 static void
949 {
950  WRITE_NODE_TYPE("LOCKROWS");
951 
952  _outPlanInfo(str, (const Plan *) node);
953 
954  WRITE_NODE_FIELD(rowMarks);
955  WRITE_INT_FIELD(epqParam);
956 }
957 
958 static void
960 {
961  WRITE_NODE_TYPE("LIMIT");
962 
963  _outPlanInfo(str, (const Plan *) node);
964 
965  WRITE_NODE_FIELD(limitOffset);
966  WRITE_NODE_FIELD(limitCount);
967  WRITE_ENUM_FIELD(limitOption, LimitOption);
968  WRITE_INT_FIELD(uniqNumCols);
969  WRITE_ATTRNUMBER_ARRAY(uniqColIdx, node->uniqNumCols);
970  WRITE_OID_ARRAY(uniqOperators, node->uniqNumCols);
971  WRITE_OID_ARRAY(uniqCollations, node->uniqNumCols);
972 }
973 
974 static void
976 {
977  WRITE_NODE_TYPE("NESTLOOPPARAM");
978 
979  WRITE_INT_FIELD(paramno);
980  WRITE_NODE_FIELD(paramval);
981 }
982 
983 static void
985 {
986  WRITE_NODE_TYPE("PLANROWMARK");
987 
988  WRITE_UINT_FIELD(rti);
989  WRITE_UINT_FIELD(prti);
990  WRITE_UINT_FIELD(rowmarkId);
991  WRITE_ENUM_FIELD(markType, RowMarkType);
992  WRITE_INT_FIELD(allMarkTypes);
994  WRITE_ENUM_FIELD(waitPolicy, LockWaitPolicy);
995  WRITE_BOOL_FIELD(isParent);
996 }
997 
998 static void
1000 {
1001  WRITE_NODE_TYPE("PARTITIONPRUNEINFO");
1002 
1003  WRITE_NODE_FIELD(prune_infos);
1004  WRITE_BITMAPSET_FIELD(other_subplans);
1005 }
1006 
1007 static void
1009 {
1010  WRITE_NODE_TYPE("PARTITIONEDRELPRUNEINFO");
1011 
1012  WRITE_UINT_FIELD(rtindex);
1013  WRITE_BITMAPSET_FIELD(present_parts);
1014  WRITE_INT_FIELD(nparts);
1015  WRITE_INT_ARRAY(subplan_map, node->nparts);
1016  WRITE_INT_ARRAY(subpart_map, node->nparts);
1017  WRITE_OID_ARRAY(relid_map, node->nparts);
1018  WRITE_NODE_FIELD(initial_pruning_steps);
1019  WRITE_NODE_FIELD(exec_pruning_steps);
1020  WRITE_BITMAPSET_FIELD(execparamids);
1021 }
1022 
1023 static void
1025 {
1026  WRITE_NODE_TYPE("PARTITIONPRUNESTEPOP");
1027 
1028  WRITE_INT_FIELD(step.step_id);
1029  WRITE_INT_FIELD(opstrategy);
1030  WRITE_NODE_FIELD(exprs);
1031  WRITE_NODE_FIELD(cmpfns);
1032  WRITE_BITMAPSET_FIELD(nullkeys);
1033 }
1034 
1035 static void
1037 {
1038  WRITE_NODE_TYPE("PARTITIONPRUNESTEPCOMBINE");
1039 
1040  WRITE_INT_FIELD(step.step_id);
1042  WRITE_NODE_FIELD(source_stepids);
1043 }
1044 
1045 static void
1047 {
1048  WRITE_NODE_TYPE("PLANINVALITEM");
1049 
1050  WRITE_INT_FIELD(cacheId);
1051  WRITE_UINT_FIELD(hashValue);
1052 }
1053 
1054 /*****************************************************************************
1055  *
1056  * Stuff from primnodes.h.
1057  *
1058  *****************************************************************************/
1059 
1060 static void
1062 {
1063  WRITE_NODE_TYPE("ALIAS");
1064 
1065  WRITE_STRING_FIELD(aliasname);
1066  WRITE_NODE_FIELD(colnames);
1067 }
1068 
1069 static void
1071 {
1072  WRITE_NODE_TYPE("RANGEVAR");
1073 
1074  /*
1075  * we deliberately ignore catalogname here, since it is presently not
1076  * semantically meaningful
1077  */
1078  WRITE_STRING_FIELD(schemaname);
1080  WRITE_BOOL_FIELD(inh);
1081  WRITE_CHAR_FIELD(relpersistence);
1082  WRITE_NODE_FIELD(alias);
1083  WRITE_LOCATION_FIELD(location);
1084 }
1085 
1086 static void
1088 {
1089  WRITE_NODE_TYPE("TABLEFUNC");
1090 
1091  WRITE_NODE_FIELD(ns_uris);
1092  WRITE_NODE_FIELD(ns_names);
1093  WRITE_NODE_FIELD(docexpr);
1094  WRITE_NODE_FIELD(rowexpr);
1095  WRITE_NODE_FIELD(colnames);
1096  WRITE_NODE_FIELD(coltypes);
1097  WRITE_NODE_FIELD(coltypmods);
1098  WRITE_NODE_FIELD(colcollations);
1099  WRITE_NODE_FIELD(colexprs);
1100  WRITE_NODE_FIELD(coldefexprs);
1101  WRITE_BITMAPSET_FIELD(notnulls);
1102  WRITE_INT_FIELD(ordinalitycol);
1103  WRITE_LOCATION_FIELD(location);
1104 }
1105 
1106 static void
1108 {
1109  WRITE_NODE_TYPE("INTOCLAUSE");
1110 
1111  WRITE_NODE_FIELD(rel);
1112  WRITE_NODE_FIELD(colNames);
1113  WRITE_STRING_FIELD(accessMethod);
1115  WRITE_ENUM_FIELD(onCommit, OnCommitAction);
1116  WRITE_STRING_FIELD(tableSpaceName);
1117  WRITE_NODE_FIELD(viewQuery);
1118  WRITE_BOOL_FIELD(skipData);
1119 }
1120 
1121 static void
1122 _outVar(StringInfo str, const Var *node)
1123 {
1124  WRITE_NODE_TYPE("VAR");
1125 
1126  WRITE_INT_FIELD(varno);
1127  WRITE_INT_FIELD(varattno);
1128  WRITE_OID_FIELD(vartype);
1129  WRITE_INT_FIELD(vartypmod);
1130  WRITE_OID_FIELD(varcollid);
1131  WRITE_UINT_FIELD(varlevelsup);
1132  WRITE_UINT_FIELD(varnosyn);
1133  WRITE_INT_FIELD(varattnosyn);
1134  WRITE_LOCATION_FIELD(location);
1135 }
1136 
1137 static void
1139 {
1140  WRITE_NODE_TYPE("CONST");
1141 
1142  WRITE_OID_FIELD(consttype);
1143  WRITE_INT_FIELD(consttypmod);
1144  WRITE_OID_FIELD(constcollid);
1145  WRITE_INT_FIELD(constlen);
1146  WRITE_BOOL_FIELD(constbyval);
1147  WRITE_BOOL_FIELD(constisnull);
1148  WRITE_LOCATION_FIELD(location);
1149 
1150  appendStringInfoString(str, " :constvalue ");
1151  if (node->constisnull)
1152  appendStringInfoString(str, "<>");
1153  else
1154  outDatum(str, node->constvalue, node->constlen, node->constbyval);
1155 }
1156 
1157 static void
1159 {
1160  WRITE_NODE_TYPE("PARAM");
1161 
1162  WRITE_ENUM_FIELD(paramkind, ParamKind);
1163  WRITE_INT_FIELD(paramid);
1164  WRITE_OID_FIELD(paramtype);
1165  WRITE_INT_FIELD(paramtypmod);
1166  WRITE_OID_FIELD(paramcollid);
1167  WRITE_LOCATION_FIELD(location);
1168 }
1169 
1170 static void
1172 {
1173  WRITE_NODE_TYPE("AGGREF");
1174 
1175  WRITE_OID_FIELD(aggfnoid);
1176  WRITE_OID_FIELD(aggtype);
1177  WRITE_OID_FIELD(aggcollid);
1178  WRITE_OID_FIELD(inputcollid);
1179  WRITE_OID_FIELD(aggtranstype);
1180  WRITE_NODE_FIELD(aggargtypes);
1181  WRITE_NODE_FIELD(aggdirectargs);
1183  WRITE_NODE_FIELD(aggorder);
1184  WRITE_NODE_FIELD(aggdistinct);
1185  WRITE_NODE_FIELD(aggfilter);
1186  WRITE_BOOL_FIELD(aggstar);
1187  WRITE_BOOL_FIELD(aggvariadic);
1188  WRITE_CHAR_FIELD(aggkind);
1189  WRITE_UINT_FIELD(agglevelsup);
1190  WRITE_ENUM_FIELD(aggsplit, AggSplit);
1191  WRITE_INT_FIELD(aggno);
1192  WRITE_INT_FIELD(aggtransno);
1193  WRITE_LOCATION_FIELD(location);
1194 }
1195 
1196 static void
1198 {
1199  WRITE_NODE_TYPE("GROUPINGFUNC");
1200 
1202  WRITE_NODE_FIELD(refs);
1203  WRITE_NODE_FIELD(cols);
1204  WRITE_UINT_FIELD(agglevelsup);
1205  WRITE_LOCATION_FIELD(location);
1206 }
1207 
1208 static void
1210 {
1211  WRITE_NODE_TYPE("WINDOWFUNC");
1212 
1213  WRITE_OID_FIELD(winfnoid);
1214  WRITE_OID_FIELD(wintype);
1215  WRITE_OID_FIELD(wincollid);
1216  WRITE_OID_FIELD(inputcollid);
1218  WRITE_NODE_FIELD(aggfilter);
1219  WRITE_UINT_FIELD(winref);
1220  WRITE_BOOL_FIELD(winstar);
1221  WRITE_BOOL_FIELD(winagg);
1222  WRITE_LOCATION_FIELD(location);
1223 }
1224 
1225 static void
1227 {
1228  WRITE_NODE_TYPE("SUBSCRIPTINGREF");
1229 
1230  WRITE_OID_FIELD(refcontainertype);
1231  WRITE_OID_FIELD(refelemtype);
1232  WRITE_OID_FIELD(refrestype);
1233  WRITE_INT_FIELD(reftypmod);
1234  WRITE_OID_FIELD(refcollid);
1235  WRITE_NODE_FIELD(refupperindexpr);
1236  WRITE_NODE_FIELD(reflowerindexpr);
1237  WRITE_NODE_FIELD(refexpr);
1238  WRITE_NODE_FIELD(refassgnexpr);
1239 }
1240 
1241 static void
1243 {
1244  WRITE_NODE_TYPE("FUNCEXPR");
1245 
1246  WRITE_OID_FIELD(funcid);
1247  WRITE_OID_FIELD(funcresulttype);
1248  WRITE_BOOL_FIELD(funcretset);
1249  WRITE_BOOL_FIELD(funcvariadic);
1250  WRITE_ENUM_FIELD(funcformat, CoercionForm);
1251  WRITE_OID_FIELD(funccollid);
1252  WRITE_OID_FIELD(inputcollid);
1254  WRITE_LOCATION_FIELD(location);
1255 }
1256 
1257 static void
1259 {
1260  WRITE_NODE_TYPE("NAMEDARGEXPR");
1261 
1264  WRITE_INT_FIELD(argnumber);
1265  WRITE_LOCATION_FIELD(location);
1266 }
1267 
1268 static void
1270 {
1271  WRITE_NODE_TYPE("OPEXPR");
1272 
1273  WRITE_OID_FIELD(opno);
1274  WRITE_OID_FIELD(opfuncid);
1275  WRITE_OID_FIELD(opresulttype);
1276  WRITE_BOOL_FIELD(opretset);
1277  WRITE_OID_FIELD(opcollid);
1278  WRITE_OID_FIELD(inputcollid);
1280  WRITE_LOCATION_FIELD(location);
1281 }
1282 
1283 static void
1285 {
1286  WRITE_NODE_TYPE("DISTINCTEXPR");
1287 
1288  WRITE_OID_FIELD(opno);
1289  WRITE_OID_FIELD(opfuncid);
1290  WRITE_OID_FIELD(opresulttype);
1291  WRITE_BOOL_FIELD(opretset);
1292  WRITE_OID_FIELD(opcollid);
1293  WRITE_OID_FIELD(inputcollid);
1295  WRITE_LOCATION_FIELD(location);
1296 }
1297 
1298 static void
1300 {
1301  WRITE_NODE_TYPE("NULLIFEXPR");
1302 
1303  WRITE_OID_FIELD(opno);
1304  WRITE_OID_FIELD(opfuncid);
1305  WRITE_OID_FIELD(opresulttype);
1306  WRITE_BOOL_FIELD(opretset);
1307  WRITE_OID_FIELD(opcollid);
1308  WRITE_OID_FIELD(inputcollid);
1310  WRITE_LOCATION_FIELD(location);
1311 }
1312 
1313 static void
1315 {
1316  WRITE_NODE_TYPE("SCALARARRAYOPEXPR");
1317 
1318  WRITE_OID_FIELD(opno);
1319  WRITE_OID_FIELD(opfuncid);
1320  WRITE_OID_FIELD(hashfuncid);
1321  WRITE_OID_FIELD(negfuncid);
1322  WRITE_BOOL_FIELD(useOr);
1323  WRITE_OID_FIELD(inputcollid);
1325  WRITE_LOCATION_FIELD(location);
1326 }
1327 
1328 static void
1330 {
1331  char *opstr = NULL;
1332 
1333  WRITE_NODE_TYPE("BOOLEXPR");
1334 
1335  /* do-it-yourself enum representation */
1336  switch (node->boolop)
1337  {
1338  case AND_EXPR:
1339  opstr = "and";
1340  break;
1341  case OR_EXPR:
1342  opstr = "or";
1343  break;
1344  case NOT_EXPR:
1345  opstr = "not";
1346  break;
1347  }
1348  appendStringInfoString(str, " :boolop ");
1349  outToken(str, opstr);
1350 
1352  WRITE_LOCATION_FIELD(location);
1353 }
1354 
1355 static void
1357 {
1358  WRITE_NODE_TYPE("SUBLINK");
1359 
1360  WRITE_ENUM_FIELD(subLinkType, SubLinkType);
1361  WRITE_INT_FIELD(subLinkId);
1362  WRITE_NODE_FIELD(testexpr);
1363  WRITE_NODE_FIELD(operName);
1364  WRITE_NODE_FIELD(subselect);
1365  WRITE_LOCATION_FIELD(location);
1366 }
1367 
1368 static void
1370 {
1371  WRITE_NODE_TYPE("SUBPLAN");
1372 
1373  WRITE_ENUM_FIELD(subLinkType, SubLinkType);
1374  WRITE_NODE_FIELD(testexpr);
1375  WRITE_NODE_FIELD(paramIds);
1376  WRITE_INT_FIELD(plan_id);
1377  WRITE_STRING_FIELD(plan_name);
1378  WRITE_OID_FIELD(firstColType);
1379  WRITE_INT_FIELD(firstColTypmod);
1380  WRITE_OID_FIELD(firstColCollation);
1381  WRITE_BOOL_FIELD(useHashTable);
1382  WRITE_BOOL_FIELD(unknownEqFalse);
1383  WRITE_BOOL_FIELD(parallel_safe);
1384  WRITE_NODE_FIELD(setParam);
1385  WRITE_NODE_FIELD(parParam);
1387  WRITE_FLOAT_FIELD(startup_cost, "%.2f");
1388  WRITE_FLOAT_FIELD(per_call_cost, "%.2f");
1389 }
1390 
1391 static void
1393 {
1394  WRITE_NODE_TYPE("ALTERNATIVESUBPLAN");
1395 
1396  WRITE_NODE_FIELD(subplans);
1397 }
1398 
1399 static void
1401 {
1402  WRITE_NODE_TYPE("FIELDSELECT");
1403 
1405  WRITE_INT_FIELD(fieldnum);
1406  WRITE_OID_FIELD(resulttype);
1407  WRITE_INT_FIELD(resulttypmod);
1408  WRITE_OID_FIELD(resultcollid);
1409 }
1410 
1411 static void
1413 {
1414  WRITE_NODE_TYPE("FIELDSTORE");
1415 
1417  WRITE_NODE_FIELD(newvals);
1418  WRITE_NODE_FIELD(fieldnums);
1419  WRITE_OID_FIELD(resulttype);
1420 }
1421 
1422 static void
1424 {
1425  WRITE_NODE_TYPE("RELABELTYPE");
1426 
1428  WRITE_OID_FIELD(resulttype);
1429  WRITE_INT_FIELD(resulttypmod);
1430  WRITE_OID_FIELD(resultcollid);
1431  WRITE_ENUM_FIELD(relabelformat, CoercionForm);
1432  WRITE_LOCATION_FIELD(location);
1433 }
1434 
1435 static void
1437 {
1438  WRITE_NODE_TYPE("COERCEVIAIO");
1439 
1441  WRITE_OID_FIELD(resulttype);
1442  WRITE_OID_FIELD(resultcollid);
1443  WRITE_ENUM_FIELD(coerceformat, CoercionForm);
1444  WRITE_LOCATION_FIELD(location);
1445 }
1446 
1447 static void
1449 {
1450  WRITE_NODE_TYPE("ARRAYCOERCEEXPR");
1451 
1453  WRITE_NODE_FIELD(elemexpr);
1454  WRITE_OID_FIELD(resulttype);
1455  WRITE_INT_FIELD(resulttypmod);
1456  WRITE_OID_FIELD(resultcollid);
1457  WRITE_ENUM_FIELD(coerceformat, CoercionForm);
1458  WRITE_LOCATION_FIELD(location);
1459 }
1460 
1461 static void
1463 {
1464  WRITE_NODE_TYPE("CONVERTROWTYPEEXPR");
1465 
1467  WRITE_OID_FIELD(resulttype);
1468  WRITE_ENUM_FIELD(convertformat, CoercionForm);
1469  WRITE_LOCATION_FIELD(location);
1470 }
1471 
1472 static void
1474 {
1475  WRITE_NODE_TYPE("COLLATEEXPR");
1476 
1478  WRITE_OID_FIELD(collOid);
1479  WRITE_LOCATION_FIELD(location);
1480 }
1481 
1482 static void
1484 {
1485  WRITE_NODE_TYPE("CASEEXPR");
1486 
1487  WRITE_OID_FIELD(casetype);
1488  WRITE_OID_FIELD(casecollid);
1491  WRITE_NODE_FIELD(defresult);
1492  WRITE_LOCATION_FIELD(location);
1493 }
1494 
1495 static void
1497 {
1498  WRITE_NODE_TYPE("CASEWHEN");
1499 
1500  WRITE_NODE_FIELD(expr);
1501  WRITE_NODE_FIELD(result);
1502  WRITE_LOCATION_FIELD(location);
1503 }
1504 
1505 static void
1507 {
1508  WRITE_NODE_TYPE("CASETESTEXPR");
1509 
1510  WRITE_OID_FIELD(typeId);
1511  WRITE_INT_FIELD(typeMod);
1512  WRITE_OID_FIELD(collation);
1513 }
1514 
1515 static void
1517 {
1518  WRITE_NODE_TYPE("ARRAYEXPR");
1519 
1520  WRITE_OID_FIELD(array_typeid);
1521  WRITE_OID_FIELD(array_collid);
1522  WRITE_OID_FIELD(element_typeid);
1523  WRITE_NODE_FIELD(elements);
1524  WRITE_BOOL_FIELD(multidims);
1525  WRITE_LOCATION_FIELD(location);
1526 }
1527 
1528 static void
1530 {
1531  WRITE_NODE_TYPE("ROWEXPR");
1532 
1534  WRITE_OID_FIELD(row_typeid);
1535  WRITE_ENUM_FIELD(row_format, CoercionForm);
1536  WRITE_NODE_FIELD(colnames);
1537  WRITE_LOCATION_FIELD(location);
1538 }
1539 
1540 static void
1542 {
1543  WRITE_NODE_TYPE("ROWCOMPAREEXPR");
1544 
1546  WRITE_NODE_FIELD(opnos);
1547  WRITE_NODE_FIELD(opfamilies);
1548  WRITE_NODE_FIELD(inputcollids);
1549  WRITE_NODE_FIELD(largs);
1550  WRITE_NODE_FIELD(rargs);
1551 }
1552 
1553 static void
1555 {
1556  WRITE_NODE_TYPE("COALESCEEXPR");
1557 
1558  WRITE_OID_FIELD(coalescetype);
1559  WRITE_OID_FIELD(coalescecollid);
1561  WRITE_LOCATION_FIELD(location);
1562 }
1563 
1564 static void
1566 {
1567  WRITE_NODE_TYPE("MINMAXEXPR");
1568 
1569  WRITE_OID_FIELD(minmaxtype);
1570  WRITE_OID_FIELD(minmaxcollid);
1571  WRITE_OID_FIELD(inputcollid);
1574  WRITE_LOCATION_FIELD(location);
1575 }
1576 
1577 static void
1579 {
1580  WRITE_NODE_TYPE("SQLVALUEFUNCTION");
1581 
1584  WRITE_INT_FIELD(typmod);
1585  WRITE_LOCATION_FIELD(location);
1586 }
1587 
1588 static void
1590 {
1591  WRITE_NODE_TYPE("XMLEXPR");
1592 
1595  WRITE_NODE_FIELD(named_args);
1596  WRITE_NODE_FIELD(arg_names);
1600  WRITE_INT_FIELD(typmod);
1601  WRITE_LOCATION_FIELD(location);
1602 }
1603 
1604 static void
1606 {
1607  WRITE_NODE_TYPE("NULLTEST");
1608 
1610  WRITE_ENUM_FIELD(nulltesttype, NullTestType);
1611  WRITE_BOOL_FIELD(argisrow);
1612  WRITE_LOCATION_FIELD(location);
1613 }
1614 
1615 static void
1617 {
1618  WRITE_NODE_TYPE("BOOLEANTEST");
1619 
1621  WRITE_ENUM_FIELD(booltesttype, BoolTestType);
1622  WRITE_LOCATION_FIELD(location);
1623 }
1624 
1625 static void
1627 {
1628  WRITE_NODE_TYPE("COERCETODOMAIN");
1629 
1631  WRITE_OID_FIELD(resulttype);
1632  WRITE_INT_FIELD(resulttypmod);
1633  WRITE_OID_FIELD(resultcollid);
1634  WRITE_ENUM_FIELD(coercionformat, CoercionForm);
1635  WRITE_LOCATION_FIELD(location);
1636 }
1637 
1638 static void
1640 {
1641  WRITE_NODE_TYPE("COERCETODOMAINVALUE");
1642 
1643  WRITE_OID_FIELD(typeId);
1644  WRITE_INT_FIELD(typeMod);
1645  WRITE_OID_FIELD(collation);
1646  WRITE_LOCATION_FIELD(location);
1647 }
1648 
1649 static void
1651 {
1652  WRITE_NODE_TYPE("SETTODEFAULT");
1653 
1654  WRITE_OID_FIELD(typeId);
1655  WRITE_INT_FIELD(typeMod);
1656  WRITE_OID_FIELD(collation);
1657  WRITE_LOCATION_FIELD(location);
1658 }
1659 
1660 static void
1662 {
1663  WRITE_NODE_TYPE("CURRENTOFEXPR");
1664 
1665  WRITE_UINT_FIELD(cvarno);
1666  WRITE_STRING_FIELD(cursor_name);
1667  WRITE_INT_FIELD(cursor_param);
1668 }
1669 
1670 static void
1672 {
1673  WRITE_NODE_TYPE("NEXTVALUEEXPR");
1674 
1675  WRITE_OID_FIELD(seqid);
1676  WRITE_OID_FIELD(typeId);
1677 }
1678 
1679 static void
1681 {
1682  WRITE_NODE_TYPE("INFERENCEELEM");
1683 
1684  WRITE_NODE_FIELD(expr);
1685  WRITE_OID_FIELD(infercollid);
1686  WRITE_OID_FIELD(inferopclass);
1687 }
1688 
1689 static void
1691 {
1692  WRITE_NODE_TYPE("TARGETENTRY");
1693 
1694  WRITE_NODE_FIELD(expr);
1695  WRITE_INT_FIELD(resno);
1696  WRITE_STRING_FIELD(resname);
1697  WRITE_UINT_FIELD(ressortgroupref);
1698  WRITE_OID_FIELD(resorigtbl);
1699  WRITE_INT_FIELD(resorigcol);
1700  WRITE_BOOL_FIELD(resjunk);
1701 }
1702 
1703 static void
1705 {
1706  WRITE_NODE_TYPE("RANGETBLREF");
1707 
1708  WRITE_INT_FIELD(rtindex);
1709 }
1710 
1711 static void
1713 {
1714  WRITE_NODE_TYPE("JOINEXPR");
1715 
1716  WRITE_ENUM_FIELD(jointype, JoinType);
1717  WRITE_BOOL_FIELD(isNatural);
1718  WRITE_NODE_FIELD(larg);
1719  WRITE_NODE_FIELD(rarg);
1720  WRITE_NODE_FIELD(usingClause);
1721  WRITE_NODE_FIELD(join_using_alias);
1722  WRITE_NODE_FIELD(quals);
1723  WRITE_NODE_FIELD(alias);
1724  WRITE_INT_FIELD(rtindex);
1725 }
1726 
1727 static void
1729 {
1730  WRITE_NODE_TYPE("FROMEXPR");
1731 
1732  WRITE_NODE_FIELD(fromlist);
1733  WRITE_NODE_FIELD(quals);
1734 }
1735 
1736 static void
1738 {
1739  WRITE_NODE_TYPE("ONCONFLICTEXPR");
1740 
1742  WRITE_NODE_FIELD(arbiterElems);
1743  WRITE_NODE_FIELD(arbiterWhere);
1744  WRITE_OID_FIELD(constraint);
1745  WRITE_NODE_FIELD(onConflictSet);
1746  WRITE_NODE_FIELD(onConflictWhere);
1747  WRITE_INT_FIELD(exclRelIndex);
1748  WRITE_NODE_FIELD(exclRelTlist);
1749 }
1750 
1751 /*****************************************************************************
1752  *
1753  * Stuff from pathnodes.h.
1754  *
1755  *****************************************************************************/
1756 
1757 /*
1758  * print the basic stuff of all nodes that inherit from Path
1759  *
1760  * Note we do NOT print the parent, else we'd be in infinite recursion.
1761  * We can print the parent's relids for identification purposes, though.
1762  * We print the pathtarget only if it's not the default one for the rel.
1763  * We also do not print the whole of param_info, since it's printed by
1764  * _outRelOptInfo; it's sufficient and less cluttering to print just the
1765  * required outer relids.
1766  */
1767 static void
1769 {
1770  WRITE_ENUM_FIELD(pathtype, NodeTag);
1771  appendStringInfoString(str, " :parent_relids ");
1772  outBitmapset(str, node->parent->relids);
1773  if (node->pathtarget != node->parent->reltarget)
1774  WRITE_NODE_FIELD(pathtarget);
1775  appendStringInfoString(str, " :required_outer ");
1776  if (node->param_info)
1777  outBitmapset(str, node->param_info->ppi_req_outer);
1778  else
1779  outBitmapset(str, NULL);
1780  WRITE_BOOL_FIELD(parallel_aware);
1781  WRITE_BOOL_FIELD(parallel_safe);
1782  WRITE_INT_FIELD(parallel_workers);
1783  WRITE_FLOAT_FIELD(rows, "%.0f");
1784  WRITE_FLOAT_FIELD(startup_cost, "%.2f");
1785  WRITE_FLOAT_FIELD(total_cost, "%.2f");
1786  WRITE_NODE_FIELD(pathkeys);
1787 }
1788 
1789 /*
1790  * print the basic stuff of all nodes that inherit from JoinPath
1791  */
1792 static void
1794 {
1795  _outPathInfo(str, (const Path *) node);
1796 
1797  WRITE_ENUM_FIELD(jointype, JoinType);
1798  WRITE_BOOL_FIELD(inner_unique);
1799  WRITE_NODE_FIELD(outerjoinpath);
1800  WRITE_NODE_FIELD(innerjoinpath);
1801  WRITE_NODE_FIELD(joinrestrictinfo);
1802 }
1803 
1804 static void
1806 {
1807  WRITE_NODE_TYPE("PATH");
1808 
1809  _outPathInfo(str, (const Path *) node);
1810 }
1811 
1812 static void
1814 {
1815  WRITE_NODE_TYPE("INDEXPATH");
1816 
1817  _outPathInfo(str, (const Path *) node);
1818 
1819  WRITE_NODE_FIELD(indexinfo);
1820  WRITE_NODE_FIELD(indexclauses);
1821  WRITE_NODE_FIELD(indexorderbys);
1822  WRITE_NODE_FIELD(indexorderbycols);
1823  WRITE_ENUM_FIELD(indexscandir, ScanDirection);
1824  WRITE_FLOAT_FIELD(indextotalcost, "%.2f");
1825  WRITE_FLOAT_FIELD(indexselectivity, "%.4f");
1826 }
1827 
1828 static void
1830 {
1831  WRITE_NODE_TYPE("BITMAPHEAPPATH");
1832 
1833  _outPathInfo(str, (const Path *) node);
1834 
1835  WRITE_NODE_FIELD(bitmapqual);
1836 }
1837 
1838 static void
1840 {
1841  WRITE_NODE_TYPE("BITMAPANDPATH");
1842 
1843  _outPathInfo(str, (const Path *) node);
1844 
1845  WRITE_NODE_FIELD(bitmapquals);
1846  WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
1847 }
1848 
1849 static void
1851 {
1852  WRITE_NODE_TYPE("BITMAPORPATH");
1853 
1854  _outPathInfo(str, (const Path *) node);
1855 
1856  WRITE_NODE_FIELD(bitmapquals);
1857  WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
1858 }
1859 
1860 static void
1862 {
1863  WRITE_NODE_TYPE("TIDPATH");
1864 
1865  _outPathInfo(str, (const Path *) node);
1866 
1867  WRITE_NODE_FIELD(tidquals);
1868 }
1869 
1870 static void
1872 {
1873  WRITE_NODE_TYPE("TIDRANGEPATH");
1874 
1875  _outPathInfo(str, (const Path *) node);
1876 
1877  WRITE_NODE_FIELD(tidrangequals);
1878 }
1879 
1880 static void
1882 {
1883  WRITE_NODE_TYPE("SUBQUERYSCANPATH");
1884 
1885  _outPathInfo(str, (const Path *) node);
1886 
1888 }
1889 
1890 static void
1892 {
1893  WRITE_NODE_TYPE("FOREIGNPATH");
1894 
1895  _outPathInfo(str, (const Path *) node);
1896 
1897  WRITE_NODE_FIELD(fdw_outerpath);
1898  WRITE_NODE_FIELD(fdw_private);
1899 }
1900 
1901 static void
1903 {
1904  WRITE_NODE_TYPE("CUSTOMPATH");
1905 
1906  _outPathInfo(str, (const Path *) node);
1907 
1908  WRITE_UINT_FIELD(flags);
1909  WRITE_NODE_FIELD(custom_paths);
1910  WRITE_NODE_FIELD(custom_private);
1911  appendStringInfoString(str, " :methods ");
1912  outToken(str, node->methods->CustomName);
1913 }
1914 
1915 static void
1917 {
1918  WRITE_NODE_TYPE("APPENDPATH");
1919 
1920  _outPathInfo(str, (const Path *) node);
1921 
1922  WRITE_NODE_FIELD(subpaths);
1923  WRITE_INT_FIELD(first_partial_path);
1924  WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
1925 }
1926 
1927 static void
1929 {
1930  WRITE_NODE_TYPE("MERGEAPPENDPATH");
1931 
1932  _outPathInfo(str, (const Path *) node);
1933 
1934  WRITE_NODE_FIELD(subpaths);
1935  WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
1936 }
1937 
1938 static void
1940 {
1941  WRITE_NODE_TYPE("GROUPRESULTPATH");
1942 
1943  _outPathInfo(str, (const Path *) node);
1944 
1945  WRITE_NODE_FIELD(quals);
1946 }
1947 
1948 static void
1950 {
1951  WRITE_NODE_TYPE("MATERIALPATH");
1952 
1953  _outPathInfo(str, (const Path *) node);
1954 
1956 }
1957 
1958 static void
1960 {
1961  WRITE_NODE_TYPE("MEMOIZEPATH");
1962 
1963  _outPathInfo(str, (const Path *) node);
1964 
1966  WRITE_NODE_FIELD(hash_operators);
1967  WRITE_NODE_FIELD(param_exprs);
1968  WRITE_BOOL_FIELD(singlerow);
1969  WRITE_FLOAT_FIELD(calls, "%.0f");
1970  WRITE_UINT_FIELD(est_entries);
1971 }
1972 
1973 static void
1975 {
1976  WRITE_NODE_TYPE("UNIQUEPATH");
1977 
1978  _outPathInfo(str, (const Path *) node);
1979 
1982  WRITE_NODE_FIELD(in_operators);
1983  WRITE_NODE_FIELD(uniq_exprs);
1984 }
1985 
1986 static void
1988 {
1989  WRITE_NODE_TYPE("GATHERPATH");
1990 
1991  _outPathInfo(str, (const Path *) node);
1992 
1994  WRITE_BOOL_FIELD(single_copy);
1995  WRITE_INT_FIELD(num_workers);
1996 }
1997 
1998 static void
2000 {
2001  WRITE_NODE_TYPE("PROJECTIONPATH");
2002 
2003  _outPathInfo(str, (const Path *) node);
2004 
2006  WRITE_BOOL_FIELD(dummypp);
2007 }
2008 
2009 static void
2011 {
2012  WRITE_NODE_TYPE("PROJECTSETPATH");
2013 
2014  _outPathInfo(str, (const Path *) node);
2015 
2017 }
2018 
2019 static void
2021 {
2022  _outPathInfo(str, (const Path *) node);
2023 
2025 }
2026 
2027 static void
2029 {
2030  WRITE_NODE_TYPE("SORTPATH");
2031 
2032  _outSortPathInfo(str, node);
2033 }
2034 
2035 static void
2037 {
2038  WRITE_NODE_TYPE("INCREMENTALSORTPATH");
2039 
2040  _outSortPathInfo(str, (const SortPath *) node);
2041 
2042  WRITE_INT_FIELD(nPresortedCols);
2043 }
2044 
2045 static void
2047 {
2048  WRITE_NODE_TYPE("GROUPPATH");
2049 
2050  _outPathInfo(str, (const Path *) node);
2051 
2053  WRITE_NODE_FIELD(groupClause);
2054  WRITE_NODE_FIELD(qual);
2055 }
2056 
2057 static void
2059 {
2060  WRITE_NODE_TYPE("UPPERUNIQUEPATH");
2061 
2062  _outPathInfo(str, (const Path *) node);
2063 
2065  WRITE_INT_FIELD(numkeys);
2066 }
2067 
2068 static void
2070 {
2071  WRITE_NODE_TYPE("AGGPATH");
2072 
2073  _outPathInfo(str, (const Path *) node);
2074 
2076  WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
2077  WRITE_ENUM_FIELD(aggsplit, AggSplit);
2078  WRITE_FLOAT_FIELD(numGroups, "%.0f");
2079  WRITE_UINT64_FIELD(transitionSpace);
2080  WRITE_NODE_FIELD(groupClause);
2081  WRITE_NODE_FIELD(qual);
2082 }
2083 
2084 static void
2086 {
2087  WRITE_NODE_TYPE("ROLLUP");
2088 
2089  WRITE_NODE_FIELD(groupClause);
2090  WRITE_NODE_FIELD(gsets);
2091  WRITE_NODE_FIELD(gsets_data);
2092  WRITE_FLOAT_FIELD(numGroups, "%.0f");
2093  WRITE_BOOL_FIELD(hashable);
2094  WRITE_BOOL_FIELD(is_hashed);
2095 }
2096 
2097 static void
2099 {
2100  WRITE_NODE_TYPE("GSDATA");
2101 
2102  WRITE_NODE_FIELD(set);
2103  WRITE_FLOAT_FIELD(numGroups, "%.0f");
2104 }
2105 
2106 static void
2108 {
2109  WRITE_NODE_TYPE("GROUPINGSETSPATH");
2110 
2111  _outPathInfo(str, (const Path *) node);
2112 
2114  WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
2115  WRITE_NODE_FIELD(rollups);
2116  WRITE_NODE_FIELD(qual);
2117  WRITE_UINT64_FIELD(transitionSpace);
2118 }
2119 
2120 static void
2122 {
2123  WRITE_NODE_TYPE("MINMAXAGGPATH");
2124 
2125  _outPathInfo(str, (const Path *) node);
2126 
2127  WRITE_NODE_FIELD(mmaggregates);
2128  WRITE_NODE_FIELD(quals);
2129 }
2130 
2131 static void
2133 {
2134  WRITE_NODE_TYPE("WINDOWAGGPATH");
2135 
2136  _outPathInfo(str, (const Path *) node);
2137 
2139  WRITE_NODE_FIELD(winclause);
2140 }
2141 
2142 static void
2144 {
2145  WRITE_NODE_TYPE("SETOPPATH");
2146 
2147  _outPathInfo(str, (const Path *) node);
2148 
2150  WRITE_ENUM_FIELD(cmd, SetOpCmd);
2151  WRITE_ENUM_FIELD(strategy, SetOpStrategy);
2152  WRITE_NODE_FIELD(distinctList);
2153  WRITE_INT_FIELD(flagColIdx);
2154  WRITE_INT_FIELD(firstFlag);
2155  WRITE_FLOAT_FIELD(numGroups, "%.0f");
2156 }
2157 
2158 static void
2160 {
2161  WRITE_NODE_TYPE("RECURSIVEUNIONPATH");
2162 
2163  _outPathInfo(str, (const Path *) node);
2164 
2165  WRITE_NODE_FIELD(leftpath);
2166  WRITE_NODE_FIELD(rightpath);
2167  WRITE_NODE_FIELD(distinctList);
2168  WRITE_INT_FIELD(wtParam);
2169  WRITE_FLOAT_FIELD(numGroups, "%.0f");
2170 }
2171 
2172 static void
2174 {
2175  WRITE_NODE_TYPE("LOCKROWSPATH");
2176 
2177  _outPathInfo(str, (const Path *) node);
2178 
2180  WRITE_NODE_FIELD(rowMarks);
2181  WRITE_INT_FIELD(epqParam);
2182 }
2183 
2184 static void
2186 {
2187  WRITE_NODE_TYPE("MODIFYTABLEPATH");
2188 
2189  _outPathInfo(str, (const Path *) node);
2190 
2192  WRITE_ENUM_FIELD(operation, CmdType);
2193  WRITE_BOOL_FIELD(canSetTag);
2194  WRITE_UINT_FIELD(nominalRelation);
2195  WRITE_UINT_FIELD(rootRelation);
2196  WRITE_BOOL_FIELD(partColsUpdated);
2197  WRITE_NODE_FIELD(resultRelations);
2198  WRITE_NODE_FIELD(updateColnosLists);
2199  WRITE_NODE_FIELD(withCheckOptionLists);
2200  WRITE_NODE_FIELD(returningLists);
2201  WRITE_NODE_FIELD(rowMarks);
2202  WRITE_NODE_FIELD(onconflict);
2203  WRITE_INT_FIELD(epqParam);
2204 }
2205 
2206 static void
2208 {
2209  WRITE_NODE_TYPE("LIMITPATH");
2210 
2211  _outPathInfo(str, (const Path *) node);
2212 
2214  WRITE_NODE_FIELD(limitOffset);
2215  WRITE_NODE_FIELD(limitCount);
2216  WRITE_ENUM_FIELD(limitOption, LimitOption);
2217 }
2218 
2219 static void
2221 {
2222  WRITE_NODE_TYPE("GATHERMERGEPATH");
2223 
2224  _outPathInfo(str, (const Path *) node);
2225 
2227  WRITE_INT_FIELD(num_workers);
2228 }
2229 
2230 static void
2232 {
2233  WRITE_NODE_TYPE("NESTPATH");
2234 
2235  _outJoinPathInfo(str, (const JoinPath *) node);
2236 }
2237 
2238 static void
2240 {
2241  WRITE_NODE_TYPE("MERGEPATH");
2242 
2243  _outJoinPathInfo(str, (const JoinPath *) node);
2244 
2245  WRITE_NODE_FIELD(path_mergeclauses);
2246  WRITE_NODE_FIELD(outersortkeys);
2247  WRITE_NODE_FIELD(innersortkeys);
2248  WRITE_BOOL_FIELD(skip_mark_restore);
2249  WRITE_BOOL_FIELD(materialize_inner);
2250 }
2251 
2252 static void
2254 {
2255  WRITE_NODE_TYPE("HASHPATH");
2256 
2257  _outJoinPathInfo(str, (const JoinPath *) node);
2258 
2259  WRITE_NODE_FIELD(path_hashclauses);
2260  WRITE_INT_FIELD(num_batches);
2261  WRITE_FLOAT_FIELD(inner_rows_total, "%.0f");
2262 }
2263 
2264 static void
2266 {
2267  WRITE_NODE_TYPE("PLANNERGLOBAL");
2268 
2269  /* NB: this isn't a complete set of fields */
2270  WRITE_NODE_FIELD(subplans);
2271  WRITE_BITMAPSET_FIELD(rewindPlanIDs);
2272  WRITE_NODE_FIELD(finalrtable);
2273  WRITE_NODE_FIELD(finalrowmarks);
2274  WRITE_NODE_FIELD(resultRelations);
2275  WRITE_NODE_FIELD(appendRelations);
2276  WRITE_NODE_FIELD(relationOids);
2277  WRITE_NODE_FIELD(invalItems);
2278  WRITE_NODE_FIELD(paramExecTypes);
2279  WRITE_UINT_FIELD(lastPHId);
2280  WRITE_UINT_FIELD(lastRowMarkId);
2281  WRITE_INT_FIELD(lastPlanNodeId);
2282  WRITE_BOOL_FIELD(transientPlan);
2283  WRITE_BOOL_FIELD(dependsOnRole);
2284  WRITE_BOOL_FIELD(parallelModeOK);
2285  WRITE_BOOL_FIELD(parallelModeNeeded);
2286  WRITE_CHAR_FIELD(maxParallelHazard);
2287 }
2288 
2289 static void
2291 {
2292  WRITE_NODE_TYPE("PLANNERINFO");
2293 
2294  /* NB: this isn't a complete set of fields */
2296  WRITE_NODE_FIELD(glob);
2297  WRITE_UINT_FIELD(query_level);
2298  WRITE_NODE_FIELD(plan_params);
2299  WRITE_BITMAPSET_FIELD(outer_params);
2300  WRITE_BITMAPSET_FIELD(all_baserels);
2301  WRITE_BITMAPSET_FIELD(nullable_baserels);
2302  WRITE_NODE_FIELD(join_rel_list);
2303  WRITE_INT_FIELD(join_cur_level);
2304  WRITE_NODE_FIELD(init_plans);
2305  WRITE_NODE_FIELD(cte_plan_ids);
2306  WRITE_NODE_FIELD(multiexpr_params);
2307  WRITE_NODE_FIELD(eq_classes);
2308  WRITE_BOOL_FIELD(ec_merging_done);
2309  WRITE_NODE_FIELD(canon_pathkeys);
2310  WRITE_NODE_FIELD(left_join_clauses);
2311  WRITE_NODE_FIELD(right_join_clauses);
2312  WRITE_NODE_FIELD(full_join_clauses);
2313  WRITE_NODE_FIELD(join_info_list);
2314  WRITE_BITMAPSET_FIELD(all_result_relids);
2315  WRITE_BITMAPSET_FIELD(leaf_result_relids);
2316  WRITE_NODE_FIELD(append_rel_list);
2317  WRITE_NODE_FIELD(row_identity_vars);
2318  WRITE_NODE_FIELD(rowMarks);
2319  WRITE_NODE_FIELD(placeholder_list);
2320  WRITE_NODE_FIELD(fkey_list);
2321  WRITE_NODE_FIELD(query_pathkeys);
2322  WRITE_NODE_FIELD(group_pathkeys);
2323  WRITE_NODE_FIELD(window_pathkeys);
2324  WRITE_NODE_FIELD(distinct_pathkeys);
2325  WRITE_NODE_FIELD(sort_pathkeys);
2326  WRITE_NODE_FIELD(processed_tlist);
2327  WRITE_NODE_FIELD(update_colnos);
2328  WRITE_NODE_FIELD(minmax_aggs);
2329  WRITE_FLOAT_FIELD(total_table_pages, "%.0f");
2330  WRITE_FLOAT_FIELD(tuple_fraction, "%.4f");
2331  WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
2332  WRITE_UINT_FIELD(qual_security_level);
2333  WRITE_BOOL_FIELD(hasJoinRTEs);
2334  WRITE_BOOL_FIELD(hasLateralRTEs);
2335  WRITE_BOOL_FIELD(hasHavingQual);
2336  WRITE_BOOL_FIELD(hasPseudoConstantQuals);
2337  WRITE_BOOL_FIELD(hasAlternativeSubPlans);
2338  WRITE_BOOL_FIELD(hasRecursion);
2339  WRITE_INT_FIELD(wt_param_id);
2340  WRITE_BITMAPSET_FIELD(curOuterRels);
2341  WRITE_NODE_FIELD(curOuterParams);
2342  WRITE_BOOL_FIELD(partColsUpdated);
2343 }
2344 
2345 static void
2347 {
2348  WRITE_NODE_TYPE("RELOPTINFO");
2349 
2350  /* NB: this isn't a complete set of fields */
2351  WRITE_ENUM_FIELD(reloptkind, RelOptKind);
2352  WRITE_BITMAPSET_FIELD(relids);
2353  WRITE_FLOAT_FIELD(rows, "%.0f");
2354  WRITE_BOOL_FIELD(consider_startup);
2355  WRITE_BOOL_FIELD(consider_param_startup);
2356  WRITE_BOOL_FIELD(consider_parallel);
2357  WRITE_NODE_FIELD(reltarget);
2358  WRITE_NODE_FIELD(pathlist);
2359  WRITE_NODE_FIELD(ppilist);
2360  WRITE_NODE_FIELD(partial_pathlist);
2361  WRITE_NODE_FIELD(cheapest_startup_path);
2362  WRITE_NODE_FIELD(cheapest_total_path);
2363  WRITE_NODE_FIELD(cheapest_unique_path);
2364  WRITE_NODE_FIELD(cheapest_parameterized_paths);
2365  WRITE_BITMAPSET_FIELD(direct_lateral_relids);
2366  WRITE_BITMAPSET_FIELD(lateral_relids);
2367  WRITE_UINT_FIELD(relid);
2368  WRITE_OID_FIELD(reltablespace);
2369  WRITE_ENUM_FIELD(rtekind, RTEKind);
2370  WRITE_INT_FIELD(min_attr);
2371  WRITE_INT_FIELD(max_attr);
2372  WRITE_NODE_FIELD(lateral_vars);
2373  WRITE_BITMAPSET_FIELD(lateral_referencers);
2374  WRITE_NODE_FIELD(indexlist);
2375  WRITE_NODE_FIELD(statlist);
2376  WRITE_UINT_FIELD(pages);
2377  WRITE_FLOAT_FIELD(tuples, "%.0f");
2378  WRITE_FLOAT_FIELD(allvisfrac, "%.6f");
2379  WRITE_BITMAPSET_FIELD(eclass_indexes);
2380  WRITE_NODE_FIELD(subroot);
2381  WRITE_NODE_FIELD(subplan_params);
2382  WRITE_INT_FIELD(rel_parallel_workers);
2383  WRITE_UINT_FIELD(amflags);
2384  WRITE_OID_FIELD(serverid);
2385  WRITE_OID_FIELD(userid);
2386  WRITE_BOOL_FIELD(useridiscurrent);
2387  /* we don't try to print fdwroutine or fdw_private */
2388  /* can't print unique_for_rels/non_unique_for_rels; BMSes aren't Nodes */
2389  WRITE_NODE_FIELD(baserestrictinfo);
2390  WRITE_UINT_FIELD(baserestrict_min_security);
2391  WRITE_NODE_FIELD(joininfo);
2392  WRITE_BOOL_FIELD(has_eclass_joins);
2393  WRITE_BOOL_FIELD(consider_partitionwise_join);
2394  WRITE_BITMAPSET_FIELD(top_parent_relids);
2395  WRITE_BOOL_FIELD(partbounds_merged);
2396  WRITE_BITMAPSET_FIELD(live_parts);
2397  WRITE_BITMAPSET_FIELD(all_partrels);
2398 }
2399 
2400 static void
2402 {
2403  WRITE_NODE_TYPE("INDEXOPTINFO");
2404 
2405  /* NB: this isn't a complete set of fields */
2406  WRITE_OID_FIELD(indexoid);
2407  /* Do NOT print rel field, else infinite recursion */
2408  WRITE_UINT_FIELD(pages);
2409  WRITE_FLOAT_FIELD(tuples, "%.0f");
2410  WRITE_INT_FIELD(tree_height);
2411  WRITE_INT_FIELD(ncolumns);
2412  /* array fields aren't really worth the trouble to print */
2413  WRITE_OID_FIELD(relam);
2414  /* indexprs is redundant since we print indextlist */
2415  WRITE_NODE_FIELD(indpred);
2416  WRITE_NODE_FIELD(indextlist);
2417  WRITE_NODE_FIELD(indrestrictinfo);
2418  WRITE_BOOL_FIELD(predOK);
2419  WRITE_BOOL_FIELD(unique);
2420  WRITE_BOOL_FIELD(immediate);
2421  WRITE_BOOL_FIELD(hypothetical);
2422  /* we don't bother with fields copied from the index AM's API struct */
2423 }
2424 
2425 static void
2427 {
2428  int i;
2429 
2430  WRITE_NODE_TYPE("FOREIGNKEYOPTINFO");
2431 
2432  WRITE_UINT_FIELD(con_relid);
2433  WRITE_UINT_FIELD(ref_relid);
2434  WRITE_INT_FIELD(nkeys);
2435  WRITE_ATTRNUMBER_ARRAY(conkey, node->nkeys);
2436  WRITE_ATTRNUMBER_ARRAY(confkey, node->nkeys);
2437  WRITE_OID_ARRAY(conpfeqop, node->nkeys);
2438  WRITE_INT_FIELD(nmatched_ec);
2439  WRITE_INT_FIELD(nconst_ec);
2440  WRITE_INT_FIELD(nmatched_rcols);
2441  WRITE_INT_FIELD(nmatched_ri);
2442  /* for compactness, just print the number of matches per column: */
2443  appendStringInfoString(str, " :eclass");
2444  for (i = 0; i < node->nkeys; i++)
2445  appendStringInfo(str, " %d", (node->eclass[i] != NULL));
2446  appendStringInfoString(str, " :rinfos");
2447  for (i = 0; i < node->nkeys; i++)
2448  appendStringInfo(str, " %d", list_length(node->rinfos[i]));
2449 }
2450 
2451 static void
2453 {
2454  WRITE_NODE_TYPE("STATISTICEXTINFO");
2455 
2456  /* NB: this isn't a complete set of fields */
2457  WRITE_OID_FIELD(statOid);
2458  /* don't write rel, leads to infinite recursion in plan tree dump */
2459  WRITE_CHAR_FIELD(kind);
2460  WRITE_BITMAPSET_FIELD(keys);
2461 }
2462 
2463 static void
2465 {
2466  /*
2467  * To simplify reading, we just chase up to the topmost merged EC and
2468  * print that, without bothering to show the merge-ees separately.
2469  */
2470  while (node->ec_merged)
2471  node = node->ec_merged;
2472 
2473  WRITE_NODE_TYPE("EQUIVALENCECLASS");
2474 
2475  WRITE_NODE_FIELD(ec_opfamilies);
2476  WRITE_OID_FIELD(ec_collation);
2477  WRITE_NODE_FIELD(ec_members);
2478  WRITE_NODE_FIELD(ec_sources);
2479  WRITE_NODE_FIELD(ec_derives);
2480  WRITE_BITMAPSET_FIELD(ec_relids);
2481  WRITE_BOOL_FIELD(ec_has_const);
2482  WRITE_BOOL_FIELD(ec_has_volatile);
2483  WRITE_BOOL_FIELD(ec_below_outer_join);
2484  WRITE_BOOL_FIELD(ec_broken);
2485  WRITE_UINT_FIELD(ec_sortref);
2486  WRITE_UINT_FIELD(ec_min_security);
2487  WRITE_UINT_FIELD(ec_max_security);
2488 }
2489 
2490 static void
2492 {
2493  WRITE_NODE_TYPE("EQUIVALENCEMEMBER");
2494 
2495  WRITE_NODE_FIELD(em_expr);
2496  WRITE_BITMAPSET_FIELD(em_relids);
2497  WRITE_BITMAPSET_FIELD(em_nullable_relids);
2498  WRITE_BOOL_FIELD(em_is_const);
2499  WRITE_BOOL_FIELD(em_is_child);
2500  WRITE_OID_FIELD(em_datatype);
2501 }
2502 
2503 static void
2505 {
2506  WRITE_NODE_TYPE("PATHKEY");
2507 
2508  WRITE_NODE_FIELD(pk_eclass);
2509  WRITE_OID_FIELD(pk_opfamily);
2510  WRITE_INT_FIELD(pk_strategy);
2511  WRITE_BOOL_FIELD(pk_nulls_first);
2512 }
2513 
2514 static void
2516 {
2517  WRITE_NODE_TYPE("PATHTARGET");
2518 
2519  WRITE_NODE_FIELD(exprs);
2520  WRITE_INDEX_ARRAY(sortgrouprefs, list_length(node->exprs));
2521  WRITE_FLOAT_FIELD(cost.startup, "%.2f");
2522  WRITE_FLOAT_FIELD(cost.per_tuple, "%.2f");
2523  WRITE_INT_FIELD(width);
2524  WRITE_ENUM_FIELD(has_volatile_expr, VolatileFunctionStatus);
2525 }
2526 
2527 static void
2529 {
2530  WRITE_NODE_TYPE("PARAMPATHINFO");
2531 
2532  WRITE_BITMAPSET_FIELD(ppi_req_outer);
2533  WRITE_FLOAT_FIELD(ppi_rows, "%.0f");
2534  WRITE_NODE_FIELD(ppi_clauses);
2535 }
2536 
2537 static void
2539 {
2540  WRITE_NODE_TYPE("RESTRICTINFO");
2541 
2542  /* NB: this isn't a complete set of fields */
2543  WRITE_NODE_FIELD(clause);
2544  WRITE_BOOL_FIELD(is_pushed_down);
2545  WRITE_BOOL_FIELD(outerjoin_delayed);
2546  WRITE_BOOL_FIELD(can_join);
2547  WRITE_BOOL_FIELD(pseudoconstant);
2548  WRITE_BOOL_FIELD(leakproof);
2550  WRITE_UINT_FIELD(security_level);
2551  WRITE_BITMAPSET_FIELD(clause_relids);
2552  WRITE_BITMAPSET_FIELD(required_relids);
2553  WRITE_BITMAPSET_FIELD(outer_relids);
2554  WRITE_BITMAPSET_FIELD(nullable_relids);
2555  WRITE_BITMAPSET_FIELD(left_relids);
2556  WRITE_BITMAPSET_FIELD(right_relids);
2557  WRITE_NODE_FIELD(orclause);
2558  /* don't write parent_ec, leads to infinite recursion in plan tree dump */
2559  WRITE_FLOAT_FIELD(norm_selec, "%.4f");
2560  WRITE_FLOAT_FIELD(outer_selec, "%.4f");
2561  WRITE_NODE_FIELD(mergeopfamilies);
2562  /* don't write left_ec, leads to infinite recursion in plan tree dump */
2563  /* don't write right_ec, leads to infinite recursion in plan tree dump */
2564  WRITE_NODE_FIELD(left_em);
2565  WRITE_NODE_FIELD(right_em);
2566  WRITE_BOOL_FIELD(outer_is_left);
2567  WRITE_OID_FIELD(hashjoinoperator);
2568  WRITE_OID_FIELD(hasheqoperator);
2569 }
2570 
2571 static void
2573 {
2574  WRITE_NODE_TYPE("INDEXCLAUSE");
2575 
2576  WRITE_NODE_FIELD(rinfo);
2577  WRITE_NODE_FIELD(indexquals);
2578  WRITE_BOOL_FIELD(lossy);
2579  WRITE_INT_FIELD(indexcol);
2580  WRITE_NODE_FIELD(indexcols);
2581 }
2582 
2583 static void
2585 {
2586  WRITE_NODE_TYPE("PLACEHOLDERVAR");
2587 
2588  WRITE_NODE_FIELD(phexpr);
2589  WRITE_BITMAPSET_FIELD(phrels);
2590  WRITE_UINT_FIELD(phid);
2591  WRITE_UINT_FIELD(phlevelsup);
2592 }
2593 
2594 static void
2596 {
2597  WRITE_NODE_TYPE("SPECIALJOININFO");
2598 
2599  WRITE_BITMAPSET_FIELD(min_lefthand);
2600  WRITE_BITMAPSET_FIELD(min_righthand);
2601  WRITE_BITMAPSET_FIELD(syn_lefthand);
2602  WRITE_BITMAPSET_FIELD(syn_righthand);
2603  WRITE_ENUM_FIELD(jointype, JoinType);
2604  WRITE_BOOL_FIELD(lhs_strict);
2605  WRITE_BOOL_FIELD(delay_upper_joins);
2606  WRITE_BOOL_FIELD(semi_can_btree);
2607  WRITE_BOOL_FIELD(semi_can_hash);
2608  WRITE_NODE_FIELD(semi_operators);
2609  WRITE_NODE_FIELD(semi_rhs_exprs);
2610 }
2611 
2612 static void
2614 {
2615  WRITE_NODE_TYPE("APPENDRELINFO");
2616 
2617  WRITE_UINT_FIELD(parent_relid);
2618  WRITE_UINT_FIELD(child_relid);
2619  WRITE_OID_FIELD(parent_reltype);
2620  WRITE_OID_FIELD(child_reltype);
2621  WRITE_NODE_FIELD(translated_vars);
2622  WRITE_INT_FIELD(num_child_cols);
2623  WRITE_ATTRNUMBER_ARRAY(parent_colnos, node->num_child_cols);
2624  WRITE_OID_FIELD(parent_reloid);
2625 }
2626 
2627 static void
2629 {
2630  WRITE_NODE_TYPE("ROWIDENTITYVARINFO");
2631 
2632  WRITE_NODE_FIELD(rowidvar);
2633  WRITE_INT_FIELD(rowidwidth);
2634  WRITE_STRING_FIELD(rowidname);
2635  WRITE_BITMAPSET_FIELD(rowidrels);
2636 }
2637 
2638 static void
2640 {
2641  WRITE_NODE_TYPE("PLACEHOLDERINFO");
2642 
2643  WRITE_UINT_FIELD(phid);
2644  WRITE_NODE_FIELD(ph_var);
2645  WRITE_BITMAPSET_FIELD(ph_eval_at);
2646  WRITE_BITMAPSET_FIELD(ph_lateral);
2647  WRITE_BITMAPSET_FIELD(ph_needed);
2648  WRITE_INT_FIELD(ph_width);
2649 }
2650 
2651 static void
2653 {
2654  WRITE_NODE_TYPE("MINMAXAGGINFO");
2655 
2656  WRITE_OID_FIELD(aggfnoid);
2657  WRITE_OID_FIELD(aggsortop);
2658  WRITE_NODE_FIELD(target);
2659  /* We intentionally omit subroot --- too large, not interesting enough */
2660  WRITE_NODE_FIELD(path);
2661  WRITE_FLOAT_FIELD(pathcost, "%.2f");
2662  WRITE_NODE_FIELD(param);
2663 }
2664 
2665 static void
2667 {
2668  WRITE_NODE_TYPE("PLANNERPARAMITEM");
2669 
2670  WRITE_NODE_FIELD(item);
2671  WRITE_INT_FIELD(paramId);
2672 }
2673 
2674 /*****************************************************************************
2675  *
2676  * Stuff from extensible.h
2677  *
2678  *****************************************************************************/
2679 
2680 static void
2682 {
2683  const ExtensibleNodeMethods *methods;
2684 
2685  methods = GetExtensibleNodeMethods(node->extnodename, false);
2686 
2687  WRITE_NODE_TYPE("EXTENSIBLENODE");
2688 
2689  WRITE_STRING_FIELD(extnodename);
2690 
2691  /* serialize the private fields */
2692  methods->nodeOut(str, node);
2693 }
2694 
2695 /*****************************************************************************
2696  *
2697  * Stuff from parsenodes.h.
2698  *
2699  *****************************************************************************/
2700 
2701 /*
2702  * print the basic stuff of all nodes that inherit from CreateStmt
2703  */
2704 static void
2706 {
2707  WRITE_NODE_FIELD(relation);
2708  WRITE_NODE_FIELD(tableElts);
2709  WRITE_NODE_FIELD(inhRelations);
2710  WRITE_NODE_FIELD(partspec);
2711  WRITE_NODE_FIELD(partbound);
2712  WRITE_NODE_FIELD(ofTypename);
2713  WRITE_NODE_FIELD(constraints);
2715  WRITE_ENUM_FIELD(oncommit, OnCommitAction);
2716  WRITE_STRING_FIELD(tablespacename);
2717  WRITE_STRING_FIELD(accessMethod);
2718  WRITE_BOOL_FIELD(if_not_exists);
2719 }
2720 
2721 static void
2723 {
2724  WRITE_NODE_TYPE("CREATESTMT");
2725 
2726  _outCreateStmtInfo(str, (const CreateStmt *) node);
2727 }
2728 
2729 static void
2731 {
2732  WRITE_NODE_TYPE("CREATEFOREIGNTABLESTMT");
2733 
2734  _outCreateStmtInfo(str, (const CreateStmt *) node);
2735 
2736  WRITE_STRING_FIELD(servername);
2738 }
2739 
2740 static void
2742 {
2743  WRITE_NODE_TYPE("IMPORTFOREIGNSCHEMASTMT");
2744 
2745  WRITE_STRING_FIELD(server_name);
2746  WRITE_STRING_FIELD(remote_schema);
2747  WRITE_STRING_FIELD(local_schema);
2749  WRITE_NODE_FIELD(table_list);
2751 }
2752 
2753 static void
2755 {
2756  WRITE_NODE_TYPE("INDEXSTMT");
2757 
2758  WRITE_STRING_FIELD(idxname);
2759  WRITE_NODE_FIELD(relation);
2760  WRITE_STRING_FIELD(accessMethod);
2761  WRITE_STRING_FIELD(tableSpace);
2762  WRITE_NODE_FIELD(indexParams);
2763  WRITE_NODE_FIELD(indexIncludingParams);
2765  WRITE_NODE_FIELD(whereClause);
2766  WRITE_NODE_FIELD(excludeOpNames);
2767  WRITE_STRING_FIELD(idxcomment);
2768  WRITE_OID_FIELD(indexOid);
2769  WRITE_OID_FIELD(oldNode);
2770  WRITE_UINT_FIELD(oldCreateSubid);
2771  WRITE_UINT_FIELD(oldFirstRelfilenodeSubid);
2772  WRITE_BOOL_FIELD(unique);
2773  WRITE_BOOL_FIELD(primary);
2774  WRITE_BOOL_FIELD(isconstraint);
2775  WRITE_BOOL_FIELD(deferrable);
2776  WRITE_BOOL_FIELD(initdeferred);
2777  WRITE_BOOL_FIELD(transformed);
2778  WRITE_BOOL_FIELD(concurrent);
2779  WRITE_BOOL_FIELD(if_not_exists);
2780  WRITE_BOOL_FIELD(reset_default_tblspc);
2781 }
2782 
2783 static void
2785 {
2786  WRITE_NODE_TYPE("CREATESTATSSTMT");
2787 
2788  WRITE_NODE_FIELD(defnames);
2789  WRITE_NODE_FIELD(stat_types);
2790  WRITE_NODE_FIELD(exprs);
2791  WRITE_NODE_FIELD(relations);
2792  WRITE_STRING_FIELD(stxcomment);
2793  WRITE_BOOL_FIELD(transformed);
2794  WRITE_BOOL_FIELD(if_not_exists);
2795 }
2796 
2797 static void
2799 {
2800  WRITE_NODE_TYPE("ALTERSTATSSTMT");
2801 
2802  WRITE_NODE_FIELD(defnames);
2803  WRITE_INT_FIELD(stxstattarget);
2804  WRITE_BOOL_FIELD(missing_ok);
2805 }
2806 
2807 static void
2809 {
2810  WRITE_NODE_TYPE("NOTIFYSTMT");
2811 
2812  WRITE_STRING_FIELD(conditionname);
2813  WRITE_STRING_FIELD(payload);
2814 }
2815 
2816 static void
2818 {
2819  WRITE_NODE_TYPE("DECLARECURSORSTMT");
2820 
2821  WRITE_STRING_FIELD(portalname);
2823  WRITE_NODE_FIELD(query);
2824 }
2825 
2826 static void
2828 {
2829  WRITE_NODE_TYPE("SELECT");
2830 
2831  WRITE_NODE_FIELD(distinctClause);
2832  WRITE_NODE_FIELD(intoClause);
2833  WRITE_NODE_FIELD(targetList);
2834  WRITE_NODE_FIELD(fromClause);
2835  WRITE_NODE_FIELD(whereClause);
2836  WRITE_NODE_FIELD(groupClause);
2837  WRITE_BOOL_FIELD(groupDistinct);
2838  WRITE_NODE_FIELD(havingClause);
2839  WRITE_NODE_FIELD(windowClause);
2840  WRITE_NODE_FIELD(valuesLists);
2841  WRITE_NODE_FIELD(sortClause);
2842  WRITE_NODE_FIELD(limitOffset);
2843  WRITE_NODE_FIELD(limitCount);
2844  WRITE_ENUM_FIELD(limitOption, LimitOption);
2845  WRITE_NODE_FIELD(lockingClause);
2846  WRITE_NODE_FIELD(withClause);
2848  WRITE_BOOL_FIELD(all);
2849  WRITE_NODE_FIELD(larg);
2850  WRITE_NODE_FIELD(rarg);
2851 }
2852 
2853 static void
2855 {
2856  WRITE_NODE_TYPE("RETURN");
2857 
2858  WRITE_NODE_FIELD(returnval);
2859 }
2860 
2861 static void
2863 {
2864  WRITE_NODE_TYPE("PLASSIGN");
2865 
2867  WRITE_NODE_FIELD(indirection);
2868  WRITE_INT_FIELD(nnames);
2870  WRITE_LOCATION_FIELD(location);
2871 }
2872 
2873 static void
2875 {
2876  WRITE_NODE_TYPE("FUNCCALL");
2877 
2878  WRITE_NODE_FIELD(funcname);
2880  WRITE_NODE_FIELD(agg_order);
2881  WRITE_NODE_FIELD(agg_filter);
2882  WRITE_NODE_FIELD(over);
2883  WRITE_BOOL_FIELD(agg_within_group);
2884  WRITE_BOOL_FIELD(agg_star);
2885  WRITE_BOOL_FIELD(agg_distinct);
2886  WRITE_BOOL_FIELD(func_variadic);
2887  WRITE_ENUM_FIELD(funcformat, CoercionForm);
2888  WRITE_LOCATION_FIELD(location);
2889 }
2890 
2891 static void
2893 {
2894  WRITE_NODE_TYPE("DEFELEM");
2895 
2896  WRITE_STRING_FIELD(defnamespace);
2897  WRITE_STRING_FIELD(defname);
2899  WRITE_ENUM_FIELD(defaction, DefElemAction);
2900  WRITE_LOCATION_FIELD(location);
2901 }
2902 
2903 static void
2905 {
2906  WRITE_NODE_TYPE("TABLELIKECLAUSE");
2907 
2908  WRITE_NODE_FIELD(relation);
2910  WRITE_OID_FIELD(relationOid);
2911 }
2912 
2913 static void
2915 {
2916  WRITE_NODE_TYPE("LOCKINGCLAUSE");
2917 
2918  WRITE_NODE_FIELD(lockedRels);
2920  WRITE_ENUM_FIELD(waitPolicy, LockWaitPolicy);
2921 }
2922 
2923 static void
2925 {
2926  WRITE_NODE_TYPE("XMLSERIALIZE");
2927 
2929  WRITE_NODE_FIELD(expr);
2930  WRITE_NODE_FIELD(typeName);
2931  WRITE_LOCATION_FIELD(location);
2932 }
2933 
2934 static void
2936 {
2937  WRITE_NODE_TYPE("TRIGGERTRANSITION");
2938 
2940  WRITE_BOOL_FIELD(isNew);
2941  WRITE_BOOL_FIELD(isTable);
2942 }
2943 
2944 static void
2946 {
2947  WRITE_NODE_TYPE("COLUMNDEF");
2948 
2949  WRITE_STRING_FIELD(colname);
2950  WRITE_NODE_FIELD(typeName);
2951  WRITE_STRING_FIELD(compression);
2952  WRITE_INT_FIELD(inhcount);
2953  WRITE_BOOL_FIELD(is_local);
2954  WRITE_BOOL_FIELD(is_not_null);
2955  WRITE_BOOL_FIELD(is_from_type);
2956  WRITE_CHAR_FIELD(storage);
2957  WRITE_NODE_FIELD(raw_default);
2958  WRITE_NODE_FIELD(cooked_default);
2959  WRITE_CHAR_FIELD(identity);
2960  WRITE_NODE_FIELD(identitySequence);
2961  WRITE_CHAR_FIELD(generated);
2962  WRITE_NODE_FIELD(collClause);
2963  WRITE_OID_FIELD(collOid);
2964  WRITE_NODE_FIELD(constraints);
2965  WRITE_NODE_FIELD(fdwoptions);
2966  WRITE_LOCATION_FIELD(location);
2967 }
2968 
2969 static void
2971 {
2972  WRITE_NODE_TYPE("TYPENAME");
2973 
2974  WRITE_NODE_FIELD(names);
2975  WRITE_OID_FIELD(typeOid);
2976  WRITE_BOOL_FIELD(setof);
2977  WRITE_BOOL_FIELD(pct_type);
2978  WRITE_NODE_FIELD(typmods);
2979  WRITE_INT_FIELD(typemod);
2980  WRITE_NODE_FIELD(arrayBounds);
2981  WRITE_LOCATION_FIELD(location);
2982 }
2983 
2984 static void
2986 {
2987  WRITE_NODE_TYPE("TYPECAST");
2988 
2990  WRITE_NODE_FIELD(typeName);
2991  WRITE_LOCATION_FIELD(location);
2992 }
2993 
2994 static void
2996 {
2997  WRITE_NODE_TYPE("COLLATECLAUSE");
2998 
3000  WRITE_NODE_FIELD(collname);
3001  WRITE_LOCATION_FIELD(location);
3002 }
3003 
3004 static void
3006 {
3007  WRITE_NODE_TYPE("INDEXELEM");
3008 
3010  WRITE_NODE_FIELD(expr);
3011  WRITE_STRING_FIELD(indexcolname);
3012  WRITE_NODE_FIELD(collation);
3013  WRITE_NODE_FIELD(opclass);
3014  WRITE_NODE_FIELD(opclassopts);
3015  WRITE_ENUM_FIELD(ordering, SortByDir);
3016  WRITE_ENUM_FIELD(nulls_ordering, SortByNulls);
3017 }
3018 
3019 static void
3021 {
3022  WRITE_NODE_TYPE("STATSELEM");
3023 
3025  WRITE_NODE_FIELD(expr);
3026 }
3027 
3028 static void
3030 {
3031  WRITE_NODE_TYPE("QUERY");
3032 
3033  WRITE_ENUM_FIELD(commandType, CmdType);
3034  WRITE_ENUM_FIELD(querySource, QuerySource);
3035  /* we intentionally do not print the queryId field */
3036  WRITE_BOOL_FIELD(canSetTag);
3037 
3038  /*
3039  * Hack to work around missing outfuncs routines for a lot of the
3040  * utility-statement node types. (The only one we actually *need* for
3041  * rules support is NotifyStmt.) Someday we ought to support 'em all, but
3042  * for the meantime do this to avoid getting lots of warnings when running
3043  * with debug_print_parse on.
3044  */
3045  if (node->utilityStmt)
3046  {
3047  switch (nodeTag(node->utilityStmt))
3048  {
3049  case T_CreateStmt:
3050  case T_IndexStmt:
3051  case T_NotifyStmt:
3052  case T_DeclareCursorStmt:
3053  WRITE_NODE_FIELD(utilityStmt);
3054  break;
3055  default:
3056  appendStringInfoString(str, " :utilityStmt ?");
3057  break;
3058  }
3059  }
3060  else
3061  appendStringInfoString(str, " :utilityStmt <>");
3062 
3063  WRITE_INT_FIELD(resultRelation);
3064  WRITE_BOOL_FIELD(hasAggs);
3065  WRITE_BOOL_FIELD(hasWindowFuncs);
3066  WRITE_BOOL_FIELD(hasTargetSRFs);
3067  WRITE_BOOL_FIELD(hasSubLinks);
3068  WRITE_BOOL_FIELD(hasDistinctOn);
3069  WRITE_BOOL_FIELD(hasRecursive);
3070  WRITE_BOOL_FIELD(hasModifyingCTE);
3071  WRITE_BOOL_FIELD(hasForUpdate);
3072  WRITE_BOOL_FIELD(hasRowSecurity);
3073  WRITE_BOOL_FIELD(isReturn);
3074  WRITE_NODE_FIELD(cteList);
3075  WRITE_NODE_FIELD(rtable);
3076  WRITE_NODE_FIELD(jointree);
3077  WRITE_NODE_FIELD(targetList);
3078  WRITE_ENUM_FIELD(override, OverridingKind);
3079  WRITE_NODE_FIELD(onConflict);
3080  WRITE_NODE_FIELD(returningList);
3081  WRITE_NODE_FIELD(groupClause);
3082  WRITE_BOOL_FIELD(groupDistinct);
3083  WRITE_NODE_FIELD(groupingSets);
3084  WRITE_NODE_FIELD(havingQual);
3085  WRITE_NODE_FIELD(windowClause);
3086  WRITE_NODE_FIELD(distinctClause);
3087  WRITE_NODE_FIELD(sortClause);
3088  WRITE_NODE_FIELD(limitOffset);
3089  WRITE_NODE_FIELD(limitCount);
3090  WRITE_ENUM_FIELD(limitOption, LimitOption);
3091  WRITE_NODE_FIELD(rowMarks);
3092  WRITE_NODE_FIELD(setOperations);
3093  WRITE_NODE_FIELD(constraintDeps);
3094  WRITE_NODE_FIELD(withCheckOptions);
3095  WRITE_LOCATION_FIELD(stmt_location);
3096  WRITE_INT_FIELD(stmt_len);
3097 }
3098 
3099 static void
3101 {
3102  WRITE_NODE_TYPE("WITHCHECKOPTION");
3103 
3104  WRITE_ENUM_FIELD(kind, WCOKind);
3106  WRITE_STRING_FIELD(polname);
3107  WRITE_NODE_FIELD(qual);
3108  WRITE_BOOL_FIELD(cascaded);
3109 }
3110 
3111 static void
3113 {
3114  WRITE_NODE_TYPE("SORTGROUPCLAUSE");
3115 
3116  WRITE_UINT_FIELD(tleSortGroupRef);
3117  WRITE_OID_FIELD(eqop);
3118  WRITE_OID_FIELD(sortop);
3119  WRITE_BOOL_FIELD(nulls_first);
3120  WRITE_BOOL_FIELD(hashable);
3121 }
3122 
3123 static void
3125 {
3126  WRITE_NODE_TYPE("GROUPINGSET");
3127 
3129  WRITE_NODE_FIELD(content);
3130  WRITE_LOCATION_FIELD(location);
3131 }
3132 
3133 static void
3135 {
3136  WRITE_NODE_TYPE("WINDOWCLAUSE");
3137 
3139  WRITE_STRING_FIELD(refname);
3140  WRITE_NODE_FIELD(partitionClause);
3141  WRITE_NODE_FIELD(orderClause);
3142  WRITE_INT_FIELD(frameOptions);
3143  WRITE_NODE_FIELD(startOffset);
3144  WRITE_NODE_FIELD(endOffset);
3145  WRITE_OID_FIELD(startInRangeFunc);
3146  WRITE_OID_FIELD(endInRangeFunc);
3147  WRITE_OID_FIELD(inRangeColl);
3148  WRITE_BOOL_FIELD(inRangeAsc);
3149  WRITE_BOOL_FIELD(inRangeNullsFirst);
3150  WRITE_UINT_FIELD(winref);
3151  WRITE_BOOL_FIELD(copiedOrder);
3152 }
3153 
3154 static void
3156 {
3157  WRITE_NODE_TYPE("ROWMARKCLAUSE");
3158 
3159  WRITE_UINT_FIELD(rti);
3161  WRITE_ENUM_FIELD(waitPolicy, LockWaitPolicy);
3162  WRITE_BOOL_FIELD(pushedDown);
3163 }
3164 
3165 static void
3167 {
3168  WRITE_NODE_TYPE("WITHCLAUSE");
3169 
3170  WRITE_NODE_FIELD(ctes);
3171  WRITE_BOOL_FIELD(recursive);
3172  WRITE_LOCATION_FIELD(location);
3173 }
3174 
3175 static void
3177 {
3178  WRITE_NODE_TYPE("CTESEARCHCLAUSE");
3179 
3180  WRITE_NODE_FIELD(search_col_list);
3181  WRITE_BOOL_FIELD(search_breadth_first);
3182  WRITE_STRING_FIELD(search_seq_column);
3183  WRITE_LOCATION_FIELD(location);
3184 }
3185 
3186 static void
3188 {
3189  WRITE_NODE_TYPE("CTECYCLECLAUSE");
3190 
3191  WRITE_NODE_FIELD(cycle_col_list);
3192  WRITE_STRING_FIELD(cycle_mark_column);
3193  WRITE_NODE_FIELD(cycle_mark_value);
3194  WRITE_NODE_FIELD(cycle_mark_default);
3195  WRITE_STRING_FIELD(cycle_path_column);
3196  WRITE_LOCATION_FIELD(location);
3197  WRITE_OID_FIELD(cycle_mark_type);
3198  WRITE_INT_FIELD(cycle_mark_typmod);
3199  WRITE_OID_FIELD(cycle_mark_collation);
3200  WRITE_OID_FIELD(cycle_mark_neop);
3201 }
3202 
3203 static void
3205 {
3206  WRITE_NODE_TYPE("COMMONTABLEEXPR");
3207 
3208  WRITE_STRING_FIELD(ctename);
3209  WRITE_NODE_FIELD(aliascolnames);
3210  WRITE_ENUM_FIELD(ctematerialized, CTEMaterialize);
3211  WRITE_NODE_FIELD(ctequery);
3212  WRITE_NODE_FIELD(search_clause);
3213  WRITE_NODE_FIELD(cycle_clause);
3214  WRITE_LOCATION_FIELD(location);
3215  WRITE_BOOL_FIELD(cterecursive);
3216  WRITE_INT_FIELD(cterefcount);
3217  WRITE_NODE_FIELD(ctecolnames);
3218  WRITE_NODE_FIELD(ctecoltypes);
3219  WRITE_NODE_FIELD(ctecoltypmods);
3220  WRITE_NODE_FIELD(ctecolcollations);
3221 }
3222 
3223 static void
3225 {
3226  WRITE_NODE_TYPE("SETOPERATIONSTMT");
3227 
3229  WRITE_BOOL_FIELD(all);
3230  WRITE_NODE_FIELD(larg);
3231  WRITE_NODE_FIELD(rarg);
3232  WRITE_NODE_FIELD(colTypes);
3233  WRITE_NODE_FIELD(colTypmods);
3234  WRITE_NODE_FIELD(colCollations);
3235  WRITE_NODE_FIELD(groupClauses);
3236 }
3237 
3238 static void
3240 {
3241  WRITE_NODE_TYPE("RANGETBLENTRY");
3242 
3243  /* put alias + eref first to make dump more legible */
3244  WRITE_NODE_FIELD(alias);
3245  WRITE_NODE_FIELD(eref);
3246  WRITE_ENUM_FIELD(rtekind, RTEKind);
3247 
3248  switch (node->rtekind)
3249  {
3250  case RTE_RELATION:
3251  WRITE_OID_FIELD(relid);
3252  WRITE_CHAR_FIELD(relkind);
3253  WRITE_INT_FIELD(rellockmode);
3254  WRITE_NODE_FIELD(tablesample);
3255  break;
3256  case RTE_SUBQUERY:
3257  WRITE_NODE_FIELD(subquery);
3258  WRITE_BOOL_FIELD(security_barrier);
3259  break;
3260  case RTE_JOIN:
3261  WRITE_ENUM_FIELD(jointype, JoinType);
3262  WRITE_INT_FIELD(joinmergedcols);
3263  WRITE_NODE_FIELD(joinaliasvars);
3264  WRITE_NODE_FIELD(joinleftcols);
3265  WRITE_NODE_FIELD(joinrightcols);
3266  WRITE_NODE_FIELD(join_using_alias);
3267  break;
3268  case RTE_FUNCTION:
3270  WRITE_BOOL_FIELD(funcordinality);
3271  break;
3272  case RTE_TABLEFUNC:
3273  WRITE_NODE_FIELD(tablefunc);
3274  break;
3275  case RTE_VALUES:
3276  WRITE_NODE_FIELD(values_lists);
3277  WRITE_NODE_FIELD(coltypes);
3278  WRITE_NODE_FIELD(coltypmods);
3279  WRITE_NODE_FIELD(colcollations);
3280  break;
3281  case RTE_CTE:
3282  WRITE_STRING_FIELD(ctename);
3283  WRITE_UINT_FIELD(ctelevelsup);
3284  WRITE_BOOL_FIELD(self_reference);
3285  WRITE_NODE_FIELD(coltypes);
3286  WRITE_NODE_FIELD(coltypmods);
3287  WRITE_NODE_FIELD(colcollations);
3288  break;
3289  case RTE_NAMEDTUPLESTORE:
3290  WRITE_STRING_FIELD(enrname);
3291  WRITE_FLOAT_FIELD(enrtuples, "%.0f");
3292  WRITE_OID_FIELD(relid);
3293  WRITE_NODE_FIELD(coltypes);
3294  WRITE_NODE_FIELD(coltypmods);
3295  WRITE_NODE_FIELD(colcollations);
3296  break;
3297  case RTE_RESULT:
3298  /* no extra fields */
3299  break;
3300  default:
3301  elog(ERROR, "unrecognized RTE kind: %d", (int) node->rtekind);
3302  break;
3303  }
3304 
3305  WRITE_BOOL_FIELD(lateral);
3306  WRITE_BOOL_FIELD(inh);
3307  WRITE_BOOL_FIELD(inFromCl);
3308  WRITE_UINT_FIELD(requiredPerms);
3309  WRITE_OID_FIELD(checkAsUser);
3310  WRITE_BITMAPSET_FIELD(selectedCols);
3311  WRITE_BITMAPSET_FIELD(insertedCols);
3312  WRITE_BITMAPSET_FIELD(updatedCols);
3313  WRITE_BITMAPSET_FIELD(extraUpdatedCols);
3314  WRITE_NODE_FIELD(securityQuals);
3315 }
3316 
3317 static void
3319 {
3320  WRITE_NODE_TYPE("RANGETBLFUNCTION");
3321 
3322  WRITE_NODE_FIELD(funcexpr);
3323  WRITE_INT_FIELD(funccolcount);
3324  WRITE_NODE_FIELD(funccolnames);
3325  WRITE_NODE_FIELD(funccoltypes);
3326  WRITE_NODE_FIELD(funccoltypmods);
3327  WRITE_NODE_FIELD(funccolcollations);
3328  WRITE_BITMAPSET_FIELD(funcparams);
3329 }
3330 
3331 static void
3333 {
3334  WRITE_NODE_TYPE("TABLESAMPLECLAUSE");
3335 
3336  WRITE_OID_FIELD(tsmhandler);
3338  WRITE_NODE_FIELD(repeatable);
3339 }
3340 
3341 static void
3343 {
3344  WRITE_NODE_TYPE("AEXPR");
3345 
3346  switch (node->kind)
3347  {
3348  case AEXPR_OP:
3349  appendStringInfoChar(str, ' ');
3351  break;
3352  case AEXPR_OP_ANY:
3353  appendStringInfoChar(str, ' ');
3355  appendStringInfoString(str, " ANY ");
3356  break;
3357  case AEXPR_OP_ALL:
3358  appendStringInfoChar(str, ' ');
3360  appendStringInfoString(str, " ALL ");
3361  break;
3362  case AEXPR_DISTINCT:
3363  appendStringInfoString(str, " DISTINCT ");
3365  break;
3366  case AEXPR_NOT_DISTINCT:
3367  appendStringInfoString(str, " NOT_DISTINCT ");
3369  break;
3370  case AEXPR_NULLIF:
3371  appendStringInfoString(str, " NULLIF ");
3373  break;
3374  case AEXPR_IN:
3375  appendStringInfoString(str, " IN ");
3377  break;
3378  case AEXPR_LIKE:
3379  appendStringInfoString(str, " LIKE ");
3381  break;
3382  case AEXPR_ILIKE:
3383  appendStringInfoString(str, " ILIKE ");
3385  break;
3386  case AEXPR_SIMILAR:
3387  appendStringInfoString(str, " SIMILAR ");
3389  break;
3390  case AEXPR_BETWEEN:
3391  appendStringInfoString(str, " BETWEEN ");
3393  break;
3394  case AEXPR_NOT_BETWEEN:
3395  appendStringInfoString(str, " NOT_BETWEEN ");
3397  break;
3398  case AEXPR_BETWEEN_SYM:
3399  appendStringInfoString(str, " BETWEEN_SYM ");
3401  break;
3402  case AEXPR_NOT_BETWEEN_SYM:
3403  appendStringInfoString(str, " NOT_BETWEEN_SYM ");
3405  break;
3406  default:
3407  appendStringInfoString(str, " ??");
3408  break;
3409  }
3410 
3411  WRITE_NODE_FIELD(lexpr);
3412  WRITE_NODE_FIELD(rexpr);
3413  WRITE_LOCATION_FIELD(location);
3414 }
3415 
3416 static void
3418 {
3419  appendStringInfo(str, "%d", node->val);
3420 }
3421 
3422 static void
3424 {
3425  /*
3426  * We assume the value is a valid numeric literal and so does not
3427  * need quoting.
3428  */
3429  appendStringInfoString(str, node->val);
3430 }
3431 
3432 static void
3434 {
3435  /*
3436  * We use outToken to provide escaping of the string's content,
3437  * but we don't want it to do anything with an empty string.
3438  */
3439  appendStringInfoChar(str, '"');
3440  if (node->val[0] != '\0')
3441  outToken(str, node->val);
3442  appendStringInfoChar(str, '"');
3443 }
3444 
3445 static void
3447 {
3448  /* internal representation already has leading 'b' */
3449  appendStringInfoString(str, node->val);
3450 }
3451 
3452 static void
3454 {
3455  WRITE_NODE_TYPE("COLUMNREF");
3456 
3457  WRITE_NODE_FIELD(fields);
3458  WRITE_LOCATION_FIELD(location);
3459 }
3460 
3461 static void
3463 {
3464  WRITE_NODE_TYPE("PARAMREF");
3465 
3466  WRITE_INT_FIELD(number);
3467  WRITE_LOCATION_FIELD(location);
3468 }
3469 
3470 /*
3471  * Node types found in raw parse trees (supported for debug purposes)
3472  */
3473 
3474 static void
3476 {
3477  WRITE_NODE_TYPE("RAWSTMT");
3478 
3479  WRITE_NODE_FIELD(stmt);
3480  WRITE_LOCATION_FIELD(stmt_location);
3481  WRITE_INT_FIELD(stmt_len);
3482 }
3483 
3484 static void
3486 {
3487  WRITE_NODE_TYPE("A_CONST");
3488 
3489  if (node->isnull)
3490  appendStringInfoString(str, "NULL");
3491  else
3492  {
3493  appendStringInfoString(str, " :val ");
3494  outNode(str, &node->val);
3495  }
3496  WRITE_LOCATION_FIELD(location);
3497 }
3498 
3499 static void
3501 {
3502  WRITE_NODE_TYPE("A_STAR");
3503 }
3504 
3505 static void
3507 {
3508  WRITE_NODE_TYPE("A_INDICES");
3509 
3510  WRITE_BOOL_FIELD(is_slice);
3511  WRITE_NODE_FIELD(lidx);
3512  WRITE_NODE_FIELD(uidx);
3513 }
3514 
3515 static void
3517 {
3518  WRITE_NODE_TYPE("A_INDIRECTION");
3519 
3521  WRITE_NODE_FIELD(indirection);
3522 }
3523 
3524 static void
3526 {
3527  WRITE_NODE_TYPE("A_ARRAYEXPR");
3528 
3529  WRITE_NODE_FIELD(elements);
3530  WRITE_LOCATION_FIELD(location);
3531 }
3532 
3533 static void
3535 {
3536  WRITE_NODE_TYPE("RESTARGET");
3537 
3539  WRITE_NODE_FIELD(indirection);
3541  WRITE_LOCATION_FIELD(location);
3542 }
3543 
3544 static void
3546 {
3547  WRITE_NODE_TYPE("MULTIASSIGNREF");
3548 
3550  WRITE_INT_FIELD(colno);
3551  WRITE_INT_FIELD(ncolumns);
3552 }
3553 
3554 static void
3556 {
3557  WRITE_NODE_TYPE("SORTBY");
3558 
3559  WRITE_NODE_FIELD(node);
3560  WRITE_ENUM_FIELD(sortby_dir, SortByDir);
3561  WRITE_ENUM_FIELD(sortby_nulls, SortByNulls);
3562  WRITE_NODE_FIELD(useOp);
3563  WRITE_LOCATION_FIELD(location);
3564 }
3565 
3566 static void
3568 {
3569  WRITE_NODE_TYPE("WINDOWDEF");
3570 
3572  WRITE_STRING_FIELD(refname);
3573  WRITE_NODE_FIELD(partitionClause);
3574  WRITE_NODE_FIELD(orderClause);
3575  WRITE_INT_FIELD(frameOptions);
3576  WRITE_NODE_FIELD(startOffset);
3577  WRITE_NODE_FIELD(endOffset);
3578  WRITE_LOCATION_FIELD(location);
3579 }
3580 
3581 static void
3583 {
3584  WRITE_NODE_TYPE("RANGESUBSELECT");
3585 
3586  WRITE_BOOL_FIELD(lateral);
3587  WRITE_NODE_FIELD(subquery);
3588  WRITE_NODE_FIELD(alias);
3589 }
3590 
3591 static void
3593 {
3594  WRITE_NODE_TYPE("RANGEFUNCTION");
3595 
3596  WRITE_BOOL_FIELD(lateral);
3597  WRITE_BOOL_FIELD(ordinality);
3598  WRITE_BOOL_FIELD(is_rowsfrom);
3600  WRITE_NODE_FIELD(alias);
3601  WRITE_NODE_FIELD(coldeflist);
3602 }
3603 
3604 static void
3606 {
3607  WRITE_NODE_TYPE("RANGETABLESAMPLE");
3608 
3609  WRITE_NODE_FIELD(relation);
3610  WRITE_NODE_FIELD(method);
3612  WRITE_NODE_FIELD(repeatable);
3613  WRITE_LOCATION_FIELD(location);
3614 }
3615 
3616 static void
3618 {
3619  WRITE_NODE_TYPE("RANGETABLEFUNC");
3620 
3621  WRITE_BOOL_FIELD(lateral);
3622  WRITE_NODE_FIELD(docexpr);
3623  WRITE_NODE_FIELD(rowexpr);
3624  WRITE_NODE_FIELD(namespaces);
3625  WRITE_NODE_FIELD(columns);
3626  WRITE_NODE_FIELD(alias);
3627  WRITE_LOCATION_FIELD(location);
3628 }
3629 
3630 static void
3632 {
3633  WRITE_NODE_TYPE("RANGETABLEFUNCCOL");
3634 
3635  WRITE_STRING_FIELD(colname);
3636  WRITE_NODE_FIELD(typeName);
3637  WRITE_BOOL_FIELD(for_ordinality);
3638  WRITE_BOOL_FIELD(is_not_null);
3639  WRITE_NODE_FIELD(colexpr);
3640  WRITE_NODE_FIELD(coldefexpr);
3641  WRITE_LOCATION_FIELD(location);
3642 }
3643 
3644 static void
3646 {
3647  WRITE_NODE_TYPE("CONSTRAINT");
3648 
3649  WRITE_STRING_FIELD(conname);
3650  WRITE_BOOL_FIELD(deferrable);
3651  WRITE_BOOL_FIELD(initdeferred);
3652  WRITE_LOCATION_FIELD(location);
3653 
3654  appendStringInfoString(str, " :contype ");
3655  switch (node->contype)
3656  {
3657  case CONSTR_NULL:
3658  appendStringInfoString(str, "NULL");
3659  break;
3660 
3661  case CONSTR_NOTNULL:
3662  appendStringInfoString(str, "NOT_NULL");
3663  break;
3664 
3665  case CONSTR_DEFAULT:
3666  appendStringInfoString(str, "DEFAULT");
3667  WRITE_NODE_FIELD(raw_expr);
3668  WRITE_STRING_FIELD(cooked_expr);
3669  break;
3670 
3671  case CONSTR_IDENTITY:
3672  appendStringInfoString(str, "IDENTITY");
3673  WRITE_NODE_FIELD(raw_expr);
3674  WRITE_STRING_FIELD(cooked_expr);
3675  WRITE_CHAR_FIELD(generated_when);
3676  break;
3677 
3678  case CONSTR_GENERATED:
3679  appendStringInfoString(str, "GENERATED");
3680  WRITE_NODE_FIELD(raw_expr);
3681  WRITE_STRING_FIELD(cooked_expr);
3682  WRITE_CHAR_FIELD(generated_when);
3683  break;
3684 
3685  case CONSTR_CHECK:
3686  appendStringInfoString(str, "CHECK");
3687  WRITE_BOOL_FIELD(is_no_inherit);
3688  WRITE_NODE_FIELD(raw_expr);
3689  WRITE_STRING_FIELD(cooked_expr);
3690  break;
3691 
3692  case CONSTR_PRIMARY:
3693  appendStringInfoString(str, "PRIMARY_KEY");
3694  WRITE_NODE_FIELD(keys);
3695  WRITE_NODE_FIELD(including);
3697  WRITE_STRING_FIELD(indexname);
3698  WRITE_STRING_FIELD(indexspace);
3699  WRITE_BOOL_FIELD(reset_default_tblspc);
3700  /* access_method and where_clause not currently used */
3701  break;
3702 
3703  case CONSTR_UNIQUE:
3704  appendStringInfoString(str, "UNIQUE");
3705  WRITE_NODE_FIELD(keys);
3706  WRITE_NODE_FIELD(including);
3708  WRITE_STRING_FIELD(indexname);
3709  WRITE_STRING_FIELD(indexspace);
3710  WRITE_BOOL_FIELD(reset_default_tblspc);
3711  /* access_method and where_clause not currently used */
3712  break;
3713 
3714  case CONSTR_EXCLUSION:
3715  appendStringInfoString(str, "EXCLUSION");
3716  WRITE_NODE_FIELD(exclusions);
3717  WRITE_NODE_FIELD(including);
3719  WRITE_STRING_FIELD(indexname);
3720  WRITE_STRING_FIELD(indexspace);
3721  WRITE_BOOL_FIELD(reset_default_tblspc);
3722  WRITE_STRING_FIELD(access_method);
3723  WRITE_NODE_FIELD(where_clause);
3724  break;
3725 
3726  case CONSTR_FOREIGN:
3727  appendStringInfoString(str, "FOREIGN_KEY");
3728  WRITE_NODE_FIELD(pktable);
3729  WRITE_NODE_FIELD(fk_attrs);
3730  WRITE_NODE_FIELD(pk_attrs);
3731  WRITE_CHAR_FIELD(fk_matchtype);
3732  WRITE_CHAR_FIELD(fk_upd_action);
3733  WRITE_CHAR_FIELD(fk_del_action);
3734  WRITE_NODE_FIELD(old_conpfeqop);
3735  WRITE_OID_FIELD(old_pktable_oid);
3736  WRITE_BOOL_FIELD(skip_validation);
3737  WRITE_BOOL_FIELD(initially_valid);
3738  break;
3739 
3741  appendStringInfoString(str, "ATTR_DEFERRABLE");
3742  break;
3743 
3745  appendStringInfoString(str, "ATTR_NOT_DEFERRABLE");
3746  break;
3747 
3748  case CONSTR_ATTR_DEFERRED:
3749  appendStringInfoString(str, "ATTR_DEFERRED");
3750  break;
3751 
3752  case CONSTR_ATTR_IMMEDIATE:
3753  appendStringInfoString(str, "ATTR_IMMEDIATE");
3754  break;
3755 
3756  default:
3757  appendStringInfo(str, "<unrecognized_constraint %d>",
3758  (int) node->contype);
3759  break;
3760  }
3761 }
3762 
3763 static void
3765 {
3766  WRITE_NODE_TYPE("FOREIGNKEYCACHEINFO");
3767 
3768  WRITE_OID_FIELD(conoid);
3769  WRITE_OID_FIELD(conrelid);
3770  WRITE_OID_FIELD(confrelid);
3771  WRITE_INT_FIELD(nkeys);
3772  WRITE_ATTRNUMBER_ARRAY(conkey, node->nkeys);
3773  WRITE_ATTRNUMBER_ARRAY(confkey, node->nkeys);
3774  WRITE_OID_ARRAY(conpfeqop, node->nkeys);
3775 }
3776 
3777 static void
3779 {
3780  WRITE_NODE_TYPE("PARTITIONELEM");
3781 
3783  WRITE_NODE_FIELD(expr);
3784  WRITE_NODE_FIELD(collation);
3785  WRITE_NODE_FIELD(opclass);
3786  WRITE_LOCATION_FIELD(location);
3787 }
3788 
3789 static void
3791 {
3792  WRITE_NODE_TYPE("PARTITIONSPEC");
3793 
3794  WRITE_STRING_FIELD(strategy);
3795  WRITE_NODE_FIELD(partParams);
3796  WRITE_LOCATION_FIELD(location);
3797 }
3798 
3799 static void
3801 {
3802  WRITE_NODE_TYPE("PARTITIONBOUNDSPEC");
3803 
3804  WRITE_CHAR_FIELD(strategy);
3805  WRITE_BOOL_FIELD(is_default);
3806  WRITE_INT_FIELD(modulus);
3807  WRITE_INT_FIELD(remainder);
3808  WRITE_NODE_FIELD(listdatums);
3809  WRITE_NODE_FIELD(lowerdatums);
3810  WRITE_NODE_FIELD(upperdatums);
3811  WRITE_LOCATION_FIELD(location);
3812 }
3813 
3814 static void
3816 {
3817  WRITE_NODE_TYPE("PARTITIONRANGEDATUM");
3818 
3821  WRITE_LOCATION_FIELD(location);
3822 }
3823 
3824 /*
3825  * outNode -
3826  * converts a Node into ascii string and append it to 'str'
3827  */
3828 void
3829 outNode(StringInfo str, const void *obj)
3830 {
3831  /* Guard against stack overflow due to overly complex expressions */
3833 
3834  if (obj == NULL)
3835  appendStringInfoString(str, "<>");
3836  else if (IsA(obj, List) || IsA(obj, IntList) || IsA(obj, OidList))
3837  _outList(str, obj);
3838  /* nodeRead does not want to see { } around these! */
3839  else if (IsA(obj, Integer))
3840  _outInteger(str, (Integer *) obj);
3841  else if (IsA(obj, Float))
3842  _outFloat(str, (Float *) obj);
3843  else if (IsA(obj, String))
3844  _outString(str, (String *) obj);
3845  else if (IsA(obj, BitString))
3846  _outBitString(str, (BitString *) obj);
3847  else
3848  {
3849  appendStringInfoChar(str, '{');
3850  switch (nodeTag(obj))
3851  {
3852  case T_PlannedStmt:
3853  _outPlannedStmt(str, obj);
3854  break;
3855  case T_Plan:
3856  _outPlan(str, obj);
3857  break;
3858  case T_Result:
3859  _outResult(str, obj);
3860  break;
3861  case T_ProjectSet:
3862  _outProjectSet(str, obj);
3863  break;
3864  case T_ModifyTable:
3865  _outModifyTable(str, obj);
3866  break;
3867  case T_Append:
3868  _outAppend(str, obj);
3869  break;
3870  case T_MergeAppend:
3871  _outMergeAppend(str, obj);
3872  break;
3873  case T_RecursiveUnion:
3874  _outRecursiveUnion(str, obj);
3875  break;
3876  case T_BitmapAnd:
3877  _outBitmapAnd(str, obj);
3878  break;
3879  case T_BitmapOr:
3880  _outBitmapOr(str, obj);
3881  break;
3882  case T_Gather:
3883  _outGather(str, obj);
3884  break;
3885  case T_GatherMerge:
3886  _outGatherMerge(str, obj);
3887  break;
3888  case T_Scan:
3889  _outScan(str, obj);
3890  break;
3891  case T_SeqScan:
3892  _outSeqScan(str, obj);
3893  break;
3894  case T_SampleScan:
3895  _outSampleScan(str, obj);
3896  break;
3897  case T_IndexScan:
3898  _outIndexScan(str, obj);
3899  break;
3900  case T_IndexOnlyScan:
3901  _outIndexOnlyScan(str, obj);
3902  break;
3903  case T_BitmapIndexScan:
3904  _outBitmapIndexScan(str, obj);
3905  break;
3906  case T_BitmapHeapScan:
3907  _outBitmapHeapScan(str, obj);
3908  break;
3909  case T_TidScan:
3910  _outTidScan(str, obj);
3911  break;
3912  case T_TidRangeScan:
3913  _outTidRangeScan(str, obj);
3914  break;
3915  case T_SubqueryScan:
3916  _outSubqueryScan(str, obj);
3917  break;
3918  case T_FunctionScan:
3919  _outFunctionScan(str, obj);
3920  break;
3921  case T_TableFuncScan:
3922  _outTableFuncScan(str, obj);
3923  break;
3924  case T_ValuesScan:
3925  _outValuesScan(str, obj);
3926  break;
3927  case T_CteScan:
3928  _outCteScan(str, obj);
3929  break;
3930  case T_NamedTuplestoreScan:
3931  _outNamedTuplestoreScan(str, obj);
3932  break;
3933  case T_WorkTableScan:
3934  _outWorkTableScan(str, obj);
3935  break;
3936  case T_ForeignScan:
3937  _outForeignScan(str, obj);
3938  break;
3939  case T_CustomScan:
3940  _outCustomScan(str, obj);
3941  break;
3942  case T_Join:
3943  _outJoin(str, obj);
3944  break;
3945  case T_NestLoop:
3946  _outNestLoop(str, obj);
3947  break;
3948  case T_MergeJoin:
3949  _outMergeJoin(str, obj);
3950  break;
3951  case T_HashJoin:
3952  _outHashJoin(str, obj);
3953  break;
3954  case T_Agg:
3955  _outAgg(str, obj);
3956  break;
3957  case T_WindowAgg:
3958  _outWindowAgg(str, obj);
3959  break;
3960  case T_Group:
3961  _outGroup(str, obj);
3962  break;
3963  case T_Material:
3964  _outMaterial(str, obj);
3965  break;
3966  case T_Memoize:
3967  _outMemoize(str, obj);
3968  break;
3969  case T_Sort:
3970  _outSort(str, obj);
3971  break;
3972  case T_IncrementalSort:
3973  _outIncrementalSort(str, obj);
3974  break;
3975  case T_Unique:
3976  _outUnique(str, obj);
3977  break;
3978  case T_Hash:
3979  _outHash(str, obj);
3980  break;
3981  case T_SetOp:
3982  _outSetOp(str, obj);
3983  break;
3984  case T_LockRows:
3985  _outLockRows(str, obj);
3986  break;
3987  case T_Limit:
3988  _outLimit(str, obj);
3989  break;
3990  case T_NestLoopParam:
3991  _outNestLoopParam(str, obj);
3992  break;
3993  case T_PlanRowMark:
3994  _outPlanRowMark(str, obj);
3995  break;
3996  case T_PartitionPruneInfo:
3997  _outPartitionPruneInfo(str, obj);
3998  break;
4000  _outPartitionedRelPruneInfo(str, obj);
4001  break;
4003  _outPartitionPruneStepOp(str, obj);
4004  break;
4007  break;
4008  case T_PlanInvalItem:
4009  _outPlanInvalItem(str, obj);
4010  break;
4011  case T_Alias:
4012  _outAlias(str, obj);
4013  break;
4014  case T_RangeVar:
4015  _outRangeVar(str, obj);
4016  break;
4017  case T_TableFunc:
4018  _outTableFunc(str, obj);
4019  break;
4020  case T_IntoClause:
4021  _outIntoClause(str, obj);
4022  break;
4023  case T_Var:
4024  _outVar(str, obj);
4025  break;
4026  case T_Const:
4027  _outConst(str, obj);
4028  break;
4029  case T_Param:
4030  _outParam(str, obj);
4031  break;
4032  case T_Aggref:
4033  _outAggref(str, obj);
4034  break;
4035  case T_GroupingFunc:
4036  _outGroupingFunc(str, obj);
4037  break;
4038  case T_WindowFunc:
4039  _outWindowFunc(str, obj);
4040  break;
4041  case T_SubscriptingRef:
4042  _outSubscriptingRef(str, obj);
4043  break;
4044  case T_FuncExpr:
4045  _outFuncExpr(str, obj);
4046  break;
4047  case T_NamedArgExpr:
4048  _outNamedArgExpr(str, obj);
4049  break;
4050  case T_OpExpr:
4051  _outOpExpr(str, obj);
4052  break;
4053  case T_DistinctExpr:
4054  _outDistinctExpr(str, obj);
4055  break;
4056  case T_NullIfExpr:
4057  _outNullIfExpr(str, obj);
4058  break;
4059  case T_ScalarArrayOpExpr:
4060  _outScalarArrayOpExpr(str, obj);
4061  break;
4062  case T_BoolExpr:
4063  _outBoolExpr(str, obj);
4064  break;
4065  case T_SubLink:
4066  _outSubLink(str, obj);
4067  break;
4068  case T_SubPlan:
4069  _outSubPlan(str, obj);
4070  break;
4071  case T_AlternativeSubPlan:
4072  _outAlternativeSubPlan(str, obj);
4073  break;
4074  case T_FieldSelect:
4075  _outFieldSelect(str, obj);
4076  break;
4077  case T_FieldStore:
4078  _outFieldStore(str, obj);
4079  break;
4080  case T_RelabelType:
4081  _outRelabelType(str, obj);
4082  break;
4083  case T_CoerceViaIO:
4084  _outCoerceViaIO(str, obj);
4085  break;
4086  case T_ArrayCoerceExpr:
4087  _outArrayCoerceExpr(str, obj);
4088  break;
4089  case T_ConvertRowtypeExpr:
4090  _outConvertRowtypeExpr(str, obj);
4091  break;
4092  case T_CollateExpr:
4093  _outCollateExpr(str, obj);
4094  break;
4095  case T_CaseExpr:
4096  _outCaseExpr(str, obj);
4097  break;
4098  case T_CaseWhen:
4099  _outCaseWhen(str, obj);
4100  break;
4101  case T_CaseTestExpr:
4102  _outCaseTestExpr(str, obj);
4103  break;
4104  case T_ArrayExpr:
4105  _outArrayExpr(str, obj);
4106  break;
4107  case T_RowExpr:
4108  _outRowExpr(str, obj);
4109  break;
4110  case T_RowCompareExpr:
4111  _outRowCompareExpr(str, obj);
4112  break;
4113  case T_CoalesceExpr:
4114  _outCoalesceExpr(str, obj);
4115  break;
4116  case T_MinMaxExpr:
4117  _outMinMaxExpr(str, obj);
4118  break;
4119  case T_SQLValueFunction:
4120  _outSQLValueFunction(str, obj);
4121  break;
4122  case T_XmlExpr:
4123  _outXmlExpr(str, obj);
4124  break;
4125  case T_NullTest:
4126  _outNullTest(str, obj);
4127  break;
4128  case T_BooleanTest:
4129  _outBooleanTest(str, obj);
4130  break;
4131  case T_CoerceToDomain:
4132  _outCoerceToDomain(str, obj);
4133  break;
4134  case T_CoerceToDomainValue:
4135  _outCoerceToDomainValue(str, obj);
4136  break;
4137  case T_SetToDefault:
4138  _outSetToDefault(str, obj);
4139  break;
4140  case T_CurrentOfExpr:
4141  _outCurrentOfExpr(str, obj);
4142  break;
4143  case T_NextValueExpr:
4144  _outNextValueExpr(str, obj);
4145  break;
4146  case T_InferenceElem:
4147  _outInferenceElem(str, obj);
4148  break;
4149  case T_TargetEntry:
4150  _outTargetEntry(str, obj);
4151  break;
4152  case T_RangeTblRef:
4153  _outRangeTblRef(str, obj);
4154  break;
4155  case T_JoinExpr:
4156  _outJoinExpr(str, obj);
4157  break;
4158  case T_FromExpr:
4159  _outFromExpr(str, obj);
4160  break;
4161  case T_OnConflictExpr:
4162  _outOnConflictExpr(str, obj);
4163  break;
4164  case T_Path:
4165  _outPath(str, obj);
4166  break;
4167  case T_IndexPath:
4168  _outIndexPath(str, obj);
4169  break;
4170  case T_BitmapHeapPath:
4171  _outBitmapHeapPath(str, obj);
4172  break;
4173  case T_BitmapAndPath:
4174  _outBitmapAndPath(str, obj);
4175  break;
4176  case T_BitmapOrPath:
4177  _outBitmapOrPath(str, obj);
4178  break;
4179  case T_TidPath:
4180  _outTidPath(str, obj);
4181  break;
4182  case T_TidRangePath:
4183  _outTidRangePath(str, obj);
4184  break;
4185  case T_SubqueryScanPath:
4186  _outSubqueryScanPath(str, obj);
4187  break;
4188  case T_ForeignPath:
4189  _outForeignPath(str, obj);
4190  break;
4191  case T_CustomPath:
4192  _outCustomPath(str, obj);
4193  break;
4194  case T_AppendPath:
4195  _outAppendPath(str, obj);
4196  break;
4197  case T_MergeAppendPath:
4198  _outMergeAppendPath(str, obj);
4199  break;
4200  case T_GroupResultPath:
4201  _outGroupResultPath(str, obj);
4202  break;
4203  case T_MaterialPath:
4204  _outMaterialPath(str, obj);
4205  break;
4206  case T_MemoizePath:
4207  _outMemoizePath(str, obj);
4208  break;
4209  case T_UniquePath:
4210  _outUniquePath(str, obj);
4211  break;
4212  case T_GatherPath:
4213  _outGatherPath(str, obj);
4214  break;
4215  case T_ProjectionPath:
4216  _outProjectionPath(str, obj);
4217  break;
4218  case T_ProjectSetPath:
4219  _outProjectSetPath(str, obj);
4220  break;
4221  case T_SortPath:
4222  _outSortPath(str, obj);
4223  break;
4224  case T_IncrementalSortPath:
4225  _outIncrementalSortPath(str, obj);
4226  break;
4227  case T_GroupPath:
4228  _outGroupPath(str, obj);
4229  break;
4230  case T_UpperUniquePath:
4231  _outUpperUniquePath(str, obj);
4232  break;
4233  case T_AggPath:
4234  _outAggPath(str, obj);
4235  break;
4236  case T_GroupingSetsPath:
4237  _outGroupingSetsPath(str, obj);
4238  break;
4239  case T_MinMaxAggPath:
4240  _outMinMaxAggPath(str, obj);
4241  break;
4242  case T_WindowAggPath:
4243  _outWindowAggPath(str, obj);
4244  break;
4245  case T_SetOpPath:
4246  _outSetOpPath(str, obj);
4247  break;
4248  case T_RecursiveUnionPath:
4249  _outRecursiveUnionPath(str, obj);
4250  break;
4251  case T_LockRowsPath:
4252  _outLockRowsPath(str, obj);
4253  break;
4254  case T_ModifyTablePath:
4255  _outModifyTablePath(str, obj);
4256  break;
4257  case T_LimitPath:
4258  _outLimitPath(str, obj);
4259  break;
4260  case T_GatherMergePath:
4261  _outGatherMergePath(str, obj);
4262  break;
4263  case T_NestPath:
4264  _outNestPath(str, obj);
4265  break;
4266  case T_MergePath:
4267  _outMergePath(str, obj);
4268  break;
4269  case T_HashPath:
4270  _outHashPath(str, obj);
4271  break;
4272  case T_PlannerGlobal:
4273  _outPlannerGlobal(str, obj);
4274  break;
4275  case T_PlannerInfo:
4276  _outPlannerInfo(str, obj);
4277  break;
4278  case T_RelOptInfo:
4279  _outRelOptInfo(str, obj);
4280  break;
4281  case T_IndexOptInfo:
4282  _outIndexOptInfo(str, obj);
4283  break;
4284  case T_ForeignKeyOptInfo:
4285  _outForeignKeyOptInfo(str, obj);
4286  break;
4287  case T_EquivalenceClass:
4288  _outEquivalenceClass(str, obj);
4289  break;
4290  case T_EquivalenceMember:
4291  _outEquivalenceMember(str, obj);
4292  break;
4293  case T_PathKey:
4294  _outPathKey(str, obj);
4295  break;
4296  case T_PathTarget:
4297  _outPathTarget(str, obj);
4298  break;
4299  case T_ParamPathInfo:
4300  _outParamPathInfo(str, obj);
4301  break;
4302  case T_RestrictInfo:
4303  _outRestrictInfo(str, obj);
4304  break;
4305  case T_IndexClause:
4306  _outIndexClause(str, obj);
4307  break;
4308  case T_PlaceHolderVar:
4309  _outPlaceHolderVar(str, obj);
4310  break;
4311  case T_SpecialJoinInfo:
4312  _outSpecialJoinInfo(str, obj);
4313  break;
4314  case T_AppendRelInfo:
4315  _outAppendRelInfo(str, obj);
4316  break;
4317  case T_RowIdentityVarInfo:
4318  _outRowIdentityVarInfo(str, obj);
4319  break;
4320  case T_PlaceHolderInfo:
4321  _outPlaceHolderInfo(str, obj);
4322  break;
4323  case T_MinMaxAggInfo:
4324  _outMinMaxAggInfo(str, obj);
4325  break;
4326  case T_PlannerParamItem:
4327  _outPlannerParamItem(str, obj);
4328  break;
4329  case T_RollupData:
4330  _outRollupData(str, obj);
4331  break;
4332  case T_GroupingSetData:
4333  _outGroupingSetData(str, obj);
4334  break;
4335  case T_StatisticExtInfo:
4336  _outStatisticExtInfo(str, obj);
4337  break;
4338  case T_ExtensibleNode:
4339  _outExtensibleNode(str, obj);
4340  break;
4341  case T_CreateStmt:
4342  _outCreateStmt(str, obj);
4343  break;
4345  _outCreateForeignTableStmt(str, obj);
4346  break;
4348  _outImportForeignSchemaStmt(str, obj);
4349  break;
4350  case T_IndexStmt:
4351  _outIndexStmt(str, obj);
4352  break;
4353  case T_CreateStatsStmt:
4354  _outCreateStatsStmt(str, obj);
4355  break;
4356  case T_AlterStatsStmt:
4357  _outAlterStatsStmt(str, obj);
4358  break;
4359  case T_NotifyStmt:
4360  _outNotifyStmt(str, obj);
4361  break;
4362  case T_DeclareCursorStmt:
4363  _outDeclareCursorStmt(str, obj);
4364  break;
4365  case T_SelectStmt:
4366  _outSelectStmt(str, obj);
4367  break;
4368  case T_ReturnStmt:
4369  _outReturnStmt(str, obj);
4370  break;
4371  case T_PLAssignStmt:
4372  _outPLAssignStmt(str, obj);
4373  break;
4374  case T_ColumnDef:
4375  _outColumnDef(str, obj);
4376  break;
4377  case T_TypeName:
4378  _outTypeName(str, obj);
4379  break;
4380  case T_TypeCast:
4381  _outTypeCast(str, obj);
4382  break;
4383  case T_CollateClause:
4384  _outCollateClause(str, obj);
4385  break;
4386  case T_IndexElem:
4387  _outIndexElem(str, obj);
4388  break;
4389  case T_StatsElem:
4390  _outStatsElem(str, obj);
4391  break;
4392  case T_Query:
4393  _outQuery(str, obj);
4394  break;
4395  case T_WithCheckOption:
4396  _outWithCheckOption(str, obj);
4397  break;
4398  case T_SortGroupClause:
4399  _outSortGroupClause(str, obj);
4400  break;
4401  case T_GroupingSet:
4402  _outGroupingSet(str, obj);
4403  break;
4404  case T_WindowClause:
4405  _outWindowClause(str, obj);
4406  break;
4407  case T_RowMarkClause:
4408  _outRowMarkClause(str, obj);
4409  break;
4410  case T_WithClause:
4411  _outWithClause(str, obj);
4412  break;
4413  case T_CTESearchClause:
4414  _outCTESearchClause(str, obj);
4415  break;
4416  case T_CTECycleClause:
4417  _outCTECycleClause(str, obj);
4418  break;
4419  case T_CommonTableExpr:
4420  _outCommonTableExpr(str, obj);
4421  break;
4422  case T_SetOperationStmt:
4423  _outSetOperationStmt(str, obj);
4424  break;
4425  case T_RangeTblEntry:
4426  _outRangeTblEntry(str, obj);
4427  break;
4428  case T_RangeTblFunction:
4429  _outRangeTblFunction(str, obj);
4430  break;
4431  case T_TableSampleClause:
4432  _outTableSampleClause(str, obj);
4433  break;
4434  case T_A_Expr:
4435  _outA_Expr(str, obj);
4436  break;
4437  case T_ColumnRef:
4438  _outColumnRef(str, obj);
4439  break;
4440  case T_ParamRef:
4441  _outParamRef(str, obj);
4442  break;
4443  case T_RawStmt:
4444  _outRawStmt(str, obj);
4445  break;
4446  case T_A_Const:
4447  _outA_Const(str, obj);
4448  break;
4449  case T_A_Star:
4450  _outA_Star(str, obj);
4451  break;
4452  case T_A_Indices:
4453  _outA_Indices(str, obj);
4454  break;
4455  case T_A_Indirection:
4456  _outA_Indirection(str, obj);
4457  break;
4458  case T_A_ArrayExpr:
4459  _outA_ArrayExpr(str, obj);
4460  break;
4461  case T_ResTarget:
4462  _outResTarget(str, obj);
4463  break;
4464  case T_MultiAssignRef:
4465  _outMultiAssignRef(str, obj);
4466  break;
4467  case T_SortBy:
4468  _outSortBy(str, obj);
4469  break;
4470  case T_WindowDef:
4471  _outWindowDef(str, obj);
4472  break;
4473  case T_RangeSubselect:
4474  _outRangeSubselect(str, obj);
4475  break;
4476  case T_RangeFunction:
4477  _outRangeFunction(str, obj);
4478  break;
4479  case T_RangeTableSample:
4480  _outRangeTableSample(str, obj);
4481  break;
4482  case T_RangeTableFunc:
4483  _outRangeTableFunc(str, obj);
4484  break;
4485  case T_RangeTableFuncCol:
4486  _outRangeTableFuncCol(str, obj);
4487  break;
4488  case T_Constraint:
4489  _outConstraint(str, obj);
4490  break;
4491  case T_FuncCall:
4492  _outFuncCall(str, obj);
4493  break;
4494  case T_DefElem:
4495  _outDefElem(str, obj);
4496  break;
4497  case T_TableLikeClause:
4498  _outTableLikeClause(str, obj);
4499  break;
4500  case T_LockingClause:
4501  _outLockingClause(str, obj);
4502  break;
4503  case T_XmlSerialize:
4504  _outXmlSerialize(str, obj);
4505  break;
4506  case T_ForeignKeyCacheInfo:
4507  _outForeignKeyCacheInfo(str, obj);
4508  break;
4509  case T_TriggerTransition:
4510  _outTriggerTransition(str, obj);
4511  break;
4512  case T_PartitionElem:
4513  _outPartitionElem(str, obj);
4514  break;
4515  case T_PartitionSpec:
4516  _outPartitionSpec(str, obj);
4517  break;
4518  case T_PartitionBoundSpec:
4519  _outPartitionBoundSpec(str, obj);
4520  break;
4521  case T_PartitionRangeDatum:
4522  _outPartitionRangeDatum(str, obj);
4523  break;
4524 
4525  default:
4526 
4527  /*
4528  * This should be an ERROR, but it's too useful to be able to
4529  * dump structures that outNode only understands part of.
4530  */
4531  elog(WARNING, "could not dump unrecognized node type: %d",
4532  (int) nodeTag(obj));
4533  break;
4534  }
4535  appendStringInfoChar(str, '}');
4536  }
4537 }
4538 
4539 /*
4540  * nodeToString -
4541  * returns the ascii representation of the Node as a palloc'd string
4542  */
4543 char *
4544 nodeToString(const void *obj)
4545 {
4547 
4548  /* see stringinfo.h for an explanation of this maneuver */
4549  initStringInfo(&str);
4550  outNode(&str, obj);
4551  return str.data;
4552 }
4553 
4554 /*
4555  * bmsToString -
4556  * returns the ascii representation of the Bitmapset as a palloc'd string
4557  */
4558 char *
4560 {
4562 
4563  /* see stringinfo.h for an explanation of this maneuver */
4564  initStringInfo(&str);
4565  outBitmapset(&str, bms);
4566  return str.data;
4567 }
Datum constvalue
Definition: primnodes.h:219
static void _outRangeTableFunc(StringInfo str, const RangeTableFunc *node)
Definition: outfuncs.c:3617
static void _outA_Indices(StringInfo str, const A_Indices *node)
Definition: outfuncs.c:3506
static void _outPlaceHolderInfo(StringInfo str, const PlaceHolderInfo *node)
Definition: outfuncs.c:2639
SortByDir
Definition: parsenodes.h:50
static void _outCaseExpr(StringInfo str, const CaseExpr *node)
Definition: outfuncs.c:1483
static void _outSpecialJoinInfo(StringInfo str, const SpecialJoinInfo *node)
Definition: outfuncs.c:2595
static void _outAppend(StringInfo str, const Append *node)
Definition: outfuncs.c:435
static void _outPartitionedRelPruneInfo(StringInfo str, const PartitionedRelPruneInfo *node)
Definition: outfuncs.c:1008
static void _outWindowAgg(StringInfo str, const WindowAgg *node)
Definition: outfuncs.c:811
Definition: nodes.h:81
static void _outProjectionPath(StringInfo str, const ProjectionPath *node)
Definition: outfuncs.c:1999
#define IsA(nodeptr, _type_)
Definition: nodes.h:587
static void _outRowExpr(StringInfo str, const RowExpr *node)
Definition: outfuncs.c:1529
PathTarget * pathtarget
Definition: pathnodes.h:1183
PartitionPruneCombineOp
Definition: plannodes.h:1263
static void _outRangeSubselect(StringInfo str, const RangeSubselect *node)
Definition: outfuncs.c:3582
static void _outRowIdentityVarInfo(StringInfo str, const RowIdentityVarInfo *node)
Definition: outfuncs.c:2628
static void _outParam(StringInfo str, const Param *node)
Definition: outfuncs.c:1158
static void _outScalarArrayOpExpr(StringInfo str, const ScalarArrayOpExpr *node)
Definition: outfuncs.c:1314
static void _outCommonTableExpr(StringInfo str, const CommonTableExpr *node)
Definition: outfuncs.c:3204
#define WRITE_INT_FIELD(fldname)
Definition: outfuncs.c:55
static void _outForeignPath(StringInfo str, const ForeignPath *node)
Definition: outfuncs.c:1891
static void _outBitmapAnd(StringInfo str, const BitmapAnd *node)
Definition: outfuncs.c:481
VolatileFunctionStatus
Definition: pathnodes.h:1077
static void _outGatherMergePath(StringInfo str, const GatherMergePath *node)
Definition: outfuncs.c:2220
static void _outTableFunc(StringInfo str, const TableFunc *node)
Definition: outfuncs.c:1087
Definition: nodes.h:83
static void _outIndexStmt(StringInfo str, const IndexStmt *node)
Definition: outfuncs.c:2754
ParamKind
Definition: primnodes.h:256
A_Expr_Kind kind
Definition: parsenodes.h:285
bool constbyval
Definition: primnodes.h:222
static void _outTargetEntry(StringInfo str, const TargetEntry *node)
Definition: outfuncs.c:1690
Definition: nodes.h:54
#define WRITE_LOCATION_FIELD(fldname)
Definition: outfuncs.c:100
static void _outMemoizePath(StringInfo str, const MemoizePath *node)
Definition: outfuncs.c:1959
void outToken(StringInfo str, const char *s)
Definition: outfuncs.c:160
static void _outFunctionScan(StringInfo str, const FunctionScan *node)
Definition: outfuncs.c:642
static ListCell * lnext(const List *l, const ListCell *c)
Definition: pg_list.h:322
static void _outMergeJoin(StringInfo str, const MergeJoin *node)
Definition: outfuncs.c:758
int num_child_cols
Definition: pathnodes.h:2342
static void _outNullTest(StringInfo str, const NullTest *node)
Definition: outfuncs.c:1605
static void _outDefElem(StringInfo str, const DefElem *node)
Definition: outfuncs.c:2892
static void _outJoinExpr(StringInfo str, const JoinExpr *node)
Definition: outfuncs.c:1712
static void _outA_Indirection(StringInfo str, const A_Indirection *node)
Definition: outfuncs.c:3516
static void _outScan(StringInfo str, const Scan *node)
Definition: outfuncs.c:533
static void _outIndexClause(StringInfo str, const IndexClause *node)
Definition: outfuncs.c:2572
static void _outPartitionElem(StringInfo str, const PartitionElem *node)
Definition: outfuncs.c:3778
static void _outUnique(StringInfo str, const Unique *node)
Definition: outfuncs.c:903
static void _outPlannerParamItem(StringInfo str, const PlannerParamItem *node)
Definition: outfuncs.c:2666
static void _outGroupPath(StringInfo str, const GroupPath *node)
Definition: outfuncs.c:2046
static void _outRelOptInfo(StringInfo str, const RelOptInfo *node)
Definition: outfuncs.c:2346
static void _outIncrementalSort(StringInfo str, const IncrementalSort *node)
Definition: outfuncs.c:893
#define WRITE_BITMAPSET_FIELD(fldname)
Definition: outfuncs.c:109
PartitionRangeDatumKind
Definition: parsenodes.h:862
static void _outWindowDef(StringInfo str, const WindowDef *node)
Definition: outfuncs.c:3567
static void _outRowMarkClause(StringInfo str, const RowMarkClause *node)
Definition: outfuncs.c:3155
static void _outStatisticExtInfo(StringInfo str, const StatisticExtInfo *node)
Definition: outfuncs.c:2452
BoolTestType
Definition: primnodes.h:1280
static void _outCreateStmt(StringInfo str, const CreateStmt *node)
Definition: outfuncs.c:2722
#define WRITE_ENUM_FIELD(fldname, enumtype)
Definition: outfuncs.c:81
static void _outIncrementalSortPath(StringInfo str, const IncrementalSortPath *node)
Definition: outfuncs.c:2036
static void _outSampleScan(StringInfo str, const SampleScan *node)
Definition: outfuncs.c:549
XmlExprOp
Definition: primnodes.h:1206
static void _outPLAssignStmt(StringInfo str, const PLAssignStmt *node)
Definition: outfuncs.c:2862
int bms_next_member(const Bitmapset *a, int prevbit)
Definition: bitmapset.c:1043
static void _outForeignScan(StringInfo str, const ForeignScan *node)
Definition: outfuncs.c:704
RelOptKind
Definition: pathnodes.h:639
static void _outRelabelType(StringInfo str, const RelabelType *node)
Definition: outfuncs.c:1423
QuerySource
Definition: parsenodes.h:40
ParamPathInfo * param_info
Definition: pathnodes.h:1185
static void _outTableFuncScan(StringInfo str, const TableFuncScan *node)
Definition: outfuncs.c:653
#define WRITE_LONG_FIELD(fldname)
Definition: outfuncs.c:72
static void _outCustomPath(StringInfo str, const CustomPath *node)
Definition: outfuncs.c:1902
static void _outMaterial(StringInfo str, const Material *node)
Definition: outfuncs.c:850
static void _outFloat(StringInfo str, const Float *node)
Definition: outfuncs.c:3423
static void _outPartitionRangeDatum(StringInfo str, const PartitionRangeDatum *node)
Definition: outfuncs.c:3815
static void _outTableLikeClause(StringInfo str, const TableLikeClause *node)
Definition: outfuncs.c:2904
static void _outSetOp(StringInfo str, const SetOp *node)
Definition: outfuncs.c:930
static void _outRangeTblRef(StringInfo str, const RangeTblRef *node)
Definition: outfuncs.c:1704
Definition: nodes.h:49
static void _outOpExpr(StringInfo str, const OpExpr *node)
Definition: outfuncs.c:1269
Definition: value.h:51
static void _outTidScan(StringInfo str, const TidScan *node)
Definition: outfuncs.c:612
static void _outNestLoop(StringInfo str, const NestLoop *node)
Definition: outfuncs.c:748
static void _outWithClause(StringInfo str, const WithClause *node)
Definition: outfuncs.c:3166
static void _outCteScan(StringInfo str, const CteScan *node)
Definition: outfuncs.c:673
static void _outDeclareCursorStmt(StringInfo str, const DeclareCursorStmt *node)
Definition: outfuncs.c:2817
Definition: nodes.h:78
void outDatum(StringInfo str, Datum value, int typlen, bool typbyval)
Definition: outfuncs.c:266
NullTestType
Definition: primnodes.h:1257
static void _outA_Star(StringInfo str, const A_Star *node)
Definition: outfuncs.c:3500
static void _outProjectSet(StringInfo str, const ProjectSet *node)
Definition: outfuncs.c:398
#define WRITE_OID_FIELD(fldname)
Definition: outfuncs.c:68
#define WRITE_INT_ARRAY(fldname, len)
Definition: outfuncs.c:134
NameData relname
Definition: pg_class.h:38
NodeTag
Definition: nodes.h:26
static void _outCurrentOfExpr(StringInfo str, const CurrentOfExpr *node)
Definition: outfuncs.c:1661
static void _outRollupData(StringInfo str, const RollupData *node)
Definition: outfuncs.c:2085
Node * utilityStmt
Definition: parsenodes.h:128
static void _outStatsElem(StringInfo str, const StatsElem *node)
Definition: outfuncs.c:3020
static void _outRowCompareExpr(StringInfo str, const RowCompareExpr *node)
Definition: outfuncs.c:1541
Definition: primnodes.h:186
#define WRITE_UINT_FIELD(fldname)
Definition: outfuncs.c:59
static void _outParamRef(StringInfo str, const ParamRef *node)
Definition: outfuncs.c:3462
static void _outRangeTableSample(StringInfo str, const RangeTableSample *node)
Definition: outfuncs.c:3605
static void _outConst(StringInfo str, const Const *node)
Definition: outfuncs.c:1138
static void _outGroupingSetsPath(StringInfo str, const GroupingSetsPath *node)
Definition: outfuncs.c:2107
SetOpStrategy
Definition: nodes.h:818
static void _outIndexOptInfo(StringInfo str, const IndexOptInfo *node)
Definition: outfuncs.c:2401
OnCommitAction
Definition: primnodes.h:47
static void _outCreateStmtInfo(StringInfo str, const CreateStmt *node)
Definition: outfuncs.c:2705
static void _outPlanInfo(StringInfo str, const Plan *node)
Definition: outfuncs.c:335
JoinType
Definition: nodes.h:704
static void _outFieldSelect(StringInfo str, const FieldSelect *node)
Definition: outfuncs.c:1400
static void _outSortInfo(StringInfo str, const Sort *node)
Definition: outfuncs.c:873
static void outChar(StringInfo str, char c)
Definition: outfuncs.c:196
static void _outJoinPlanInfo(StringInfo str, const Join *node)
Definition: outfuncs.c:369
static void _outBitmapOr(StringInfo str, const BitmapOr *node)
Definition: outfuncs.c:491
static void _outGroupResultPath(StringInfo str, const GroupResultPath *node)
Definition: outfuncs.c:1939
static void _outLockRows(StringInfo str, const LockRows *node)
Definition: outfuncs.c:948
static void _outIndexElem(StringInfo str, const IndexElem *node)
Definition: outfuncs.c:3005
int constlen
Definition: primnodes.h:218
static void _outBoolExpr(StringInfo str, const BoolExpr *node)
Definition: outfuncs.c:1329
static void _outWorkTableScan(StringInfo str, const WorkTableScan *node)
Definition: outfuncs.c:694
static void _outNestLoopParam(StringInfo str, const NestLoopParam *node)
Definition: outfuncs.c:975
bool isnull
Definition: parsenodes.h:310
static void _outMergeAppendPath(StringInfo str, const MergeAppendPath *node)
Definition: outfuncs.c:1928
static void _outHashJoin(StringInfo str, const HashJoin *node)
Definition: outfuncs.c:778
SetOperation
Definition: parsenodes.h:1643
MinMaxOp
Definition: primnodes.h:1139
static void _outGroupingFunc(StringInfo str, const GroupingFunc *node)
Definition: outfuncs.c:1197
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:91
static void _outFuncExpr(StringInfo str, const FuncExpr *node)
Definition: outfuncs.c:1242
static void _outCTECycleClause(StringInfo str, const CTECycleClause *node)
Definition: outfuncs.c:3187
Definition: nodes.h:46
static void _outQuery(StringInfo str, const Query *node)
Definition: outfuncs.c:3029
#define ERROR
Definition: elog.h:46
static void _outSQLValueFunction(StringInfo str, const SQLValueFunction *node)
Definition: outfuncs.c:1578
CTEMaterialize
Definition: parsenodes.h:1477
static void _outAppendRelInfo(StringInfo str, const AppendRelInfo *node)
Definition: outfuncs.c:2613
static void _outTypeName(StringInfo str, const TypeName *node)
Definition: outfuncs.c:2970
static void _outLimitPath(StringInfo str, const LimitPath *node)
Definition: outfuncs.c:2207
static void _outPlannerInfo(StringInfo str, const PlannerInfo *node)
Definition: outfuncs.c:2290
static void _outPartitionPruneStepCombine(StringInfo str, const PartitionPruneStepCombine *node)
Definition: outfuncs.c:1036
#define lfirst_int(lc)
Definition: pg_list.h:170
static void _outBitmapAndPath(StringInfo str, const BitmapAndPath *node)
Definition: outfuncs.c:1839
static void _outSubscriptingRef(StringInfo str, const SubscriptingRef *node)
Definition: outfuncs.c:1226
BoolExprType boolop
Definition: primnodes.h:625
static void _outPlanRowMark(StringInfo str, const PlanRowMark *node)
Definition: outfuncs.c:984
static void _outGatherMerge(StringInfo str, const GatherMerge *node)
Definition: outfuncs.c:516
static void _outExtensibleNode(StringInfo str, const ExtensibleNode *node)
Definition: outfuncs.c:2681
static void _outInteger(StringInfo str, const Integer *node)
Definition: outfuncs.c:3417
RTEKind
Definition: parsenodes.h:988
RelOptInfo * parent
Definition: pathnodes.h:1182
static void _outNextValueExpr(StringInfo str, const NextValueExpr *node)
Definition: outfuncs.c:1671
Definition: nodes.h:80
static void _outMinMaxAggInfo(StringInfo str, const MinMaxAggInfo *node)
Definition: outfuncs.c:2652
Definition: value.h:28
void appendStringInfoString(StringInfo str, const char *s)
Definition: stringinfo.c:176
char * c
static void _outSortBy(StringInfo str, const SortBy *node)
Definition: outfuncs.c:3555
static void _outCollateExpr(StringInfo str, const CollateExpr *node)
Definition: outfuncs.c:1473
static void _outLimit(StringInfo str, const Limit *node)
Definition: outfuncs.c:959
static void _outRangeVar(StringInfo str, const RangeVar *node)
Definition: outfuncs.c:1070
static void _outIndexOnlyScan(StringInfo str, const IndexOnlyScan *node)
Definition: outfuncs.c:575
static void _outMinMaxExpr(StringInfo str, const MinMaxExpr *node)
Definition: outfuncs.c:1565
#define WRITE_BOOL_FIELD(fldname)
Definition: outfuncs.c:90
Definition: nodes.h:153
static void _outSetOpPath(StringInfo str, const SetOpPath *node)
Definition: outfuncs.c:2143
void check_stack_depth(void)
Definition: postgres.c:3469
static void _outTidRangePath(StringInfo str, const TidRangePath *node)
Definition: outfuncs.c:1871
static void _outMergeAppend(StringInfo str, const MergeAppend *node)
Definition: outfuncs.c:449
static void _outConstraint(StringInfo str, const Constraint *node)
Definition: outfuncs.c:3645
static void _outRecursiveUnion(StringInfo str, const RecursiveUnion *node)
Definition: outfuncs.c:466
ScanDirection
Definition: sdir.h:22
static void _outHash(StringInfo str, const Hash *node)
Definition: outfuncs.c:916
static void _outUniquePath(StringInfo str, const UniquePath *node)
Definition: outfuncs.c:1974
static void _outGroupingSet(StringInfo str, const GroupingSet *node)
Definition: outfuncs.c:3124
static void _outPath(StringInfo str, const Path *node)
Definition: outfuncs.c:1805
static void _outCreateForeignTableStmt(StringInfo str, const CreateForeignTableStmt *node)
Definition: outfuncs.c:2730
static void _outRecursiveUnionPath(StringInfo str, const RecursiveUnionPath *node)
Definition: outfuncs.c:2159
Relids relids
Definition: pathnodes.h:681
#define WRITE_BOOL_ARRAY(fldname, len)
Definition: outfuncs.c:141
static void _outPathKey(StringInfo str, const PathKey *node)
Definition: outfuncs.c:2504
#define WRITE_ATTRNUMBER_ARRAY(fldname, len)
Definition: outfuncs.c:113
static void _outValuesScan(StringInfo str, const ValuesScan *node)
Definition: outfuncs.c:663
static void _outRawStmt(StringInfo str, const RawStmt *node)
Definition: outfuncs.c:3475
#define WRITE_FLOAT_FIELD(fldname, format)
Definition: outfuncs.c:86
WCOKind
Definition: parsenodes.h:1216
static void _outSetToDefault(StringInfo str, const SetToDefault *node)
Definition: outfuncs.c:1650
SQLValueFunctionOp
Definition: primnodes.h:1167
static void _outJoinPathInfo(StringInfo str, const JoinPath *node)
Definition: outfuncs.c:1793
char * val
Definition: value.h:54
static void _outIndexScan(StringInfo str, const IndexScan *node)
Definition: outfuncs.c:559
static void _outUpperUniquePath(StringInfo str, const UpperUniquePath *node)
Definition: outfuncs.c:2058
static void _outTidRangeScan(StringInfo str, const TidRangeScan *node)
Definition: outfuncs.c:622
Definition: nodes.h:157
SubLinkType
Definition: primnodes.h:681
static void _outSeqScan(StringInfo str, const SeqScan *node)
Definition: outfuncs.c:541
void appendStringInfoChar(StringInfo str, char ch)
Definition: stringinfo.c:188
void initStringInfo(StringInfo str)
Definition: stringinfo.c:59
static void _outTypeCast(StringInfo str, const TypeCast *node)
Definition: outfuncs.c:2985
struct EquivalenceClass * eclass[INDEX_MAX_KEYS]
Definition: pathnodes.h:918
static void _outRangeFunction(StringInfo str, const RangeFunction *node)
Definition: outfuncs.c:3592
void outNode(StringInfo str, const void *obj)
Definition: outfuncs.c:3829
#define WARNING
Definition: elog.h:40
Definition: nodes.h:156
List * exprs
Definition: pathnodes.h:1110
Definition: value.h:45
static void _outSelectStmt(StringInfo str, const SelectStmt *node)
Definition: outfuncs.c:2827
static void _outResult(StringInfo str, const Result *node)
Definition: outfuncs.c:388
static void _outModifyTable(StringInfo str, const ModifyTable *node)
Definition: outfuncs.c:406
static void _outBitmapHeapScan(StringInfo str, const BitmapHeapScan *node)
Definition: outfuncs.c:602
static void _outJoin(StringInfo str, const Join *node)
Definition: outfuncs.c:740
Definition: nodes.h:314
char * val
Definition: value.h:60
static void _outEquivalenceMember(StringInfo str, const EquivalenceMember *node)
Definition: outfuncs.c:2491
static void _outAggref(StringInfo str, const Aggref *node)
Definition: outfuncs.c:1171
LockClauseStrength
Definition: lockoptions.h:21
static void _outNestPath(StringInfo str, const NestPath *node)
Definition: outfuncs.c:2231
Defi