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_OID_FIELD(fs_server);
705  WRITE_NODE_FIELD(fdw_exprs);
706  WRITE_NODE_FIELD(fdw_private);
707  WRITE_NODE_FIELD(fdw_scan_tlist);
708  WRITE_NODE_FIELD(fdw_recheck_quals);
709  WRITE_BITMAPSET_FIELD(fs_relids);
710  WRITE_BOOL_FIELD(fsSystemCol);
711  WRITE_INT_FIELD(resultRelation);
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("RESULTCACHE");
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_BOOL_FIELD(useOr);
1315  WRITE_OID_FIELD(inputcollid);
1317  WRITE_LOCATION_FIELD(location);
1318 }
1319 
1320 static void
1322 {
1323  char *opstr = NULL;
1324 
1325  WRITE_NODE_TYPE("BOOLEXPR");
1326 
1327  /* do-it-yourself enum representation */
1328  switch (node->boolop)
1329  {
1330  case AND_EXPR:
1331  opstr = "and";
1332  break;
1333  case OR_EXPR:
1334  opstr = "or";
1335  break;
1336  case NOT_EXPR:
1337  opstr = "not";
1338  break;
1339  }
1340  appendStringInfoString(str, " :boolop ");
1341  outToken(str, opstr);
1342 
1344  WRITE_LOCATION_FIELD(location);
1345 }
1346 
1347 static void
1349 {
1350  WRITE_NODE_TYPE("SUBLINK");
1351 
1352  WRITE_ENUM_FIELD(subLinkType, SubLinkType);
1353  WRITE_INT_FIELD(subLinkId);
1354  WRITE_NODE_FIELD(testexpr);
1355  WRITE_NODE_FIELD(operName);
1356  WRITE_NODE_FIELD(subselect);
1357  WRITE_LOCATION_FIELD(location);
1358 }
1359 
1360 static void
1362 {
1363  WRITE_NODE_TYPE("SUBPLAN");
1364 
1365  WRITE_ENUM_FIELD(subLinkType, SubLinkType);
1366  WRITE_NODE_FIELD(testexpr);
1367  WRITE_NODE_FIELD(paramIds);
1368  WRITE_INT_FIELD(plan_id);
1369  WRITE_STRING_FIELD(plan_name);
1370  WRITE_OID_FIELD(firstColType);
1371  WRITE_INT_FIELD(firstColTypmod);
1372  WRITE_OID_FIELD(firstColCollation);
1373  WRITE_BOOL_FIELD(useHashTable);
1374  WRITE_BOOL_FIELD(unknownEqFalse);
1375  WRITE_BOOL_FIELD(parallel_safe);
1376  WRITE_NODE_FIELD(setParam);
1377  WRITE_NODE_FIELD(parParam);
1379  WRITE_FLOAT_FIELD(startup_cost, "%.2f");
1380  WRITE_FLOAT_FIELD(per_call_cost, "%.2f");
1381 }
1382 
1383 static void
1385 {
1386  WRITE_NODE_TYPE("ALTERNATIVESUBPLAN");
1387 
1388  WRITE_NODE_FIELD(subplans);
1389 }
1390 
1391 static void
1393 {
1394  WRITE_NODE_TYPE("FIELDSELECT");
1395 
1397  WRITE_INT_FIELD(fieldnum);
1398  WRITE_OID_FIELD(resulttype);
1399  WRITE_INT_FIELD(resulttypmod);
1400  WRITE_OID_FIELD(resultcollid);
1401 }
1402 
1403 static void
1405 {
1406  WRITE_NODE_TYPE("FIELDSTORE");
1407 
1409  WRITE_NODE_FIELD(newvals);
1410  WRITE_NODE_FIELD(fieldnums);
1411  WRITE_OID_FIELD(resulttype);
1412 }
1413 
1414 static void
1416 {
1417  WRITE_NODE_TYPE("RELABELTYPE");
1418 
1420  WRITE_OID_FIELD(resulttype);
1421  WRITE_INT_FIELD(resulttypmod);
1422  WRITE_OID_FIELD(resultcollid);
1423  WRITE_ENUM_FIELD(relabelformat, CoercionForm);
1424  WRITE_LOCATION_FIELD(location);
1425 }
1426 
1427 static void
1429 {
1430  WRITE_NODE_TYPE("COERCEVIAIO");
1431 
1433  WRITE_OID_FIELD(resulttype);
1434  WRITE_OID_FIELD(resultcollid);
1435  WRITE_ENUM_FIELD(coerceformat, CoercionForm);
1436  WRITE_LOCATION_FIELD(location);
1437 }
1438 
1439 static void
1441 {
1442  WRITE_NODE_TYPE("ARRAYCOERCEEXPR");
1443 
1445  WRITE_NODE_FIELD(elemexpr);
1446  WRITE_OID_FIELD(resulttype);
1447  WRITE_INT_FIELD(resulttypmod);
1448  WRITE_OID_FIELD(resultcollid);
1449  WRITE_ENUM_FIELD(coerceformat, CoercionForm);
1450  WRITE_LOCATION_FIELD(location);
1451 }
1452 
1453 static void
1455 {
1456  WRITE_NODE_TYPE("CONVERTROWTYPEEXPR");
1457 
1459  WRITE_OID_FIELD(resulttype);
1460  WRITE_ENUM_FIELD(convertformat, CoercionForm);
1461  WRITE_LOCATION_FIELD(location);
1462 }
1463 
1464 static void
1466 {
1467  WRITE_NODE_TYPE("COLLATE");
1468 
1470  WRITE_OID_FIELD(collOid);
1471  WRITE_LOCATION_FIELD(location);
1472 }
1473 
1474 static void
1476 {
1477  WRITE_NODE_TYPE("CASE");
1478 
1479  WRITE_OID_FIELD(casetype);
1480  WRITE_OID_FIELD(casecollid);
1483  WRITE_NODE_FIELD(defresult);
1484  WRITE_LOCATION_FIELD(location);
1485 }
1486 
1487 static void
1489 {
1490  WRITE_NODE_TYPE("WHEN");
1491 
1492  WRITE_NODE_FIELD(expr);
1493  WRITE_NODE_FIELD(result);
1494  WRITE_LOCATION_FIELD(location);
1495 }
1496 
1497 static void
1499 {
1500  WRITE_NODE_TYPE("CASETESTEXPR");
1501 
1502  WRITE_OID_FIELD(typeId);
1503  WRITE_INT_FIELD(typeMod);
1504  WRITE_OID_FIELD(collation);
1505 }
1506 
1507 static void
1509 {
1510  WRITE_NODE_TYPE("ARRAY");
1511 
1512  WRITE_OID_FIELD(array_typeid);
1513  WRITE_OID_FIELD(array_collid);
1514  WRITE_OID_FIELD(element_typeid);
1515  WRITE_NODE_FIELD(elements);
1516  WRITE_BOOL_FIELD(multidims);
1517  WRITE_LOCATION_FIELD(location);
1518 }
1519 
1520 static void
1522 {
1523  WRITE_NODE_TYPE("ROW");
1524 
1526  WRITE_OID_FIELD(row_typeid);
1527  WRITE_ENUM_FIELD(row_format, CoercionForm);
1528  WRITE_NODE_FIELD(colnames);
1529  WRITE_LOCATION_FIELD(location);
1530 }
1531 
1532 static void
1534 {
1535  WRITE_NODE_TYPE("ROWCOMPARE");
1536 
1538  WRITE_NODE_FIELD(opnos);
1539  WRITE_NODE_FIELD(opfamilies);
1540  WRITE_NODE_FIELD(inputcollids);
1541  WRITE_NODE_FIELD(largs);
1542  WRITE_NODE_FIELD(rargs);
1543 }
1544 
1545 static void
1547 {
1548  WRITE_NODE_TYPE("COALESCE");
1549 
1550  WRITE_OID_FIELD(coalescetype);
1551  WRITE_OID_FIELD(coalescecollid);
1553  WRITE_LOCATION_FIELD(location);
1554 }
1555 
1556 static void
1558 {
1559  WRITE_NODE_TYPE("MINMAX");
1560 
1561  WRITE_OID_FIELD(minmaxtype);
1562  WRITE_OID_FIELD(minmaxcollid);
1563  WRITE_OID_FIELD(inputcollid);
1566  WRITE_LOCATION_FIELD(location);
1567 }
1568 
1569 static void
1571 {
1572  WRITE_NODE_TYPE("SQLVALUEFUNCTION");
1573 
1576  WRITE_INT_FIELD(typmod);
1577  WRITE_LOCATION_FIELD(location);
1578 }
1579 
1580 static void
1582 {
1583  WRITE_NODE_TYPE("XMLEXPR");
1584 
1587  WRITE_NODE_FIELD(named_args);
1588  WRITE_NODE_FIELD(arg_names);
1592  WRITE_INT_FIELD(typmod);
1593  WRITE_LOCATION_FIELD(location);
1594 }
1595 
1596 static void
1598 {
1599  WRITE_NODE_TYPE("NULLTEST");
1600 
1602  WRITE_ENUM_FIELD(nulltesttype, NullTestType);
1603  WRITE_BOOL_FIELD(argisrow);
1604  WRITE_LOCATION_FIELD(location);
1605 }
1606 
1607 static void
1609 {
1610  WRITE_NODE_TYPE("BOOLEANTEST");
1611 
1613  WRITE_ENUM_FIELD(booltesttype, BoolTestType);
1614  WRITE_LOCATION_FIELD(location);
1615 }
1616 
1617 static void
1619 {
1620  WRITE_NODE_TYPE("COERCETODOMAIN");
1621 
1623  WRITE_OID_FIELD(resulttype);
1624  WRITE_INT_FIELD(resulttypmod);
1625  WRITE_OID_FIELD(resultcollid);
1626  WRITE_ENUM_FIELD(coercionformat, CoercionForm);
1627  WRITE_LOCATION_FIELD(location);
1628 }
1629 
1630 static void
1632 {
1633  WRITE_NODE_TYPE("COERCETODOMAINVALUE");
1634 
1635  WRITE_OID_FIELD(typeId);
1636  WRITE_INT_FIELD(typeMod);
1637  WRITE_OID_FIELD(collation);
1638  WRITE_LOCATION_FIELD(location);
1639 }
1640 
1641 static void
1643 {
1644  WRITE_NODE_TYPE("SETTODEFAULT");
1645 
1646  WRITE_OID_FIELD(typeId);
1647  WRITE_INT_FIELD(typeMod);
1648  WRITE_OID_FIELD(collation);
1649  WRITE_LOCATION_FIELD(location);
1650 }
1651 
1652 static void
1654 {
1655  WRITE_NODE_TYPE("CURRENTOFEXPR");
1656 
1657  WRITE_UINT_FIELD(cvarno);
1658  WRITE_STRING_FIELD(cursor_name);
1659  WRITE_INT_FIELD(cursor_param);
1660 }
1661 
1662 static void
1664 {
1665  WRITE_NODE_TYPE("NEXTVALUEEXPR");
1666 
1667  WRITE_OID_FIELD(seqid);
1668  WRITE_OID_FIELD(typeId);
1669 }
1670 
1671 static void
1673 {
1674  WRITE_NODE_TYPE("INFERENCEELEM");
1675 
1676  WRITE_NODE_FIELD(expr);
1677  WRITE_OID_FIELD(infercollid);
1678  WRITE_OID_FIELD(inferopclass);
1679 }
1680 
1681 static void
1683 {
1684  WRITE_NODE_TYPE("TARGETENTRY");
1685 
1686  WRITE_NODE_FIELD(expr);
1687  WRITE_INT_FIELD(resno);
1688  WRITE_STRING_FIELD(resname);
1689  WRITE_UINT_FIELD(ressortgroupref);
1690  WRITE_OID_FIELD(resorigtbl);
1691  WRITE_INT_FIELD(resorigcol);
1692  WRITE_BOOL_FIELD(resjunk);
1693 }
1694 
1695 static void
1697 {
1698  WRITE_NODE_TYPE("RANGETBLREF");
1699 
1700  WRITE_INT_FIELD(rtindex);
1701 }
1702 
1703 static void
1705 {
1706  WRITE_NODE_TYPE("JOINEXPR");
1707 
1708  WRITE_ENUM_FIELD(jointype, JoinType);
1709  WRITE_BOOL_FIELD(isNatural);
1710  WRITE_NODE_FIELD(larg);
1711  WRITE_NODE_FIELD(rarg);
1712  WRITE_NODE_FIELD(usingClause);
1713  WRITE_NODE_FIELD(join_using_alias);
1714  WRITE_NODE_FIELD(quals);
1715  WRITE_NODE_FIELD(alias);
1716  WRITE_INT_FIELD(rtindex);
1717 }
1718 
1719 static void
1721 {
1722  WRITE_NODE_TYPE("FROMEXPR");
1723 
1724  WRITE_NODE_FIELD(fromlist);
1725  WRITE_NODE_FIELD(quals);
1726 }
1727 
1728 static void
1730 {
1731  WRITE_NODE_TYPE("ONCONFLICTEXPR");
1732 
1734  WRITE_NODE_FIELD(arbiterElems);
1735  WRITE_NODE_FIELD(arbiterWhere);
1736  WRITE_OID_FIELD(constraint);
1737  WRITE_NODE_FIELD(onConflictSet);
1738  WRITE_NODE_FIELD(onConflictWhere);
1739  WRITE_INT_FIELD(exclRelIndex);
1740  WRITE_NODE_FIELD(exclRelTlist);
1741 }
1742 
1743 /*****************************************************************************
1744  *
1745  * Stuff from pathnodes.h.
1746  *
1747  *****************************************************************************/
1748 
1749 /*
1750  * print the basic stuff of all nodes that inherit from Path
1751  *
1752  * Note we do NOT print the parent, else we'd be in infinite recursion.
1753  * We can print the parent's relids for identification purposes, though.
1754  * We print the pathtarget only if it's not the default one for the rel.
1755  * We also do not print the whole of param_info, since it's printed by
1756  * _outRelOptInfo; it's sufficient and less cluttering to print just the
1757  * required outer relids.
1758  */
1759 static void
1761 {
1762  WRITE_ENUM_FIELD(pathtype, NodeTag);
1763  appendStringInfoString(str, " :parent_relids ");
1764  outBitmapset(str, node->parent->relids);
1765  if (node->pathtarget != node->parent->reltarget)
1766  WRITE_NODE_FIELD(pathtarget);
1767  appendStringInfoString(str, " :required_outer ");
1768  if (node->param_info)
1769  outBitmapset(str, node->param_info->ppi_req_outer);
1770  else
1771  outBitmapset(str, NULL);
1772  WRITE_BOOL_FIELD(parallel_aware);
1773  WRITE_BOOL_FIELD(parallel_safe);
1774  WRITE_INT_FIELD(parallel_workers);
1775  WRITE_FLOAT_FIELD(rows, "%.0f");
1776  WRITE_FLOAT_FIELD(startup_cost, "%.2f");
1777  WRITE_FLOAT_FIELD(total_cost, "%.2f");
1778  WRITE_NODE_FIELD(pathkeys);
1779 }
1780 
1781 /*
1782  * print the basic stuff of all nodes that inherit from JoinPath
1783  */
1784 static void
1786 {
1787  _outPathInfo(str, (const Path *) node);
1788 
1789  WRITE_ENUM_FIELD(jointype, JoinType);
1790  WRITE_BOOL_FIELD(inner_unique);
1791  WRITE_NODE_FIELD(outerjoinpath);
1792  WRITE_NODE_FIELD(innerjoinpath);
1793  WRITE_NODE_FIELD(joinrestrictinfo);
1794 }
1795 
1796 static void
1798 {
1799  WRITE_NODE_TYPE("PATH");
1800 
1801  _outPathInfo(str, (const Path *) node);
1802 }
1803 
1804 static void
1806 {
1807  WRITE_NODE_TYPE("INDEXPATH");
1808 
1809  _outPathInfo(str, (const Path *) node);
1810 
1811  WRITE_NODE_FIELD(indexinfo);
1812  WRITE_NODE_FIELD(indexclauses);
1813  WRITE_NODE_FIELD(indexorderbys);
1814  WRITE_NODE_FIELD(indexorderbycols);
1815  WRITE_ENUM_FIELD(indexscandir, ScanDirection);
1816  WRITE_FLOAT_FIELD(indextotalcost, "%.2f");
1817  WRITE_FLOAT_FIELD(indexselectivity, "%.4f");
1818 }
1819 
1820 static void
1822 {
1823  WRITE_NODE_TYPE("BITMAPHEAPPATH");
1824 
1825  _outPathInfo(str, (const Path *) node);
1826 
1827  WRITE_NODE_FIELD(bitmapqual);
1828 }
1829 
1830 static void
1832 {
1833  WRITE_NODE_TYPE("BITMAPANDPATH");
1834 
1835  _outPathInfo(str, (const Path *) node);
1836 
1837  WRITE_NODE_FIELD(bitmapquals);
1838  WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
1839 }
1840 
1841 static void
1843 {
1844  WRITE_NODE_TYPE("BITMAPORPATH");
1845 
1846  _outPathInfo(str, (const Path *) node);
1847 
1848  WRITE_NODE_FIELD(bitmapquals);
1849  WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
1850 }
1851 
1852 static void
1854 {
1855  WRITE_NODE_TYPE("TIDPATH");
1856 
1857  _outPathInfo(str, (const Path *) node);
1858 
1859  WRITE_NODE_FIELD(tidquals);
1860 }
1861 
1862 static void
1864 {
1865  WRITE_NODE_TYPE("SUBQUERYSCANPATH");
1866 
1867  _outPathInfo(str, (const Path *) node);
1868 
1870 }
1871 
1872 static void
1874 {
1875  WRITE_NODE_TYPE("FOREIGNPATH");
1876 
1877  _outPathInfo(str, (const Path *) node);
1878 
1879  WRITE_NODE_FIELD(fdw_outerpath);
1880  WRITE_NODE_FIELD(fdw_private);
1881 }
1882 
1883 static void
1885 {
1886  WRITE_NODE_TYPE("CUSTOMPATH");
1887 
1888  _outPathInfo(str, (const Path *) node);
1889 
1890  WRITE_UINT_FIELD(flags);
1891  WRITE_NODE_FIELD(custom_paths);
1892  WRITE_NODE_FIELD(custom_private);
1893  appendStringInfoString(str, " :methods ");
1894  outToken(str, node->methods->CustomName);
1895 }
1896 
1897 static void
1899 {
1900  WRITE_NODE_TYPE("APPENDPATH");
1901 
1902  _outPathInfo(str, (const Path *) node);
1903 
1904  WRITE_NODE_FIELD(subpaths);
1905  WRITE_INT_FIELD(first_partial_path);
1906  WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
1907 }
1908 
1909 static void
1911 {
1912  WRITE_NODE_TYPE("MERGEAPPENDPATH");
1913 
1914  _outPathInfo(str, (const Path *) node);
1915 
1916  WRITE_NODE_FIELD(subpaths);
1917  WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
1918 }
1919 
1920 static void
1922 {
1923  WRITE_NODE_TYPE("GROUPRESULTPATH");
1924 
1925  _outPathInfo(str, (const Path *) node);
1926 
1927  WRITE_NODE_FIELD(quals);
1928 }
1929 
1930 static void
1932 {
1933  WRITE_NODE_TYPE("MATERIALPATH");
1934 
1935  _outPathInfo(str, (const Path *) node);
1936 
1938 }
1939 
1940 static void
1942 {
1943  WRITE_NODE_TYPE("RESULTCACHEPATH");
1944 
1945  _outPathInfo(str, (const Path *) node);
1946 
1948  WRITE_NODE_FIELD(hash_operators);
1949  WRITE_NODE_FIELD(param_exprs);
1950  WRITE_BOOL_FIELD(singlerow);
1951  WRITE_FLOAT_FIELD(calls, "%.0f");
1952  WRITE_UINT_FIELD(est_entries);
1953 }
1954 
1955 static void
1957 {
1958  WRITE_NODE_TYPE("UNIQUEPATH");
1959 
1960  _outPathInfo(str, (const Path *) node);
1961 
1964  WRITE_NODE_FIELD(in_operators);
1965  WRITE_NODE_FIELD(uniq_exprs);
1966 }
1967 
1968 static void
1970 {
1971  WRITE_NODE_TYPE("GATHERPATH");
1972 
1973  _outPathInfo(str, (const Path *) node);
1974 
1976  WRITE_BOOL_FIELD(single_copy);
1977  WRITE_INT_FIELD(num_workers);
1978 }
1979 
1980 static void
1982 {
1983  WRITE_NODE_TYPE("PROJECTIONPATH");
1984 
1985  _outPathInfo(str, (const Path *) node);
1986 
1988  WRITE_BOOL_FIELD(dummypp);
1989 }
1990 
1991 static void
1993 {
1994  WRITE_NODE_TYPE("PROJECTSETPATH");
1995 
1996  _outPathInfo(str, (const Path *) node);
1997 
1999 }
2000 
2001 static void
2003 {
2004  _outPathInfo(str, (const Path *) node);
2005 
2007 }
2008 
2009 static void
2011 {
2012  WRITE_NODE_TYPE("SORTPATH");
2013 
2014  _outSortPathInfo(str, node);
2015 }
2016 
2017 static void
2019 {
2020  WRITE_NODE_TYPE("INCREMENTALSORTPATH");
2021 
2022  _outSortPathInfo(str, (const SortPath *) node);
2023 
2024  WRITE_INT_FIELD(nPresortedCols);
2025 }
2026 
2027 static void
2029 {
2030  WRITE_NODE_TYPE("GROUPPATH");
2031 
2032  _outPathInfo(str, (const Path *) node);
2033 
2035  WRITE_NODE_FIELD(groupClause);
2036  WRITE_NODE_FIELD(qual);
2037 }
2038 
2039 static void
2041 {
2042  WRITE_NODE_TYPE("UPPERUNIQUEPATH");
2043 
2044  _outPathInfo(str, (const Path *) node);
2045 
2047  WRITE_INT_FIELD(numkeys);
2048 }
2049 
2050 static void
2052 {
2053  WRITE_NODE_TYPE("AGGPATH");
2054 
2055  _outPathInfo(str, (const Path *) node);
2056 
2058  WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
2059  WRITE_ENUM_FIELD(aggsplit, AggSplit);
2060  WRITE_FLOAT_FIELD(numGroups, "%.0f");
2061  WRITE_UINT64_FIELD(transitionSpace);
2062  WRITE_NODE_FIELD(groupClause);
2063  WRITE_NODE_FIELD(qual);
2064 }
2065 
2066 static void
2068 {
2069  WRITE_NODE_TYPE("ROLLUP");
2070 
2071  WRITE_NODE_FIELD(groupClause);
2072  WRITE_NODE_FIELD(gsets);
2073  WRITE_NODE_FIELD(gsets_data);
2074  WRITE_FLOAT_FIELD(numGroups, "%.0f");
2075  WRITE_BOOL_FIELD(hashable);
2076  WRITE_BOOL_FIELD(is_hashed);
2077 }
2078 
2079 static void
2081 {
2082  WRITE_NODE_TYPE("GSDATA");
2083 
2084  WRITE_NODE_FIELD(set);
2085  WRITE_FLOAT_FIELD(numGroups, "%.0f");
2086 }
2087 
2088 static void
2090 {
2091  WRITE_NODE_TYPE("GROUPINGSETSPATH");
2092 
2093  _outPathInfo(str, (const Path *) node);
2094 
2096  WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
2097  WRITE_NODE_FIELD(rollups);
2098  WRITE_NODE_FIELD(qual);
2099  WRITE_UINT64_FIELD(transitionSpace);
2100 }
2101 
2102 static void
2104 {
2105  WRITE_NODE_TYPE("MINMAXAGGPATH");
2106 
2107  _outPathInfo(str, (const Path *) node);
2108 
2109  WRITE_NODE_FIELD(mmaggregates);
2110  WRITE_NODE_FIELD(quals);
2111 }
2112 
2113 static void
2115 {
2116  WRITE_NODE_TYPE("WINDOWAGGPATH");
2117 
2118  _outPathInfo(str, (const Path *) node);
2119 
2121  WRITE_NODE_FIELD(winclause);
2122 }
2123 
2124 static void
2126 {
2127  WRITE_NODE_TYPE("SETOPPATH");
2128 
2129  _outPathInfo(str, (const Path *) node);
2130 
2132  WRITE_ENUM_FIELD(cmd, SetOpCmd);
2133  WRITE_ENUM_FIELD(strategy, SetOpStrategy);
2134  WRITE_NODE_FIELD(distinctList);
2135  WRITE_INT_FIELD(flagColIdx);
2136  WRITE_INT_FIELD(firstFlag);
2137  WRITE_FLOAT_FIELD(numGroups, "%.0f");
2138 }
2139 
2140 static void
2142 {
2143  WRITE_NODE_TYPE("RECURSIVEUNIONPATH");
2144 
2145  _outPathInfo(str, (const Path *) node);
2146 
2147  WRITE_NODE_FIELD(leftpath);
2148  WRITE_NODE_FIELD(rightpath);
2149  WRITE_NODE_FIELD(distinctList);
2150  WRITE_INT_FIELD(wtParam);
2151  WRITE_FLOAT_FIELD(numGroups, "%.0f");
2152 }
2153 
2154 static void
2156 {
2157  WRITE_NODE_TYPE("LOCKROWSPATH");
2158 
2159  _outPathInfo(str, (const Path *) node);
2160 
2162  WRITE_NODE_FIELD(rowMarks);
2163  WRITE_INT_FIELD(epqParam);
2164 }
2165 
2166 static void
2168 {
2169  WRITE_NODE_TYPE("MODIFYTABLEPATH");
2170 
2171  _outPathInfo(str, (const Path *) node);
2172 
2174  WRITE_ENUM_FIELD(operation, CmdType);
2175  WRITE_BOOL_FIELD(canSetTag);
2176  WRITE_UINT_FIELD(nominalRelation);
2177  WRITE_UINT_FIELD(rootRelation);
2178  WRITE_BOOL_FIELD(partColsUpdated);
2179  WRITE_NODE_FIELD(resultRelations);
2180  WRITE_NODE_FIELD(updateColnosLists);
2181  WRITE_NODE_FIELD(withCheckOptionLists);
2182  WRITE_NODE_FIELD(returningLists);
2183  WRITE_NODE_FIELD(rowMarks);
2184  WRITE_NODE_FIELD(onconflict);
2185  WRITE_INT_FIELD(epqParam);
2186 }
2187 
2188 static void
2190 {
2191  WRITE_NODE_TYPE("LIMITPATH");
2192 
2193  _outPathInfo(str, (const Path *) node);
2194 
2196  WRITE_NODE_FIELD(limitOffset);
2197  WRITE_NODE_FIELD(limitCount);
2198  WRITE_ENUM_FIELD(limitOption, LimitOption);
2199 }
2200 
2201 static void
2203 {
2204  WRITE_NODE_TYPE("GATHERMERGEPATH");
2205 
2206  _outPathInfo(str, (const Path *) node);
2207 
2209  WRITE_INT_FIELD(num_workers);
2210 }
2211 
2212 static void
2214 {
2215  WRITE_NODE_TYPE("NESTPATH");
2216 
2217  _outJoinPathInfo(str, (const JoinPath *) node);
2218 }
2219 
2220 static void
2222 {
2223  WRITE_NODE_TYPE("MERGEPATH");
2224 
2225  _outJoinPathInfo(str, (const JoinPath *) node);
2226 
2227  WRITE_NODE_FIELD(path_mergeclauses);
2228  WRITE_NODE_FIELD(outersortkeys);
2229  WRITE_NODE_FIELD(innersortkeys);
2230  WRITE_BOOL_FIELD(skip_mark_restore);
2231  WRITE_BOOL_FIELD(materialize_inner);
2232 }
2233 
2234 static void
2236 {
2237  WRITE_NODE_TYPE("HASHPATH");
2238 
2239  _outJoinPathInfo(str, (const JoinPath *) node);
2240 
2241  WRITE_NODE_FIELD(path_hashclauses);
2242  WRITE_INT_FIELD(num_batches);
2243  WRITE_FLOAT_FIELD(inner_rows_total, "%.0f");
2244 }
2245 
2246 static void
2248 {
2249  WRITE_NODE_TYPE("PLANNERGLOBAL");
2250 
2251  /* NB: this isn't a complete set of fields */
2252  WRITE_NODE_FIELD(subplans);
2253  WRITE_BITMAPSET_FIELD(rewindPlanIDs);
2254  WRITE_NODE_FIELD(finalrtable);
2255  WRITE_NODE_FIELD(finalrowmarks);
2256  WRITE_NODE_FIELD(resultRelations);
2257  WRITE_NODE_FIELD(appendRelations);
2258  WRITE_NODE_FIELD(relationOids);
2259  WRITE_NODE_FIELD(invalItems);
2260  WRITE_NODE_FIELD(paramExecTypes);
2261  WRITE_UINT_FIELD(lastPHId);
2262  WRITE_UINT_FIELD(lastRowMarkId);
2263  WRITE_INT_FIELD(lastPlanNodeId);
2264  WRITE_BOOL_FIELD(transientPlan);
2265  WRITE_BOOL_FIELD(dependsOnRole);
2266  WRITE_BOOL_FIELD(parallelModeOK);
2267  WRITE_BOOL_FIELD(parallelModeNeeded);
2268  WRITE_CHAR_FIELD(maxParallelHazard);
2269 }
2270 
2271 static void
2273 {
2274  WRITE_NODE_TYPE("PLANNERINFO");
2275 
2276  /* NB: this isn't a complete set of fields */
2278  WRITE_NODE_FIELD(glob);
2279  WRITE_UINT_FIELD(query_level);
2280  WRITE_NODE_FIELD(plan_params);
2281  WRITE_BITMAPSET_FIELD(outer_params);
2282  WRITE_BITMAPSET_FIELD(all_baserels);
2283  WRITE_BITMAPSET_FIELD(nullable_baserels);
2284  WRITE_NODE_FIELD(join_rel_list);
2285  WRITE_INT_FIELD(join_cur_level);
2286  WRITE_NODE_FIELD(init_plans);
2287  WRITE_NODE_FIELD(cte_plan_ids);
2288  WRITE_NODE_FIELD(multiexpr_params);
2289  WRITE_NODE_FIELD(eq_classes);
2290  WRITE_BOOL_FIELD(ec_merging_done);
2291  WRITE_NODE_FIELD(canon_pathkeys);
2292  WRITE_NODE_FIELD(left_join_clauses);
2293  WRITE_NODE_FIELD(right_join_clauses);
2294  WRITE_NODE_FIELD(full_join_clauses);
2295  WRITE_NODE_FIELD(join_info_list);
2296  WRITE_BITMAPSET_FIELD(all_result_relids);
2297  WRITE_BITMAPSET_FIELD(leaf_result_relids);
2298  WRITE_NODE_FIELD(append_rel_list);
2299  WRITE_NODE_FIELD(row_identity_vars);
2300  WRITE_NODE_FIELD(rowMarks);
2301  WRITE_NODE_FIELD(placeholder_list);
2302  WRITE_NODE_FIELD(fkey_list);
2303  WRITE_NODE_FIELD(query_pathkeys);
2304  WRITE_NODE_FIELD(group_pathkeys);
2305  WRITE_NODE_FIELD(window_pathkeys);
2306  WRITE_NODE_FIELD(distinct_pathkeys);
2307  WRITE_NODE_FIELD(sort_pathkeys);
2308  WRITE_NODE_FIELD(processed_tlist);
2309  WRITE_NODE_FIELD(update_colnos);
2310  WRITE_NODE_FIELD(minmax_aggs);
2311  WRITE_FLOAT_FIELD(total_table_pages, "%.0f");
2312  WRITE_FLOAT_FIELD(tuple_fraction, "%.4f");
2313  WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
2314  WRITE_UINT_FIELD(qual_security_level);
2315  WRITE_BOOL_FIELD(hasJoinRTEs);
2316  WRITE_BOOL_FIELD(hasLateralRTEs);
2317  WRITE_BOOL_FIELD(hasHavingQual);
2318  WRITE_BOOL_FIELD(hasPseudoConstantQuals);
2319  WRITE_BOOL_FIELD(hasAlternativeSubPlans);
2320  WRITE_BOOL_FIELD(hasRecursion);
2321  WRITE_INT_FIELD(wt_param_id);
2322  WRITE_BITMAPSET_FIELD(curOuterRels);
2323  WRITE_NODE_FIELD(curOuterParams);
2324  WRITE_BOOL_FIELD(partColsUpdated);
2325 }
2326 
2327 static void
2329 {
2330  WRITE_NODE_TYPE("RELOPTINFO");
2331 
2332  /* NB: this isn't a complete set of fields */
2333  WRITE_ENUM_FIELD(reloptkind, RelOptKind);
2334  WRITE_BITMAPSET_FIELD(relids);
2335  WRITE_FLOAT_FIELD(rows, "%.0f");
2336  WRITE_BOOL_FIELD(consider_startup);
2337  WRITE_BOOL_FIELD(consider_param_startup);
2338  WRITE_BOOL_FIELD(consider_parallel);
2339  WRITE_NODE_FIELD(reltarget);
2340  WRITE_NODE_FIELD(pathlist);
2341  WRITE_NODE_FIELD(ppilist);
2342  WRITE_NODE_FIELD(partial_pathlist);
2343  WRITE_NODE_FIELD(cheapest_startup_path);
2344  WRITE_NODE_FIELD(cheapest_total_path);
2345  WRITE_NODE_FIELD(cheapest_unique_path);
2346  WRITE_NODE_FIELD(cheapest_parameterized_paths);
2347  WRITE_BITMAPSET_FIELD(direct_lateral_relids);
2348  WRITE_BITMAPSET_FIELD(lateral_relids);
2349  WRITE_UINT_FIELD(relid);
2350  WRITE_OID_FIELD(reltablespace);
2351  WRITE_ENUM_FIELD(rtekind, RTEKind);
2352  WRITE_INT_FIELD(min_attr);
2353  WRITE_INT_FIELD(max_attr);
2354  WRITE_NODE_FIELD(lateral_vars);
2355  WRITE_BITMAPSET_FIELD(lateral_referencers);
2356  WRITE_NODE_FIELD(indexlist);
2357  WRITE_NODE_FIELD(statlist);
2358  WRITE_UINT_FIELD(pages);
2359  WRITE_FLOAT_FIELD(tuples, "%.0f");
2360  WRITE_FLOAT_FIELD(allvisfrac, "%.6f");
2361  WRITE_BITMAPSET_FIELD(eclass_indexes);
2362  WRITE_NODE_FIELD(subroot);
2363  WRITE_NODE_FIELD(subplan_params);
2364  WRITE_INT_FIELD(rel_parallel_workers);
2365  WRITE_UINT_FIELD(amflags);
2366  WRITE_OID_FIELD(serverid);
2367  WRITE_OID_FIELD(userid);
2368  WRITE_BOOL_FIELD(useridiscurrent);
2369  /* we don't try to print fdwroutine or fdw_private */
2370  /* can't print unique_for_rels/non_unique_for_rels; BMSes aren't Nodes */
2371  WRITE_NODE_FIELD(baserestrictinfo);
2372  WRITE_UINT_FIELD(baserestrict_min_security);
2373  WRITE_NODE_FIELD(joininfo);
2374  WRITE_BOOL_FIELD(has_eclass_joins);
2375  WRITE_BOOL_FIELD(consider_partitionwise_join);
2376  WRITE_BITMAPSET_FIELD(top_parent_relids);
2377  WRITE_BOOL_FIELD(partbounds_merged);
2378  WRITE_BITMAPSET_FIELD(all_partrels);
2379 }
2380 
2381 static void
2383 {
2384  WRITE_NODE_TYPE("INDEXOPTINFO");
2385 
2386  /* NB: this isn't a complete set of fields */
2387  WRITE_OID_FIELD(indexoid);
2388  /* Do NOT print rel field, else infinite recursion */
2389  WRITE_UINT_FIELD(pages);
2390  WRITE_FLOAT_FIELD(tuples, "%.0f");
2391  WRITE_INT_FIELD(tree_height);
2392  WRITE_INT_FIELD(ncolumns);
2393  /* array fields aren't really worth the trouble to print */
2394  WRITE_OID_FIELD(relam);
2395  /* indexprs is redundant since we print indextlist */
2396  WRITE_NODE_FIELD(indpred);
2397  WRITE_NODE_FIELD(indextlist);
2398  WRITE_NODE_FIELD(indrestrictinfo);
2399  WRITE_BOOL_FIELD(predOK);
2400  WRITE_BOOL_FIELD(unique);
2401  WRITE_BOOL_FIELD(immediate);
2402  WRITE_BOOL_FIELD(hypothetical);
2403  /* we don't bother with fields copied from the index AM's API struct */
2404 }
2405 
2406 static void
2408 {
2409  int i;
2410 
2411  WRITE_NODE_TYPE("FOREIGNKEYOPTINFO");
2412 
2413  WRITE_UINT_FIELD(con_relid);
2414  WRITE_UINT_FIELD(ref_relid);
2415  WRITE_INT_FIELD(nkeys);
2416  WRITE_ATTRNUMBER_ARRAY(conkey, node->nkeys);
2417  WRITE_ATTRNUMBER_ARRAY(confkey, node->nkeys);
2418  WRITE_OID_ARRAY(conpfeqop, node->nkeys);
2419  WRITE_INT_FIELD(nmatched_ec);
2420  WRITE_INT_FIELD(nconst_ec);
2421  WRITE_INT_FIELD(nmatched_rcols);
2422  WRITE_INT_FIELD(nmatched_ri);
2423  /* for compactness, just print the number of matches per column: */
2424  appendStringInfoString(str, " :eclass");
2425  for (i = 0; i < node->nkeys; i++)
2426  appendStringInfo(str, " %d", (node->eclass[i] != NULL));
2427  appendStringInfoString(str, " :rinfos");
2428  for (i = 0; i < node->nkeys; i++)
2429  appendStringInfo(str, " %d", list_length(node->rinfos[i]));
2430 }
2431 
2432 static void
2434 {
2435  WRITE_NODE_TYPE("STATISTICEXTINFO");
2436 
2437  /* NB: this isn't a complete set of fields */
2438  WRITE_OID_FIELD(statOid);
2439  /* don't write rel, leads to infinite recursion in plan tree dump */
2440  WRITE_CHAR_FIELD(kind);
2441  WRITE_BITMAPSET_FIELD(keys);
2442 }
2443 
2444 static void
2446 {
2447  /*
2448  * To simplify reading, we just chase up to the topmost merged EC and
2449  * print that, without bothering to show the merge-ees separately.
2450  */
2451  while (node->ec_merged)
2452  node = node->ec_merged;
2453 
2454  WRITE_NODE_TYPE("EQUIVALENCECLASS");
2455 
2456  WRITE_NODE_FIELD(ec_opfamilies);
2457  WRITE_OID_FIELD(ec_collation);
2458  WRITE_NODE_FIELD(ec_members);
2459  WRITE_NODE_FIELD(ec_sources);
2460  WRITE_NODE_FIELD(ec_derives);
2461  WRITE_BITMAPSET_FIELD(ec_relids);
2462  WRITE_BOOL_FIELD(ec_has_const);
2463  WRITE_BOOL_FIELD(ec_has_volatile);
2464  WRITE_BOOL_FIELD(ec_below_outer_join);
2465  WRITE_BOOL_FIELD(ec_broken);
2466  WRITE_UINT_FIELD(ec_sortref);
2467  WRITE_UINT_FIELD(ec_min_security);
2468  WRITE_UINT_FIELD(ec_max_security);
2469 }
2470 
2471 static void
2473 {
2474  WRITE_NODE_TYPE("EQUIVALENCEMEMBER");
2475 
2476  WRITE_NODE_FIELD(em_expr);
2477  WRITE_BITMAPSET_FIELD(em_relids);
2478  WRITE_BITMAPSET_FIELD(em_nullable_relids);
2479  WRITE_BOOL_FIELD(em_is_const);
2480  WRITE_BOOL_FIELD(em_is_child);
2481  WRITE_OID_FIELD(em_datatype);
2482 }
2483 
2484 static void
2486 {
2487  WRITE_NODE_TYPE("PATHKEY");
2488 
2489  WRITE_NODE_FIELD(pk_eclass);
2490  WRITE_OID_FIELD(pk_opfamily);
2491  WRITE_INT_FIELD(pk_strategy);
2492  WRITE_BOOL_FIELD(pk_nulls_first);
2493 }
2494 
2495 static void
2497 {
2498  WRITE_NODE_TYPE("PATHTARGET");
2499 
2500  WRITE_NODE_FIELD(exprs);
2501  if (node->sortgrouprefs)
2502  {
2503  int i;
2504 
2505  appendStringInfoString(str, " :sortgrouprefs");
2506  for (i = 0; i < list_length(node->exprs); i++)
2507  appendStringInfo(str, " %u", node->sortgrouprefs[i]);
2508  }
2509  WRITE_FLOAT_FIELD(cost.startup, "%.2f");
2510  WRITE_FLOAT_FIELD(cost.per_tuple, "%.2f");
2511  WRITE_INT_FIELD(width);
2512  WRITE_ENUM_FIELD(has_volatile_expr, VolatileFunctionStatus);
2513 }
2514 
2515 static void
2517 {
2518  WRITE_NODE_TYPE("PARAMPATHINFO");
2519 
2520  WRITE_BITMAPSET_FIELD(ppi_req_outer);
2521  WRITE_FLOAT_FIELD(ppi_rows, "%.0f");
2522  WRITE_NODE_FIELD(ppi_clauses);
2523 }
2524 
2525 static void
2527 {
2528  WRITE_NODE_TYPE("RESTRICTINFO");
2529 
2530  /* NB: this isn't a complete set of fields */
2531  WRITE_NODE_FIELD(clause);
2532  WRITE_BOOL_FIELD(is_pushed_down);
2533  WRITE_BOOL_FIELD(outerjoin_delayed);
2534  WRITE_BOOL_FIELD(can_join);
2535  WRITE_BOOL_FIELD(pseudoconstant);
2536  WRITE_BOOL_FIELD(leakproof);
2538  WRITE_UINT_FIELD(security_level);
2539  WRITE_BITMAPSET_FIELD(clause_relids);
2540  WRITE_BITMAPSET_FIELD(required_relids);
2541  WRITE_BITMAPSET_FIELD(outer_relids);
2542  WRITE_BITMAPSET_FIELD(nullable_relids);
2543  WRITE_BITMAPSET_FIELD(left_relids);
2544  WRITE_BITMAPSET_FIELD(right_relids);
2545  WRITE_NODE_FIELD(orclause);
2546  /* don't write parent_ec, leads to infinite recursion in plan tree dump */
2547  WRITE_FLOAT_FIELD(norm_selec, "%.4f");
2548  WRITE_FLOAT_FIELD(outer_selec, "%.4f");
2549  WRITE_NODE_FIELD(mergeopfamilies);
2550  /* don't write left_ec, leads to infinite recursion in plan tree dump */
2551  /* don't write right_ec, leads to infinite recursion in plan tree dump */
2552  WRITE_NODE_FIELD(left_em);
2553  WRITE_NODE_FIELD(right_em);
2554  WRITE_BOOL_FIELD(outer_is_left);
2555  WRITE_OID_FIELD(hashjoinoperator);
2556  WRITE_OID_FIELD(hasheqoperator);
2557 }
2558 
2559 static void
2561 {
2562  WRITE_NODE_TYPE("INDEXCLAUSE");
2563 
2564  WRITE_NODE_FIELD(rinfo);
2565  WRITE_NODE_FIELD(indexquals);
2566  WRITE_BOOL_FIELD(lossy);
2567  WRITE_INT_FIELD(indexcol);
2568  WRITE_NODE_FIELD(indexcols);
2569 }
2570 
2571 static void
2573 {
2574  WRITE_NODE_TYPE("PLACEHOLDERVAR");
2575 
2576  WRITE_NODE_FIELD(phexpr);
2577  WRITE_BITMAPSET_FIELD(phrels);
2578  WRITE_UINT_FIELD(phid);
2579  WRITE_UINT_FIELD(phlevelsup);
2580 }
2581 
2582 static void
2584 {
2585  WRITE_NODE_TYPE("SPECIALJOININFO");
2586 
2587  WRITE_BITMAPSET_FIELD(min_lefthand);
2588  WRITE_BITMAPSET_FIELD(min_righthand);
2589  WRITE_BITMAPSET_FIELD(syn_lefthand);
2590  WRITE_BITMAPSET_FIELD(syn_righthand);
2591  WRITE_ENUM_FIELD(jointype, JoinType);
2592  WRITE_BOOL_FIELD(lhs_strict);
2593  WRITE_BOOL_FIELD(delay_upper_joins);
2594  WRITE_BOOL_FIELD(semi_can_btree);
2595  WRITE_BOOL_FIELD(semi_can_hash);
2596  WRITE_NODE_FIELD(semi_operators);
2597  WRITE_NODE_FIELD(semi_rhs_exprs);
2598 }
2599 
2600 static void
2602 {
2603  WRITE_NODE_TYPE("APPENDRELINFO");
2604 
2605  WRITE_UINT_FIELD(parent_relid);
2606  WRITE_UINT_FIELD(child_relid);
2607  WRITE_OID_FIELD(parent_reltype);
2608  WRITE_OID_FIELD(child_reltype);
2609  WRITE_NODE_FIELD(translated_vars);
2610  WRITE_INT_FIELD(num_child_cols);
2611  WRITE_ATTRNUMBER_ARRAY(parent_colnos, node->num_child_cols);
2612  WRITE_OID_FIELD(parent_reloid);
2613 }
2614 
2615 static void
2617 {
2618  WRITE_NODE_TYPE("ROWIDENTITYVARINFO");
2619 
2620  WRITE_NODE_FIELD(rowidvar);
2621  WRITE_INT_FIELD(rowidwidth);
2622  WRITE_STRING_FIELD(rowidname);
2623  WRITE_BITMAPSET_FIELD(rowidrels);
2624 }
2625 
2626 static void
2628 {
2629  WRITE_NODE_TYPE("PLACEHOLDERINFO");
2630 
2631  WRITE_UINT_FIELD(phid);
2632  WRITE_NODE_FIELD(ph_var);
2633  WRITE_BITMAPSET_FIELD(ph_eval_at);
2634  WRITE_BITMAPSET_FIELD(ph_lateral);
2635  WRITE_BITMAPSET_FIELD(ph_needed);
2636  WRITE_INT_FIELD(ph_width);
2637 }
2638 
2639 static void
2641 {
2642  WRITE_NODE_TYPE("MINMAXAGGINFO");
2643 
2644  WRITE_OID_FIELD(aggfnoid);
2645  WRITE_OID_FIELD(aggsortop);
2646  WRITE_NODE_FIELD(target);
2647  /* We intentionally omit subroot --- too large, not interesting enough */
2648  WRITE_NODE_FIELD(path);
2649  WRITE_FLOAT_FIELD(pathcost, "%.2f");
2650  WRITE_NODE_FIELD(param);
2651 }
2652 
2653 static void
2655 {
2656  WRITE_NODE_TYPE("PLANNERPARAMITEM");
2657 
2658  WRITE_NODE_FIELD(item);
2659  WRITE_INT_FIELD(paramId);
2660 }
2661 
2662 /*****************************************************************************
2663  *
2664  * Stuff from extensible.h
2665  *
2666  *****************************************************************************/
2667 
2668 static void
2670 {
2671  const ExtensibleNodeMethods *methods;
2672 
2673  methods = GetExtensibleNodeMethods(node->extnodename, false);
2674 
2675  WRITE_NODE_TYPE("EXTENSIBLENODE");
2676 
2677  WRITE_STRING_FIELD(extnodename);
2678 
2679  /* serialize the private fields */
2680  methods->nodeOut(str, node);
2681 }
2682 
2683 /*****************************************************************************
2684  *
2685  * Stuff from parsenodes.h.
2686  *
2687  *****************************************************************************/
2688 
2689 /*
2690  * print the basic stuff of all nodes that inherit from CreateStmt
2691  */
2692 static void
2694 {
2695  WRITE_NODE_FIELD(relation);
2696  WRITE_NODE_FIELD(tableElts);
2697  WRITE_NODE_FIELD(inhRelations);
2698  WRITE_NODE_FIELD(partspec);
2699  WRITE_NODE_FIELD(partbound);
2700  WRITE_NODE_FIELD(ofTypename);
2701  WRITE_NODE_FIELD(constraints);
2703  WRITE_ENUM_FIELD(oncommit, OnCommitAction);
2704  WRITE_STRING_FIELD(tablespacename);
2705  WRITE_STRING_FIELD(accessMethod);
2706  WRITE_BOOL_FIELD(if_not_exists);
2707 }
2708 
2709 static void
2711 {
2712  WRITE_NODE_TYPE("CREATESTMT");
2713 
2714  _outCreateStmtInfo(str, (const CreateStmt *) node);
2715 }
2716 
2717 static void
2719 {
2720  WRITE_NODE_TYPE("CREATEFOREIGNTABLESTMT");
2721 
2722  _outCreateStmtInfo(str, (const CreateStmt *) node);
2723 
2724  WRITE_STRING_FIELD(servername);
2726 }
2727 
2728 static void
2730 {
2731  WRITE_NODE_TYPE("IMPORTFOREIGNSCHEMASTMT");
2732 
2733  WRITE_STRING_FIELD(server_name);
2734  WRITE_STRING_FIELD(remote_schema);
2735  WRITE_STRING_FIELD(local_schema);
2737  WRITE_NODE_FIELD(table_list);
2739 }
2740 
2741 static void
2743 {
2744  WRITE_NODE_TYPE("INDEXSTMT");
2745 
2746  WRITE_STRING_FIELD(idxname);
2747  WRITE_NODE_FIELD(relation);
2748  WRITE_STRING_FIELD(accessMethod);
2749  WRITE_STRING_FIELD(tableSpace);
2750  WRITE_NODE_FIELD(indexParams);
2751  WRITE_NODE_FIELD(indexIncludingParams);
2753  WRITE_NODE_FIELD(whereClause);
2754  WRITE_NODE_FIELD(excludeOpNames);
2755  WRITE_STRING_FIELD(idxcomment);
2756  WRITE_OID_FIELD(indexOid);
2757  WRITE_OID_FIELD(oldNode);
2758  WRITE_UINT_FIELD(oldCreateSubid);
2759  WRITE_UINT_FIELD(oldFirstRelfilenodeSubid);
2760  WRITE_BOOL_FIELD(unique);
2761  WRITE_BOOL_FIELD(primary);
2762  WRITE_BOOL_FIELD(isconstraint);
2763  WRITE_BOOL_FIELD(deferrable);
2764  WRITE_BOOL_FIELD(initdeferred);
2765  WRITE_BOOL_FIELD(transformed);
2766  WRITE_BOOL_FIELD(concurrent);
2767  WRITE_BOOL_FIELD(if_not_exists);
2768  WRITE_BOOL_FIELD(reset_default_tblspc);
2769 }
2770 
2771 static void
2773 {
2774  WRITE_NODE_TYPE("CREATESTATSSTMT");
2775 
2776  WRITE_NODE_FIELD(defnames);
2777  WRITE_NODE_FIELD(stat_types);
2778  WRITE_NODE_FIELD(exprs);
2779  WRITE_NODE_FIELD(relations);
2780  WRITE_STRING_FIELD(stxcomment);
2781  WRITE_BOOL_FIELD(if_not_exists);
2782 }
2783 
2784 static void
2786 {
2787  WRITE_NODE_TYPE("ALTERSTATSSTMT");
2788 
2789  WRITE_NODE_FIELD(defnames);
2790  WRITE_INT_FIELD(stxstattarget);
2791  WRITE_BOOL_FIELD(missing_ok);
2792 }
2793 
2794 static void
2796 {
2797  WRITE_NODE_TYPE("NOTIFY");
2798 
2799  WRITE_STRING_FIELD(conditionname);
2800  WRITE_STRING_FIELD(payload);
2801 }
2802 
2803 static void
2805 {
2806  WRITE_NODE_TYPE("DECLARECURSOR");
2807 
2808  WRITE_STRING_FIELD(portalname);
2810  WRITE_NODE_FIELD(query);
2811 }
2812 
2813 static void
2815 {
2816  WRITE_NODE_TYPE("SELECT");
2817 
2818  WRITE_NODE_FIELD(distinctClause);
2819  WRITE_NODE_FIELD(intoClause);
2820  WRITE_NODE_FIELD(targetList);
2821  WRITE_NODE_FIELD(fromClause);
2822  WRITE_NODE_FIELD(whereClause);
2823  WRITE_NODE_FIELD(groupClause);
2824  WRITE_BOOL_FIELD(groupDistinct);
2825  WRITE_NODE_FIELD(havingClause);
2826  WRITE_NODE_FIELD(windowClause);
2827  WRITE_NODE_FIELD(valuesLists);
2828  WRITE_NODE_FIELD(sortClause);
2829  WRITE_NODE_FIELD(limitOffset);
2830  WRITE_NODE_FIELD(limitCount);
2831  WRITE_ENUM_FIELD(limitOption, LimitOption);
2832  WRITE_NODE_FIELD(lockingClause);
2833  WRITE_NODE_FIELD(withClause);
2835  WRITE_BOOL_FIELD(all);
2836  WRITE_NODE_FIELD(larg);
2837  WRITE_NODE_FIELD(rarg);
2838 }
2839 
2840 static void
2842 {
2843  WRITE_NODE_TYPE("RETURN");
2844 
2845  WRITE_NODE_FIELD(returnval);
2846 }
2847 
2848 static void
2850 {
2851  WRITE_NODE_TYPE("PLASSIGN");
2852 
2854  WRITE_NODE_FIELD(indirection);
2855  WRITE_INT_FIELD(nnames);
2857  WRITE_LOCATION_FIELD(location);
2858 }
2859 
2860 static void
2862 {
2863  WRITE_NODE_TYPE("FUNCCALL");
2864 
2865  WRITE_NODE_FIELD(funcname);
2867  WRITE_NODE_FIELD(agg_order);
2868  WRITE_NODE_FIELD(agg_filter);
2869  WRITE_NODE_FIELD(over);
2870  WRITE_BOOL_FIELD(agg_within_group);
2871  WRITE_BOOL_FIELD(agg_star);
2872  WRITE_BOOL_FIELD(agg_distinct);
2873  WRITE_BOOL_FIELD(func_variadic);
2874  WRITE_ENUM_FIELD(funcformat, CoercionForm);
2875  WRITE_LOCATION_FIELD(location);
2876 }
2877 
2878 static void
2880 {
2881  WRITE_NODE_TYPE("DEFELEM");
2882 
2883  WRITE_STRING_FIELD(defnamespace);
2884  WRITE_STRING_FIELD(defname);
2886  WRITE_ENUM_FIELD(defaction, DefElemAction);
2887  WRITE_LOCATION_FIELD(location);
2888 }
2889 
2890 static void
2892 {
2893  WRITE_NODE_TYPE("TABLELIKECLAUSE");
2894 
2895  WRITE_NODE_FIELD(relation);
2897  WRITE_OID_FIELD(relationOid);
2898 }
2899 
2900 static void
2902 {
2903  WRITE_NODE_TYPE("LOCKINGCLAUSE");
2904 
2905  WRITE_NODE_FIELD(lockedRels);
2907  WRITE_ENUM_FIELD(waitPolicy, LockWaitPolicy);
2908 }
2909 
2910 static void
2912 {
2913  WRITE_NODE_TYPE("XMLSERIALIZE");
2914 
2916  WRITE_NODE_FIELD(expr);
2917  WRITE_NODE_FIELD(typeName);
2918  WRITE_LOCATION_FIELD(location);
2919 }
2920 
2921 static void
2923 {
2924  WRITE_NODE_TYPE("TRIGGERTRANSITION");
2925 
2927  WRITE_BOOL_FIELD(isNew);
2928  WRITE_BOOL_FIELD(isTable);
2929 }
2930 
2931 static void
2933 {
2934  WRITE_NODE_TYPE("COLUMNDEF");
2935 
2936  WRITE_STRING_FIELD(colname);
2937  WRITE_NODE_FIELD(typeName);
2938  WRITE_STRING_FIELD(compression);
2939  WRITE_INT_FIELD(inhcount);
2940  WRITE_BOOL_FIELD(is_local);
2941  WRITE_BOOL_FIELD(is_not_null);
2942  WRITE_BOOL_FIELD(is_from_type);
2943  WRITE_CHAR_FIELD(storage);
2944  WRITE_NODE_FIELD(raw_default);
2945  WRITE_NODE_FIELD(cooked_default);
2946  WRITE_CHAR_FIELD(identity);
2947  WRITE_NODE_FIELD(identitySequence);
2948  WRITE_CHAR_FIELD(generated);
2949  WRITE_NODE_FIELD(collClause);
2950  WRITE_OID_FIELD(collOid);
2951  WRITE_NODE_FIELD(constraints);
2952  WRITE_NODE_FIELD(fdwoptions);
2953  WRITE_LOCATION_FIELD(location);
2954 }
2955 
2956 static void
2958 {
2959  WRITE_NODE_TYPE("TYPENAME");
2960 
2961  WRITE_NODE_FIELD(names);
2962  WRITE_OID_FIELD(typeOid);
2963  WRITE_BOOL_FIELD(setof);
2964  WRITE_BOOL_FIELD(pct_type);
2965  WRITE_NODE_FIELD(typmods);
2966  WRITE_INT_FIELD(typemod);
2967  WRITE_NODE_FIELD(arrayBounds);
2968  WRITE_LOCATION_FIELD(location);
2969 }
2970 
2971 static void
2973 {
2974  WRITE_NODE_TYPE("TYPECAST");
2975 
2977  WRITE_NODE_FIELD(typeName);
2978  WRITE_LOCATION_FIELD(location);
2979 }
2980 
2981 static void
2983 {
2984  WRITE_NODE_TYPE("COLLATECLAUSE");
2985 
2987  WRITE_NODE_FIELD(collname);
2988  WRITE_LOCATION_FIELD(location);
2989 }
2990 
2991 static void
2993 {
2994  WRITE_NODE_TYPE("INDEXELEM");
2995 
2997  WRITE_NODE_FIELD(expr);
2998  WRITE_STRING_FIELD(indexcolname);
2999  WRITE_NODE_FIELD(collation);
3000  WRITE_NODE_FIELD(opclass);
3001  WRITE_NODE_FIELD(opclassopts);
3002  WRITE_ENUM_FIELD(ordering, SortByDir);
3003  WRITE_ENUM_FIELD(nulls_ordering, SortByNulls);
3004 }
3005 
3006 static void
3008 {
3009  WRITE_NODE_TYPE("STATSELEM");
3010 
3012  WRITE_NODE_FIELD(expr);
3013 }
3014 
3015 static void
3017 {
3018  WRITE_NODE_TYPE("QUERY");
3019 
3020  WRITE_ENUM_FIELD(commandType, CmdType);
3021  WRITE_ENUM_FIELD(querySource, QuerySource);
3022  /* we intentionally do not print the queryId field */
3023  WRITE_BOOL_FIELD(canSetTag);
3024 
3025  /*
3026  * Hack to work around missing outfuncs routines for a lot of the
3027  * utility-statement node types. (The only one we actually *need* for
3028  * rules support is NotifyStmt.) Someday we ought to support 'em all, but
3029  * for the meantime do this to avoid getting lots of warnings when running
3030  * with debug_print_parse on.
3031  */
3032  if (node->utilityStmt)
3033  {
3034  switch (nodeTag(node->utilityStmt))
3035  {
3036  case T_CreateStmt:
3037  case T_IndexStmt:
3038  case T_NotifyStmt:
3039  case T_DeclareCursorStmt:
3040  WRITE_NODE_FIELD(utilityStmt);
3041  break;
3042  default:
3043  appendStringInfoString(str, " :utilityStmt ?");
3044  break;
3045  }
3046  }
3047  else
3048  appendStringInfoString(str, " :utilityStmt <>");
3049 
3050  WRITE_INT_FIELD(resultRelation);
3051  WRITE_BOOL_FIELD(hasAggs);
3052  WRITE_BOOL_FIELD(hasWindowFuncs);
3053  WRITE_BOOL_FIELD(hasTargetSRFs);
3054  WRITE_BOOL_FIELD(hasSubLinks);
3055  WRITE_BOOL_FIELD(hasDistinctOn);
3056  WRITE_BOOL_FIELD(hasRecursive);
3057  WRITE_BOOL_FIELD(hasModifyingCTE);
3058  WRITE_BOOL_FIELD(hasForUpdate);
3059  WRITE_BOOL_FIELD(hasRowSecurity);
3060  WRITE_BOOL_FIELD(isReturn);
3061  WRITE_NODE_FIELD(cteList);
3062  WRITE_NODE_FIELD(rtable);
3063  WRITE_NODE_FIELD(jointree);
3064  WRITE_NODE_FIELD(targetList);
3065  WRITE_ENUM_FIELD(override, OverridingKind);
3066  WRITE_NODE_FIELD(onConflict);
3067  WRITE_NODE_FIELD(returningList);
3068  WRITE_NODE_FIELD(groupClause);
3069  WRITE_BOOL_FIELD(groupDistinct);
3070  WRITE_NODE_FIELD(groupingSets);
3071  WRITE_NODE_FIELD(havingQual);
3072  WRITE_NODE_FIELD(windowClause);
3073  WRITE_NODE_FIELD(distinctClause);
3074  WRITE_NODE_FIELD(sortClause);
3075  WRITE_NODE_FIELD(limitOffset);
3076  WRITE_NODE_FIELD(limitCount);
3077  WRITE_ENUM_FIELD(limitOption, LimitOption);
3078  WRITE_NODE_FIELD(rowMarks);
3079  WRITE_NODE_FIELD(setOperations);
3080  WRITE_NODE_FIELD(constraintDeps);
3081  WRITE_NODE_FIELD(withCheckOptions);
3082  WRITE_LOCATION_FIELD(stmt_location);
3083  WRITE_INT_FIELD(stmt_len);
3084 }
3085 
3086 static void
3088 {
3089  WRITE_NODE_TYPE("WITHCHECKOPTION");
3090 
3091  WRITE_ENUM_FIELD(kind, WCOKind);
3093  WRITE_STRING_FIELD(polname);
3094  WRITE_NODE_FIELD(qual);
3095  WRITE_BOOL_FIELD(cascaded);
3096 }
3097 
3098 static void
3100 {
3101  WRITE_NODE_TYPE("SORTGROUPCLAUSE");
3102 
3103  WRITE_UINT_FIELD(tleSortGroupRef);
3104  WRITE_OID_FIELD(eqop);
3105  WRITE_OID_FIELD(sortop);
3106  WRITE_BOOL_FIELD(nulls_first);
3107  WRITE_BOOL_FIELD(hashable);
3108 }
3109 
3110 static void
3112 {
3113  WRITE_NODE_TYPE("GROUPINGSET");
3114 
3116  WRITE_NODE_FIELD(content);
3117  WRITE_LOCATION_FIELD(location);
3118 }
3119 
3120 static void
3122 {
3123  WRITE_NODE_TYPE("WINDOWCLAUSE");
3124 
3126  WRITE_STRING_FIELD(refname);
3127  WRITE_NODE_FIELD(partitionClause);
3128  WRITE_NODE_FIELD(orderClause);
3129  WRITE_INT_FIELD(frameOptions);
3130  WRITE_NODE_FIELD(startOffset);
3131  WRITE_NODE_FIELD(endOffset);
3132  WRITE_OID_FIELD(startInRangeFunc);
3133  WRITE_OID_FIELD(endInRangeFunc);
3134  WRITE_OID_FIELD(inRangeColl);
3135  WRITE_BOOL_FIELD(inRangeAsc);
3136  WRITE_BOOL_FIELD(inRangeNullsFirst);
3137  WRITE_UINT_FIELD(winref);
3138  WRITE_BOOL_FIELD(copiedOrder);
3139 }
3140 
3141 static void
3143 {
3144  WRITE_NODE_TYPE("ROWMARKCLAUSE");
3145 
3146  WRITE_UINT_FIELD(rti);
3148  WRITE_ENUM_FIELD(waitPolicy, LockWaitPolicy);
3149  WRITE_BOOL_FIELD(pushedDown);
3150 }
3151 
3152 static void
3154 {
3155  WRITE_NODE_TYPE("WITHCLAUSE");
3156 
3157  WRITE_NODE_FIELD(ctes);
3158  WRITE_BOOL_FIELD(recursive);
3159  WRITE_LOCATION_FIELD(location);
3160 }
3161 
3162 static void
3164 {
3165  WRITE_NODE_TYPE("CTESEARCHCLAUSE");
3166 
3167  WRITE_NODE_FIELD(search_col_list);
3168  WRITE_BOOL_FIELD(search_breadth_first);
3169  WRITE_STRING_FIELD(search_seq_column);
3170  WRITE_LOCATION_FIELD(location);
3171 }
3172 
3173 static void
3175 {
3176  WRITE_NODE_TYPE("CTECYCLECLAUSE");
3177 
3178  WRITE_NODE_FIELD(cycle_col_list);
3179  WRITE_STRING_FIELD(cycle_mark_column);
3180  WRITE_NODE_FIELD(cycle_mark_value);
3181  WRITE_NODE_FIELD(cycle_mark_default);
3182  WRITE_STRING_FIELD(cycle_path_column);
3183  WRITE_LOCATION_FIELD(location);
3184  WRITE_OID_FIELD(cycle_mark_type);
3185  WRITE_INT_FIELD(cycle_mark_typmod);
3186  WRITE_OID_FIELD(cycle_mark_collation);
3187  WRITE_OID_FIELD(cycle_mark_neop);
3188 }
3189 
3190 static void
3192 {
3193  WRITE_NODE_TYPE("COMMONTABLEEXPR");
3194 
3195  WRITE_STRING_FIELD(ctename);
3196  WRITE_NODE_FIELD(aliascolnames);
3197  WRITE_ENUM_FIELD(ctematerialized, CTEMaterialize);
3198  WRITE_NODE_FIELD(ctequery);
3199  WRITE_NODE_FIELD(search_clause);
3200  WRITE_NODE_FIELD(cycle_clause);
3201  WRITE_LOCATION_FIELD(location);
3202  WRITE_BOOL_FIELD(cterecursive);
3203  WRITE_INT_FIELD(cterefcount);
3204  WRITE_NODE_FIELD(ctecolnames);
3205  WRITE_NODE_FIELD(ctecoltypes);
3206  WRITE_NODE_FIELD(ctecoltypmods);
3207  WRITE_NODE_FIELD(ctecolcollations);
3208 }
3209 
3210 static void
3212 {
3213  WRITE_NODE_TYPE("SETOPERATIONSTMT");
3214 
3216  WRITE_BOOL_FIELD(all);
3217  WRITE_NODE_FIELD(larg);
3218  WRITE_NODE_FIELD(rarg);
3219  WRITE_NODE_FIELD(colTypes);
3220  WRITE_NODE_FIELD(colTypmods);
3221  WRITE_NODE_FIELD(colCollations);
3222  WRITE_NODE_FIELD(groupClauses);
3223 }
3224 
3225 static void
3227 {
3228  WRITE_NODE_TYPE("RTE");
3229 
3230  /* put alias + eref first to make dump more legible */
3231  WRITE_NODE_FIELD(alias);
3232  WRITE_NODE_FIELD(eref);
3233  WRITE_ENUM_FIELD(rtekind, RTEKind);
3234 
3235  switch (node->rtekind)
3236  {
3237  case RTE_RELATION:
3238  WRITE_OID_FIELD(relid);
3239  WRITE_CHAR_FIELD(relkind);
3240  WRITE_INT_FIELD(rellockmode);
3241  WRITE_NODE_FIELD(tablesample);
3242  break;
3243  case RTE_SUBQUERY:
3244  WRITE_NODE_FIELD(subquery);
3245  WRITE_BOOL_FIELD(security_barrier);
3246  break;
3247  case RTE_JOIN:
3248  WRITE_ENUM_FIELD(jointype, JoinType);
3249  WRITE_INT_FIELD(joinmergedcols);
3250  WRITE_NODE_FIELD(joinaliasvars);
3251  WRITE_NODE_FIELD(joinleftcols);
3252  WRITE_NODE_FIELD(joinrightcols);
3253  WRITE_NODE_FIELD(join_using_alias);
3254  break;
3255  case RTE_FUNCTION:
3257  WRITE_BOOL_FIELD(funcordinality);
3258  break;
3259  case RTE_TABLEFUNC:
3260  WRITE_NODE_FIELD(tablefunc);
3261  break;
3262  case RTE_VALUES:
3263  WRITE_NODE_FIELD(values_lists);
3264  WRITE_NODE_FIELD(coltypes);
3265  WRITE_NODE_FIELD(coltypmods);
3266  WRITE_NODE_FIELD(colcollations);
3267  break;
3268  case RTE_CTE:
3269  WRITE_STRING_FIELD(ctename);
3270  WRITE_UINT_FIELD(ctelevelsup);
3271  WRITE_BOOL_FIELD(self_reference);
3272  WRITE_NODE_FIELD(coltypes);
3273  WRITE_NODE_FIELD(coltypmods);
3274  WRITE_NODE_FIELD(colcollations);
3275  break;
3276  case RTE_NAMEDTUPLESTORE:
3277  WRITE_STRING_FIELD(enrname);
3278  WRITE_FLOAT_FIELD(enrtuples, "%.0f");
3279  WRITE_OID_FIELD(relid);
3280  WRITE_NODE_FIELD(coltypes);
3281  WRITE_NODE_FIELD(coltypmods);
3282  WRITE_NODE_FIELD(colcollations);
3283  break;
3284  case RTE_RESULT:
3285  /* no extra fields */
3286  break;
3287  default:
3288  elog(ERROR, "unrecognized RTE kind: %d", (int) node->rtekind);
3289  break;
3290  }
3291 
3292  WRITE_BOOL_FIELD(lateral);
3293  WRITE_BOOL_FIELD(inh);
3294  WRITE_BOOL_FIELD(inFromCl);
3295  WRITE_UINT_FIELD(requiredPerms);
3296  WRITE_OID_FIELD(checkAsUser);
3297  WRITE_BITMAPSET_FIELD(selectedCols);
3298  WRITE_BITMAPSET_FIELD(insertedCols);
3299  WRITE_BITMAPSET_FIELD(updatedCols);
3300  WRITE_BITMAPSET_FIELD(extraUpdatedCols);
3301  WRITE_NODE_FIELD(securityQuals);
3302 }
3303 
3304 static void
3306 {
3307  WRITE_NODE_TYPE("RANGETBLFUNCTION");
3308 
3309  WRITE_NODE_FIELD(funcexpr);
3310  WRITE_INT_FIELD(funccolcount);
3311  WRITE_NODE_FIELD(funccolnames);
3312  WRITE_NODE_FIELD(funccoltypes);
3313  WRITE_NODE_FIELD(funccoltypmods);
3314  WRITE_NODE_FIELD(funccolcollations);
3315  WRITE_BITMAPSET_FIELD(funcparams);
3316 }
3317 
3318 static void
3320 {
3321  WRITE_NODE_TYPE("TABLESAMPLECLAUSE");
3322 
3323  WRITE_OID_FIELD(tsmhandler);
3325  WRITE_NODE_FIELD(repeatable);
3326 }
3327 
3328 static void
3330 {
3331  WRITE_NODE_TYPE("AEXPR");
3332 
3333  switch (node->kind)
3334  {
3335  case AEXPR_OP:
3336  appendStringInfoChar(str, ' ');
3338  break;
3339  case AEXPR_OP_ANY:
3340  appendStringInfoChar(str, ' ');
3342  appendStringInfoString(str, " ANY ");
3343  break;
3344  case AEXPR_OP_ALL:
3345  appendStringInfoChar(str, ' ');
3347  appendStringInfoString(str, " ALL ");
3348  break;
3349  case AEXPR_DISTINCT:
3350  appendStringInfoString(str, " DISTINCT ");
3352  break;
3353  case AEXPR_NOT_DISTINCT:
3354  appendStringInfoString(str, " NOT_DISTINCT ");
3356  break;
3357  case AEXPR_NULLIF:
3358  appendStringInfoString(str, " NULLIF ");
3360  break;
3361  case AEXPR_IN:
3362  appendStringInfoString(str, " IN ");
3364  break;
3365  case AEXPR_LIKE:
3366  appendStringInfoString(str, " LIKE ");
3368  break;
3369  case AEXPR_ILIKE:
3370  appendStringInfoString(str, " ILIKE ");
3372  break;
3373  case AEXPR_SIMILAR:
3374  appendStringInfoString(str, " SIMILAR ");
3376  break;
3377  case AEXPR_BETWEEN:
3378  appendStringInfoString(str, " BETWEEN ");
3380  break;
3381  case AEXPR_NOT_BETWEEN:
3382  appendStringInfoString(str, " NOT_BETWEEN ");
3384  break;
3385  case AEXPR_BETWEEN_SYM:
3386  appendStringInfoString(str, " BETWEEN_SYM ");
3388  break;
3389  case AEXPR_NOT_BETWEEN_SYM:
3390  appendStringInfoString(str, " NOT_BETWEEN_SYM ");
3392  break;
3393  default:
3394  appendStringInfoString(str, " ??");
3395  break;
3396  }
3397 
3398  WRITE_NODE_FIELD(lexpr);
3399  WRITE_NODE_FIELD(rexpr);
3400  WRITE_LOCATION_FIELD(location);
3401 }
3402 
3403 static void
3405 {
3406  switch (value->type)
3407  {
3408  case T_Integer:
3409  appendStringInfo(str, "%d", value->val.ival);
3410  break;
3411  case T_Float:
3412 
3413  /*
3414  * We assume the value is a valid numeric literal and so does not
3415  * need quoting.
3416  */
3417  appendStringInfoString(str, value->val.str);
3418  break;
3419  case T_String:
3420 
3421  /*
3422  * We use outToken to provide escaping of the string's content,
3423  * but we don't want it to do anything with an empty string.
3424  */
3425  appendStringInfoChar(str, '"');
3426  if (value->val.str[0] != '\0')
3427  outToken(str, value->val.str);
3428  appendStringInfoChar(str, '"');
3429  break;
3430  case T_BitString:
3431  /* internal representation already has leading 'b' */
3432  appendStringInfoString(str, value->val.str);
3433  break;
3434  case T_Null:
3435  /* this is seen only within A_Const, not in transformed trees */
3436  appendStringInfoString(str, "NULL");
3437  break;
3438  default:
3439  elog(ERROR, "unrecognized node type: %d", (int) value->type);
3440  break;
3441  }
3442 }
3443 
3444 static void
3446 {
3447  WRITE_NODE_TYPE("COLUMNREF");
3448 
3449  WRITE_NODE_FIELD(fields);
3450  WRITE_LOCATION_FIELD(location);
3451 }
3452 
3453 static void
3455 {
3456  WRITE_NODE_TYPE("PARAMREF");
3457 
3458  WRITE_INT_FIELD(number);
3459  WRITE_LOCATION_FIELD(location);
3460 }
3461 
3462 /*
3463  * Node types found in raw parse trees (supported for debug purposes)
3464  */
3465 
3466 static void
3468 {
3469  WRITE_NODE_TYPE("RAWSTMT");
3470 
3471  WRITE_NODE_FIELD(stmt);
3472  WRITE_LOCATION_FIELD(stmt_location);
3473  WRITE_INT_FIELD(stmt_len);
3474 }
3475 
3476 static void
3478 {
3479  WRITE_NODE_TYPE("A_CONST");
3480 
3481  appendStringInfoString(str, " :val ");
3482  _outValue(str, &(node->val));
3483  WRITE_LOCATION_FIELD(location);
3484 }
3485 
3486 static void
3488 {
3489  WRITE_NODE_TYPE("A_STAR");
3490 }
3491 
3492 static void
3494 {
3495  WRITE_NODE_TYPE("A_INDICES");
3496 
3497  WRITE_BOOL_FIELD(is_slice);
3498  WRITE_NODE_FIELD(lidx);
3499  WRITE_NODE_FIELD(uidx);
3500 }
3501 
3502 static void
3504 {
3505  WRITE_NODE_TYPE("A_INDIRECTION");
3506 
3508  WRITE_NODE_FIELD(indirection);
3509 }
3510 
3511 static void
3513 {
3514  WRITE_NODE_TYPE("A_ARRAYEXPR");
3515 
3516  WRITE_NODE_FIELD(elements);
3517  WRITE_LOCATION_FIELD(location);
3518 }
3519 
3520 static void
3522 {
3523  WRITE_NODE_TYPE("RESTARGET");
3524 
3526  WRITE_NODE_FIELD(indirection);
3528  WRITE_LOCATION_FIELD(location);
3529 }
3530 
3531 static void
3533 {
3534  WRITE_NODE_TYPE("MULTIASSIGNREF");
3535 
3537  WRITE_INT_FIELD(colno);
3538  WRITE_INT_FIELD(ncolumns);
3539 }
3540 
3541 static void
3543 {
3544  WRITE_NODE_TYPE("SORTBY");
3545 
3546  WRITE_NODE_FIELD(node);
3547  WRITE_ENUM_FIELD(sortby_dir, SortByDir);
3548  WRITE_ENUM_FIELD(sortby_nulls, SortByNulls);
3549  WRITE_NODE_FIELD(useOp);
3550  WRITE_LOCATION_FIELD(location);
3551 }
3552 
3553 static void
3555 {
3556  WRITE_NODE_TYPE("WINDOWDEF");
3557 
3559  WRITE_STRING_FIELD(refname);
3560  WRITE_NODE_FIELD(partitionClause);
3561  WRITE_NODE_FIELD(orderClause);
3562  WRITE_INT_FIELD(frameOptions);
3563  WRITE_NODE_FIELD(startOffset);
3564  WRITE_NODE_FIELD(endOffset);
3565  WRITE_LOCATION_FIELD(location);
3566 }
3567 
3568 static void
3570 {
3571  WRITE_NODE_TYPE("RANGESUBSELECT");
3572 
3573  WRITE_BOOL_FIELD(lateral);
3574  WRITE_NODE_FIELD(subquery);
3575  WRITE_NODE_FIELD(alias);
3576 }
3577 
3578 static void
3580 {
3581  WRITE_NODE_TYPE("RANGEFUNCTION");
3582 
3583  WRITE_BOOL_FIELD(lateral);
3584  WRITE_BOOL_FIELD(ordinality);
3585  WRITE_BOOL_FIELD(is_rowsfrom);
3587  WRITE_NODE_FIELD(alias);
3588  WRITE_NODE_FIELD(coldeflist);
3589 }
3590 
3591 static void
3593 {
3594  WRITE_NODE_TYPE("RANGETABLESAMPLE");
3595 
3596  WRITE_NODE_FIELD(relation);
3597  WRITE_NODE_FIELD(method);
3599  WRITE_NODE_FIELD(repeatable);
3600  WRITE_LOCATION_FIELD(location);
3601 }
3602 
3603 static void
3605 {
3606  WRITE_NODE_TYPE("RANGETABLEFUNC");
3607 
3608  WRITE_BOOL_FIELD(lateral);
3609  WRITE_NODE_FIELD(docexpr);
3610  WRITE_NODE_FIELD(rowexpr);
3611  WRITE_NODE_FIELD(namespaces);
3612  WRITE_NODE_FIELD(columns);
3613  WRITE_NODE_FIELD(alias);
3614  WRITE_LOCATION_FIELD(location);
3615 }
3616 
3617 static void
3619 {
3620  WRITE_NODE_TYPE("RANGETABLEFUNCCOL");
3621 
3622  WRITE_STRING_FIELD(colname);
3623  WRITE_NODE_FIELD(typeName);
3624  WRITE_BOOL_FIELD(for_ordinality);
3625  WRITE_BOOL_FIELD(is_not_null);
3626  WRITE_NODE_FIELD(colexpr);
3627  WRITE_NODE_FIELD(coldefexpr);
3628  WRITE_LOCATION_FIELD(location);
3629 }
3630 
3631 static void
3633 {
3634  WRITE_NODE_TYPE("CONSTRAINT");
3635 
3636  WRITE_STRING_FIELD(conname);
3637  WRITE_BOOL_FIELD(deferrable);
3638  WRITE_BOOL_FIELD(initdeferred);
3639  WRITE_LOCATION_FIELD(location);
3640 
3641  appendStringInfoString(str, " :contype ");
3642  switch (node->contype)
3643  {
3644  case CONSTR_NULL:
3645  appendStringInfoString(str, "NULL");
3646  break;
3647 
3648  case CONSTR_NOTNULL:
3649  appendStringInfoString(str, "NOT_NULL");
3650  break;
3651 
3652  case CONSTR_DEFAULT:
3653  appendStringInfoString(str, "DEFAULT");
3654  WRITE_NODE_FIELD(raw_expr);
3655  WRITE_STRING_FIELD(cooked_expr);
3656  break;
3657 
3658  case CONSTR_IDENTITY:
3659  appendStringInfoString(str, "IDENTITY");
3660  WRITE_NODE_FIELD(raw_expr);
3661  WRITE_STRING_FIELD(cooked_expr);
3662  WRITE_CHAR_FIELD(generated_when);
3663  break;
3664 
3665  case CONSTR_GENERATED:
3666  appendStringInfoString(str, "GENERATED");
3667  WRITE_NODE_FIELD(raw_expr);
3668  WRITE_STRING_FIELD(cooked_expr);
3669  WRITE_CHAR_FIELD(generated_when);
3670  break;
3671 
3672  case CONSTR_CHECK:
3673  appendStringInfoString(str, "CHECK");
3674  WRITE_BOOL_FIELD(is_no_inherit);
3675  WRITE_NODE_FIELD(raw_expr);
3676  WRITE_STRING_FIELD(cooked_expr);
3677  break;
3678 
3679  case CONSTR_PRIMARY:
3680  appendStringInfoString(str, "PRIMARY_KEY");
3681  WRITE_NODE_FIELD(keys);
3682  WRITE_NODE_FIELD(including);
3684  WRITE_STRING_FIELD(indexname);
3685  WRITE_STRING_FIELD(indexspace);
3686  WRITE_BOOL_FIELD(reset_default_tblspc);
3687  /* access_method and where_clause not currently used */
3688  break;
3689 
3690  case CONSTR_UNIQUE:
3691  appendStringInfoString(str, "UNIQUE");
3692  WRITE_NODE_FIELD(keys);
3693  WRITE_NODE_FIELD(including);
3695  WRITE_STRING_FIELD(indexname);
3696  WRITE_STRING_FIELD(indexspace);
3697  WRITE_BOOL_FIELD(reset_default_tblspc);
3698  /* access_method and where_clause not currently used */
3699  break;
3700 
3701  case CONSTR_EXCLUSION:
3702  appendStringInfoString(str, "EXCLUSION");
3703  WRITE_NODE_FIELD(exclusions);
3704  WRITE_NODE_FIELD(including);
3706  WRITE_STRING_FIELD(indexname);
3707  WRITE_STRING_FIELD(indexspace);
3708  WRITE_BOOL_FIELD(reset_default_tblspc);
3709  WRITE_STRING_FIELD(access_method);
3710  WRITE_NODE_FIELD(where_clause);
3711  break;
3712 
3713  case CONSTR_FOREIGN:
3714  appendStringInfoString(str, "FOREIGN_KEY");
3715  WRITE_NODE_FIELD(pktable);
3716  WRITE_NODE_FIELD(fk_attrs);
3717  WRITE_NODE_FIELD(pk_attrs);
3718  WRITE_CHAR_FIELD(fk_matchtype);
3719  WRITE_CHAR_FIELD(fk_upd_action);
3720  WRITE_CHAR_FIELD(fk_del_action);
3721  WRITE_NODE_FIELD(old_conpfeqop);
3722  WRITE_OID_FIELD(old_pktable_oid);
3723  WRITE_BOOL_FIELD(skip_validation);
3724  WRITE_BOOL_FIELD(initially_valid);
3725  break;
3726 
3728  appendStringInfoString(str, "ATTR_DEFERRABLE");
3729  break;
3730 
3732  appendStringInfoString(str, "ATTR_NOT_DEFERRABLE");
3733  break;
3734 
3735  case CONSTR_ATTR_DEFERRED:
3736  appendStringInfoString(str, "ATTR_DEFERRED");
3737  break;
3738 
3739  case CONSTR_ATTR_IMMEDIATE:
3740  appendStringInfoString(str, "ATTR_IMMEDIATE");
3741  break;
3742 
3743  default:
3744  appendStringInfo(str, "<unrecognized_constraint %d>",
3745  (int) node->contype);
3746  break;
3747  }
3748 }
3749 
3750 static void
3752 {
3753  WRITE_NODE_TYPE("FOREIGNKEYCACHEINFO");
3754 
3755  WRITE_OID_FIELD(conoid);
3756  WRITE_OID_FIELD(conrelid);
3757  WRITE_OID_FIELD(confrelid);
3758  WRITE_INT_FIELD(nkeys);
3759  WRITE_ATTRNUMBER_ARRAY(conkey, node->nkeys);
3760  WRITE_ATTRNUMBER_ARRAY(confkey, node->nkeys);
3761  WRITE_OID_ARRAY(conpfeqop, node->nkeys);
3762 }
3763 
3764 static void
3766 {
3767  WRITE_NODE_TYPE("PARTITIONELEM");
3768 
3770  WRITE_NODE_FIELD(expr);
3771  WRITE_NODE_FIELD(collation);
3772  WRITE_NODE_FIELD(opclass);
3773  WRITE_LOCATION_FIELD(location);
3774 }
3775 
3776 static void
3778 {
3779  WRITE_NODE_TYPE("PARTITIONSPEC");
3780 
3781  WRITE_STRING_FIELD(strategy);
3782  WRITE_NODE_FIELD(partParams);
3783  WRITE_LOCATION_FIELD(location);
3784 }
3785 
3786 static void
3788 {
3789  WRITE_NODE_TYPE("PARTITIONBOUNDSPEC");
3790 
3791  WRITE_CHAR_FIELD(strategy);
3792  WRITE_BOOL_FIELD(is_default);
3793  WRITE_INT_FIELD(modulus);
3794  WRITE_INT_FIELD(remainder);
3795  WRITE_NODE_FIELD(listdatums);
3796  WRITE_NODE_FIELD(lowerdatums);
3797  WRITE_NODE_FIELD(upperdatums);
3798  WRITE_LOCATION_FIELD(location);
3799 }
3800 
3801 static void
3803 {
3804  WRITE_NODE_TYPE("PARTITIONRANGEDATUM");
3805 
3808  WRITE_LOCATION_FIELD(location);
3809 }
3810 
3811 /*
3812  * outNode -
3813  * converts a Node into ascii string and append it to 'str'
3814  */
3815 void
3816 outNode(StringInfo str, const void *obj)
3817 {
3818  /* Guard against stack overflow due to overly complex expressions */
3820 
3821  if (obj == NULL)
3822  appendStringInfoString(str, "<>");
3823  else if (IsA(obj, List) || IsA(obj, IntList) || IsA(obj, OidList))
3824  _outList(str, obj);
3825  else if (IsA(obj, Integer) ||
3826  IsA(obj, Float) ||
3827  IsA(obj, String) ||
3828  IsA(obj, BitString))
3829  {
3830  /* nodeRead does not want to see { } around these! */
3831  _outValue(str, obj);
3832  }
3833  else
3834  {
3835  appendStringInfoChar(str, '{');
3836  switch (nodeTag(obj))
3837  {
3838  case T_PlannedStmt:
3839  _outPlannedStmt(str, obj);
3840  break;
3841  case T_Plan:
3842  _outPlan(str, obj);
3843  break;
3844  case T_Result:
3845  _outResult(str, obj);
3846  break;
3847  case T_ProjectSet:
3848  _outProjectSet(str, obj);
3849  break;
3850  case T_ModifyTable:
3851  _outModifyTable(str, obj);
3852  break;
3853  case T_Append:
3854  _outAppend(str, obj);
3855  break;
3856  case T_MergeAppend:
3857  _outMergeAppend(str, obj);
3858  break;
3859  case T_RecursiveUnion:
3860  _outRecursiveUnion(str, obj);
3861  break;
3862  case T_BitmapAnd:
3863  _outBitmapAnd(str, obj);
3864  break;
3865  case T_BitmapOr:
3866  _outBitmapOr(str, obj);
3867  break;
3868  case T_Gather:
3869  _outGather(str, obj);
3870  break;
3871  case T_GatherMerge:
3872  _outGatherMerge(str, obj);
3873  break;
3874  case T_Scan:
3875  _outScan(str, obj);
3876  break;
3877  case T_SeqScan:
3878  _outSeqScan(str, obj);
3879  break;
3880  case T_SampleScan:
3881  _outSampleScan(str, obj);
3882  break;
3883  case T_IndexScan:
3884  _outIndexScan(str, obj);
3885  break;
3886  case T_IndexOnlyScan:
3887  _outIndexOnlyScan(str, obj);
3888  break;
3889  case T_BitmapIndexScan:
3890  _outBitmapIndexScan(str, obj);
3891  break;
3892  case T_BitmapHeapScan:
3893  _outBitmapHeapScan(str, obj);
3894  break;
3895  case T_TidScan:
3896  _outTidScan(str, obj);
3897  break;
3898  case T_TidRangeScan:
3899  _outTidRangeScan(str, obj);
3900  break;
3901  case T_SubqueryScan:
3902  _outSubqueryScan(str, obj);
3903  break;
3904  case T_FunctionScan:
3905  _outFunctionScan(str, obj);
3906  break;
3907  case T_TableFuncScan:
3908  _outTableFuncScan(str, obj);
3909  break;
3910  case T_ValuesScan:
3911  _outValuesScan(str, obj);
3912  break;
3913  case T_CteScan:
3914  _outCteScan(str, obj);
3915  break;
3916  case T_NamedTuplestoreScan:
3917  _outNamedTuplestoreScan(str, obj);
3918  break;
3919  case T_WorkTableScan:
3920  _outWorkTableScan(str, obj);
3921  break;
3922  case T_ForeignScan:
3923  _outForeignScan(str, obj);
3924  break;
3925  case T_CustomScan:
3926  _outCustomScan(str, obj);
3927  break;
3928  case T_Join:
3929  _outJoin(str, obj);
3930  break;
3931  case T_NestLoop:
3932  _outNestLoop(str, obj);
3933  break;
3934  case T_MergeJoin:
3935  _outMergeJoin(str, obj);
3936  break;
3937  case T_HashJoin:
3938  _outHashJoin(str, obj);
3939  break;
3940  case T_Agg:
3941  _outAgg(str, obj);
3942  break;
3943  case T_WindowAgg:
3944  _outWindowAgg(str, obj);
3945  break;
3946  case T_Group:
3947  _outGroup(str, obj);
3948  break;
3949  case T_Material:
3950  _outMaterial(str, obj);
3951  break;
3952  case T_ResultCache:
3953  _outResultCache(str, obj);
3954  break;
3955  case T_Sort:
3956  _outSort(str, obj);
3957  break;
3958  case T_IncrementalSort:
3959  _outIncrementalSort(str, obj);
3960  break;
3961  case T_Unique:
3962  _outUnique(str, obj);
3963  break;
3964  case T_Hash:
3965  _outHash(str, obj);
3966  break;
3967  case T_SetOp:
3968  _outSetOp(str, obj);
3969  break;
3970  case T_LockRows:
3971  _outLockRows(str, obj);
3972  break;
3973  case T_Limit:
3974  _outLimit(str, obj);
3975  break;
3976  case T_NestLoopParam:
3977  _outNestLoopParam(str, obj);
3978  break;
3979  case T_PlanRowMark:
3980  _outPlanRowMark(str, obj);
3981  break;
3982  case T_PartitionPruneInfo:
3983  _outPartitionPruneInfo(str, obj);
3984  break;
3986  _outPartitionedRelPruneInfo(str, obj);
3987  break;
3989  _outPartitionPruneStepOp(str, obj);
3990  break;
3993  break;
3994  case T_PlanInvalItem:
3995  _outPlanInvalItem(str, obj);
3996  break;
3997  case T_Alias:
3998  _outAlias(str, obj);
3999  break;
4000  case T_RangeVar:
4001  _outRangeVar(str, obj);
4002  break;
4003  case T_TableFunc:
4004  _outTableFunc(str, obj);
4005  break;
4006  case T_IntoClause:
4007  _outIntoClause(str, obj);
4008  break;
4009  case T_Var:
4010  _outVar(str, obj);
4011  break;
4012  case T_Const:
4013  _outConst(str, obj);
4014  break;
4015  case T_Param:
4016  _outParam(str, obj);
4017  break;
4018  case T_Aggref:
4019  _outAggref(str, obj);
4020  break;
4021  case T_GroupingFunc:
4022  _outGroupingFunc(str, obj);
4023  break;
4024  case T_WindowFunc:
4025  _outWindowFunc(str, obj);
4026  break;
4027  case T_SubscriptingRef:
4028  _outSubscriptingRef(str, obj);
4029  break;
4030  case T_FuncExpr:
4031  _outFuncExpr(str, obj);
4032  break;
4033  case T_NamedArgExpr:
4034  _outNamedArgExpr(str, obj);
4035  break;
4036  case T_OpExpr:
4037  _outOpExpr(str, obj);
4038  break;
4039  case T_DistinctExpr:
4040  _outDistinctExpr(str, obj);
4041  break;
4042  case T_NullIfExpr:
4043  _outNullIfExpr(str, obj);
4044  break;
4045  case T_ScalarArrayOpExpr:
4046  _outScalarArrayOpExpr(str, obj);
4047  break;
4048  case T_BoolExpr:
4049  _outBoolExpr(str, obj);
4050  break;
4051  case T_SubLink:
4052  _outSubLink(str, obj);
4053  break;
4054  case T_SubPlan:
4055  _outSubPlan(str, obj);
4056  break;
4057  case T_AlternativeSubPlan:
4058  _outAlternativeSubPlan(str, obj);
4059  break;
4060  case T_FieldSelect:
4061  _outFieldSelect(str, obj);
4062  break;
4063  case T_FieldStore:
4064  _outFieldStore(str, obj);
4065  break;
4066  case T_RelabelType:
4067  _outRelabelType(str, obj);
4068  break;
4069  case T_CoerceViaIO:
4070  _outCoerceViaIO(str, obj);
4071  break;
4072  case T_ArrayCoerceExpr:
4073  _outArrayCoerceExpr(str, obj);
4074  break;
4075  case T_ConvertRowtypeExpr:
4076  _outConvertRowtypeExpr(str, obj);
4077  break;
4078  case T_CollateExpr:
4079  _outCollateExpr(str, obj);
4080  break;
4081  case T_CaseExpr:
4082  _outCaseExpr(str, obj);
4083  break;
4084  case T_CaseWhen:
4085  _outCaseWhen(str, obj);
4086  break;
4087  case T_CaseTestExpr:
4088  _outCaseTestExpr(str, obj);
4089  break;
4090  case T_ArrayExpr:
4091  _outArrayExpr(str, obj);
4092  break;
4093  case T_RowExpr:
4094  _outRowExpr(str, obj);
4095  break;
4096  case T_RowCompareExpr:
4097  _outRowCompareExpr(str, obj);
4098  break;
4099  case T_CoalesceExpr:
4100  _outCoalesceExpr(str, obj);
4101  break;
4102  case T_MinMaxExpr:
4103  _outMinMaxExpr(str, obj);
4104  break;
4105  case T_SQLValueFunction:
4106  _outSQLValueFunction(str, obj);
4107  break;
4108  case T_XmlExpr:
4109  _outXmlExpr(str, obj);
4110  break;
4111  case T_NullTest:
4112  _outNullTest(str, obj);
4113  break;
4114  case T_BooleanTest:
4115  _outBooleanTest(str, obj);
4116  break;
4117  case T_CoerceToDomain:
4118  _outCoerceToDomain(str, obj);
4119  break;
4120  case T_CoerceToDomainValue:
4121  _outCoerceToDomainValue(str, obj);
4122  break;
4123  case T_SetToDefault:
4124  _outSetToDefault(str, obj);
4125  break;
4126  case T_CurrentOfExpr:
4127  _outCurrentOfExpr(str, obj);
4128  break;
4129  case T_NextValueExpr:
4130  _outNextValueExpr(str, obj);
4131  break;
4132  case T_InferenceElem:
4133  _outInferenceElem(str, obj);
4134  break;
4135  case T_TargetEntry:
4136  _outTargetEntry(str, obj);
4137  break;
4138  case T_RangeTblRef:
4139  _outRangeTblRef(str, obj);
4140  break;
4141  case T_JoinExpr:
4142  _outJoinExpr(str, obj);
4143  break;
4144  case T_FromExpr:
4145  _outFromExpr(str, obj);
4146  break;
4147  case T_OnConflictExpr:
4148  _outOnConflictExpr(str, obj);
4149  break;
4150  case T_Path:
4151  _outPath(str, obj);
4152  break;
4153  case T_IndexPath:
4154  _outIndexPath(str, obj);
4155  break;
4156  case T_BitmapHeapPath:
4157  _outBitmapHeapPath(str, obj);
4158  break;
4159  case T_BitmapAndPath:
4160  _outBitmapAndPath(str, obj);
4161  break;
4162  case T_BitmapOrPath:
4163  _outBitmapOrPath(str, obj);
4164  break;
4165  case T_TidPath:
4166  _outTidPath(str, obj);
4167  break;
4168  case T_SubqueryScanPath:
4169  _outSubqueryScanPath(str, obj);
4170  break;
4171  case T_ForeignPath:
4172  _outForeignPath(str, obj);
4173  break;
4174  case T_CustomPath:
4175  _outCustomPath(str, obj);
4176  break;
4177  case T_AppendPath:
4178  _outAppendPath(str, obj);
4179  break;
4180  case T_MergeAppendPath:
4181  _outMergeAppendPath(str, obj);
4182  break;
4183  case T_GroupResultPath:
4184  _outGroupResultPath(str, obj);
4185  break;
4186  case T_MaterialPath:
4187  _outMaterialPath(str, obj);
4188  break;
4189  case T_ResultCachePath:
4190  _outResultCachePath(str, obj);
4191  break;
4192  case T_UniquePath:
4193  _outUniquePath(str, obj);
4194  break;
4195  case T_GatherPath:
4196  _outGatherPath(str, obj);
4197  break;
4198  case T_ProjectionPath:
4199  _outProjectionPath(str, obj);
4200  break;
4201  case T_ProjectSetPath:
4202  _outProjectSetPath(str, obj);
4203  break;
4204  case T_SortPath:
4205  _outSortPath(str, obj);
4206  break;
4207  case T_IncrementalSortPath:
4208  _outIncrementalSortPath(str, obj);
4209  break;
4210  case T_GroupPath:
4211  _outGroupPath(str, obj);
4212  break;
4213  case T_UpperUniquePath:
4214  _outUpperUniquePath(str, obj);
4215  break;
4216  case T_AggPath:
4217  _outAggPath(str, obj);
4218  break;
4219  case T_GroupingSetsPath:
4220  _outGroupingSetsPath(str, obj);
4221  break;
4222  case T_MinMaxAggPath:
4223  _outMinMaxAggPath(str, obj);
4224  break;
4225  case T_WindowAggPath:
4226  _outWindowAggPath(str, obj);
4227  break;
4228  case T_SetOpPath:
4229  _outSetOpPath(str, obj);
4230  break;
4231  case T_RecursiveUnionPath:
4232  _outRecursiveUnionPath(str, obj);
4233  break;
4234  case T_LockRowsPath:
4235  _outLockRowsPath(str, obj);
4236  break;
4237  case T_ModifyTablePath:
4238  _outModifyTablePath(str, obj);
4239  break;
4240  case T_LimitPath:
4241  _outLimitPath(str, obj);
4242  break;
4243  case T_GatherMergePath:
4244  _outGatherMergePath(str, obj);
4245  break;
4246  case T_NestPath:
4247  _outNestPath(str, obj);
4248  break;
4249  case T_MergePath:
4250  _outMergePath(str, obj);
4251  break;
4252  case T_HashPath:
4253  _outHashPath(str, obj);
4254  break;
4255  case T_PlannerGlobal:
4256  _outPlannerGlobal(str, obj);
4257  break;
4258  case T_PlannerInfo:
4259  _outPlannerInfo(str, obj);
4260  break;
4261  case T_RelOptInfo:
4262  _outRelOptInfo(str, obj);
4263  break;
4264  case T_IndexOptInfo:
4265  _outIndexOptInfo(str, obj);
4266  break;
4267  case T_ForeignKeyOptInfo:
4268  _outForeignKeyOptInfo(str, obj);
4269  break;
4270  case T_EquivalenceClass:
4271  _outEquivalenceClass(str, obj);
4272  break;
4273  case T_EquivalenceMember:
4274  _outEquivalenceMember(str, obj);
4275  break;
4276  case T_PathKey:
4277  _outPathKey(str, obj);
4278  break;
4279  case T_PathTarget:
4280  _outPathTarget(str, obj);
4281  break;
4282  case T_ParamPathInfo:
4283  _outParamPathInfo(str, obj);
4284  break;
4285  case T_RestrictInfo:
4286  _outRestrictInfo(str, obj);
4287  break;
4288  case T_IndexClause:
4289  _outIndexClause(str, obj);
4290  break;
4291  case T_PlaceHolderVar:
4292  _outPlaceHolderVar(str, obj);
4293  break;
4294  case T_SpecialJoinInfo:
4295  _outSpecialJoinInfo(str, obj);
4296  break;
4297  case T_AppendRelInfo:
4298  _outAppendRelInfo(str, obj);
4299  break;
4300  case T_RowIdentityVarInfo:
4301  _outRowIdentityVarInfo(str, obj);
4302  break;
4303  case T_PlaceHolderInfo:
4304  _outPlaceHolderInfo(str, obj);
4305  break;
4306  case T_MinMaxAggInfo:
4307  _outMinMaxAggInfo(str, obj);
4308  break;
4309  case T_PlannerParamItem:
4310  _outPlannerParamItem(str, obj);
4311  break;
4312  case T_RollupData:
4313  _outRollupData(str, obj);
4314  break;
4315  case T_GroupingSetData:
4316  _outGroupingSetData(str, obj);
4317  break;
4318  case T_StatisticExtInfo:
4319  _outStatisticExtInfo(str, obj);
4320  break;
4321  case T_ExtensibleNode:
4322  _outExtensibleNode(str, obj);
4323  break;
4324  case T_CreateStmt:
4325  _outCreateStmt(str, obj);
4326  break;
4328  _outCreateForeignTableStmt(str, obj);
4329  break;
4331  _outImportForeignSchemaStmt(str, obj);
4332  break;
4333  case T_IndexStmt:
4334  _outIndexStmt(str, obj);
4335  break;
4336  case T_CreateStatsStmt:
4337  _outCreateStatsStmt(str, obj);
4338  break;
4339  case T_AlterStatsStmt:
4340  _outAlterStatsStmt(str, obj);
4341  break;
4342  case T_NotifyStmt:
4343  _outNotifyStmt(str, obj);
4344  break;
4345  case T_DeclareCursorStmt:
4346  _outDeclareCursorStmt(str, obj);
4347  break;
4348  case T_SelectStmt:
4349  _outSelectStmt(str, obj);
4350  break;
4351  case T_ReturnStmt:
4352  _outReturnStmt(str, obj);
4353  break;
4354  case T_PLAssignStmt:
4355  _outPLAssignStmt(str, obj);
4356  break;
4357  case T_ColumnDef:
4358  _outColumnDef(str, obj);
4359  break;
4360  case T_TypeName:
4361  _outTypeName(str, obj);
4362  break;
4363  case T_TypeCast:
4364  _outTypeCast(str, obj);
4365  break;
4366  case T_CollateClause:
4367  _outCollateClause(str, obj);
4368  break;
4369  case T_IndexElem:
4370  _outIndexElem(str, obj);
4371  break;
4372  case T_StatsElem:
4373  _outStatsElem(str, obj);
4374  break;
4375  case T_Query:
4376  _outQuery(str, obj);
4377  break;
4378  case T_WithCheckOption:
4379  _outWithCheckOption(str, obj);
4380  break;
4381  case T_SortGroupClause:
4382  _outSortGroupClause(str, obj);
4383  break;
4384  case T_GroupingSet:
4385  _outGroupingSet(str, obj);
4386  break;
4387  case T_WindowClause:
4388  _outWindowClause(str, obj);
4389  break;
4390  case T_RowMarkClause:
4391  _outRowMarkClause(str, obj);
4392  break;
4393  case T_WithClause:
4394  _outWithClause(str, obj);
4395  break;
4396  case T_CTESearchClause:
4397  _outCTESearchClause(str, obj);
4398  break;
4399  case T_CTECycleClause:
4400  _outCTECycleClause(str, obj);
4401  break;
4402  case T_CommonTableExpr:
4403  _outCommonTableExpr(str, obj);
4404  break;
4405  case T_SetOperationStmt:
4406  _outSetOperationStmt(str, obj);
4407  break;
4408  case T_RangeTblEntry:
4409  _outRangeTblEntry(str, obj);
4410  break;
4411  case T_RangeTblFunction:
4412  _outRangeTblFunction(str, obj);
4413  break;
4414  case T_TableSampleClause:
4415  _outTableSampleClause(str, obj);
4416  break;
4417  case T_A_Expr:
4418  _outAExpr(str, obj);
4419  break;
4420  case T_ColumnRef:
4421  _outColumnRef(str, obj);
4422  break;
4423  case T_ParamRef:
4424  _outParamRef(str, obj);
4425  break;
4426  case T_RawStmt:
4427  _outRawStmt(str, obj);
4428  break;
4429  case T_A_Const:
4430  _outAConst(str, obj);
4431  break;
4432  case T_A_Star:
4433  _outA_Star(str, obj);
4434  break;
4435  case T_A_Indices:
4436  _outA_Indices(str, obj);
4437  break;
4438  case T_A_Indirection:
4439  _outA_Indirection(str, obj);
4440  break;
4441  case T_A_ArrayExpr:
4442  _outA_ArrayExpr(str, obj);
4443  break;
4444  case T_ResTarget:
4445  _outResTarget(str, obj);
4446  break;
4447  case T_MultiAssignRef:
4448  _outMultiAssignRef(str, obj);
4449  break;
4450  case T_SortBy:
4451  _outSortBy(str, obj);
4452  break;
4453  case T_WindowDef:
4454  _outWindowDef(str, obj);
4455  break;
4456  case T_RangeSubselect:
4457  _outRangeSubselect(str, obj);
4458  break;
4459  case T_RangeFunction:
4460  _outRangeFunction(str, obj);
4461  break;
4462  case T_RangeTableSample:
4463  _outRangeTableSample(str, obj);
4464  break;
4465  case T_RangeTableFunc:
4466  _outRangeTableFunc(str, obj);
4467  break;
4468  case T_RangeTableFuncCol:
4469  _outRangeTableFuncCol(str, obj);
4470  break;
4471  case T_Constraint:
4472  _outConstraint(str, obj);
4473  break;
4474  case T_FuncCall:
4475  _outFuncCall(str, obj);
4476  break;
4477  case T_DefElem:
4478  _outDefElem(str, obj);
4479  break;
4480  case T_TableLikeClause:
4481  _outTableLikeClause(str, obj);
4482  break;
4483  case T_LockingClause:
4484  _outLockingClause(str, obj);
4485  break;
4486  case T_XmlSerialize:
4487  _outXmlSerialize(str, obj);
4488  break;
4489  case T_ForeignKeyCacheInfo:
4490  _outForeignKeyCacheInfo(str, obj);
4491  break;
4492  case T_TriggerTransition:
4493  _outTriggerTransition(str, obj);
4494  break;
4495  case T_PartitionElem:
4496  _outPartitionElem(str, obj);
4497  break;
4498  case T_PartitionSpec:
4499  _outPartitionSpec(str, obj);
4500  break;
4501  case T_PartitionBoundSpec:
4502  _outPartitionBoundSpec(str, obj);
4503  break;
4504  case T_PartitionRangeDatum:
4505  _outPartitionRangeDatum(str, obj);
4506  break;
4507 
4508  default:
4509 
4510  /*
4511  * This should be an ERROR, but it's too useful to be able to
4512  * dump structures that outNode only understands part of.
4513  */
4514  elog(WARNING, "could not dump unrecognized node type: %d",
4515  (int) nodeTag(obj));
4516  break;
4517  }
4518  appendStringInfoChar(str, '}');
4519  }
4520 }
4521 
4522 /*
4523  * nodeToString -
4524  * returns the ascii representation of the Node as a palloc'd string
4525  */
4526 char *
4527 nodeToString(const void *obj)
4528 {
4530 
4531  /* see stringinfo.h for an explanation of this maneuver */
4532  initStringInfo(&str);
4533  outNode(&str, obj);
4534  return str.data;
4535 }
4536 
4537 /*
4538  * bmsToString -
4539  * returns the ascii representation of the Bitmapset as a palloc'd string
4540  */
4541 char *
4543 {
4545 
4546  /* see stringinfo.h for an explanation of this maneuver */
4547  initStringInfo(&str);
4548  outBitmapset(&str, bms);
4549  return str.data;
4550 }
Datum constvalue
Definition: primnodes.h:219
static void _outRangeTableFunc(StringInfo str, const RangeTableFunc *node)
Definition: outfuncs.c:3604
static void _outA_Indices(StringInfo str, const A_Indices *node)
Definition: outfuncs.c:3493
static void _outValue(StringInfo str, const Value *value)
Definition: outfuncs.c:3404
static void _outPlaceHolderInfo(StringInfo str, const PlaceHolderInfo *node)
Definition: outfuncs.c:2627
SortByDir
Definition: parsenodes.h:50
static void _outCaseExpr(StringInfo str, const CaseExpr *node)
Definition: outfuncs.c:1475
static void _outSpecialJoinInfo(StringInfo str, const SpecialJoinInfo *node)
Definition: outfuncs.c:2583
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:1981
#define IsA(nodeptr, _type_)
Definition: nodes.h:590
static void _outRowExpr(StringInfo str, const RowExpr *node)
Definition: outfuncs.c:1521
PathTarget * pathtarget
Definition: pathnodes.h:1175
PartitionPruneCombineOp
Definition: plannodes.h:1261
static void _outRangeSubselect(StringInfo str, const RangeSubselect *node)
Definition: outfuncs.c:3569
static void _outRowIdentityVarInfo(StringInfo str, const RowIdentityVarInfo *node)
Definition: outfuncs.c:2616
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:3191
#define WRITE_INT_FIELD(fldname)
Definition: outfuncs.c:55
static void _outForeignPath(StringInfo str, const ForeignPath *node)
Definition: outfuncs.c:1873
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:2202
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:2742
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:1682
static struct @142 value
Definition: nodes.h:54
#define WRITE_LOCATION_FIELD(fldname)
Definition: outfuncs.c:100
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:1597
static void _outDefElem(StringInfo str, const DefElem *node)
Definition: outfuncs.c:2879
static void _outJoinExpr(StringInfo str, const JoinExpr *node)
Definition: outfuncs.c:1704
static void _outA_Indirection(StringInfo str, const A_Indirection *node)
Definition: outfuncs.c:3503
static void _outScan(StringInfo str, const Scan *node)
Definition: outfuncs.c:526
static void _outIndexClause(StringInfo str, const IndexClause *node)
Definition: outfuncs.c:2560
static void _outPartitionElem(StringInfo str, const PartitionElem *node)
Definition: outfuncs.c:3765
static void _outUnique(StringInfo str, const Unique *node)
Definition: outfuncs.c:896
static void _outPlannerParamItem(StringInfo str, const PlannerParamItem *node)
Definition: outfuncs.c:2654
static void _outGroupPath(StringInfo str, const GroupPath *node)
Definition: outfuncs.c:2028
static void _outRelOptInfo(StringInfo str, const RelOptInfo *node)
Definition: outfuncs.c:2328
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:3554
static void _outRowMarkClause(StringInfo str, const RowMarkClause *node)
Definition: outfuncs.c:3142
static void _outStatisticExtInfo(StringInfo str, const StatisticExtInfo *node)
Definition: outfuncs.c:2433
BoolTestType
Definition: primnodes.h:1270
static void _outCreateStmt(StringInfo str, const CreateStmt *node)
Definition: outfuncs.c:2710
#define WRITE_ENUM_FIELD(fldname, enumtype)
Definition: outfuncs.c:81
static void _outIncrementalSortPath(StringInfo str, const IncrementalSortPath *node)
Definition: outfuncs.c:2018
static void _outSampleScan(StringInfo str, const SampleScan *node)
Definition: outfuncs.c:542
XmlExprOp
Definition: primnodes.h:1196
static void _outPLAssignStmt(StringInfo str, const PLAssignStmt *node)
Definition: outfuncs.c:2849
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:1415
QuerySource
Definition: parsenodes.h:40
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:1884
static void _outMaterial(StringInfo str, const Material *node)
Definition: outfuncs.c:843
static void _outPartitionRangeDatum(StringInfo str, const PartitionRangeDatum *node)
Definition: outfuncs.c:3802
static void _outTableLikeClause(StringInfo str, const TableLikeClause *node)
Definition: outfuncs.c:2891
static void _outSetOp(StringInfo str, const SetOp *node)
Definition: outfuncs.c:923
static void _outRangeTblRef(StringInfo str, const RangeTblRef *node)
Definition: outfuncs.c:1696
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:3153
static void _outCteScan(StringInfo str, const CteScan *node)
Definition: outfuncs.c:666
static void _outDeclareCursorStmt(StringInfo str, const DeclareCursorStmt *node)
Definition: outfuncs.c:2804
Definition: nodes.h:78
void outDatum(StringInfo str, Datum value, int typlen, bool typbyval)
Definition: outfuncs.c:259
NullTestType
Definition: primnodes.h:1247
static void _outA_Star(StringInfo str, const A_Star *node)
Definition: outfuncs.c:3487
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:1653
static void _outRollupData(StringInfo str, const RollupData *node)
Definition: outfuncs.c:2067
Node * utilityStmt
Definition: parsenodes.h:128
static void _outStatsElem(StringInfo str, const StatsElem *node)
Definition: outfuncs.c:3007
static void _outRowCompareExpr(StringInfo str, const RowCompareExpr *node)
Definition: outfuncs.c:1533
Definition: primnodes.h:186
#define WRITE_UINT_FIELD(fldname)
Definition: outfuncs.c:59
static void _outParamRef(StringInfo str, const ParamRef *node)
Definition: outfuncs.c:3454
static void _outRangeTableSample(StringInfo str, const RangeTableSample *node)
Definition: outfuncs.c:3592
static void _outConst(StringInfo str, const Const *node)
Definition: outfuncs.c:1131
static void _outGroupingSetsPath(StringInfo str, const GroupingSetsPath *node)
Definition: outfuncs.c:2089
SetOpStrategy
Definition: nodes.h:820
static void _outIndexOptInfo(StringInfo str, const IndexOptInfo *node)
Definition: outfuncs.c:2382
OnCommitAction
Definition: primnodes.h:47
static void _outCreateStmtInfo(StringInfo str, const CreateStmt *node)
Definition: outfuncs.c:2693
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:1392
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:1921
static void _outLockRows(StringInfo str, const LockRows *node)
Definition: outfuncs.c:941
static void _outIndexElem(StringInfo str, const IndexElem *node)
Definition: outfuncs.c:2992
int constlen
Definition: primnodes.h:218
static void _outBoolExpr(StringInfo str, const BoolExpr *node)
Definition: outfuncs.c:1321
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:1910
static void _outHashJoin(StringInfo str, const HashJoin *node)
Definition: outfuncs.c:771
SetOperation
Definition: parsenodes.h:1631
MinMaxOp
Definition: primnodes.h:1129
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:3174
Definition: nodes.h:46
static void _outQuery(StringInfo str, const Query *node)
Definition: outfuncs.c:3016
#define ERROR
Definition: elog.h:46
static void _outSQLValueFunction(StringInfo str, const SQLValueFunction *node)
Definition: outfuncs.c:1570
CTEMaterialize
Definition: parsenodes.h:1465
static void _outAppendRelInfo(StringInfo str, const AppendRelInfo *node)
Definition: outfuncs.c:2601
static void _outTypeName(StringInfo str, const TypeName *node)
Definition: outfuncs.c:2957
static void _outLimitPath(StringInfo str, const LimitPath *node)
Definition: outfuncs.c:2189
static void _outPlannerInfo(StringInfo str, const PlannerInfo *node)
Definition: outfuncs.c:2272
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:1831
static void _outSubscriptingRef(StringInfo str, const SubscriptingRef *node)
Definition: outfuncs.c:1219
BoolExprType boolop
Definition: primnodes.h:615
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:2669
RTEKind
Definition: parsenodes.h:976
RelOptInfo * parent
Definition: pathnodes.h:1174
static void _outNextValueExpr(StringInfo str, const NextValueExpr *node)
Definition: outfuncs.c:1663
Definition: nodes.h:80
static void _outMinMaxAggInfo(StringInfo str, const MinMaxAggInfo *node)
Definition: outfuncs.c:2640
void appendStringInfoString(StringInfo str, const char *s)
Definition: stringinfo.c:176
char * c
static void _outSortBy(StringInfo str, const SortBy *node)
Definition: outfuncs.c:3542
static void _outCollateExpr(StringInfo str, const CollateExpr *node)
Definition: outfuncs.c:1465
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:1557
#define WRITE_BOOL_FIELD(fldname)
Definition: outfuncs.c:90
Definition: nodes.h:153
static void _outSetOpPath(StringInfo str, const SetOpPath *node)
Definition: outfuncs.c:2125
void check_stack_depth(void)
Definition: postgres.c:3469
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:3632
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:1956
static void _outGroupingSet(StringInfo str, const GroupingSet *node)
Definition: outfuncs.c:3111
Index * sortgrouprefs
Definition: pathnodes.h:1103
static void _outPath(StringInfo str, const Path *node)
Definition: outfuncs.c:1797
static void _outCreateForeignTableStmt(StringInfo str, const CreateForeignTableStmt *node)
Definition: outfuncs.c:2718
static void _outRecursiveUnionPath(StringInfo str, const RecursiveUnionPath *node)
Definition: outfuncs.c:2141
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:2485
#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:3467
#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:1642
SQLValueFunctionOp
Definition: primnodes.h:1157
static void _outJoinPathInfo(StringInfo str, const JoinPath *node)
Definition: outfuncs.c:1785
static void _outIndexScan(StringInfo str, const IndexScan *node)
Definition: outfuncs.c:552
static void _outUpperUniquePath(StringInfo str, const UpperUniquePath *node)
Definition: outfuncs.c:2040
static void _outTidRangeScan(StringInfo str, const TidRangeScan *node)
Definition: outfuncs.c:615
Definition: nodes.h:158
SubLinkType
Definition: primnodes.h:671
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:2972
struct EquivalenceClass * eclass[INDEX_MAX_KEYS]
Definition: pathnodes.h:910
static void _outRangeFunction(StringInfo str, const RangeFunction *node)
Definition: outfuncs.c:3579
void outNode(StringInfo str, const void *obj)
Definition: outfuncs.c:3816
#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:2814
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:2472
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:2213
static void _outWindowClause(StringInfo str, const WindowClause *node)
Definition: outfuncs.c:3121
#define WRITE_OID_ARRAY(fldname, len)
Definition: outfuncs.c:120
uintptr_t Datum
Definition: postgres.h:411
static void _outFromExpr(StringInfo str, const FromExpr *node)
Definition: outfuncs.c:1720
static void _outSortGroupClause(StringInfo str, const SortGroupClause *node)
Definition: outfuncs.c:3099
static void _outAgg(StringInfo str, const Agg *node)
Definition: outfuncs.c:784
static void _outDistinctExpr(StringInfo str, const DistinctExpr *node)
Definition: outfuncs.c:1277
static void _outCoerceViaIO(StringInfo str, const CoerceViaIO *node)
Definition: