LCOV - code coverage report
Current view: top level - src/backend/nodes - outfuncs.c (source / functions) Hit Total Coverage
Test: PostgreSQL 13devel Lines: 1375 2691 51.1 %
Date: 2019-09-19 23:07:04 Functions: 120 227 52.9 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.13