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