1 /*-------------------------------------------------------------------------
4 * Output functions for Postgres tree nodes.
6 * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
11 * src/backend/nodes/outfuncs.c
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). For use in debugging, we also provide output
17 * functions for nodes that appear in raw parsetrees, path, and plan trees.
18 * These nodes however need not have input functions.
20 *-------------------------------------------------------------------------
26 #include "lib/stringinfo.h"
27 #include "nodes/plannodes.h"
28 #include "nodes/relation.h"
29 #include "utils/datum.h"
33 * Macros to simplify output of different kinds of fields. Use these
34 * wherever possible to reduce the chance for silly typos. Note that these
35 * hard-wire conventions about the names of the local variables in an Out
39 /* Write the label for the node type */
40 #define WRITE_NODE_TYPE(nodelabel) \
41 appendStringInfoString(str, nodelabel)
43 /* Write an integer field (anything written as ":fldname %d") */
44 #define WRITE_INT_FIELD(fldname) \
45 appendStringInfo(str, " :" CppAsString(fldname) " %d", node->fldname)
47 /* Write an unsigned integer field (anything written as ":fldname %u") */
48 #define WRITE_UINT_FIELD(fldname) \
49 appendStringInfo(str, " :" CppAsString(fldname) " %u", node->fldname)
51 /* Write an OID field (don't hard-wire assumption that OID is same as uint) */
52 #define WRITE_OID_FIELD(fldname) \
53 appendStringInfo(str, " :" CppAsString(fldname) " %u", node->fldname)
55 /* Write a long-integer field */
56 #define WRITE_LONG_FIELD(fldname) \
57 appendStringInfo(str, " :" CppAsString(fldname) " %ld", node->fldname)
59 /* Write a char field (ie, one ascii character) */
60 #define WRITE_CHAR_FIELD(fldname) \
61 appendStringInfo(str, " :" CppAsString(fldname) " %c", node->fldname)
63 /* Write an enumerated-type field as an integer code */
64 #define WRITE_ENUM_FIELD(fldname, enumtype) \
65 appendStringInfo(str, " :" CppAsString(fldname) " %d", \
68 /* Write a float field --- caller must give format to define precision */
69 #define WRITE_FLOAT_FIELD(fldname,format) \
70 appendStringInfo(str, " :" CppAsString(fldname) " " format, node->fldname)
72 /* Write a boolean field */
73 #define WRITE_BOOL_FIELD(fldname) \
74 appendStringInfo(str, " :" CppAsString(fldname) " %s", \
75 booltostr(node->fldname))
77 /* Write a character-string (possibly NULL) field */
78 #define WRITE_STRING_FIELD(fldname) \
79 (appendStringInfo(str, " :" CppAsString(fldname) " "), \
80 _outToken(str, node->fldname))
82 /* Write a parse location field (actually same as INT case) */
83 #define WRITE_LOCATION_FIELD(fldname) \
84 appendStringInfo(str, " :" CppAsString(fldname) " %d", node->fldname)
86 /* Write a Node field */
87 #define WRITE_NODE_FIELD(fldname) \
88 (appendStringInfo(str, " :" CppAsString(fldname) " "), \
89 _outNode(str, node->fldname))
91 /* Write a bitmapset field */
92 #define WRITE_BITMAPSET_FIELD(fldname) \
93 (appendStringInfo(str, " :" CppAsString(fldname) " "), \
94 _outBitmapset(str, node->fldname))
97 #define booltostr(x) ((x) ? "true" : "false")
99 static void _outNode(StringInfo str, const void *obj);
104 * Convert an ordinary string (eg, an identifier) into a form that
105 * will be decoded back to a plain token by read.c's functions.
107 * If a null or empty string is given, it is encoded as "<>".
110 _outToken(StringInfo str, const char *s)
112 if (s == NULL || *s == '\0')
114 appendStringInfo(str, "<>");
119 * Look for characters or patterns that are treated specially by read.c
120 * (either in pg_strtok() or in nodeRead()), and therefore need a
121 * protective backslash.
123 /* These characters only need to be quoted at the start of the string */
126 isdigit((unsigned char) *s) ||
127 ((*s == '+' || *s == '-') &&
128 (isdigit((unsigned char) s[1]) || s[1] == '.')))
129 appendStringInfoChar(str, '\\');
132 /* These chars must be backslashed anywhere in the string */
133 if (*s == ' ' || *s == '\n' || *s == '\t' ||
134 *s == '(' || *s == ')' || *s == '{' || *s == '}' ||
136 appendStringInfoChar(str, '\\');
137 appendStringInfoChar(str, *s++);
142 _outList(StringInfo str, const List *node)
146 appendStringInfoChar(str, '(');
148 if (IsA(node, IntList))
149 appendStringInfoChar(str, 'i');
150 else if (IsA(node, OidList))
151 appendStringInfoChar(str, 'o');
156 * For the sake of backward compatibility, we emit a slightly
157 * different whitespace format for lists of nodes vs. other types of
158 * lists. XXX: is this necessary?
162 _outNode(str, lfirst(lc));
164 appendStringInfoChar(str, ' ');
166 else if (IsA(node, IntList))
167 appendStringInfo(str, " %d", lfirst_int(lc));
168 else if (IsA(node, OidList))
169 appendStringInfo(str, " %u", lfirst_oid(lc));
171 elog(ERROR, "unrecognized list node type: %d",
175 appendStringInfoChar(str, ')');
180 * converts a bitmap set of integers
182 * Note: the output format is "(b int int ...)", similar to an integer List.
185 _outBitmapset(StringInfo str, const Bitmapset *bms)
190 appendStringInfoChar(str, '(');
191 appendStringInfoChar(str, 'b');
192 tmpset = bms_copy(bms);
193 while ((x = bms_first_member(tmpset)) >= 0)
194 appendStringInfo(str, " %d", x);
196 appendStringInfoChar(str, ')');
200 * Print the value of a Datum given its type.
203 _outDatum(StringInfo str, Datum value, int typlen, bool typbyval)
209 length = datumGetSize(value, typbyval, typlen);
213 s = (char *) (&value);
214 appendStringInfo(str, "%u [ ", (unsigned int) length);
215 for (i = 0; i < (Size) sizeof(Datum); i++)
216 appendStringInfo(str, "%d ", (int) (s[i]));
217 appendStringInfo(str, "]");
221 s = (char *) DatumGetPointer(value);
222 if (!PointerIsValid(s))
223 appendStringInfo(str, "0 [ ]");
226 appendStringInfo(str, "%u [ ", (unsigned int) length);
227 for (i = 0; i < length; i++)
228 appendStringInfo(str, "%d ", (int) (s[i]));
229 appendStringInfo(str, "]");
236 * Stuff from plannodes.h
240 _outPlannedStmt(StringInfo str, const PlannedStmt *node)
242 WRITE_NODE_TYPE("PLANNEDSTMT");
244 WRITE_ENUM_FIELD(commandType, CmdType);
245 WRITE_UINT_FIELD(queryId);
246 WRITE_BOOL_FIELD(hasReturning);
247 WRITE_BOOL_FIELD(hasModifyingCTE);
248 WRITE_BOOL_FIELD(canSetTag);
249 WRITE_BOOL_FIELD(transientPlan);
250 WRITE_NODE_FIELD(planTree);
251 WRITE_NODE_FIELD(rtable);
252 WRITE_NODE_FIELD(resultRelations);
253 WRITE_NODE_FIELD(utilityStmt);
254 WRITE_NODE_FIELD(subplans);
255 WRITE_BITMAPSET_FIELD(rewindPlanIDs);
256 WRITE_NODE_FIELD(rowMarks);
257 WRITE_NODE_FIELD(relationOids);
258 WRITE_NODE_FIELD(invalItems);
259 WRITE_INT_FIELD(nParamExec);
263 * print the basic stuff of all nodes that inherit from Plan
266 _outPlanInfo(StringInfo str, const Plan *node)
268 WRITE_FLOAT_FIELD(startup_cost, "%.2f");
269 WRITE_FLOAT_FIELD(total_cost, "%.2f");
270 WRITE_FLOAT_FIELD(plan_rows, "%.0f");
271 WRITE_INT_FIELD(plan_width);
272 WRITE_NODE_FIELD(targetlist);
273 WRITE_NODE_FIELD(qual);
274 WRITE_NODE_FIELD(lefttree);
275 WRITE_NODE_FIELD(righttree);
276 WRITE_NODE_FIELD(initPlan);
277 WRITE_BITMAPSET_FIELD(extParam);
278 WRITE_BITMAPSET_FIELD(allParam);
282 * print the basic stuff of all nodes that inherit from Scan
285 _outScanInfo(StringInfo str, const Scan *node)
287 _outPlanInfo(str, (const Plan *) node);
289 WRITE_UINT_FIELD(scanrelid);
293 * print the basic stuff of all nodes that inherit from Join
296 _outJoinPlanInfo(StringInfo str, const Join *node)
298 _outPlanInfo(str, (const Plan *) node);
300 WRITE_ENUM_FIELD(jointype, JoinType);
301 WRITE_NODE_FIELD(joinqual);
306 _outPlan(StringInfo str, const Plan *node)
308 WRITE_NODE_TYPE("PLAN");
310 _outPlanInfo(str, (const Plan *) node);
314 _outResult(StringInfo str, const Result *node)
316 WRITE_NODE_TYPE("RESULT");
318 _outPlanInfo(str, (const Plan *) node);
320 WRITE_NODE_FIELD(resconstantqual);
324 _outModifyTable(StringInfo str, const ModifyTable *node)
326 WRITE_NODE_TYPE("MODIFYTABLE");
328 _outPlanInfo(str, (const Plan *) node);
330 WRITE_ENUM_FIELD(operation, CmdType);
331 WRITE_BOOL_FIELD(canSetTag);
332 WRITE_NODE_FIELD(resultRelations);
333 WRITE_INT_FIELD(resultRelIndex);
334 WRITE_NODE_FIELD(plans);
335 WRITE_NODE_FIELD(returningLists);
336 WRITE_NODE_FIELD(fdwPrivLists);
337 WRITE_NODE_FIELD(rowMarks);
338 WRITE_INT_FIELD(epqParam);
342 _outAppend(StringInfo str, const Append *node)
344 WRITE_NODE_TYPE("APPEND");
346 _outPlanInfo(str, (const Plan *) node);
348 WRITE_NODE_FIELD(appendplans);
352 _outMergeAppend(StringInfo str, const MergeAppend *node)
356 WRITE_NODE_TYPE("MERGEAPPEND");
358 _outPlanInfo(str, (const Plan *) node);
360 WRITE_NODE_FIELD(mergeplans);
362 WRITE_INT_FIELD(numCols);
364 appendStringInfo(str, " :sortColIdx");
365 for (i = 0; i < node->numCols; i++)
366 appendStringInfo(str, " %d", node->sortColIdx[i]);
368 appendStringInfo(str, " :sortOperators");
369 for (i = 0; i < node->numCols; i++)
370 appendStringInfo(str, " %u", node->sortOperators[i]);
372 appendStringInfo(str, " :collations");
373 for (i = 0; i < node->numCols; i++)
374 appendStringInfo(str, " %u", node->collations[i]);
376 appendStringInfo(str, " :nullsFirst");
377 for (i = 0; i < node->numCols; i++)
378 appendStringInfo(str, " %s", booltostr(node->nullsFirst[i]));
382 _outRecursiveUnion(StringInfo str, const RecursiveUnion *node)
386 WRITE_NODE_TYPE("RECURSIVEUNION");
388 _outPlanInfo(str, (const Plan *) node);
390 WRITE_INT_FIELD(wtParam);
391 WRITE_INT_FIELD(numCols);
393 appendStringInfo(str, " :dupColIdx");
394 for (i = 0; i < node->numCols; i++)
395 appendStringInfo(str, " %d", node->dupColIdx[i]);
397 appendStringInfo(str, " :dupOperators");
398 for (i = 0; i < node->numCols; i++)
399 appendStringInfo(str, " %u", node->dupOperators[i]);
401 WRITE_LONG_FIELD(numGroups);
405 _outBitmapAnd(StringInfo str, const BitmapAnd *node)
407 WRITE_NODE_TYPE("BITMAPAND");
409 _outPlanInfo(str, (const Plan *) node);
411 WRITE_NODE_FIELD(bitmapplans);
415 _outBitmapOr(StringInfo str, const BitmapOr *node)
417 WRITE_NODE_TYPE("BITMAPOR");
419 _outPlanInfo(str, (const Plan *) node);
421 WRITE_NODE_FIELD(bitmapplans);
425 _outScan(StringInfo str, const Scan *node)
427 WRITE_NODE_TYPE("SCAN");
429 _outScanInfo(str, node);
433 _outSeqScan(StringInfo str, const SeqScan *node)
435 WRITE_NODE_TYPE("SEQSCAN");
437 _outScanInfo(str, (const Scan *) node);
441 _outIndexScan(StringInfo str, const IndexScan *node)
443 WRITE_NODE_TYPE("INDEXSCAN");
445 _outScanInfo(str, (const Scan *) node);
447 WRITE_OID_FIELD(indexid);
448 WRITE_NODE_FIELD(indexqual);
449 WRITE_NODE_FIELD(indexqualorig);
450 WRITE_NODE_FIELD(indexorderby);
451 WRITE_NODE_FIELD(indexorderbyorig);
452 WRITE_ENUM_FIELD(indexorderdir, ScanDirection);
456 _outIndexOnlyScan(StringInfo str, const IndexOnlyScan *node)
458 WRITE_NODE_TYPE("INDEXONLYSCAN");
460 _outScanInfo(str, (const Scan *) node);
462 WRITE_OID_FIELD(indexid);
463 WRITE_NODE_FIELD(indexqual);
464 WRITE_NODE_FIELD(indexorderby);
465 WRITE_NODE_FIELD(indextlist);
466 WRITE_ENUM_FIELD(indexorderdir, ScanDirection);
470 _outBitmapIndexScan(StringInfo str, const BitmapIndexScan *node)
472 WRITE_NODE_TYPE("BITMAPINDEXSCAN");
474 _outScanInfo(str, (const Scan *) node);
476 WRITE_OID_FIELD(indexid);
477 WRITE_NODE_FIELD(indexqual);
478 WRITE_NODE_FIELD(indexqualorig);
482 _outBitmapHeapScan(StringInfo str, const BitmapHeapScan *node)
484 WRITE_NODE_TYPE("BITMAPHEAPSCAN");
486 _outScanInfo(str, (const Scan *) node);
488 WRITE_NODE_FIELD(bitmapqualorig);
492 _outTidScan(StringInfo str, const TidScan *node)
494 WRITE_NODE_TYPE("TIDSCAN");
496 _outScanInfo(str, (const Scan *) node);
498 WRITE_NODE_FIELD(tidquals);
502 _outSubqueryScan(StringInfo str, const SubqueryScan *node)
504 WRITE_NODE_TYPE("SUBQUERYSCAN");
506 _outScanInfo(str, (const Scan *) node);
508 WRITE_NODE_FIELD(subplan);
512 _outFunctionScan(StringInfo str, const FunctionScan *node)
514 WRITE_NODE_TYPE("FUNCTIONSCAN");
516 _outScanInfo(str, (const Scan *) node);
518 WRITE_NODE_FIELD(funcexpr);
519 WRITE_NODE_FIELD(funccolnames);
520 WRITE_NODE_FIELD(funccoltypes);
521 WRITE_NODE_FIELD(funccoltypmods);
522 WRITE_NODE_FIELD(funccolcollations);
526 _outValuesScan(StringInfo str, const ValuesScan *node)
528 WRITE_NODE_TYPE("VALUESSCAN");
530 _outScanInfo(str, (const Scan *) node);
532 WRITE_NODE_FIELD(values_lists);
536 _outCteScan(StringInfo str, const CteScan *node)
538 WRITE_NODE_TYPE("CTESCAN");
540 _outScanInfo(str, (const Scan *) node);
542 WRITE_INT_FIELD(ctePlanId);
543 WRITE_INT_FIELD(cteParam);
547 _outWorkTableScan(StringInfo str, const WorkTableScan *node)
549 WRITE_NODE_TYPE("WORKTABLESCAN");
551 _outScanInfo(str, (const Scan *) node);
553 WRITE_INT_FIELD(wtParam);
557 _outForeignScan(StringInfo str, const ForeignScan *node)
559 WRITE_NODE_TYPE("FOREIGNSCAN");
561 _outScanInfo(str, (const Scan *) node);
563 WRITE_NODE_FIELD(fdw_exprs);
564 WRITE_NODE_FIELD(fdw_private);
565 WRITE_BOOL_FIELD(fsSystemCol);
569 _outJoin(StringInfo str, const Join *node)
571 WRITE_NODE_TYPE("JOIN");
573 _outJoinPlanInfo(str, (const Join *) node);
577 _outNestLoop(StringInfo str, const NestLoop *node)
579 WRITE_NODE_TYPE("NESTLOOP");
581 _outJoinPlanInfo(str, (const Join *) node);
583 WRITE_NODE_FIELD(nestParams);
587 _outMergeJoin(StringInfo str, const MergeJoin *node)
592 WRITE_NODE_TYPE("MERGEJOIN");
594 _outJoinPlanInfo(str, (const Join *) node);
596 WRITE_NODE_FIELD(mergeclauses);
598 numCols = list_length(node->mergeclauses);
600 appendStringInfo(str, " :mergeFamilies");
601 for (i = 0; i < numCols; i++)
602 appendStringInfo(str, " %u", node->mergeFamilies[i]);
604 appendStringInfo(str, " :mergeCollations");
605 for (i = 0; i < numCols; i++)
606 appendStringInfo(str, " %u", node->mergeCollations[i]);
608 appendStringInfo(str, " :mergeStrategies");
609 for (i = 0; i < numCols; i++)
610 appendStringInfo(str, " %d", node->mergeStrategies[i]);
612 appendStringInfo(str, " :mergeNullsFirst");
613 for (i = 0; i < numCols; i++)
614 appendStringInfo(str, " %d", (int) node->mergeNullsFirst[i]);
618 _outHashJoin(StringInfo str, const HashJoin *node)
620 WRITE_NODE_TYPE("HASHJOIN");
622 _outJoinPlanInfo(str, (const Join *) node);
624 WRITE_NODE_FIELD(hashclauses);
628 _outAgg(StringInfo str, const Agg *node)
632 WRITE_NODE_TYPE("AGG");
634 _outPlanInfo(str, (const Plan *) node);
636 WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
637 WRITE_INT_FIELD(numCols);
639 appendStringInfo(str, " :grpColIdx");
640 for (i = 0; i < node->numCols; i++)
641 appendStringInfo(str, " %d", node->grpColIdx[i]);
643 appendStringInfo(str, " :grpOperators");
644 for (i = 0; i < node->numCols; i++)
645 appendStringInfo(str, " %u", node->grpOperators[i]);
647 WRITE_LONG_FIELD(numGroups);
651 _outWindowAgg(StringInfo str, const WindowAgg *node)
655 WRITE_NODE_TYPE("WINDOWAGG");
657 _outPlanInfo(str, (const Plan *) node);
659 WRITE_UINT_FIELD(winref);
660 WRITE_INT_FIELD(partNumCols);
662 appendStringInfo(str, " :partColIdx");
663 for (i = 0; i < node->partNumCols; i++)
664 appendStringInfo(str, " %d", node->partColIdx[i]);
666 appendStringInfo(str, " :partOperations");
667 for (i = 0; i < node->partNumCols; i++)
668 appendStringInfo(str, " %u", node->partOperators[i]);
670 WRITE_INT_FIELD(ordNumCols);
672 appendStringInfo(str, " :ordColIdx");
673 for (i = 0; i < node->ordNumCols; i++)
674 appendStringInfo(str, " %d", node->ordColIdx[i]);
676 appendStringInfo(str, " :ordOperations");
677 for (i = 0; i < node->ordNumCols; i++)
678 appendStringInfo(str, " %u", node->ordOperators[i]);
680 WRITE_INT_FIELD(frameOptions);
681 WRITE_NODE_FIELD(startOffset);
682 WRITE_NODE_FIELD(endOffset);
686 _outGroup(StringInfo str, const Group *node)
690 WRITE_NODE_TYPE("GROUP");
692 _outPlanInfo(str, (const Plan *) node);
694 WRITE_INT_FIELD(numCols);
696 appendStringInfo(str, " :grpColIdx");
697 for (i = 0; i < node->numCols; i++)
698 appendStringInfo(str, " %d", node->grpColIdx[i]);
700 appendStringInfo(str, " :grpOperators");
701 for (i = 0; i < node->numCols; i++)
702 appendStringInfo(str, " %u", node->grpOperators[i]);
706 _outMaterial(StringInfo str, const Material *node)
708 WRITE_NODE_TYPE("MATERIAL");
710 _outPlanInfo(str, (const Plan *) node);
714 _outSort(StringInfo str, const Sort *node)
718 WRITE_NODE_TYPE("SORT");
720 _outPlanInfo(str, (const Plan *) node);
722 WRITE_INT_FIELD(numCols);
724 appendStringInfo(str, " :sortColIdx");
725 for (i = 0; i < node->numCols; i++)
726 appendStringInfo(str, " %d", node->sortColIdx[i]);
728 appendStringInfo(str, " :sortOperators");
729 for (i = 0; i < node->numCols; i++)
730 appendStringInfo(str, " %u", node->sortOperators[i]);
732 appendStringInfo(str, " :collations");
733 for (i = 0; i < node->numCols; i++)
734 appendStringInfo(str, " %u", node->collations[i]);
736 appendStringInfo(str, " :nullsFirst");
737 for (i = 0; i < node->numCols; i++)
738 appendStringInfo(str, " %s", booltostr(node->nullsFirst[i]));
742 _outUnique(StringInfo str, const Unique *node)
746 WRITE_NODE_TYPE("UNIQUE");
748 _outPlanInfo(str, (const Plan *) node);
750 WRITE_INT_FIELD(numCols);
752 appendStringInfo(str, " :uniqColIdx");
753 for (i = 0; i < node->numCols; i++)
754 appendStringInfo(str, " %d", node->uniqColIdx[i]);
756 appendStringInfo(str, " :uniqOperators");
757 for (i = 0; i < node->numCols; i++)
758 appendStringInfo(str, " %u", node->uniqOperators[i]);
762 _outHash(StringInfo str, const Hash *node)
764 WRITE_NODE_TYPE("HASH");
766 _outPlanInfo(str, (const Plan *) node);
768 WRITE_OID_FIELD(skewTable);
769 WRITE_INT_FIELD(skewColumn);
770 WRITE_BOOL_FIELD(skewInherit);
771 WRITE_OID_FIELD(skewColType);
772 WRITE_INT_FIELD(skewColTypmod);
776 _outSetOp(StringInfo str, const SetOp *node)
780 WRITE_NODE_TYPE("SETOP");
782 _outPlanInfo(str, (const Plan *) node);
784 WRITE_ENUM_FIELD(cmd, SetOpCmd);
785 WRITE_ENUM_FIELD(strategy, SetOpStrategy);
786 WRITE_INT_FIELD(numCols);
788 appendStringInfo(str, " :dupColIdx");
789 for (i = 0; i < node->numCols; i++)
790 appendStringInfo(str, " %d", node->dupColIdx[i]);
792 appendStringInfo(str, " :dupOperators");
793 for (i = 0; i < node->numCols; i++)
794 appendStringInfo(str, " %u", node->dupOperators[i]);
796 WRITE_INT_FIELD(flagColIdx);
797 WRITE_INT_FIELD(firstFlag);
798 WRITE_LONG_FIELD(numGroups);
802 _outLockRows(StringInfo str, const LockRows *node)
804 WRITE_NODE_TYPE("LOCKROWS");
806 _outPlanInfo(str, (const Plan *) node);
808 WRITE_NODE_FIELD(rowMarks);
809 WRITE_INT_FIELD(epqParam);
813 _outLimit(StringInfo str, const Limit *node)
815 WRITE_NODE_TYPE("LIMIT");
817 _outPlanInfo(str, (const Plan *) node);
819 WRITE_NODE_FIELD(limitOffset);
820 WRITE_NODE_FIELD(limitCount);
824 _outNestLoopParam(StringInfo str, const NestLoopParam *node)
826 WRITE_NODE_TYPE("NESTLOOPPARAM");
828 WRITE_INT_FIELD(paramno);
829 WRITE_NODE_FIELD(paramval);
833 _outPlanRowMark(StringInfo str, const PlanRowMark *node)
835 WRITE_NODE_TYPE("PLANROWMARK");
837 WRITE_UINT_FIELD(rti);
838 WRITE_UINT_FIELD(prti);
839 WRITE_UINT_FIELD(rowmarkId);
840 WRITE_ENUM_FIELD(markType, RowMarkType);
841 WRITE_BOOL_FIELD(noWait);
842 WRITE_BOOL_FIELD(isParent);
846 _outPlanInvalItem(StringInfo str, const PlanInvalItem *node)
848 WRITE_NODE_TYPE("PLANINVALITEM");
850 WRITE_INT_FIELD(cacheId);
851 WRITE_UINT_FIELD(hashValue);
854 /*****************************************************************************
856 * Stuff from primnodes.h.
858 *****************************************************************************/
861 _outAlias(StringInfo str, const Alias *node)
863 WRITE_NODE_TYPE("ALIAS");
865 WRITE_STRING_FIELD(aliasname);
866 WRITE_NODE_FIELD(colnames);
870 _outRangeVar(StringInfo str, const RangeVar *node)
872 WRITE_NODE_TYPE("RANGEVAR");
875 * we deliberately ignore catalogname here, since it is presently not
876 * semantically meaningful
878 WRITE_STRING_FIELD(schemaname);
879 WRITE_STRING_FIELD(relname);
880 WRITE_ENUM_FIELD(inhOpt, InhOption);
881 WRITE_CHAR_FIELD(relpersistence);
882 WRITE_NODE_FIELD(alias);
883 WRITE_LOCATION_FIELD(location);
887 _outIntoClause(StringInfo str, const IntoClause *node)
889 WRITE_NODE_TYPE("INTOCLAUSE");
891 WRITE_NODE_FIELD(rel);
892 WRITE_NODE_FIELD(colNames);
893 WRITE_NODE_FIELD(options);
894 WRITE_ENUM_FIELD(onCommit, OnCommitAction);
895 WRITE_STRING_FIELD(tableSpaceName);
896 WRITE_NODE_FIELD(viewQuery);
897 WRITE_BOOL_FIELD(skipData);
901 _outVar(StringInfo str, const Var *node)
903 WRITE_NODE_TYPE("VAR");
905 WRITE_UINT_FIELD(varno);
906 WRITE_INT_FIELD(varattno);
907 WRITE_OID_FIELD(vartype);
908 WRITE_INT_FIELD(vartypmod);
909 WRITE_OID_FIELD(varcollid);
910 WRITE_UINT_FIELD(varlevelsup);
911 WRITE_UINT_FIELD(varnoold);
912 WRITE_INT_FIELD(varoattno);
913 WRITE_LOCATION_FIELD(location);
917 _outConst(StringInfo str, const Const *node)
919 WRITE_NODE_TYPE("CONST");
921 WRITE_OID_FIELD(consttype);
922 WRITE_INT_FIELD(consttypmod);
923 WRITE_OID_FIELD(constcollid);
924 WRITE_INT_FIELD(constlen);
925 WRITE_BOOL_FIELD(constbyval);
926 WRITE_BOOL_FIELD(constisnull);
927 WRITE_LOCATION_FIELD(location);
929 appendStringInfo(str, " :constvalue ");
930 if (node->constisnull)
931 appendStringInfo(str, "<>");
933 _outDatum(str, node->constvalue, node->constlen, node->constbyval);
937 _outParam(StringInfo str, const Param *node)
939 WRITE_NODE_TYPE("PARAM");
941 WRITE_ENUM_FIELD(paramkind, ParamKind);
942 WRITE_INT_FIELD(paramid);
943 WRITE_OID_FIELD(paramtype);
944 WRITE_INT_FIELD(paramtypmod);
945 WRITE_OID_FIELD(paramcollid);
946 WRITE_LOCATION_FIELD(location);
950 _outAggref(StringInfo str, const Aggref *node)
952 WRITE_NODE_TYPE("AGGREF");
954 WRITE_OID_FIELD(aggfnoid);
955 WRITE_OID_FIELD(aggtype);
956 WRITE_OID_FIELD(aggcollid);
957 WRITE_OID_FIELD(inputcollid);
958 WRITE_NODE_FIELD(args);
959 WRITE_NODE_FIELD(aggorder);
960 WRITE_NODE_FIELD(aggdistinct);
961 WRITE_BOOL_FIELD(aggstar);
962 WRITE_UINT_FIELD(agglevelsup);
963 WRITE_LOCATION_FIELD(location);
967 _outWindowFunc(StringInfo str, const WindowFunc *node)
969 WRITE_NODE_TYPE("WINDOWFUNC");
971 WRITE_OID_FIELD(winfnoid);
972 WRITE_OID_FIELD(wintype);
973 WRITE_OID_FIELD(wincollid);
974 WRITE_OID_FIELD(inputcollid);
975 WRITE_NODE_FIELD(args);
976 WRITE_UINT_FIELD(winref);
977 WRITE_BOOL_FIELD(winstar);
978 WRITE_BOOL_FIELD(winagg);
979 WRITE_LOCATION_FIELD(location);
983 _outArrayRef(StringInfo str, const ArrayRef *node)
985 WRITE_NODE_TYPE("ARRAYREF");
987 WRITE_OID_FIELD(refarraytype);
988 WRITE_OID_FIELD(refelemtype);
989 WRITE_INT_FIELD(reftypmod);
990 WRITE_OID_FIELD(refcollid);
991 WRITE_NODE_FIELD(refupperindexpr);
992 WRITE_NODE_FIELD(reflowerindexpr);
993 WRITE_NODE_FIELD(refexpr);
994 WRITE_NODE_FIELD(refassgnexpr);
998 _outFuncExpr(StringInfo str, const FuncExpr *node)
1000 WRITE_NODE_TYPE("FUNCEXPR");
1002 WRITE_OID_FIELD(funcid);
1003 WRITE_OID_FIELD(funcresulttype);
1004 WRITE_BOOL_FIELD(funcretset);
1005 WRITE_BOOL_FIELD(funcvariadic);
1006 WRITE_ENUM_FIELD(funcformat, CoercionForm);
1007 WRITE_OID_FIELD(funccollid);
1008 WRITE_OID_FIELD(inputcollid);
1009 WRITE_NODE_FIELD(args);
1010 WRITE_LOCATION_FIELD(location);
1014 _outNamedArgExpr(StringInfo str, const NamedArgExpr *node)
1016 WRITE_NODE_TYPE("NAMEDARGEXPR");
1018 WRITE_NODE_FIELD(arg);
1019 WRITE_STRING_FIELD(name);
1020 WRITE_INT_FIELD(argnumber);
1021 WRITE_LOCATION_FIELD(location);
1025 _outOpExpr(StringInfo str, const OpExpr *node)
1027 WRITE_NODE_TYPE("OPEXPR");
1029 WRITE_OID_FIELD(opno);
1030 WRITE_OID_FIELD(opfuncid);
1031 WRITE_OID_FIELD(opresulttype);
1032 WRITE_BOOL_FIELD(opretset);
1033 WRITE_OID_FIELD(opcollid);
1034 WRITE_OID_FIELD(inputcollid);
1035 WRITE_NODE_FIELD(args);
1036 WRITE_LOCATION_FIELD(location);
1040 _outDistinctExpr(StringInfo str, const DistinctExpr *node)
1042 WRITE_NODE_TYPE("DISTINCTEXPR");
1044 WRITE_OID_FIELD(opno);
1045 WRITE_OID_FIELD(opfuncid);
1046 WRITE_OID_FIELD(opresulttype);
1047 WRITE_BOOL_FIELD(opretset);
1048 WRITE_OID_FIELD(opcollid);
1049 WRITE_OID_FIELD(inputcollid);
1050 WRITE_NODE_FIELD(args);
1051 WRITE_LOCATION_FIELD(location);
1055 _outNullIfExpr(StringInfo str, const NullIfExpr *node)
1057 WRITE_NODE_TYPE("NULLIFEXPR");
1059 WRITE_OID_FIELD(opno);
1060 WRITE_OID_FIELD(opfuncid);
1061 WRITE_OID_FIELD(opresulttype);
1062 WRITE_BOOL_FIELD(opretset);
1063 WRITE_OID_FIELD(opcollid);
1064 WRITE_OID_FIELD(inputcollid);
1065 WRITE_NODE_FIELD(args);
1066 WRITE_LOCATION_FIELD(location);
1070 _outScalarArrayOpExpr(StringInfo str, const ScalarArrayOpExpr *node)
1072 WRITE_NODE_TYPE("SCALARARRAYOPEXPR");
1074 WRITE_OID_FIELD(opno);
1075 WRITE_OID_FIELD(opfuncid);
1076 WRITE_BOOL_FIELD(useOr);
1077 WRITE_OID_FIELD(inputcollid);
1078 WRITE_NODE_FIELD(args);
1079 WRITE_LOCATION_FIELD(location);
1083 _outBoolExpr(StringInfo str, const BoolExpr *node)
1087 WRITE_NODE_TYPE("BOOLEXPR");
1089 /* do-it-yourself enum representation */
1090 switch (node->boolop)
1102 appendStringInfo(str, " :boolop ");
1103 _outToken(str, opstr);
1105 WRITE_NODE_FIELD(args);
1106 WRITE_LOCATION_FIELD(location);
1110 _outSubLink(StringInfo str, const SubLink *node)
1112 WRITE_NODE_TYPE("SUBLINK");
1114 WRITE_ENUM_FIELD(subLinkType, SubLinkType);
1115 WRITE_NODE_FIELD(testexpr);
1116 WRITE_NODE_FIELD(operName);
1117 WRITE_NODE_FIELD(subselect);
1118 WRITE_LOCATION_FIELD(location);
1122 _outSubPlan(StringInfo str, const SubPlan *node)
1124 WRITE_NODE_TYPE("SUBPLAN");
1126 WRITE_ENUM_FIELD(subLinkType, SubLinkType);
1127 WRITE_NODE_FIELD(testexpr);
1128 WRITE_NODE_FIELD(paramIds);
1129 WRITE_INT_FIELD(plan_id);
1130 WRITE_STRING_FIELD(plan_name);
1131 WRITE_OID_FIELD(firstColType);
1132 WRITE_INT_FIELD(firstColTypmod);
1133 WRITE_OID_FIELD(firstColCollation);
1134 WRITE_BOOL_FIELD(useHashTable);
1135 WRITE_BOOL_FIELD(unknownEqFalse);
1136 WRITE_NODE_FIELD(setParam);
1137 WRITE_NODE_FIELD(parParam);
1138 WRITE_NODE_FIELD(args);
1139 WRITE_FLOAT_FIELD(startup_cost, "%.2f");
1140 WRITE_FLOAT_FIELD(per_call_cost, "%.2f");
1144 _outAlternativeSubPlan(StringInfo str, const AlternativeSubPlan *node)
1146 WRITE_NODE_TYPE("ALTERNATIVESUBPLAN");
1148 WRITE_NODE_FIELD(subplans);
1152 _outFieldSelect(StringInfo str, const FieldSelect *node)
1154 WRITE_NODE_TYPE("FIELDSELECT");
1156 WRITE_NODE_FIELD(arg);
1157 WRITE_INT_FIELD(fieldnum);
1158 WRITE_OID_FIELD(resulttype);
1159 WRITE_INT_FIELD(resulttypmod);
1160 WRITE_OID_FIELD(resultcollid);
1164 _outFieldStore(StringInfo str, const FieldStore *node)
1166 WRITE_NODE_TYPE("FIELDSTORE");
1168 WRITE_NODE_FIELD(arg);
1169 WRITE_NODE_FIELD(newvals);
1170 WRITE_NODE_FIELD(fieldnums);
1171 WRITE_OID_FIELD(resulttype);
1175 _outRelabelType(StringInfo str, const RelabelType *node)
1177 WRITE_NODE_TYPE("RELABELTYPE");
1179 WRITE_NODE_FIELD(arg);
1180 WRITE_OID_FIELD(resulttype);
1181 WRITE_INT_FIELD(resulttypmod);
1182 WRITE_OID_FIELD(resultcollid);
1183 WRITE_ENUM_FIELD(relabelformat, CoercionForm);
1184 WRITE_LOCATION_FIELD(location);
1188 _outCoerceViaIO(StringInfo str, const CoerceViaIO *node)
1190 WRITE_NODE_TYPE("COERCEVIAIO");
1192 WRITE_NODE_FIELD(arg);
1193 WRITE_OID_FIELD(resulttype);
1194 WRITE_OID_FIELD(resultcollid);
1195 WRITE_ENUM_FIELD(coerceformat, CoercionForm);
1196 WRITE_LOCATION_FIELD(location);
1200 _outArrayCoerceExpr(StringInfo str, const ArrayCoerceExpr *node)
1202 WRITE_NODE_TYPE("ARRAYCOERCEEXPR");
1204 WRITE_NODE_FIELD(arg);
1205 WRITE_OID_FIELD(elemfuncid);
1206 WRITE_OID_FIELD(resulttype);
1207 WRITE_INT_FIELD(resulttypmod);
1208 WRITE_OID_FIELD(resultcollid);
1209 WRITE_BOOL_FIELD(isExplicit);
1210 WRITE_ENUM_FIELD(coerceformat, CoercionForm);
1211 WRITE_LOCATION_FIELD(location);
1215 _outConvertRowtypeExpr(StringInfo str, const ConvertRowtypeExpr *node)
1217 WRITE_NODE_TYPE("CONVERTROWTYPEEXPR");
1219 WRITE_NODE_FIELD(arg);
1220 WRITE_OID_FIELD(resulttype);
1221 WRITE_ENUM_FIELD(convertformat, CoercionForm);
1222 WRITE_LOCATION_FIELD(location);
1226 _outCollateExpr(StringInfo str, const CollateExpr *node)
1228 WRITE_NODE_TYPE("COLLATE");
1230 WRITE_NODE_FIELD(arg);
1231 WRITE_OID_FIELD(collOid);
1232 WRITE_LOCATION_FIELD(location);
1236 _outCaseExpr(StringInfo str, const CaseExpr *node)
1238 WRITE_NODE_TYPE("CASE");
1240 WRITE_OID_FIELD(casetype);
1241 WRITE_OID_FIELD(casecollid);
1242 WRITE_NODE_FIELD(arg);
1243 WRITE_NODE_FIELD(args);
1244 WRITE_NODE_FIELD(defresult);
1245 WRITE_LOCATION_FIELD(location);
1249 _outCaseWhen(StringInfo str, const CaseWhen *node)
1251 WRITE_NODE_TYPE("WHEN");
1253 WRITE_NODE_FIELD(expr);
1254 WRITE_NODE_FIELD(result);
1255 WRITE_LOCATION_FIELD(location);
1259 _outCaseTestExpr(StringInfo str, const CaseTestExpr *node)
1261 WRITE_NODE_TYPE("CASETESTEXPR");
1263 WRITE_OID_FIELD(typeId);
1264 WRITE_INT_FIELD(typeMod);
1265 WRITE_OID_FIELD(collation);
1269 _outArrayExpr(StringInfo str, const ArrayExpr *node)
1271 WRITE_NODE_TYPE("ARRAY");
1273 WRITE_OID_FIELD(array_typeid);
1274 WRITE_OID_FIELD(array_collid);
1275 WRITE_OID_FIELD(element_typeid);
1276 WRITE_NODE_FIELD(elements);
1277 WRITE_BOOL_FIELD(multidims);
1278 WRITE_LOCATION_FIELD(location);
1282 _outRowExpr(StringInfo str, const RowExpr *node)
1284 WRITE_NODE_TYPE("ROW");
1286 WRITE_NODE_FIELD(args);
1287 WRITE_OID_FIELD(row_typeid);
1288 WRITE_ENUM_FIELD(row_format, CoercionForm);
1289 WRITE_NODE_FIELD(colnames);
1290 WRITE_LOCATION_FIELD(location);
1294 _outRowCompareExpr(StringInfo str, const RowCompareExpr *node)
1296 WRITE_NODE_TYPE("ROWCOMPARE");
1298 WRITE_ENUM_FIELD(rctype, RowCompareType);
1299 WRITE_NODE_FIELD(opnos);
1300 WRITE_NODE_FIELD(opfamilies);
1301 WRITE_NODE_FIELD(inputcollids);
1302 WRITE_NODE_FIELD(largs);
1303 WRITE_NODE_FIELD(rargs);
1307 _outCoalesceExpr(StringInfo str, const CoalesceExpr *node)
1309 WRITE_NODE_TYPE("COALESCE");
1311 WRITE_OID_FIELD(coalescetype);
1312 WRITE_OID_FIELD(coalescecollid);
1313 WRITE_NODE_FIELD(args);
1314 WRITE_LOCATION_FIELD(location);
1318 _outMinMaxExpr(StringInfo str, const MinMaxExpr *node)
1320 WRITE_NODE_TYPE("MINMAX");
1322 WRITE_OID_FIELD(minmaxtype);
1323 WRITE_OID_FIELD(minmaxcollid);
1324 WRITE_OID_FIELD(inputcollid);
1325 WRITE_ENUM_FIELD(op, MinMaxOp);
1326 WRITE_NODE_FIELD(args);
1327 WRITE_LOCATION_FIELD(location);
1331 _outXmlExpr(StringInfo str, const XmlExpr *node)
1333 WRITE_NODE_TYPE("XMLEXPR");
1335 WRITE_ENUM_FIELD(op, XmlExprOp);
1336 WRITE_STRING_FIELD(name);
1337 WRITE_NODE_FIELD(named_args);
1338 WRITE_NODE_FIELD(arg_names);
1339 WRITE_NODE_FIELD(args);
1340 WRITE_ENUM_FIELD(xmloption, XmlOptionType);
1341 WRITE_OID_FIELD(type);
1342 WRITE_INT_FIELD(typmod);
1343 WRITE_LOCATION_FIELD(location);
1347 _outNullTest(StringInfo str, const NullTest *node)
1349 WRITE_NODE_TYPE("NULLTEST");
1351 WRITE_NODE_FIELD(arg);
1352 WRITE_ENUM_FIELD(nulltesttype, NullTestType);
1353 WRITE_BOOL_FIELD(argisrow);
1357 _outBooleanTest(StringInfo str, const BooleanTest *node)
1359 WRITE_NODE_TYPE("BOOLEANTEST");
1361 WRITE_NODE_FIELD(arg);
1362 WRITE_ENUM_FIELD(booltesttype, BoolTestType);
1366 _outCoerceToDomain(StringInfo str, const CoerceToDomain *node)
1368 WRITE_NODE_TYPE("COERCETODOMAIN");
1370 WRITE_NODE_FIELD(arg);
1371 WRITE_OID_FIELD(resulttype);
1372 WRITE_INT_FIELD(resulttypmod);
1373 WRITE_OID_FIELD(resultcollid);
1374 WRITE_ENUM_FIELD(coercionformat, CoercionForm);
1375 WRITE_LOCATION_FIELD(location);
1379 _outCoerceToDomainValue(StringInfo str, const CoerceToDomainValue *node)
1381 WRITE_NODE_TYPE("COERCETODOMAINVALUE");
1383 WRITE_OID_FIELD(typeId);
1384 WRITE_INT_FIELD(typeMod);
1385 WRITE_OID_FIELD(collation);
1386 WRITE_LOCATION_FIELD(location);
1390 _outSetToDefault(StringInfo str, const SetToDefault *node)
1392 WRITE_NODE_TYPE("SETTODEFAULT");
1394 WRITE_OID_FIELD(typeId);
1395 WRITE_INT_FIELD(typeMod);
1396 WRITE_OID_FIELD(collation);
1397 WRITE_LOCATION_FIELD(location);
1401 _outCurrentOfExpr(StringInfo str, const CurrentOfExpr *node)
1403 WRITE_NODE_TYPE("CURRENTOFEXPR");
1405 WRITE_UINT_FIELD(cvarno);
1406 WRITE_STRING_FIELD(cursor_name);
1407 WRITE_INT_FIELD(cursor_param);
1411 _outTargetEntry(StringInfo str, const TargetEntry *node)
1413 WRITE_NODE_TYPE("TARGETENTRY");
1415 WRITE_NODE_FIELD(expr);
1416 WRITE_INT_FIELD(resno);
1417 WRITE_STRING_FIELD(resname);
1418 WRITE_UINT_FIELD(ressortgroupref);
1419 WRITE_OID_FIELD(resorigtbl);
1420 WRITE_INT_FIELD(resorigcol);
1421 WRITE_BOOL_FIELD(resjunk);
1425 _outRangeTblRef(StringInfo str, const RangeTblRef *node)
1427 WRITE_NODE_TYPE("RANGETBLREF");
1429 WRITE_INT_FIELD(rtindex);
1433 _outJoinExpr(StringInfo str, const JoinExpr *node)
1435 WRITE_NODE_TYPE("JOINEXPR");
1437 WRITE_ENUM_FIELD(jointype, JoinType);
1438 WRITE_BOOL_FIELD(isNatural);
1439 WRITE_NODE_FIELD(larg);
1440 WRITE_NODE_FIELD(rarg);
1441 WRITE_NODE_FIELD(usingClause);
1442 WRITE_NODE_FIELD(quals);
1443 WRITE_NODE_FIELD(alias);
1444 WRITE_INT_FIELD(rtindex);
1448 _outFromExpr(StringInfo str, const FromExpr *node)
1450 WRITE_NODE_TYPE("FROMEXPR");
1452 WRITE_NODE_FIELD(fromlist);
1453 WRITE_NODE_FIELD(quals);
1456 /*****************************************************************************
1458 * Stuff from relation.h.
1460 *****************************************************************************/
1463 * print the basic stuff of all nodes that inherit from Path
1465 * Note we do NOT print the parent, else we'd be in infinite recursion.
1466 * We can print the parent's relids for identification purposes, though.
1467 * We also do not print the whole of param_info, since it's printed by
1468 * _outRelOptInfo; it's sufficient and less cluttering to print just the
1469 * required outer relids.
1472 _outPathInfo(StringInfo str, const Path *node)
1474 WRITE_ENUM_FIELD(pathtype, NodeTag);
1475 appendStringInfo(str, " :parent_relids ");
1476 _outBitmapset(str, node->parent->relids);
1477 appendStringInfo(str, " :required_outer ");
1478 if (node->param_info)
1479 _outBitmapset(str, node->param_info->ppi_req_outer);
1481 _outBitmapset(str, NULL);
1482 WRITE_FLOAT_FIELD(rows, "%.0f");
1483 WRITE_FLOAT_FIELD(startup_cost, "%.2f");
1484 WRITE_FLOAT_FIELD(total_cost, "%.2f");
1485 WRITE_NODE_FIELD(pathkeys);
1489 * print the basic stuff of all nodes that inherit from JoinPath
1492 _outJoinPathInfo(StringInfo str, const JoinPath *node)
1494 _outPathInfo(str, (const Path *) node);
1496 WRITE_ENUM_FIELD(jointype, JoinType);
1497 WRITE_NODE_FIELD(outerjoinpath);
1498 WRITE_NODE_FIELD(innerjoinpath);
1499 WRITE_NODE_FIELD(joinrestrictinfo);
1503 _outPath(StringInfo str, const Path *node)
1505 WRITE_NODE_TYPE("PATH");
1507 _outPathInfo(str, (const Path *) node);
1511 _outIndexPath(StringInfo str, const IndexPath *node)
1513 WRITE_NODE_TYPE("INDEXPATH");
1515 _outPathInfo(str, (const Path *) node);
1517 WRITE_NODE_FIELD(indexinfo);
1518 WRITE_NODE_FIELD(indexclauses);
1519 WRITE_NODE_FIELD(indexquals);
1520 WRITE_NODE_FIELD(indexqualcols);
1521 WRITE_NODE_FIELD(indexorderbys);
1522 WRITE_NODE_FIELD(indexorderbycols);
1523 WRITE_ENUM_FIELD(indexscandir, ScanDirection);
1524 WRITE_FLOAT_FIELD(indextotalcost, "%.2f");
1525 WRITE_FLOAT_FIELD(indexselectivity, "%.4f");
1529 _outBitmapHeapPath(StringInfo str, const BitmapHeapPath *node)
1531 WRITE_NODE_TYPE("BITMAPHEAPPATH");
1533 _outPathInfo(str, (const Path *) node);
1535 WRITE_NODE_FIELD(bitmapqual);
1539 _outBitmapAndPath(StringInfo str, const BitmapAndPath *node)
1541 WRITE_NODE_TYPE("BITMAPANDPATH");
1543 _outPathInfo(str, (const Path *) node);
1545 WRITE_NODE_FIELD(bitmapquals);
1546 WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
1550 _outBitmapOrPath(StringInfo str, const BitmapOrPath *node)
1552 WRITE_NODE_TYPE("BITMAPORPATH");
1554 _outPathInfo(str, (const Path *) node);
1556 WRITE_NODE_FIELD(bitmapquals);
1557 WRITE_FLOAT_FIELD(bitmapselectivity, "%.4f");
1561 _outTidPath(StringInfo str, const TidPath *node)
1563 WRITE_NODE_TYPE("TIDPATH");
1565 _outPathInfo(str, (const Path *) node);
1567 WRITE_NODE_FIELD(tidquals);
1571 _outForeignPath(StringInfo str, const ForeignPath *node)
1573 WRITE_NODE_TYPE("FOREIGNPATH");
1575 _outPathInfo(str, (const Path *) node);
1577 WRITE_NODE_FIELD(fdw_private);
1581 _outAppendPath(StringInfo str, const AppendPath *node)
1583 WRITE_NODE_TYPE("APPENDPATH");
1585 _outPathInfo(str, (const Path *) node);
1587 WRITE_NODE_FIELD(subpaths);
1591 _outMergeAppendPath(StringInfo str, const MergeAppendPath *node)
1593 WRITE_NODE_TYPE("MERGEAPPENDPATH");
1595 _outPathInfo(str, (const Path *) node);
1597 WRITE_NODE_FIELD(subpaths);
1598 WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
1602 _outResultPath(StringInfo str, const ResultPath *node)
1604 WRITE_NODE_TYPE("RESULTPATH");
1606 _outPathInfo(str, (const Path *) node);
1608 WRITE_NODE_FIELD(quals);
1612 _outMaterialPath(StringInfo str, const MaterialPath *node)
1614 WRITE_NODE_TYPE("MATERIALPATH");
1616 _outPathInfo(str, (const Path *) node);
1618 WRITE_NODE_FIELD(subpath);
1622 _outUniquePath(StringInfo str, const UniquePath *node)
1624 WRITE_NODE_TYPE("UNIQUEPATH");
1626 _outPathInfo(str, (const Path *) node);
1628 WRITE_NODE_FIELD(subpath);
1629 WRITE_ENUM_FIELD(umethod, UniquePathMethod);
1630 WRITE_NODE_FIELD(in_operators);
1631 WRITE_NODE_FIELD(uniq_exprs);
1635 _outNestPath(StringInfo str, const NestPath *node)
1637 WRITE_NODE_TYPE("NESTPATH");
1639 _outJoinPathInfo(str, (const JoinPath *) node);
1643 _outMergePath(StringInfo str, const MergePath *node)
1645 WRITE_NODE_TYPE("MERGEPATH");
1647 _outJoinPathInfo(str, (const JoinPath *) node);
1649 WRITE_NODE_FIELD(path_mergeclauses);
1650 WRITE_NODE_FIELD(outersortkeys);
1651 WRITE_NODE_FIELD(innersortkeys);
1652 WRITE_BOOL_FIELD(materialize_inner);
1656 _outHashPath(StringInfo str, const HashPath *node)
1658 WRITE_NODE_TYPE("HASHPATH");
1660 _outJoinPathInfo(str, (const JoinPath *) node);
1662 WRITE_NODE_FIELD(path_hashclauses);
1663 WRITE_INT_FIELD(num_batches);
1667 _outPlannerGlobal(StringInfo str, const PlannerGlobal *node)
1669 WRITE_NODE_TYPE("PLANNERGLOBAL");
1671 /* NB: this isn't a complete set of fields */
1672 WRITE_NODE_FIELD(subplans);
1673 WRITE_BITMAPSET_FIELD(rewindPlanIDs);
1674 WRITE_NODE_FIELD(finalrtable);
1675 WRITE_NODE_FIELD(finalrowmarks);
1676 WRITE_NODE_FIELD(resultRelations);
1677 WRITE_NODE_FIELD(relationOids);
1678 WRITE_NODE_FIELD(invalItems);
1679 WRITE_INT_FIELD(nParamExec);
1680 WRITE_UINT_FIELD(lastPHId);
1681 WRITE_UINT_FIELD(lastRowMarkId);
1682 WRITE_BOOL_FIELD(transientPlan);
1686 _outPlannerInfo(StringInfo str, const PlannerInfo *node)
1688 WRITE_NODE_TYPE("PLANNERINFO");
1690 /* NB: this isn't a complete set of fields */
1691 WRITE_NODE_FIELD(parse);
1692 WRITE_NODE_FIELD(glob);
1693 WRITE_UINT_FIELD(query_level);
1694 WRITE_NODE_FIELD(plan_params);
1695 WRITE_BITMAPSET_FIELD(all_baserels);
1696 WRITE_NODE_FIELD(join_rel_list);
1697 WRITE_INT_FIELD(join_cur_level);
1698 WRITE_NODE_FIELD(init_plans);
1699 WRITE_NODE_FIELD(cte_plan_ids);
1700 WRITE_NODE_FIELD(eq_classes);
1701 WRITE_NODE_FIELD(canon_pathkeys);
1702 WRITE_NODE_FIELD(left_join_clauses);
1703 WRITE_NODE_FIELD(right_join_clauses);
1704 WRITE_NODE_FIELD(full_join_clauses);
1705 WRITE_NODE_FIELD(join_info_list);
1706 WRITE_NODE_FIELD(lateral_info_list);
1707 WRITE_NODE_FIELD(append_rel_list);
1708 WRITE_NODE_FIELD(rowMarks);
1709 WRITE_NODE_FIELD(placeholder_list);
1710 WRITE_NODE_FIELD(query_pathkeys);
1711 WRITE_NODE_FIELD(group_pathkeys);
1712 WRITE_NODE_FIELD(window_pathkeys);
1713 WRITE_NODE_FIELD(distinct_pathkeys);
1714 WRITE_NODE_FIELD(sort_pathkeys);
1715 WRITE_NODE_FIELD(minmax_aggs);
1716 WRITE_FLOAT_FIELD(total_table_pages, "%.0f");
1717 WRITE_FLOAT_FIELD(tuple_fraction, "%.4f");
1718 WRITE_FLOAT_FIELD(limit_tuples, "%.0f");
1719 WRITE_BOOL_FIELD(hasInheritedTarget);
1720 WRITE_BOOL_FIELD(hasJoinRTEs);
1721 WRITE_BOOL_FIELD(hasLateralRTEs);
1722 WRITE_BOOL_FIELD(hasHavingQual);
1723 WRITE_BOOL_FIELD(hasPseudoConstantQuals);
1724 WRITE_BOOL_FIELD(hasRecursion);
1725 WRITE_INT_FIELD(wt_param_id);
1726 WRITE_BITMAPSET_FIELD(curOuterRels);
1727 WRITE_NODE_FIELD(curOuterParams);
1731 _outRelOptInfo(StringInfo str, const RelOptInfo *node)
1733 WRITE_NODE_TYPE("RELOPTINFO");
1735 /* NB: this isn't a complete set of fields */
1736 WRITE_ENUM_FIELD(reloptkind, RelOptKind);
1737 WRITE_BITMAPSET_FIELD(relids);
1738 WRITE_FLOAT_FIELD(rows, "%.0f");
1739 WRITE_INT_FIELD(width);
1740 WRITE_BOOL_FIELD(consider_startup);
1741 WRITE_NODE_FIELD(reltargetlist);
1742 WRITE_NODE_FIELD(pathlist);
1743 WRITE_NODE_FIELD(ppilist);
1744 WRITE_NODE_FIELD(cheapest_startup_path);
1745 WRITE_NODE_FIELD(cheapest_total_path);
1746 WRITE_NODE_FIELD(cheapest_unique_path);
1747 WRITE_NODE_FIELD(cheapest_parameterized_paths);
1748 WRITE_UINT_FIELD(relid);
1749 WRITE_UINT_FIELD(reltablespace);
1750 WRITE_ENUM_FIELD(rtekind, RTEKind);
1751 WRITE_INT_FIELD(min_attr);
1752 WRITE_INT_FIELD(max_attr);
1753 WRITE_NODE_FIELD(lateral_vars);
1754 WRITE_BITMAPSET_FIELD(lateral_relids);
1755 WRITE_NODE_FIELD(indexlist);
1756 WRITE_UINT_FIELD(pages);
1757 WRITE_FLOAT_FIELD(tuples, "%.0f");
1758 WRITE_FLOAT_FIELD(allvisfrac, "%.6f");
1759 WRITE_NODE_FIELD(subplan);
1760 WRITE_NODE_FIELD(subroot);
1761 WRITE_NODE_FIELD(subplan_params);
1762 /* we don't try to print fdwroutine or fdw_private */
1763 WRITE_NODE_FIELD(baserestrictinfo);
1764 WRITE_NODE_FIELD(joininfo);
1765 WRITE_BOOL_FIELD(has_eclass_joins);
1769 _outIndexOptInfo(StringInfo str, const IndexOptInfo *node)
1771 WRITE_NODE_TYPE("INDEXOPTINFO");
1773 /* NB: this isn't a complete set of fields */
1774 WRITE_OID_FIELD(indexoid);
1775 /* Do NOT print rel field, else infinite recursion */
1776 WRITE_UINT_FIELD(pages);
1777 WRITE_FLOAT_FIELD(tuples, "%.0f");
1778 WRITE_INT_FIELD(tree_height);
1779 WRITE_INT_FIELD(ncolumns);
1780 /* array fields aren't really worth the trouble to print */
1781 WRITE_OID_FIELD(relam);
1782 /* indexprs is redundant since we print indextlist */
1783 WRITE_NODE_FIELD(indpred);
1784 WRITE_NODE_FIELD(indextlist);
1785 WRITE_BOOL_FIELD(predOK);
1786 WRITE_BOOL_FIELD(unique);
1787 WRITE_BOOL_FIELD(immediate);
1788 WRITE_BOOL_FIELD(hypothetical);
1789 /* we don't bother with fields copied from the pg_am entry */
1793 _outEquivalenceClass(StringInfo str, const EquivalenceClass *node)
1796 * To simplify reading, we just chase up to the topmost merged EC and
1797 * print that, without bothering to show the merge-ees separately.
1799 while (node->ec_merged)
1800 node = node->ec_merged;
1802 WRITE_NODE_TYPE("EQUIVALENCECLASS");
1804 WRITE_NODE_FIELD(ec_opfamilies);
1805 WRITE_OID_FIELD(ec_collation);
1806 WRITE_NODE_FIELD(ec_members);
1807 WRITE_NODE_FIELD(ec_sources);
1808 WRITE_NODE_FIELD(ec_derives);
1809 WRITE_BITMAPSET_FIELD(ec_relids);
1810 WRITE_BOOL_FIELD(ec_has_const);
1811 WRITE_BOOL_FIELD(ec_has_volatile);
1812 WRITE_BOOL_FIELD(ec_below_outer_join);
1813 WRITE_BOOL_FIELD(ec_broken);
1814 WRITE_UINT_FIELD(ec_sortref);
1818 _outEquivalenceMember(StringInfo str, const EquivalenceMember *node)
1820 WRITE_NODE_TYPE("EQUIVALENCEMEMBER");
1822 WRITE_NODE_FIELD(em_expr);
1823 WRITE_BITMAPSET_FIELD(em_relids);
1824 WRITE_BITMAPSET_FIELD(em_nullable_relids);
1825 WRITE_BOOL_FIELD(em_is_const);
1826 WRITE_BOOL_FIELD(em_is_child);
1827 WRITE_OID_FIELD(em_datatype);
1831 _outPathKey(StringInfo str, const PathKey *node)
1833 WRITE_NODE_TYPE("PATHKEY");
1835 WRITE_NODE_FIELD(pk_eclass);
1836 WRITE_OID_FIELD(pk_opfamily);
1837 WRITE_INT_FIELD(pk_strategy);
1838 WRITE_BOOL_FIELD(pk_nulls_first);
1842 _outParamPathInfo(StringInfo str, const ParamPathInfo *node)
1844 WRITE_NODE_TYPE("PARAMPATHINFO");
1846 WRITE_BITMAPSET_FIELD(ppi_req_outer);
1847 WRITE_FLOAT_FIELD(ppi_rows, "%.0f");
1848 WRITE_NODE_FIELD(ppi_clauses);
1852 _outRestrictInfo(StringInfo str, const RestrictInfo *node)
1854 WRITE_NODE_TYPE("RESTRICTINFO");
1856 /* NB: this isn't a complete set of fields */
1857 WRITE_NODE_FIELD(clause);
1858 WRITE_BOOL_FIELD(is_pushed_down);
1859 WRITE_BOOL_FIELD(outerjoin_delayed);
1860 WRITE_BOOL_FIELD(can_join);
1861 WRITE_BOOL_FIELD(pseudoconstant);
1862 WRITE_BITMAPSET_FIELD(clause_relids);
1863 WRITE_BITMAPSET_FIELD(required_relids);
1864 WRITE_BITMAPSET_FIELD(outer_relids);
1865 WRITE_BITMAPSET_FIELD(nullable_relids);
1866 WRITE_BITMAPSET_FIELD(left_relids);
1867 WRITE_BITMAPSET_FIELD(right_relids);
1868 WRITE_NODE_FIELD(orclause);
1869 /* don't write parent_ec, leads to infinite recursion in plan tree dump */
1870 WRITE_FLOAT_FIELD(norm_selec, "%.4f");
1871 WRITE_FLOAT_FIELD(outer_selec, "%.4f");
1872 WRITE_NODE_FIELD(mergeopfamilies);
1873 /* don't write left_ec, leads to infinite recursion in plan tree dump */
1874 /* don't write right_ec, leads to infinite recursion in plan tree dump */
1875 WRITE_NODE_FIELD(left_em);
1876 WRITE_NODE_FIELD(right_em);
1877 WRITE_BOOL_FIELD(outer_is_left);
1878 WRITE_OID_FIELD(hashjoinoperator);
1882 _outPlaceHolderVar(StringInfo str, const PlaceHolderVar *node)
1884 WRITE_NODE_TYPE("PLACEHOLDERVAR");
1886 WRITE_NODE_FIELD(phexpr);
1887 WRITE_BITMAPSET_FIELD(phrels);
1888 WRITE_UINT_FIELD(phid);
1889 WRITE_UINT_FIELD(phlevelsup);
1893 _outSpecialJoinInfo(StringInfo str, const SpecialJoinInfo *node)
1895 WRITE_NODE_TYPE("SPECIALJOININFO");
1897 WRITE_BITMAPSET_FIELD(min_lefthand);
1898 WRITE_BITMAPSET_FIELD(min_righthand);
1899 WRITE_BITMAPSET_FIELD(syn_lefthand);
1900 WRITE_BITMAPSET_FIELD(syn_righthand);
1901 WRITE_ENUM_FIELD(jointype, JoinType);
1902 WRITE_BOOL_FIELD(lhs_strict);
1903 WRITE_BOOL_FIELD(delay_upper_joins);
1904 WRITE_NODE_FIELD(join_quals);
1908 _outLateralJoinInfo(StringInfo str, const LateralJoinInfo *node)
1910 WRITE_NODE_TYPE("LATERALJOININFO");
1912 WRITE_UINT_FIELD(lateral_rhs);
1913 WRITE_BITMAPSET_FIELD(lateral_lhs);
1917 _outAppendRelInfo(StringInfo str, const AppendRelInfo *node)
1919 WRITE_NODE_TYPE("APPENDRELINFO");
1921 WRITE_UINT_FIELD(parent_relid);
1922 WRITE_UINT_FIELD(child_relid);
1923 WRITE_OID_FIELD(parent_reltype);
1924 WRITE_OID_FIELD(child_reltype);
1925 WRITE_NODE_FIELD(translated_vars);
1926 WRITE_OID_FIELD(parent_reloid);
1930 _outPlaceHolderInfo(StringInfo str, const PlaceHolderInfo *node)
1932 WRITE_NODE_TYPE("PLACEHOLDERINFO");
1934 WRITE_UINT_FIELD(phid);
1935 WRITE_NODE_FIELD(ph_var);
1936 WRITE_BITMAPSET_FIELD(ph_eval_at);
1937 WRITE_BITMAPSET_FIELD(ph_needed);
1938 WRITE_BITMAPSET_FIELD(ph_may_need);
1939 WRITE_INT_FIELD(ph_width);
1943 _outMinMaxAggInfo(StringInfo str, const MinMaxAggInfo *node)
1945 WRITE_NODE_TYPE("MINMAXAGGINFO");
1947 WRITE_OID_FIELD(aggfnoid);
1948 WRITE_OID_FIELD(aggsortop);
1949 WRITE_NODE_FIELD(target);
1950 /* We intentionally omit subroot --- too large, not interesting enough */
1951 WRITE_NODE_FIELD(path);
1952 WRITE_FLOAT_FIELD(pathcost, "%.2f");
1953 WRITE_NODE_FIELD(param);
1957 _outPlannerParamItem(StringInfo str, const PlannerParamItem *node)
1959 WRITE_NODE_TYPE("PLANNERPARAMITEM");
1961 WRITE_NODE_FIELD(item);
1962 WRITE_INT_FIELD(paramId);
1965 /*****************************************************************************
1967 * Stuff from parsenodes.h.
1969 *****************************************************************************/
1972 * print the basic stuff of all nodes that inherit from CreateStmt
1975 _outCreateStmtInfo(StringInfo str, const CreateStmt *node)
1977 WRITE_NODE_FIELD(relation);
1978 WRITE_NODE_FIELD(tableElts);
1979 WRITE_NODE_FIELD(inhRelations);
1980 WRITE_NODE_FIELD(ofTypename);
1981 WRITE_NODE_FIELD(constraints);
1982 WRITE_NODE_FIELD(options);
1983 WRITE_ENUM_FIELD(oncommit, OnCommitAction);
1984 WRITE_STRING_FIELD(tablespacename);
1985 WRITE_BOOL_FIELD(if_not_exists);
1989 _outCreateStmt(StringInfo str, const CreateStmt *node)
1991 WRITE_NODE_TYPE("CREATESTMT");
1993 _outCreateStmtInfo(str, (const CreateStmt *) node);
1997 _outCreateForeignTableStmt(StringInfo str, const CreateForeignTableStmt *node)
1999 WRITE_NODE_TYPE("CREATEFOREIGNTABLESTMT");
2001 _outCreateStmtInfo(str, (const CreateStmt *) node);
2003 WRITE_STRING_FIELD(servername);
2004 WRITE_NODE_FIELD(options);
2008 _outIndexStmt(StringInfo str, const IndexStmt *node)
2010 WRITE_NODE_TYPE("INDEXSTMT");
2012 WRITE_STRING_FIELD(idxname);
2013 WRITE_NODE_FIELD(relation);
2014 WRITE_STRING_FIELD(accessMethod);
2015 WRITE_STRING_FIELD(tableSpace);
2016 WRITE_NODE_FIELD(indexParams);
2017 WRITE_NODE_FIELD(options);
2018 WRITE_NODE_FIELD(whereClause);
2019 WRITE_NODE_FIELD(excludeOpNames);
2020 WRITE_STRING_FIELD(idxcomment);
2021 WRITE_OID_FIELD(indexOid);
2022 WRITE_OID_FIELD(oldNode);
2023 WRITE_BOOL_FIELD(unique);
2024 WRITE_BOOL_FIELD(primary);
2025 WRITE_BOOL_FIELD(isconstraint);
2026 WRITE_BOOL_FIELD(deferrable);
2027 WRITE_BOOL_FIELD(initdeferred);
2028 WRITE_BOOL_FIELD(concurrent);
2032 _outNotifyStmt(StringInfo str, const NotifyStmt *node)
2034 WRITE_NODE_TYPE("NOTIFY");
2036 WRITE_STRING_FIELD(conditionname);
2037 WRITE_STRING_FIELD(payload);
2041 _outDeclareCursorStmt(StringInfo str, const DeclareCursorStmt *node)
2043 WRITE_NODE_TYPE("DECLARECURSOR");
2045 WRITE_STRING_FIELD(portalname);
2046 WRITE_INT_FIELD(options);
2047 WRITE_NODE_FIELD(query);
2051 _outSelectStmt(StringInfo str, const SelectStmt *node)
2053 WRITE_NODE_TYPE("SELECT");
2055 WRITE_NODE_FIELD(distinctClause);
2056 WRITE_NODE_FIELD(intoClause);
2057 WRITE_NODE_FIELD(targetList);
2058 WRITE_NODE_FIELD(fromClause);
2059 WRITE_NODE_FIELD(whereClause);
2060 WRITE_NODE_FIELD(groupClause);
2061 WRITE_NODE_FIELD(havingClause);
2062 WRITE_NODE_FIELD(windowClause);
2063 WRITE_NODE_FIELD(valuesLists);
2064 WRITE_NODE_FIELD(sortClause);
2065 WRITE_NODE_FIELD(limitOffset);
2066 WRITE_NODE_FIELD(limitCount);
2067 WRITE_NODE_FIELD(lockingClause);
2068 WRITE_NODE_FIELD(withClause);
2069 WRITE_ENUM_FIELD(op, SetOperation);
2070 WRITE_BOOL_FIELD(all);
2071 WRITE_NODE_FIELD(larg);
2072 WRITE_NODE_FIELD(rarg);
2076 _outFuncCall(StringInfo str, const FuncCall *node)
2078 WRITE_NODE_TYPE("FUNCCALL");
2080 WRITE_NODE_FIELD(funcname);
2081 WRITE_NODE_FIELD(args);
2082 WRITE_NODE_FIELD(agg_order);
2083 WRITE_BOOL_FIELD(agg_star);
2084 WRITE_BOOL_FIELD(agg_distinct);
2085 WRITE_BOOL_FIELD(func_variadic);
2086 WRITE_NODE_FIELD(over);
2087 WRITE_LOCATION_FIELD(location);
2091 _outDefElem(StringInfo str, const DefElem *node)
2093 WRITE_NODE_TYPE("DEFELEM");
2095 WRITE_STRING_FIELD(defnamespace);
2096 WRITE_STRING_FIELD(defname);
2097 WRITE_NODE_FIELD(arg);
2098 WRITE_ENUM_FIELD(defaction, DefElemAction);
2102 _outTableLikeClause(StringInfo str, const TableLikeClause *node)
2104 WRITE_NODE_TYPE("TABLELIKECLAUSE");
2106 WRITE_NODE_FIELD(relation);
2107 WRITE_UINT_FIELD(options);
2111 _outLockingClause(StringInfo str, const LockingClause *node)
2113 WRITE_NODE_TYPE("LOCKINGCLAUSE");
2115 WRITE_NODE_FIELD(lockedRels);
2116 WRITE_ENUM_FIELD(strength, LockClauseStrength);
2117 WRITE_BOOL_FIELD(noWait);
2121 _outXmlSerialize(StringInfo str, const XmlSerialize *node)
2123 WRITE_NODE_TYPE("XMLSERIALIZE");
2125 WRITE_ENUM_FIELD(xmloption, XmlOptionType);
2126 WRITE_NODE_FIELD(expr);
2127 WRITE_NODE_FIELD(typeName);
2128 WRITE_LOCATION_FIELD(location);
2132 _outColumnDef(StringInfo str, const ColumnDef *node)
2134 WRITE_NODE_TYPE("COLUMNDEF");
2136 WRITE_STRING_FIELD(colname);
2137 WRITE_NODE_FIELD(typeName);
2138 WRITE_INT_FIELD(inhcount);
2139 WRITE_BOOL_FIELD(is_local);
2140 WRITE_BOOL_FIELD(is_not_null);
2141 WRITE_BOOL_FIELD(is_from_type);
2142 WRITE_CHAR_FIELD(storage);
2143 WRITE_NODE_FIELD(raw_default);
2144 WRITE_NODE_FIELD(cooked_default);
2145 WRITE_NODE_FIELD(collClause);
2146 WRITE_OID_FIELD(collOid);
2147 WRITE_NODE_FIELD(constraints);
2148 WRITE_NODE_FIELD(fdwoptions);
2152 _outTypeName(StringInfo str, const TypeName *node)
2154 WRITE_NODE_TYPE("TYPENAME");
2156 WRITE_NODE_FIELD(names);
2157 WRITE_OID_FIELD(typeOid);
2158 WRITE_BOOL_FIELD(setof);
2159 WRITE_BOOL_FIELD(pct_type);
2160 WRITE_NODE_FIELD(typmods);
2161 WRITE_INT_FIELD(typemod);
2162 WRITE_NODE_FIELD(arrayBounds);
2163 WRITE_LOCATION_FIELD(location);
2167 _outTypeCast(StringInfo str, const TypeCast *node)
2169 WRITE_NODE_TYPE("TYPECAST");
2171 WRITE_NODE_FIELD(arg);
2172 WRITE_NODE_FIELD(typeName);
2173 WRITE_LOCATION_FIELD(location);
2177 _outCollateClause(StringInfo str, const CollateClause *node)
2179 WRITE_NODE_TYPE("COLLATECLAUSE");
2181 WRITE_NODE_FIELD(arg);
2182 WRITE_NODE_FIELD(collname);
2183 WRITE_LOCATION_FIELD(location);
2187 _outIndexElem(StringInfo str, const IndexElem *node)
2189 WRITE_NODE_TYPE("INDEXELEM");
2191 WRITE_STRING_FIELD(name);
2192 WRITE_NODE_FIELD(expr);
2193 WRITE_STRING_FIELD(indexcolname);
2194 WRITE_NODE_FIELD(collation);
2195 WRITE_NODE_FIELD(opclass);
2196 WRITE_ENUM_FIELD(ordering, SortByDir);
2197 WRITE_ENUM_FIELD(nulls_ordering, SortByNulls);
2201 _outQuery(StringInfo str, const Query *node)
2203 WRITE_NODE_TYPE("QUERY");
2205 WRITE_ENUM_FIELD(commandType, CmdType);
2206 WRITE_ENUM_FIELD(querySource, QuerySource);
2207 /* we intentionally do not print the queryId field */
2208 WRITE_BOOL_FIELD(canSetTag);
2211 * Hack to work around missing outfuncs routines for a lot of the
2212 * utility-statement node types. (The only one we actually *need* for
2213 * rules support is NotifyStmt.) Someday we ought to support 'em all, but
2214 * for the meantime do this to avoid getting lots of warnings when running
2215 * with debug_print_parse on.
2217 if (node->utilityStmt)
2219 switch (nodeTag(node->utilityStmt))
2224 case T_DeclareCursorStmt:
2225 WRITE_NODE_FIELD(utilityStmt);
2228 appendStringInfo(str, " :utilityStmt ?");
2233 appendStringInfo(str, " :utilityStmt <>");
2235 WRITE_INT_FIELD(resultRelation);
2236 WRITE_BOOL_FIELD(hasAggs);
2237 WRITE_BOOL_FIELD(hasWindowFuncs);
2238 WRITE_BOOL_FIELD(hasSubLinks);
2239 WRITE_BOOL_FIELD(hasDistinctOn);
2240 WRITE_BOOL_FIELD(hasRecursive);
2241 WRITE_BOOL_FIELD(hasModifyingCTE);
2242 WRITE_BOOL_FIELD(hasForUpdate);
2243 WRITE_NODE_FIELD(cteList);
2244 WRITE_NODE_FIELD(rtable);
2245 WRITE_NODE_FIELD(jointree);
2246 WRITE_NODE_FIELD(targetList);
2247 WRITE_NODE_FIELD(returningList);
2248 WRITE_NODE_FIELD(groupClause);
2249 WRITE_NODE_FIELD(havingQual);
2250 WRITE_NODE_FIELD(windowClause);
2251 WRITE_NODE_FIELD(distinctClause);
2252 WRITE_NODE_FIELD(sortClause);
2253 WRITE_NODE_FIELD(limitOffset);
2254 WRITE_NODE_FIELD(limitCount);
2255 WRITE_NODE_FIELD(rowMarks);
2256 WRITE_NODE_FIELD(setOperations);
2257 WRITE_NODE_FIELD(constraintDeps);
2261 _outSortGroupClause(StringInfo str, const SortGroupClause *node)
2263 WRITE_NODE_TYPE("SORTGROUPCLAUSE");
2265 WRITE_UINT_FIELD(tleSortGroupRef);
2266 WRITE_OID_FIELD(eqop);
2267 WRITE_OID_FIELD(sortop);
2268 WRITE_BOOL_FIELD(nulls_first);
2269 WRITE_BOOL_FIELD(hashable);
2273 _outWindowClause(StringInfo str, const WindowClause *node)
2275 WRITE_NODE_TYPE("WINDOWCLAUSE");
2277 WRITE_STRING_FIELD(name);
2278 WRITE_STRING_FIELD(refname);
2279 WRITE_NODE_FIELD(partitionClause);
2280 WRITE_NODE_FIELD(orderClause);
2281 WRITE_INT_FIELD(frameOptions);
2282 WRITE_NODE_FIELD(startOffset);
2283 WRITE_NODE_FIELD(endOffset);
2284 WRITE_UINT_FIELD(winref);
2285 WRITE_BOOL_FIELD(copiedOrder);
2289 _outRowMarkClause(StringInfo str, const RowMarkClause *node)
2291 WRITE_NODE_TYPE("ROWMARKCLAUSE");
2293 WRITE_UINT_FIELD(rti);
2294 WRITE_ENUM_FIELD(strength, LockClauseStrength);
2295 WRITE_BOOL_FIELD(noWait);
2296 WRITE_BOOL_FIELD(pushedDown);
2300 _outWithClause(StringInfo str, const WithClause *node)
2302 WRITE_NODE_TYPE("WITHCLAUSE");
2304 WRITE_NODE_FIELD(ctes);
2305 WRITE_BOOL_FIELD(recursive);
2306 WRITE_LOCATION_FIELD(location);
2310 _outCommonTableExpr(StringInfo str, const CommonTableExpr *node)
2312 WRITE_NODE_TYPE("COMMONTABLEEXPR");
2314 WRITE_STRING_FIELD(ctename);
2315 WRITE_NODE_FIELD(aliascolnames);
2316 WRITE_NODE_FIELD(ctequery);
2317 WRITE_LOCATION_FIELD(location);
2318 WRITE_BOOL_FIELD(cterecursive);
2319 WRITE_INT_FIELD(cterefcount);
2320 WRITE_NODE_FIELD(ctecolnames);
2321 WRITE_NODE_FIELD(ctecoltypes);
2322 WRITE_NODE_FIELD(ctecoltypmods);
2323 WRITE_NODE_FIELD(ctecolcollations);
2327 _outSetOperationStmt(StringInfo str, const SetOperationStmt *node)
2329 WRITE_NODE_TYPE("SETOPERATIONSTMT");
2331 WRITE_ENUM_FIELD(op, SetOperation);
2332 WRITE_BOOL_FIELD(all);
2333 WRITE_NODE_FIELD(larg);
2334 WRITE_NODE_FIELD(rarg);
2335 WRITE_NODE_FIELD(colTypes);
2336 WRITE_NODE_FIELD(colTypmods);
2337 WRITE_NODE_FIELD(colCollations);
2338 WRITE_NODE_FIELD(groupClauses);
2342 _outRangeTblEntry(StringInfo str, const RangeTblEntry *node)
2344 WRITE_NODE_TYPE("RTE");
2346 /* put alias + eref first to make dump more legible */
2347 WRITE_NODE_FIELD(alias);
2348 WRITE_NODE_FIELD(eref);
2349 WRITE_ENUM_FIELD(rtekind, RTEKind);
2351 switch (node->rtekind)
2354 WRITE_OID_FIELD(relid);
2355 WRITE_CHAR_FIELD(relkind);
2358 WRITE_NODE_FIELD(subquery);
2359 WRITE_BOOL_FIELD(security_barrier);
2362 WRITE_ENUM_FIELD(jointype, JoinType);
2363 WRITE_NODE_FIELD(joinaliasvars);
2366 WRITE_NODE_FIELD(funcexpr);
2367 WRITE_NODE_FIELD(funccoltypes);
2368 WRITE_NODE_FIELD(funccoltypmods);
2369 WRITE_NODE_FIELD(funccolcollations);
2372 WRITE_NODE_FIELD(values_lists);
2373 WRITE_NODE_FIELD(values_collations);
2376 WRITE_STRING_FIELD(ctename);
2377 WRITE_UINT_FIELD(ctelevelsup);
2378 WRITE_BOOL_FIELD(self_reference);
2379 WRITE_NODE_FIELD(ctecoltypes);
2380 WRITE_NODE_FIELD(ctecoltypmods);
2381 WRITE_NODE_FIELD(ctecolcollations);
2384 elog(ERROR, "unrecognized RTE kind: %d", (int) node->rtekind);
2388 WRITE_BOOL_FIELD(lateral);
2389 WRITE_BOOL_FIELD(inh);
2390 WRITE_BOOL_FIELD(inFromCl);
2391 WRITE_UINT_FIELD(requiredPerms);
2392 WRITE_OID_FIELD(checkAsUser);
2393 WRITE_BITMAPSET_FIELD(selectedCols);
2394 WRITE_BITMAPSET_FIELD(modifiedCols);
2398 _outAExpr(StringInfo str, const A_Expr *node)
2400 WRITE_NODE_TYPE("AEXPR");
2405 appendStringInfo(str, " ");
2406 WRITE_NODE_FIELD(name);
2409 appendStringInfo(str, " AND");
2412 appendStringInfo(str, " OR");
2415 appendStringInfo(str, " NOT");
2418 appendStringInfo(str, " ");
2419 WRITE_NODE_FIELD(name);
2420 appendStringInfo(str, " ANY ");
2423 appendStringInfo(str, " ");
2424 WRITE_NODE_FIELD(name);
2425 appendStringInfo(str, " ALL ");
2427 case AEXPR_DISTINCT:
2428 appendStringInfo(str, " DISTINCT ");
2429 WRITE_NODE_FIELD(name);
2432 appendStringInfo(str, " NULLIF ");
2433 WRITE_NODE_FIELD(name);
2436 appendStringInfo(str, " OF ");
2437 WRITE_NODE_FIELD(name);
2440 appendStringInfo(str, " IN ");
2441 WRITE_NODE_FIELD(name);
2444 appendStringInfo(str, " ??");
2448 WRITE_NODE_FIELD(lexpr);
2449 WRITE_NODE_FIELD(rexpr);
2450 WRITE_LOCATION_FIELD(location);
2454 _outValue(StringInfo str, const Value *value)
2456 switch (value->type)
2459 appendStringInfo(str, "%ld", value->val.ival);
2464 * We assume the value is a valid numeric literal and so does not
2467 appendStringInfoString(str, value->val.str);
2470 appendStringInfoChar(str, '"');
2471 _outToken(str, value->val.str);
2472 appendStringInfoChar(str, '"');
2475 /* internal representation already has leading 'b' */
2476 appendStringInfoString(str, value->val.str);
2479 /* this is seen only within A_Const, not in transformed trees */
2480 appendStringInfoString(str, "NULL");
2483 elog(ERROR, "unrecognized node type: %d", (int) value->type);
2489 _outColumnRef(StringInfo str, const ColumnRef *node)
2491 WRITE_NODE_TYPE("COLUMNREF");
2493 WRITE_NODE_FIELD(fields);
2494 WRITE_LOCATION_FIELD(location);
2498 _outParamRef(StringInfo str, const ParamRef *node)
2500 WRITE_NODE_TYPE("PARAMREF");
2502 WRITE_INT_FIELD(number);
2503 WRITE_LOCATION_FIELD(location);
2507 _outAConst(StringInfo str, const A_Const *node)
2509 WRITE_NODE_TYPE("A_CONST");
2511 appendStringInfo(str, " :val ");
2512 _outValue(str, &(node->val));
2513 WRITE_LOCATION_FIELD(location);
2517 _outA_Star(StringInfo str, const A_Star *node)
2519 WRITE_NODE_TYPE("A_STAR");
2523 _outA_Indices(StringInfo str, const A_Indices *node)
2525 WRITE_NODE_TYPE("A_INDICES");
2527 WRITE_NODE_FIELD(lidx);
2528 WRITE_NODE_FIELD(uidx);
2532 _outA_Indirection(StringInfo str, const A_Indirection *node)
2534 WRITE_NODE_TYPE("A_INDIRECTION");
2536 WRITE_NODE_FIELD(arg);
2537 WRITE_NODE_FIELD(indirection);
2541 _outA_ArrayExpr(StringInfo str, const A_ArrayExpr *node)
2543 WRITE_NODE_TYPE("A_ARRAYEXPR");
2545 WRITE_NODE_FIELD(elements);
2546 WRITE_LOCATION_FIELD(location);
2550 _outResTarget(StringInfo str, const ResTarget *node)
2552 WRITE_NODE_TYPE("RESTARGET");
2554 WRITE_STRING_FIELD(name);
2555 WRITE_NODE_FIELD(indirection);
2556 WRITE_NODE_FIELD(val);
2557 WRITE_LOCATION_FIELD(location);
2561 _outSortBy(StringInfo str, const SortBy *node)
2563 WRITE_NODE_TYPE("SORTBY");
2565 WRITE_NODE_FIELD(node);
2566 WRITE_ENUM_FIELD(sortby_dir, SortByDir);
2567 WRITE_ENUM_FIELD(sortby_nulls, SortByNulls);
2568 WRITE_NODE_FIELD(useOp);
2569 WRITE_LOCATION_FIELD(location);
2573 _outWindowDef(StringInfo str, const WindowDef *node)
2575 WRITE_NODE_TYPE("WINDOWDEF");
2577 WRITE_STRING_FIELD(name);
2578 WRITE_STRING_FIELD(refname);
2579 WRITE_NODE_FIELD(partitionClause);
2580 WRITE_NODE_FIELD(orderClause);
2581 WRITE_INT_FIELD(frameOptions);
2582 WRITE_NODE_FIELD(startOffset);
2583 WRITE_NODE_FIELD(endOffset);
2584 WRITE_LOCATION_FIELD(location);
2588 _outRangeSubselect(StringInfo str, const RangeSubselect *node)
2590 WRITE_NODE_TYPE("RANGESUBSELECT");
2592 WRITE_BOOL_FIELD(lateral);
2593 WRITE_NODE_FIELD(subquery);
2594 WRITE_NODE_FIELD(alias);
2598 _outRangeFunction(StringInfo str, const RangeFunction *node)
2600 WRITE_NODE_TYPE("RANGEFUNCTION");
2602 WRITE_BOOL_FIELD(lateral);
2603 WRITE_NODE_FIELD(funccallnode);
2604 WRITE_NODE_FIELD(alias);
2605 WRITE_NODE_FIELD(coldeflist);
2609 _outConstraint(StringInfo str, const Constraint *node)
2611 WRITE_NODE_TYPE("CONSTRAINT");
2613 WRITE_STRING_FIELD(conname);
2614 WRITE_BOOL_FIELD(deferrable);
2615 WRITE_BOOL_FIELD(initdeferred);
2616 WRITE_LOCATION_FIELD(location);
2618 appendStringInfo(str, " :contype ");
2619 switch (node->contype)
2622 appendStringInfo(str, "NULL");
2625 case CONSTR_NOTNULL:
2626 appendStringInfo(str, "NOT_NULL");
2629 case CONSTR_DEFAULT:
2630 appendStringInfo(str, "DEFAULT");
2631 WRITE_NODE_FIELD(raw_expr);
2632 WRITE_STRING_FIELD(cooked_expr);
2636 appendStringInfo(str, "CHECK");
2637 WRITE_BOOL_FIELD(is_no_inherit);
2638 WRITE_NODE_FIELD(raw_expr);
2639 WRITE_STRING_FIELD(cooked_expr);
2642 case CONSTR_PRIMARY:
2643 appendStringInfo(str, "PRIMARY_KEY");
2644 WRITE_NODE_FIELD(keys);
2645 WRITE_NODE_FIELD(options);
2646 WRITE_STRING_FIELD(indexname);
2647 WRITE_STRING_FIELD(indexspace);
2648 /* access_method and where_clause not currently used */
2652 appendStringInfo(str, "UNIQUE");
2653 WRITE_NODE_FIELD(keys);
2654 WRITE_NODE_FIELD(options);
2655 WRITE_STRING_FIELD(indexname);
2656 WRITE_STRING_FIELD(indexspace);
2657 /* access_method and where_clause not currently used */
2660 case CONSTR_EXCLUSION:
2661 appendStringInfo(str, "EXCLUSION");
2662 WRITE_NODE_FIELD(exclusions);
2663 WRITE_NODE_FIELD(options);
2664 WRITE_STRING_FIELD(indexname);
2665 WRITE_STRING_FIELD(indexspace);
2666 WRITE_STRING_FIELD(access_method);
2667 WRITE_NODE_FIELD(where_clause);
2670 case CONSTR_FOREIGN:
2671 appendStringInfo(str, "FOREIGN_KEY");
2672 WRITE_NODE_FIELD(pktable);
2673 WRITE_NODE_FIELD(fk_attrs);
2674 WRITE_NODE_FIELD(pk_attrs);
2675 WRITE_CHAR_FIELD(fk_matchtype);
2676 WRITE_CHAR_FIELD(fk_upd_action);
2677 WRITE_CHAR_FIELD(fk_del_action);
2678 WRITE_NODE_FIELD(old_conpfeqop);
2679 WRITE_BOOL_FIELD(skip_validation);
2680 WRITE_BOOL_FIELD(initially_valid);
2683 case CONSTR_ATTR_DEFERRABLE:
2684 appendStringInfo(str, "ATTR_DEFERRABLE");
2687 case CONSTR_ATTR_NOT_DEFERRABLE:
2688 appendStringInfo(str, "ATTR_NOT_DEFERRABLE");
2691 case CONSTR_ATTR_DEFERRED:
2692 appendStringInfo(str, "ATTR_DEFERRED");
2695 case CONSTR_ATTR_IMMEDIATE:
2696 appendStringInfo(str, "ATTR_IMMEDIATE");
2700 appendStringInfo(str, "<unrecognized_constraint %d>",
2701 (int) node->contype);
2709 * converts a Node into ascii string and append it to 'str'
2712 _outNode(StringInfo str, const void *obj)
2715 appendStringInfo(str, "<>");
2716 else if (IsA(obj, List) ||IsA(obj, IntList) || IsA(obj, OidList))
2718 else if (IsA(obj, Integer) ||
2721 IsA(obj, BitString))
2723 /* nodeRead does not want to see { } around these! */
2724 _outValue(str, obj);
2728 appendStringInfoChar(str, '{');
2729 switch (nodeTag(obj))
2732 _outPlannedStmt(str, obj);
2738 _outResult(str, obj);
2741 _outModifyTable(str, obj);
2744 _outAppend(str, obj);
2747 _outMergeAppend(str, obj);
2749 case T_RecursiveUnion:
2750 _outRecursiveUnion(str, obj);
2753 _outBitmapAnd(str, obj);
2756 _outBitmapOr(str, obj);
2762 _outSeqScan(str, obj);
2765 _outIndexScan(str, obj);
2767 case T_IndexOnlyScan:
2768 _outIndexOnlyScan(str, obj);
2770 case T_BitmapIndexScan:
2771 _outBitmapIndexScan(str, obj);
2773 case T_BitmapHeapScan:
2774 _outBitmapHeapScan(str, obj);
2777 _outTidScan(str, obj);
2779 case T_SubqueryScan:
2780 _outSubqueryScan(str, obj);
2782 case T_FunctionScan:
2783 _outFunctionScan(str, obj);
2786 _outValuesScan(str, obj);
2789 _outCteScan(str, obj);
2791 case T_WorkTableScan:
2792 _outWorkTableScan(str, obj);
2795 _outForeignScan(str, obj);
2801 _outNestLoop(str, obj);
2804 _outMergeJoin(str, obj);
2807 _outHashJoin(str, obj);
2813 _outWindowAgg(str, obj);
2816 _outGroup(str, obj);
2819 _outMaterial(str, obj);
2825 _outUnique(str, obj);
2831 _outSetOp(str, obj);
2834 _outLockRows(str, obj);
2837 _outLimit(str, obj);
2839 case T_NestLoopParam:
2840 _outNestLoopParam(str, obj);
2843 _outPlanRowMark(str, obj);
2845 case T_PlanInvalItem:
2846 _outPlanInvalItem(str, obj);
2849 _outAlias(str, obj);
2852 _outRangeVar(str, obj);
2855 _outIntoClause(str, obj);
2861 _outConst(str, obj);
2864 _outParam(str, obj);
2867 _outAggref(str, obj);
2870 _outWindowFunc(str, obj);
2873 _outArrayRef(str, obj);
2876 _outFuncExpr(str, obj);
2878 case T_NamedArgExpr:
2879 _outNamedArgExpr(str, obj);
2882 _outOpExpr(str, obj);
2884 case T_DistinctExpr:
2885 _outDistinctExpr(str, obj);
2888 _outNullIfExpr(str, obj);
2890 case T_ScalarArrayOpExpr:
2891 _outScalarArrayOpExpr(str, obj);
2894 _outBoolExpr(str, obj);
2897 _outSubLink(str, obj);
2900 _outSubPlan(str, obj);
2902 case T_AlternativeSubPlan:
2903 _outAlternativeSubPlan(str, obj);
2906 _outFieldSelect(str, obj);
2909 _outFieldStore(str, obj);
2912 _outRelabelType(str, obj);
2915 _outCoerceViaIO(str, obj);
2917 case T_ArrayCoerceExpr:
2918 _outArrayCoerceExpr(str, obj);
2920 case T_ConvertRowtypeExpr:
2921 _outConvertRowtypeExpr(str, obj);
2924 _outCollateExpr(str, obj);
2927 _outCaseExpr(str, obj);
2930 _outCaseWhen(str, obj);
2932 case T_CaseTestExpr:
2933 _outCaseTestExpr(str, obj);
2936 _outArrayExpr(str, obj);
2939 _outRowExpr(str, obj);
2941 case T_RowCompareExpr:
2942 _outRowCompareExpr(str, obj);
2944 case T_CoalesceExpr:
2945 _outCoalesceExpr(str, obj);
2948 _outMinMaxExpr(str, obj);
2951 _outXmlExpr(str, obj);
2954 _outNullTest(str, obj);
2957 _outBooleanTest(str, obj);
2959 case T_CoerceToDomain:
2960 _outCoerceToDomain(str, obj);
2962 case T_CoerceToDomainValue:
2963 _outCoerceToDomainValue(str, obj);
2965 case T_SetToDefault:
2966 _outSetToDefault(str, obj);
2968 case T_CurrentOfExpr:
2969 _outCurrentOfExpr(str, obj);
2972 _outTargetEntry(str, obj);
2975 _outRangeTblRef(str, obj);
2978 _outJoinExpr(str, obj);
2981 _outFromExpr(str, obj);
2988 _outIndexPath(str, obj);
2990 case T_BitmapHeapPath:
2991 _outBitmapHeapPath(str, obj);
2993 case T_BitmapAndPath:
2994 _outBitmapAndPath(str, obj);
2996 case T_BitmapOrPath:
2997 _outBitmapOrPath(str, obj);
3000 _outTidPath(str, obj);
3003 _outForeignPath(str, obj);
3006 _outAppendPath(str, obj);
3008 case T_MergeAppendPath:
3009 _outMergeAppendPath(str, obj);
3012 _outResultPath(str, obj);
3014 case T_MaterialPath:
3015 _outMaterialPath(str, obj);
3018 _outUniquePath(str, obj);
3021 _outNestPath(str, obj);
3024 _outMergePath(str, obj);
3027 _outHashPath(str, obj);
3029 case T_PlannerGlobal:
3030 _outPlannerGlobal(str, obj);
3033 _outPlannerInfo(str, obj);
3036 _outRelOptInfo(str, obj);
3038 case T_IndexOptInfo:
3039 _outIndexOptInfo(str, obj);
3041 case T_EquivalenceClass:
3042 _outEquivalenceClass(str, obj);
3044 case T_EquivalenceMember:
3045 _outEquivalenceMember(str, obj);
3048 _outPathKey(str, obj);
3050 case T_ParamPathInfo:
3051 _outParamPathInfo(str, obj);
3053 case T_RestrictInfo:
3054 _outRestrictInfo(str, obj);
3056 case T_PlaceHolderVar:
3057 _outPlaceHolderVar(str, obj);
3059 case T_SpecialJoinInfo:
3060 _outSpecialJoinInfo(str, obj);
3062 case T_LateralJoinInfo:
3063 _outLateralJoinInfo(str, obj);
3065 case T_AppendRelInfo:
3066 _outAppendRelInfo(str, obj);
3068 case T_PlaceHolderInfo:
3069 _outPlaceHolderInfo(str, obj);
3071 case T_MinMaxAggInfo:
3072 _outMinMaxAggInfo(str, obj);
3074 case T_PlannerParamItem:
3075 _outPlannerParamItem(str, obj);
3079 _outCreateStmt(str, obj);
3081 case T_CreateForeignTableStmt:
3082 _outCreateForeignTableStmt(str, obj);
3085 _outIndexStmt(str, obj);
3088 _outNotifyStmt(str, obj);
3090 case T_DeclareCursorStmt:
3091 _outDeclareCursorStmt(str, obj);
3094 _outSelectStmt(str, obj);
3097 _outColumnDef(str, obj);
3100 _outTypeName(str, obj);
3103 _outTypeCast(str, obj);
3105 case T_CollateClause:
3106 _outCollateClause(str, obj);
3109 _outIndexElem(str, obj);
3112 _outQuery(str, obj);
3114 case T_SortGroupClause:
3115 _outSortGroupClause(str, obj);
3117 case T_WindowClause:
3118 _outWindowClause(str, obj);
3120 case T_RowMarkClause:
3121 _outRowMarkClause(str, obj);
3124 _outWithClause(str, obj);
3126 case T_CommonTableExpr:
3127 _outCommonTableExpr(str, obj);
3129 case T_SetOperationStmt:
3130 _outSetOperationStmt(str, obj);
3132 case T_RangeTblEntry:
3133 _outRangeTblEntry(str, obj);
3136 _outAExpr(str, obj);
3139 _outColumnRef(str, obj);
3142 _outParamRef(str, obj);
3145 _outAConst(str, obj);
3148 _outA_Star(str, obj);
3151 _outA_Indices(str, obj);
3153 case T_A_Indirection:
3154 _outA_Indirection(str, obj);
3157 _outA_ArrayExpr(str, obj);
3160 _outResTarget(str, obj);
3163 _outSortBy(str, obj);
3166 _outWindowDef(str, obj);
3168 case T_RangeSubselect:
3169 _outRangeSubselect(str, obj);
3171 case T_RangeFunction:
3172 _outRangeFunction(str, obj);
3175 _outConstraint(str, obj);
3178 _outFuncCall(str, obj);
3181 _outDefElem(str, obj);
3183 case T_TableLikeClause:
3184 _outTableLikeClause(str, obj);
3186 case T_LockingClause:
3187 _outLockingClause(str, obj);
3189 case T_XmlSerialize:
3190 _outXmlSerialize(str, obj);
3196 * This should be an ERROR, but it's too useful to be able to
3197 * dump structures that _outNode only understands part of.
3199 elog(WARNING, "could not dump unrecognized node type: %d",
3200 (int) nodeTag(obj));
3203 appendStringInfoChar(str, '}');
3209 * returns the ascii representation of the Node as a palloc'd string
3212 nodeToString(const void *obj)
3216 /* see stringinfo.h for an explanation of this maneuver */
3217 initStringInfo(&str);
3218 _outNode(&str, obj);