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

Generated by: LCOV version 1.14