LCOV - code coverage report
Current view: top level - src/backend/nodes - copyfuncs.funcs.c (source / functions) Coverage Total Hit
Test: PostgreSQL 19devel Lines: 96.2 % 3466 3336
Test Date: 2026-03-11 12:14:45 Functions: 96.7 % 330 319
Legend: Lines:     hit not hit

            Line data    Source code
       1              : /*-------------------------------------------------------------------------
       2              :  *
       3              :  * copyfuncs.funcs.c
       4              :  *    Generated node infrastructure code
       5              :  *
       6              :  * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
       7              :  * Portions Copyright (c) 1994, Regents of the University of California
       8              :  *
       9              :  * NOTES
      10              :  *  ******************************
      11              :  *  *** DO NOT EDIT THIS FILE! ***
      12              :  *  ******************************
      13              :  *
      14              :  *  It has been GENERATED by src/backend/nodes/gen_node_support.pl
      15              :  *
      16              :  *-------------------------------------------------------------------------
      17              :  */
      18              : #include "access/amapi.h"
      19              : #include "access/cmptype.h"
      20              : #include "access/sdir.h"
      21              : #include "access/tableam.h"
      22              : #include "access/tsmapi.h"
      23              : #include "commands/event_trigger.h"
      24              : #include "commands/trigger.h"
      25              : #include "executor/tuptable.h"
      26              : #include "foreign/fdwapi.h"
      27              : #include "nodes/bitmapset.h"
      28              : #include "nodes/execnodes.h"
      29              : #include "nodes/extensible.h"
      30              : #include "nodes/lockoptions.h"
      31              : #include "nodes/miscnodes.h"
      32              : #include "nodes/nodes.h"
      33              : #include "nodes/parsenodes.h"
      34              : #include "nodes/pathnodes.h"
      35              : #include "nodes/plannodes.h"
      36              : #include "nodes/primnodes.h"
      37              : #include "nodes/replnodes.h"
      38              : #include "nodes/supportnodes.h"
      39              : #include "nodes/value.h"
      40              : #include "utils/rel.h"
      41              : 
      42              : static Alias *
      43      1938451 : _copyAlias(const Alias *from)
      44              : {
      45      1938451 :     Alias *newnode = makeNode(Alias);
      46              : 
      47      1938451 :     COPY_STRING_FIELD(aliasname);
      48      1938451 :     COPY_NODE_FIELD(colnames);
      49              : 
      50      1938451 :     return newnode;
      51              : }
      52              : 
      53              : static RangeVar *
      54       509984 : _copyRangeVar(const RangeVar *from)
      55              : {
      56       509984 :     RangeVar *newnode = makeNode(RangeVar);
      57              : 
      58       509984 :     COPY_STRING_FIELD(catalogname);
      59       509984 :     COPY_STRING_FIELD(schemaname);
      60       509984 :     COPY_STRING_FIELD(relname);
      61       509984 :     COPY_SCALAR_FIELD(inh);
      62       509984 :     COPY_SCALAR_FIELD(relpersistence);
      63       509984 :     COPY_NODE_FIELD(alias);
      64       509984 :     COPY_LOCATION_FIELD(location);
      65              : 
      66       509984 :     return newnode;
      67              : }
      68              : 
      69              : static TableFunc *
      70          680 : _copyTableFunc(const TableFunc *from)
      71              : {
      72          680 :     TableFunc *newnode = makeNode(TableFunc);
      73              : 
      74          680 :     COPY_SCALAR_FIELD(functype);
      75          680 :     COPY_NODE_FIELD(ns_uris);
      76          680 :     COPY_NODE_FIELD(ns_names);
      77          680 :     COPY_NODE_FIELD(docexpr);
      78          680 :     COPY_NODE_FIELD(rowexpr);
      79          680 :     COPY_NODE_FIELD(colnames);
      80          680 :     COPY_NODE_FIELD(coltypes);
      81          680 :     COPY_NODE_FIELD(coltypmods);
      82          680 :     COPY_NODE_FIELD(colcollations);
      83          680 :     COPY_NODE_FIELD(colexprs);
      84          680 :     COPY_NODE_FIELD(coldefexprs);
      85          680 :     COPY_NODE_FIELD(colvalexprs);
      86          680 :     COPY_NODE_FIELD(passingvalexprs);
      87          680 :     COPY_BITMAPSET_FIELD(notnulls);
      88          680 :     COPY_NODE_FIELD(plan);
      89          680 :     COPY_SCALAR_FIELD(ordinalitycol);
      90          680 :     COPY_LOCATION_FIELD(location);
      91              : 
      92          680 :     return newnode;
      93              : }
      94              : 
      95              : static IntoClause *
      96         2196 : _copyIntoClause(const IntoClause *from)
      97              : {
      98         2196 :     IntoClause *newnode = makeNode(IntoClause);
      99              : 
     100         2196 :     COPY_NODE_FIELD(rel);
     101         2196 :     COPY_NODE_FIELD(colNames);
     102         2196 :     COPY_STRING_FIELD(accessMethod);
     103         2196 :     COPY_NODE_FIELD(options);
     104         2196 :     COPY_SCALAR_FIELD(onCommit);
     105         2196 :     COPY_STRING_FIELD(tableSpaceName);
     106         2196 :     COPY_NODE_FIELD(viewQuery);
     107         2196 :     COPY_SCALAR_FIELD(skipData);
     108              : 
     109         2196 :     return newnode;
     110              : }
     111              : 
     112              : static Var *
     113     11687716 : _copyVar(const Var *from)
     114              : {
     115     11687716 :     Var *newnode = makeNode(Var);
     116              : 
     117     11687716 :     COPY_SCALAR_FIELD(varno);
     118     11687716 :     COPY_SCALAR_FIELD(varattno);
     119     11687716 :     COPY_SCALAR_FIELD(vartype);
     120     11687716 :     COPY_SCALAR_FIELD(vartypmod);
     121     11687716 :     COPY_SCALAR_FIELD(varcollid);
     122     11687716 :     COPY_BITMAPSET_FIELD(varnullingrels);
     123     11687716 :     COPY_SCALAR_FIELD(varlevelsup);
     124     11687716 :     COPY_SCALAR_FIELD(varreturningtype);
     125     11687716 :     COPY_SCALAR_FIELD(varnosyn);
     126     11687716 :     COPY_SCALAR_FIELD(varattnosyn);
     127     11687716 :     COPY_LOCATION_FIELD(location);
     128              : 
     129     11687716 :     return newnode;
     130              : }
     131              : 
     132              : static Param *
     133       405855 : _copyParam(const Param *from)
     134              : {
     135       405855 :     Param *newnode = makeNode(Param);
     136              : 
     137       405855 :     COPY_SCALAR_FIELD(paramkind);
     138       405855 :     COPY_SCALAR_FIELD(paramid);
     139       405855 :     COPY_SCALAR_FIELD(paramtype);
     140       405855 :     COPY_SCALAR_FIELD(paramtypmod);
     141       405855 :     COPY_SCALAR_FIELD(paramcollid);
     142       405855 :     COPY_LOCATION_FIELD(location);
     143              : 
     144       405855 :     return newnode;
     145              : }
     146              : 
     147              : static Aggref *
     148       120154 : _copyAggref(const Aggref *from)
     149              : {
     150       120154 :     Aggref *newnode = makeNode(Aggref);
     151              : 
     152       120154 :     COPY_SCALAR_FIELD(aggfnoid);
     153       120154 :     COPY_SCALAR_FIELD(aggtype);
     154       120154 :     COPY_SCALAR_FIELD(aggcollid);
     155       120154 :     COPY_SCALAR_FIELD(inputcollid);
     156       120154 :     COPY_SCALAR_FIELD(aggtranstype);
     157       120154 :     COPY_NODE_FIELD(aggargtypes);
     158       120154 :     COPY_NODE_FIELD(aggdirectargs);
     159       120154 :     COPY_NODE_FIELD(args);
     160       120154 :     COPY_NODE_FIELD(aggorder);
     161       120154 :     COPY_NODE_FIELD(aggdistinct);
     162       120154 :     COPY_NODE_FIELD(aggfilter);
     163       120154 :     COPY_SCALAR_FIELD(aggstar);
     164       120154 :     COPY_SCALAR_FIELD(aggvariadic);
     165       120154 :     COPY_SCALAR_FIELD(aggkind);
     166       120154 :     COPY_SCALAR_FIELD(aggpresorted);
     167       120154 :     COPY_SCALAR_FIELD(agglevelsup);
     168       120154 :     COPY_SCALAR_FIELD(aggsplit);
     169       120154 :     COPY_SCALAR_FIELD(aggno);
     170       120154 :     COPY_SCALAR_FIELD(aggtransno);
     171       120154 :     COPY_LOCATION_FIELD(location);
     172              : 
     173       120154 :     return newnode;
     174              : }
     175              : 
     176              : static GroupingFunc *
     177          714 : _copyGroupingFunc(const GroupingFunc *from)
     178              : {
     179          714 :     GroupingFunc *newnode = makeNode(GroupingFunc);
     180              : 
     181          714 :     COPY_NODE_FIELD(args);
     182          714 :     COPY_NODE_FIELD(refs);
     183          714 :     COPY_NODE_FIELD(cols);
     184          714 :     COPY_SCALAR_FIELD(agglevelsup);
     185          714 :     COPY_LOCATION_FIELD(location);
     186              : 
     187          714 :     return newnode;
     188              : }
     189              : 
     190              : static WindowFunc *
     191         4585 : _copyWindowFunc(const WindowFunc *from)
     192              : {
     193         4585 :     WindowFunc *newnode = makeNode(WindowFunc);
     194              : 
     195         4585 :     COPY_SCALAR_FIELD(winfnoid);
     196         4585 :     COPY_SCALAR_FIELD(wintype);
     197         4585 :     COPY_SCALAR_FIELD(wincollid);
     198         4585 :     COPY_SCALAR_FIELD(inputcollid);
     199         4585 :     COPY_NODE_FIELD(args);
     200         4585 :     COPY_NODE_FIELD(aggfilter);
     201         4585 :     COPY_NODE_FIELD(runCondition);
     202         4585 :     COPY_SCALAR_FIELD(winref);
     203         4585 :     COPY_SCALAR_FIELD(winstar);
     204         4585 :     COPY_SCALAR_FIELD(winagg);
     205         4585 :     COPY_SCALAR_FIELD(ignore_nulls);
     206         4585 :     COPY_LOCATION_FIELD(location);
     207              : 
     208         4585 :     return newnode;
     209              : }
     210              : 
     211              : static WindowFuncRunCondition *
     212          270 : _copyWindowFuncRunCondition(const WindowFuncRunCondition *from)
     213              : {
     214          270 :     WindowFuncRunCondition *newnode = makeNode(WindowFuncRunCondition);
     215              : 
     216          270 :     COPY_SCALAR_FIELD(opno);
     217          270 :     COPY_SCALAR_FIELD(inputcollid);
     218          270 :     COPY_SCALAR_FIELD(wfunc_left);
     219          270 :     COPY_NODE_FIELD(arg);
     220              : 
     221          270 :     return newnode;
     222              : }
     223              : 
     224              : static MergeSupportFunc *
     225         1208 : _copyMergeSupportFunc(const MergeSupportFunc *from)
     226              : {
     227         1208 :     MergeSupportFunc *newnode = makeNode(MergeSupportFunc);
     228              : 
     229         1208 :     COPY_SCALAR_FIELD(msftype);
     230         1208 :     COPY_SCALAR_FIELD(msfcollid);
     231         1208 :     COPY_LOCATION_FIELD(location);
     232              : 
     233         1208 :     return newnode;
     234              : }
     235              : 
     236              : static SubscriptingRef *
     237        40863 : _copySubscriptingRef(const SubscriptingRef *from)
     238              : {
     239        40863 :     SubscriptingRef *newnode = makeNode(SubscriptingRef);
     240              : 
     241        40863 :     COPY_SCALAR_FIELD(refcontainertype);
     242        40863 :     COPY_SCALAR_FIELD(refelemtype);
     243        40863 :     COPY_SCALAR_FIELD(refrestype);
     244        40863 :     COPY_SCALAR_FIELD(reftypmod);
     245        40863 :     COPY_SCALAR_FIELD(refcollid);
     246        40863 :     COPY_NODE_FIELD(refupperindexpr);
     247        40863 :     COPY_NODE_FIELD(reflowerindexpr);
     248        40863 :     COPY_NODE_FIELD(refexpr);
     249        40863 :     COPY_NODE_FIELD(refassgnexpr);
     250              : 
     251        40863 :     return newnode;
     252              : }
     253              : 
     254              : static FuncExpr *
     255       568568 : _copyFuncExpr(const FuncExpr *from)
     256              : {
     257       568568 :     FuncExpr *newnode = makeNode(FuncExpr);
     258              : 
     259       568568 :     COPY_SCALAR_FIELD(funcid);
     260       568568 :     COPY_SCALAR_FIELD(funcresulttype);
     261       568568 :     COPY_SCALAR_FIELD(funcretset);
     262       568568 :     COPY_SCALAR_FIELD(funcvariadic);
     263       568568 :     COPY_SCALAR_FIELD(funcformat);
     264       568568 :     COPY_SCALAR_FIELD(funccollid);
     265       568568 :     COPY_SCALAR_FIELD(inputcollid);
     266       568568 :     COPY_NODE_FIELD(args);
     267       568568 :     COPY_LOCATION_FIELD(location);
     268              : 
     269       568568 :     return newnode;
     270              : }
     271              : 
     272              : static NamedArgExpr *
     273        47765 : _copyNamedArgExpr(const NamedArgExpr *from)
     274              : {
     275        47765 :     NamedArgExpr *newnode = makeNode(NamedArgExpr);
     276              : 
     277        47765 :     COPY_NODE_FIELD(arg);
     278        47765 :     COPY_STRING_FIELD(name);
     279        47765 :     COPY_SCALAR_FIELD(argnumber);
     280        47765 :     COPY_LOCATION_FIELD(location);
     281              : 
     282        47765 :     return newnode;
     283              : }
     284              : 
     285              : static OpExpr *
     286      1199307 : _copyOpExpr(const OpExpr *from)
     287              : {
     288      1199307 :     OpExpr *newnode = makeNode(OpExpr);
     289              : 
     290      1199307 :     COPY_SCALAR_FIELD(opno);
     291      1199307 :     COPY_SCALAR_FIELD(opfuncid);
     292      1199307 :     COPY_SCALAR_FIELD(opresulttype);
     293      1199307 :     COPY_SCALAR_FIELD(opretset);
     294      1199307 :     COPY_SCALAR_FIELD(opcollid);
     295      1199307 :     COPY_SCALAR_FIELD(inputcollid);
     296      1199307 :     COPY_NODE_FIELD(args);
     297      1199307 :     COPY_LOCATION_FIELD(location);
     298              : 
     299      1199307 :     return newnode;
     300              : }
     301              : 
     302              : static DistinctExpr *
     303         1608 : _copyDistinctExpr(const DistinctExpr *from)
     304              : {
     305         1608 :     DistinctExpr *newnode = makeNode(DistinctExpr);
     306              : 
     307         1608 :     COPY_SCALAR_FIELD(opno);
     308         1608 :     COPY_SCALAR_FIELD(opfuncid);
     309         1608 :     COPY_SCALAR_FIELD(opresulttype);
     310         1608 :     COPY_SCALAR_FIELD(opretset);
     311         1608 :     COPY_SCALAR_FIELD(opcollid);
     312         1608 :     COPY_SCALAR_FIELD(inputcollid);
     313         1608 :     COPY_NODE_FIELD(args);
     314         1608 :     COPY_LOCATION_FIELD(location);
     315              : 
     316         1608 :     return newnode;
     317              : }
     318              : 
     319              : static NullIfExpr *
     320          946 : _copyNullIfExpr(const NullIfExpr *from)
     321              : {
     322          946 :     NullIfExpr *newnode = makeNode(NullIfExpr);
     323              : 
     324          946 :     COPY_SCALAR_FIELD(opno);
     325          946 :     COPY_SCALAR_FIELD(opfuncid);
     326          946 :     COPY_SCALAR_FIELD(opresulttype);
     327          946 :     COPY_SCALAR_FIELD(opretset);
     328          946 :     COPY_SCALAR_FIELD(opcollid);
     329          946 :     COPY_SCALAR_FIELD(inputcollid);
     330          946 :     COPY_NODE_FIELD(args);
     331          946 :     COPY_LOCATION_FIELD(location);
     332              : 
     333          946 :     return newnode;
     334              : }
     335              : 
     336              : static ScalarArrayOpExpr *
     337        51384 : _copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
     338              : {
     339        51384 :     ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
     340              : 
     341        51384 :     COPY_SCALAR_FIELD(opno);
     342        51384 :     COPY_SCALAR_FIELD(opfuncid);
     343        51384 :     COPY_SCALAR_FIELD(hashfuncid);
     344        51384 :     COPY_SCALAR_FIELD(negfuncid);
     345        51384 :     COPY_SCALAR_FIELD(useOr);
     346        51384 :     COPY_SCALAR_FIELD(inputcollid);
     347        51384 :     COPY_NODE_FIELD(args);
     348        51384 :     COPY_LOCATION_FIELD(location);
     349              : 
     350        51384 :     return newnode;
     351              : }
     352              : 
     353              : static BoolExpr *
     354       305696 : _copyBoolExpr(const BoolExpr *from)
     355              : {
     356       305696 :     BoolExpr *newnode = makeNode(BoolExpr);
     357              : 
     358       305696 :     COPY_SCALAR_FIELD(boolop);
     359       305696 :     COPY_NODE_FIELD(args);
     360       305696 :     COPY_LOCATION_FIELD(location);
     361              : 
     362       305696 :     return newnode;
     363              : }
     364              : 
     365              : static SubLink *
     366        68053 : _copySubLink(const SubLink *from)
     367              : {
     368        68053 :     SubLink *newnode = makeNode(SubLink);
     369              : 
     370        68053 :     COPY_SCALAR_FIELD(subLinkType);
     371        68053 :     COPY_SCALAR_FIELD(subLinkId);
     372        68053 :     COPY_NODE_FIELD(testexpr);
     373        68053 :     COPY_NODE_FIELD(operName);
     374        68053 :     COPY_NODE_FIELD(subselect);
     375        68053 :     COPY_LOCATION_FIELD(location);
     376              : 
     377        68053 :     return newnode;
     378              : }
     379              : 
     380              : static SubPlan *
     381        27333 : _copySubPlan(const SubPlan *from)
     382              : {
     383        27333 :     SubPlan *newnode = makeNode(SubPlan);
     384              : 
     385        27333 :     COPY_SCALAR_FIELD(subLinkType);
     386        27333 :     COPY_NODE_FIELD(testexpr);
     387        27333 :     COPY_NODE_FIELD(paramIds);
     388        27333 :     COPY_SCALAR_FIELD(plan_id);
     389        27333 :     COPY_STRING_FIELD(plan_name);
     390        27333 :     COPY_SCALAR_FIELD(firstColType);
     391        27333 :     COPY_SCALAR_FIELD(firstColTypmod);
     392        27333 :     COPY_SCALAR_FIELD(firstColCollation);
     393        27333 :     COPY_SCALAR_FIELD(isInitPlan);
     394        27333 :     COPY_SCALAR_FIELD(useHashTable);
     395        27333 :     COPY_SCALAR_FIELD(unknownEqFalse);
     396        27333 :     COPY_SCALAR_FIELD(parallel_safe);
     397        27333 :     COPY_NODE_FIELD(setParam);
     398        27333 :     COPY_NODE_FIELD(parParam);
     399        27333 :     COPY_NODE_FIELD(args);
     400        27333 :     COPY_SCALAR_FIELD(startup_cost);
     401        27333 :     COPY_SCALAR_FIELD(per_call_cost);
     402              : 
     403        27333 :     return newnode;
     404              : }
     405              : 
     406              : static AlternativeSubPlan *
     407            0 : _copyAlternativeSubPlan(const AlternativeSubPlan *from)
     408              : {
     409            0 :     AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
     410              : 
     411            0 :     COPY_NODE_FIELD(subplans);
     412              : 
     413            0 :     return newnode;
     414              : }
     415              : 
     416              : static FieldSelect *
     417       125624 : _copyFieldSelect(const FieldSelect *from)
     418              : {
     419       125624 :     FieldSelect *newnode = makeNode(FieldSelect);
     420              : 
     421       125624 :     COPY_NODE_FIELD(arg);
     422       125624 :     COPY_SCALAR_FIELD(fieldnum);
     423       125624 :     COPY_SCALAR_FIELD(resulttype);
     424       125624 :     COPY_SCALAR_FIELD(resulttypmod);
     425       125624 :     COPY_SCALAR_FIELD(resultcollid);
     426              : 
     427       125624 :     return newnode;
     428              : }
     429              : 
     430              : static FieldStore *
     431          400 : _copyFieldStore(const FieldStore *from)
     432              : {
     433          400 :     FieldStore *newnode = makeNode(FieldStore);
     434              : 
     435          400 :     COPY_NODE_FIELD(arg);
     436          400 :     COPY_NODE_FIELD(newvals);
     437          400 :     COPY_NODE_FIELD(fieldnums);
     438          400 :     COPY_SCALAR_FIELD(resulttype);
     439              : 
     440          400 :     return newnode;
     441              : }
     442              : 
     443              : static RelabelType *
     444       196460 : _copyRelabelType(const RelabelType *from)
     445              : {
     446       196460 :     RelabelType *newnode = makeNode(RelabelType);
     447              : 
     448       196460 :     COPY_NODE_FIELD(arg);
     449       196460 :     COPY_SCALAR_FIELD(resulttype);
     450       196460 :     COPY_SCALAR_FIELD(resulttypmod);
     451       196460 :     COPY_SCALAR_FIELD(resultcollid);
     452       196460 :     COPY_SCALAR_FIELD(relabelformat);
     453       196460 :     COPY_LOCATION_FIELD(location);
     454              : 
     455       196460 :     return newnode;
     456              : }
     457              : 
     458              : static CoerceViaIO *
     459        49098 : _copyCoerceViaIO(const CoerceViaIO *from)
     460              : {
     461        49098 :     CoerceViaIO *newnode = makeNode(CoerceViaIO);
     462              : 
     463        49098 :     COPY_NODE_FIELD(arg);
     464        49098 :     COPY_SCALAR_FIELD(resulttype);
     465        49098 :     COPY_SCALAR_FIELD(resultcollid);
     466        49098 :     COPY_SCALAR_FIELD(coerceformat);
     467        49098 :     COPY_LOCATION_FIELD(location);
     468              : 
     469        49098 :     return newnode;
     470              : }
     471              : 
     472              : static ArrayCoerceExpr *
     473         7830 : _copyArrayCoerceExpr(const ArrayCoerceExpr *from)
     474              : {
     475         7830 :     ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
     476              : 
     477         7830 :     COPY_NODE_FIELD(arg);
     478         7830 :     COPY_NODE_FIELD(elemexpr);
     479         7830 :     COPY_SCALAR_FIELD(resulttype);
     480         7830 :     COPY_SCALAR_FIELD(resulttypmod);
     481         7830 :     COPY_SCALAR_FIELD(resultcollid);
     482         7830 :     COPY_SCALAR_FIELD(coerceformat);
     483         7830 :     COPY_LOCATION_FIELD(location);
     484              : 
     485         7830 :     return newnode;
     486              : }
     487              : 
     488              : static ConvertRowtypeExpr *
     489          518 : _copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
     490              : {
     491          518 :     ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
     492              : 
     493          518 :     COPY_NODE_FIELD(arg);
     494          518 :     COPY_SCALAR_FIELD(resulttype);
     495          518 :     COPY_SCALAR_FIELD(convertformat);
     496          518 :     COPY_LOCATION_FIELD(location);
     497              : 
     498          518 :     return newnode;
     499              : }
     500              : 
     501              : static CollateExpr *
     502         5077 : _copyCollateExpr(const CollateExpr *from)
     503              : {
     504         5077 :     CollateExpr *newnode = makeNode(CollateExpr);
     505              : 
     506         5077 :     COPY_NODE_FIELD(arg);
     507         5077 :     COPY_SCALAR_FIELD(collOid);
     508         5077 :     COPY_LOCATION_FIELD(location);
     509              : 
     510         5077 :     return newnode;
     511              : }
     512              : 
     513              : static CaseExpr *
     514       100630 : _copyCaseExpr(const CaseExpr *from)
     515              : {
     516       100630 :     CaseExpr *newnode = makeNode(CaseExpr);
     517              : 
     518       100630 :     COPY_SCALAR_FIELD(casetype);
     519       100630 :     COPY_SCALAR_FIELD(casecollid);
     520       100630 :     COPY_NODE_FIELD(arg);
     521       100630 :     COPY_NODE_FIELD(args);
     522       100630 :     COPY_NODE_FIELD(defresult);
     523       100630 :     COPY_LOCATION_FIELD(location);
     524              : 
     525       100630 :     return newnode;
     526              : }
     527              : 
     528              : static CaseWhen *
     529       235369 : _copyCaseWhen(const CaseWhen *from)
     530              : {
     531       235369 :     CaseWhen *newnode = makeNode(CaseWhen);
     532              : 
     533       235369 :     COPY_NODE_FIELD(expr);
     534       235369 :     COPY_NODE_FIELD(result);
     535       235369 :     COPY_LOCATION_FIELD(location);
     536              : 
     537       235369 :     return newnode;
     538              : }
     539              : 
     540              : static CaseTestExpr *
     541        69181 : _copyCaseTestExpr(const CaseTestExpr *from)
     542              : {
     543        69181 :     CaseTestExpr *newnode = makeNode(CaseTestExpr);
     544              : 
     545        69181 :     COPY_SCALAR_FIELD(typeId);
     546        69181 :     COPY_SCALAR_FIELD(typeMod);
     547        69181 :     COPY_SCALAR_FIELD(collation);
     548              : 
     549        69181 :     return newnode;
     550              : }
     551              : 
     552              : static ArrayExpr *
     553        27953 : _copyArrayExpr(const ArrayExpr *from)
     554              : {
     555        27953 :     ArrayExpr *newnode = makeNode(ArrayExpr);
     556              : 
     557        27953 :     COPY_SCALAR_FIELD(array_typeid);
     558        27953 :     COPY_SCALAR_FIELD(array_collid);
     559        27953 :     COPY_SCALAR_FIELD(element_typeid);
     560        27953 :     COPY_NODE_FIELD(elements);
     561        27953 :     COPY_SCALAR_FIELD(multidims);
     562        27953 :     COPY_LOCATION_FIELD(list_start);
     563        27953 :     COPY_LOCATION_FIELD(list_end);
     564        27953 :     COPY_LOCATION_FIELD(location);
     565              : 
     566        27953 :     return newnode;
     567              : }
     568              : 
     569              : static RowExpr *
     570         9272 : _copyRowExpr(const RowExpr *from)
     571              : {
     572         9272 :     RowExpr *newnode = makeNode(RowExpr);
     573              : 
     574         9272 :     COPY_NODE_FIELD(args);
     575         9272 :     COPY_SCALAR_FIELD(row_typeid);
     576         9272 :     COPY_SCALAR_FIELD(row_format);
     577         9272 :     COPY_NODE_FIELD(colnames);
     578         9272 :     COPY_LOCATION_FIELD(location);
     579              : 
     580         9272 :     return newnode;
     581              : }
     582              : 
     583              : static RowCompareExpr *
     584          354 : _copyRowCompareExpr(const RowCompareExpr *from)
     585              : {
     586          354 :     RowCompareExpr *newnode = makeNode(RowCompareExpr);
     587              : 
     588          354 :     COPY_SCALAR_FIELD(cmptype);
     589          354 :     COPY_NODE_FIELD(opnos);
     590          354 :     COPY_NODE_FIELD(opfamilies);
     591          354 :     COPY_NODE_FIELD(inputcollids);
     592          354 :     COPY_NODE_FIELD(largs);
     593          354 :     COPY_NODE_FIELD(rargs);
     594              : 
     595          354 :     return newnode;
     596              : }
     597              : 
     598              : static CoalesceExpr *
     599        11492 : _copyCoalesceExpr(const CoalesceExpr *from)
     600              : {
     601        11492 :     CoalesceExpr *newnode = makeNode(CoalesceExpr);
     602              : 
     603        11492 :     COPY_SCALAR_FIELD(coalescetype);
     604        11492 :     COPY_SCALAR_FIELD(coalescecollid);
     605        11492 :     COPY_NODE_FIELD(args);
     606        11492 :     COPY_LOCATION_FIELD(location);
     607              : 
     608        11492 :     return newnode;
     609              : }
     610              : 
     611              : static MinMaxExpr *
     612          924 : _copyMinMaxExpr(const MinMaxExpr *from)
     613              : {
     614          924 :     MinMaxExpr *newnode = makeNode(MinMaxExpr);
     615              : 
     616          924 :     COPY_SCALAR_FIELD(minmaxtype);
     617          924 :     COPY_SCALAR_FIELD(minmaxcollid);
     618          924 :     COPY_SCALAR_FIELD(inputcollid);
     619          924 :     COPY_SCALAR_FIELD(op);
     620          924 :     COPY_NODE_FIELD(args);
     621          924 :     COPY_LOCATION_FIELD(location);
     622              : 
     623          924 :     return newnode;
     624              : }
     625              : 
     626              : static SQLValueFunction *
     627        15970 : _copySQLValueFunction(const SQLValueFunction *from)
     628              : {
     629        15970 :     SQLValueFunction *newnode = makeNode(SQLValueFunction);
     630              : 
     631        15970 :     COPY_SCALAR_FIELD(op);
     632        15970 :     COPY_SCALAR_FIELD(type);
     633        15970 :     COPY_SCALAR_FIELD(typmod);
     634        15970 :     COPY_LOCATION_FIELD(location);
     635              : 
     636        15970 :     return newnode;
     637              : }
     638              : 
     639              : static XmlExpr *
     640         1139 : _copyXmlExpr(const XmlExpr *from)
     641              : {
     642         1139 :     XmlExpr *newnode = makeNode(XmlExpr);
     643              : 
     644         1139 :     COPY_SCALAR_FIELD(op);
     645         1139 :     COPY_STRING_FIELD(name);
     646         1139 :     COPY_NODE_FIELD(named_args);
     647         1139 :     COPY_NODE_FIELD(arg_names);
     648         1139 :     COPY_NODE_FIELD(args);
     649         1139 :     COPY_SCALAR_FIELD(xmloption);
     650         1139 :     COPY_SCALAR_FIELD(indent);
     651         1139 :     COPY_SCALAR_FIELD(type);
     652         1139 :     COPY_SCALAR_FIELD(typmod);
     653         1139 :     COPY_LOCATION_FIELD(location);
     654              : 
     655         1139 :     return newnode;
     656              : }
     657              : 
     658              : static JsonFormat *
     659        14550 : _copyJsonFormat(const JsonFormat *from)
     660              : {
     661        14550 :     JsonFormat *newnode = makeNode(JsonFormat);
     662              : 
     663        14550 :     COPY_SCALAR_FIELD(format_type);
     664        14550 :     COPY_SCALAR_FIELD(encoding);
     665        14550 :     COPY_LOCATION_FIELD(location);
     666              : 
     667        14550 :     return newnode;
     668              : }
     669              : 
     670              : static JsonReturning *
     671         6109 : _copyJsonReturning(const JsonReturning *from)
     672              : {
     673         6109 :     JsonReturning *newnode = makeNode(JsonReturning);
     674              : 
     675         6109 :     COPY_NODE_FIELD(format);
     676         6109 :     COPY_SCALAR_FIELD(typid);
     677         6109 :     COPY_SCALAR_FIELD(typmod);
     678              : 
     679         6109 :     return newnode;
     680              : }
     681              : 
     682              : static JsonValueExpr *
     683         3453 : _copyJsonValueExpr(const JsonValueExpr *from)
     684              : {
     685         3453 :     JsonValueExpr *newnode = makeNode(JsonValueExpr);
     686              : 
     687         3453 :     COPY_NODE_FIELD(raw_expr);
     688         3453 :     COPY_NODE_FIELD(formatted_expr);
     689         3453 :     COPY_NODE_FIELD(format);
     690              : 
     691         3453 :     return newnode;
     692              : }
     693              : 
     694              : static JsonConstructorExpr *
     695         1432 : _copyJsonConstructorExpr(const JsonConstructorExpr *from)
     696              : {
     697         1432 :     JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
     698              : 
     699         1432 :     COPY_SCALAR_FIELD(type);
     700         1432 :     COPY_NODE_FIELD(args);
     701         1432 :     COPY_NODE_FIELD(func);
     702         1432 :     COPY_NODE_FIELD(coercion);
     703         1432 :     COPY_NODE_FIELD(returning);
     704         1432 :     COPY_SCALAR_FIELD(absent_on_null);
     705         1432 :     COPY_SCALAR_FIELD(unique);
     706         1432 :     COPY_LOCATION_FIELD(location);
     707              : 
     708         1432 :     return newnode;
     709              : }
     710              : 
     711              : static JsonIsPredicate *
     712          513 : _copyJsonIsPredicate(const JsonIsPredicate *from)
     713              : {
     714          513 :     JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
     715              : 
     716          513 :     COPY_NODE_FIELD(expr);
     717          513 :     COPY_NODE_FIELD(format);
     718          513 :     COPY_SCALAR_FIELD(item_type);
     719          513 :     COPY_SCALAR_FIELD(unique_keys);
     720          513 :     COPY_LOCATION_FIELD(location);
     721              : 
     722          513 :     return newnode;
     723              : }
     724              : 
     725              : static JsonBehavior *
     726         5283 : _copyJsonBehavior(const JsonBehavior *from)
     727              : {
     728         5283 :     JsonBehavior *newnode = makeNode(JsonBehavior);
     729              : 
     730         5283 :     COPY_SCALAR_FIELD(btype);
     731         5283 :     COPY_NODE_FIELD(expr);
     732         5283 :     COPY_SCALAR_FIELD(coerce);
     733         5283 :     COPY_LOCATION_FIELD(location);
     734              : 
     735         5283 :     return newnode;
     736              : }
     737              : 
     738              : static JsonExpr *
     739         2701 : _copyJsonExpr(const JsonExpr *from)
     740              : {
     741         2701 :     JsonExpr *newnode = makeNode(JsonExpr);
     742              : 
     743         2701 :     COPY_SCALAR_FIELD(op);
     744         2701 :     COPY_STRING_FIELD(column_name);
     745         2701 :     COPY_NODE_FIELD(formatted_expr);
     746         2701 :     COPY_NODE_FIELD(format);
     747         2701 :     COPY_NODE_FIELD(path_spec);
     748         2701 :     COPY_NODE_FIELD(returning);
     749         2701 :     COPY_NODE_FIELD(passing_names);
     750         2701 :     COPY_NODE_FIELD(passing_values);
     751         2701 :     COPY_NODE_FIELD(on_empty);
     752         2701 :     COPY_NODE_FIELD(on_error);
     753         2701 :     COPY_SCALAR_FIELD(use_io_coercion);
     754         2701 :     COPY_SCALAR_FIELD(use_json_coercion);
     755         2701 :     COPY_SCALAR_FIELD(wrapper);
     756         2701 :     COPY_SCALAR_FIELD(omit_quotes);
     757         2701 :     COPY_SCALAR_FIELD(collation);
     758         2701 :     COPY_LOCATION_FIELD(location);
     759              : 
     760         2701 :     return newnode;
     761              : }
     762              : 
     763              : static JsonTablePath *
     764          607 : _copyJsonTablePath(const JsonTablePath *from)
     765              : {
     766          607 :     JsonTablePath *newnode = makeNode(JsonTablePath);
     767              : 
     768          607 :     COPY_NODE_FIELD(value);
     769          607 :     COPY_STRING_FIELD(name);
     770              : 
     771          607 :     return newnode;
     772              : }
     773              : 
     774              : static JsonTablePathScan *
     775          607 : _copyJsonTablePathScan(const JsonTablePathScan *from)
     776              : {
     777          607 :     JsonTablePathScan *newnode = makeNode(JsonTablePathScan);
     778              : 
     779          607 :     COPY_NODE_FIELD(path);
     780          607 :     COPY_SCALAR_FIELD(errorOnError);
     781          607 :     COPY_NODE_FIELD(child);
     782          607 :     COPY_SCALAR_FIELD(colMin);
     783          607 :     COPY_SCALAR_FIELD(colMax);
     784              : 
     785          607 :     return newnode;
     786              : }
     787              : 
     788              : static JsonTableSiblingJoin *
     789           60 : _copyJsonTableSiblingJoin(const JsonTableSiblingJoin *from)
     790              : {
     791           60 :     JsonTableSiblingJoin *newnode = makeNode(JsonTableSiblingJoin);
     792              : 
     793           60 :     COPY_NODE_FIELD(lplan);
     794           60 :     COPY_NODE_FIELD(rplan);
     795              : 
     796           60 :     return newnode;
     797              : }
     798              : 
     799              : static NullTest *
     800        49577 : _copyNullTest(const NullTest *from)
     801              : {
     802        49577 :     NullTest *newnode = makeNode(NullTest);
     803              : 
     804        49577 :     COPY_NODE_FIELD(arg);
     805        49577 :     COPY_SCALAR_FIELD(nulltesttype);
     806        49577 :     COPY_SCALAR_FIELD(argisrow);
     807        49577 :     COPY_LOCATION_FIELD(location);
     808              : 
     809        49577 :     return newnode;
     810              : }
     811              : 
     812              : static BooleanTest *
     813         2676 : _copyBooleanTest(const BooleanTest *from)
     814              : {
     815         2676 :     BooleanTest *newnode = makeNode(BooleanTest);
     816              : 
     817         2676 :     COPY_NODE_FIELD(arg);
     818         2676 :     COPY_SCALAR_FIELD(booltesttype);
     819         2676 :     COPY_LOCATION_FIELD(location);
     820              : 
     821         2676 :     return newnode;
     822              : }
     823              : 
     824              : static MergeAction *
     825         4610 : _copyMergeAction(const MergeAction *from)
     826              : {
     827         4610 :     MergeAction *newnode = makeNode(MergeAction);
     828              : 
     829         4610 :     COPY_SCALAR_FIELD(matchKind);
     830         4610 :     COPY_SCALAR_FIELD(commandType);
     831         4610 :     COPY_SCALAR_FIELD(override);
     832         4610 :     COPY_NODE_FIELD(qual);
     833         4610 :     COPY_NODE_FIELD(targetList);
     834         4610 :     COPY_NODE_FIELD(updateColnos);
     835              : 
     836         4610 :     return newnode;
     837              : }
     838              : 
     839              : static CoerceToDomain *
     840        41028 : _copyCoerceToDomain(const CoerceToDomain *from)
     841              : {
     842        41028 :     CoerceToDomain *newnode = makeNode(CoerceToDomain);
     843              : 
     844        41028 :     COPY_NODE_FIELD(arg);
     845        41028 :     COPY_SCALAR_FIELD(resulttype);
     846        41028 :     COPY_SCALAR_FIELD(resulttypmod);
     847        41028 :     COPY_SCALAR_FIELD(resultcollid);
     848        41028 :     COPY_SCALAR_FIELD(coercionformat);
     849        41028 :     COPY_LOCATION_FIELD(location);
     850              : 
     851        41028 :     return newnode;
     852              : }
     853              : 
     854              : static CoerceToDomainValue *
     855         1907 : _copyCoerceToDomainValue(const CoerceToDomainValue *from)
     856              : {
     857         1907 :     CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
     858              : 
     859         1907 :     COPY_SCALAR_FIELD(typeId);
     860         1907 :     COPY_SCALAR_FIELD(typeMod);
     861         1907 :     COPY_SCALAR_FIELD(collation);
     862         1907 :     COPY_LOCATION_FIELD(location);
     863              : 
     864         1907 :     return newnode;
     865              : }
     866              : 
     867              : static SetToDefault *
     868         1023 : _copySetToDefault(const SetToDefault *from)
     869              : {
     870         1023 :     SetToDefault *newnode = makeNode(SetToDefault);
     871              : 
     872         1023 :     COPY_SCALAR_FIELD(typeId);
     873         1023 :     COPY_SCALAR_FIELD(typeMod);
     874         1023 :     COPY_SCALAR_FIELD(collation);
     875         1023 :     COPY_LOCATION_FIELD(location);
     876              : 
     877         1023 :     return newnode;
     878              : }
     879              : 
     880              : static CurrentOfExpr *
     881          876 : _copyCurrentOfExpr(const CurrentOfExpr *from)
     882              : {
     883          876 :     CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
     884              : 
     885          876 :     COPY_SCALAR_FIELD(cvarno);
     886          876 :     COPY_STRING_FIELD(cursor_name);
     887          876 :     COPY_SCALAR_FIELD(cursor_param);
     888              : 
     889          876 :     return newnode;
     890              : }
     891              : 
     892              : static NextValueExpr *
     893          767 : _copyNextValueExpr(const NextValueExpr *from)
     894              : {
     895          767 :     NextValueExpr *newnode = makeNode(NextValueExpr);
     896              : 
     897          767 :     COPY_SCALAR_FIELD(seqid);
     898          767 :     COPY_SCALAR_FIELD(typeId);
     899              : 
     900          767 :     return newnode;
     901              : }
     902              : 
     903              : static InferenceElem *
     904         1206 : _copyInferenceElem(const InferenceElem *from)
     905              : {
     906         1206 :     InferenceElem *newnode = makeNode(InferenceElem);
     907              : 
     908         1206 :     COPY_NODE_FIELD(expr);
     909         1206 :     COPY_SCALAR_FIELD(infercollid);
     910         1206 :     COPY_SCALAR_FIELD(inferopclass);
     911              : 
     912         1206 :     return newnode;
     913              : }
     914              : 
     915              : static ReturningExpr *
     916         1008 : _copyReturningExpr(const ReturningExpr *from)
     917              : {
     918         1008 :     ReturningExpr *newnode = makeNode(ReturningExpr);
     919              : 
     920         1008 :     COPY_SCALAR_FIELD(retlevelsup);
     921         1008 :     COPY_SCALAR_FIELD(retold);
     922         1008 :     COPY_NODE_FIELD(retexpr);
     923              : 
     924         1008 :     return newnode;
     925              : }
     926              : 
     927              : static TargetEntry *
     928      4950521 : _copyTargetEntry(const TargetEntry *from)
     929              : {
     930      4950521 :     TargetEntry *newnode = makeNode(TargetEntry);
     931              : 
     932      4950521 :     COPY_NODE_FIELD(expr);
     933      4950521 :     COPY_SCALAR_FIELD(resno);
     934      4950521 :     COPY_STRING_FIELD(resname);
     935      4950521 :     COPY_SCALAR_FIELD(ressortgroupref);
     936      4950521 :     COPY_SCALAR_FIELD(resorigtbl);
     937      4950521 :     COPY_SCALAR_FIELD(resorigcol);
     938      4950521 :     COPY_SCALAR_FIELD(resjunk);
     939              : 
     940      4950521 :     return newnode;
     941              : }
     942              : 
     943              : static RangeTblRef *
     944       523823 : _copyRangeTblRef(const RangeTblRef *from)
     945              : {
     946       523823 :     RangeTblRef *newnode = makeNode(RangeTblRef);
     947              : 
     948       523823 :     COPY_SCALAR_FIELD(rtindex);
     949              : 
     950       523823 :     return newnode;
     951              : }
     952              : 
     953              : static JoinExpr *
     954       155967 : _copyJoinExpr(const JoinExpr *from)
     955              : {
     956       155967 :     JoinExpr *newnode = makeNode(JoinExpr);
     957              : 
     958       155967 :     COPY_SCALAR_FIELD(jointype);
     959       155967 :     COPY_SCALAR_FIELD(isNatural);
     960       155967 :     COPY_NODE_FIELD(larg);
     961       155967 :     COPY_NODE_FIELD(rarg);
     962       155967 :     COPY_NODE_FIELD(usingClause);
     963       155967 :     COPY_NODE_FIELD(join_using_alias);
     964       155967 :     COPY_NODE_FIELD(quals);
     965       155967 :     COPY_NODE_FIELD(alias);
     966       155967 :     COPY_SCALAR_FIELD(rtindex);
     967              : 
     968       155967 :     return newnode;
     969              : }
     970              : 
     971              : static FromExpr *
     972       502346 : _copyFromExpr(const FromExpr *from)
     973              : {
     974       502346 :     FromExpr *newnode = makeNode(FromExpr);
     975              : 
     976       502346 :     COPY_NODE_FIELD(fromlist);
     977       502346 :     COPY_NODE_FIELD(quals);
     978              : 
     979       502346 :     return newnode;
     980              : }
     981              : 
     982              : static OnConflictExpr *
     983         1207 : _copyOnConflictExpr(const OnConflictExpr *from)
     984              : {
     985         1207 :     OnConflictExpr *newnode = makeNode(OnConflictExpr);
     986              : 
     987         1207 :     COPY_SCALAR_FIELD(action);
     988         1207 :     COPY_NODE_FIELD(arbiterElems);
     989         1207 :     COPY_NODE_FIELD(arbiterWhere);
     990         1207 :     COPY_SCALAR_FIELD(constraint);
     991         1207 :     COPY_SCALAR_FIELD(lockStrength);
     992         1207 :     COPY_NODE_FIELD(onConflictSet);
     993         1207 :     COPY_NODE_FIELD(onConflictWhere);
     994         1207 :     COPY_SCALAR_FIELD(exclRelIndex);
     995         1207 :     COPY_NODE_FIELD(exclRelTlist);
     996              : 
     997         1207 :     return newnode;
     998              : }
     999              : 
    1000              : static Query *
    1001       714391 : _copyQuery(const Query *from)
    1002              : {
    1003       714391 :     Query *newnode = makeNode(Query);
    1004              : 
    1005       714391 :     COPY_SCALAR_FIELD(commandType);
    1006       714391 :     COPY_SCALAR_FIELD(querySource);
    1007       714391 :     COPY_SCALAR_FIELD(queryId);
    1008       714391 :     COPY_SCALAR_FIELD(canSetTag);
    1009       714391 :     COPY_NODE_FIELD(utilityStmt);
    1010       714391 :     COPY_SCALAR_FIELD(resultRelation);
    1011       714391 :     COPY_SCALAR_FIELD(hasAggs);
    1012       714391 :     COPY_SCALAR_FIELD(hasWindowFuncs);
    1013       714391 :     COPY_SCALAR_FIELD(hasTargetSRFs);
    1014       714391 :     COPY_SCALAR_FIELD(hasSubLinks);
    1015       714391 :     COPY_SCALAR_FIELD(hasDistinctOn);
    1016       714391 :     COPY_SCALAR_FIELD(hasRecursive);
    1017       714391 :     COPY_SCALAR_FIELD(hasModifyingCTE);
    1018       714391 :     COPY_SCALAR_FIELD(hasForUpdate);
    1019       714391 :     COPY_SCALAR_FIELD(hasRowSecurity);
    1020       714391 :     COPY_SCALAR_FIELD(hasGroupRTE);
    1021       714391 :     COPY_SCALAR_FIELD(isReturn);
    1022       714391 :     COPY_NODE_FIELD(cteList);
    1023       714391 :     COPY_NODE_FIELD(rtable);
    1024       714391 :     COPY_NODE_FIELD(rteperminfos);
    1025       714391 :     COPY_NODE_FIELD(jointree);
    1026       714391 :     COPY_NODE_FIELD(mergeActionList);
    1027       714391 :     COPY_SCALAR_FIELD(mergeTargetRelation);
    1028       714391 :     COPY_NODE_FIELD(mergeJoinCondition);
    1029       714391 :     COPY_NODE_FIELD(targetList);
    1030       714391 :     COPY_SCALAR_FIELD(override);
    1031       714391 :     COPY_NODE_FIELD(onConflict);
    1032       714391 :     COPY_STRING_FIELD(returningOldAlias);
    1033       714391 :     COPY_STRING_FIELD(returningNewAlias);
    1034       714391 :     COPY_NODE_FIELD(returningList);
    1035       714391 :     COPY_NODE_FIELD(groupClause);
    1036       714391 :     COPY_SCALAR_FIELD(groupDistinct);
    1037       714391 :     COPY_SCALAR_FIELD(groupByAll);
    1038       714391 :     COPY_NODE_FIELD(groupingSets);
    1039       714391 :     COPY_NODE_FIELD(havingQual);
    1040       714391 :     COPY_NODE_FIELD(windowClause);
    1041       714391 :     COPY_NODE_FIELD(distinctClause);
    1042       714391 :     COPY_NODE_FIELD(sortClause);
    1043       714391 :     COPY_NODE_FIELD(limitOffset);
    1044       714391 :     COPY_NODE_FIELD(limitCount);
    1045       714391 :     COPY_SCALAR_FIELD(limitOption);
    1046       714391 :     COPY_NODE_FIELD(rowMarks);
    1047       714391 :     COPY_NODE_FIELD(setOperations);
    1048       714391 :     COPY_NODE_FIELD(constraintDeps);
    1049       714391 :     COPY_NODE_FIELD(withCheckOptions);
    1050       714391 :     COPY_LOCATION_FIELD(stmt_location);
    1051       714391 :     COPY_LOCATION_FIELD(stmt_len);
    1052              : 
    1053       714391 :     return newnode;
    1054              : }
    1055              : 
    1056              : static TypeName *
    1057       417013 : _copyTypeName(const TypeName *from)
    1058              : {
    1059       417013 :     TypeName *newnode = makeNode(TypeName);
    1060              : 
    1061       417013 :     COPY_NODE_FIELD(names);
    1062       417013 :     COPY_SCALAR_FIELD(typeOid);
    1063       417013 :     COPY_SCALAR_FIELD(setof);
    1064       417013 :     COPY_SCALAR_FIELD(pct_type);
    1065       417013 :     COPY_NODE_FIELD(typmods);
    1066       417013 :     COPY_SCALAR_FIELD(typemod);
    1067       417013 :     COPY_NODE_FIELD(arrayBounds);
    1068       417013 :     COPY_LOCATION_FIELD(location);
    1069              : 
    1070       417013 :     return newnode;
    1071              : }
    1072              : 
    1073              : static ColumnRef *
    1074      1210987 : _copyColumnRef(const ColumnRef *from)
    1075              : {
    1076      1210987 :     ColumnRef *newnode = makeNode(ColumnRef);
    1077              : 
    1078      1210987 :     COPY_NODE_FIELD(fields);
    1079      1210987 :     COPY_LOCATION_FIELD(location);
    1080              : 
    1081      1210987 :     return newnode;
    1082              : }
    1083              : 
    1084              : static ParamRef *
    1085        41740 : _copyParamRef(const ParamRef *from)
    1086              : {
    1087        41740 :     ParamRef *newnode = makeNode(ParamRef);
    1088              : 
    1089        41740 :     COPY_SCALAR_FIELD(number);
    1090        41740 :     COPY_LOCATION_FIELD(location);
    1091              : 
    1092        41740 :     return newnode;
    1093              : }
    1094              : 
    1095              : static A_Expr *
    1096       386774 : _copyA_Expr(const A_Expr *from)
    1097              : {
    1098       386774 :     A_Expr *newnode = makeNode(A_Expr);
    1099              : 
    1100       386774 :     COPY_SCALAR_FIELD(kind);
    1101       386774 :     COPY_NODE_FIELD(name);
    1102       386774 :     COPY_NODE_FIELD(lexpr);
    1103       386774 :     COPY_NODE_FIELD(rexpr);
    1104       386774 :     COPY_LOCATION_FIELD(rexpr_list_start);
    1105       386774 :     COPY_LOCATION_FIELD(rexpr_list_end);
    1106       386774 :     COPY_LOCATION_FIELD(location);
    1107              : 
    1108       386774 :     return newnode;
    1109              : }
    1110              : 
    1111              : static TypeCast *
    1112       204876 : _copyTypeCast(const TypeCast *from)
    1113              : {
    1114       204876 :     TypeCast *newnode = makeNode(TypeCast);
    1115              : 
    1116       204876 :     COPY_NODE_FIELD(arg);
    1117       204876 :     COPY_NODE_FIELD(typeName);
    1118       204876 :     COPY_LOCATION_FIELD(location);
    1119              : 
    1120       204876 :     return newnode;
    1121              : }
    1122              : 
    1123              : static CollateClause *
    1124         5690 : _copyCollateClause(const CollateClause *from)
    1125              : {
    1126         5690 :     CollateClause *newnode = makeNode(CollateClause);
    1127              : 
    1128         5690 :     COPY_NODE_FIELD(arg);
    1129         5690 :     COPY_NODE_FIELD(collname);
    1130         5690 :     COPY_LOCATION_FIELD(location);
    1131              : 
    1132         5690 :     return newnode;
    1133              : }
    1134              : 
    1135              : static RoleSpec *
    1136        30281 : _copyRoleSpec(const RoleSpec *from)
    1137              : {
    1138        30281 :     RoleSpec *newnode = makeNode(RoleSpec);
    1139              : 
    1140        30281 :     COPY_SCALAR_FIELD(roletype);
    1141        30281 :     COPY_STRING_FIELD(rolename);
    1142        30281 :     COPY_LOCATION_FIELD(location);
    1143              : 
    1144        30281 :     return newnode;
    1145              : }
    1146              : 
    1147              : static FuncCall *
    1148       236408 : _copyFuncCall(const FuncCall *from)
    1149              : {
    1150       236408 :     FuncCall *newnode = makeNode(FuncCall);
    1151              : 
    1152       236408 :     COPY_NODE_FIELD(funcname);
    1153       236408 :     COPY_NODE_FIELD(args);
    1154       236408 :     COPY_NODE_FIELD(agg_order);
    1155       236408 :     COPY_NODE_FIELD(agg_filter);
    1156       236408 :     COPY_NODE_FIELD(over);
    1157       236408 :     COPY_SCALAR_FIELD(ignore_nulls);
    1158       236408 :     COPY_SCALAR_FIELD(agg_within_group);
    1159       236408 :     COPY_SCALAR_FIELD(agg_star);
    1160       236408 :     COPY_SCALAR_FIELD(agg_distinct);
    1161       236408 :     COPY_SCALAR_FIELD(func_variadic);
    1162       236408 :     COPY_SCALAR_FIELD(funcformat);
    1163       236408 :     COPY_LOCATION_FIELD(location);
    1164              : 
    1165       236408 :     return newnode;
    1166              : }
    1167              : 
    1168              : static A_Star *
    1169        39956 : _copyA_Star(const A_Star *from)
    1170              : {
    1171        39956 :     A_Star *newnode = makeNode(A_Star);
    1172              : 
    1173              : 
    1174        39956 :     return newnode;
    1175              : }
    1176              : 
    1177              : static A_Indices *
    1178         9029 : _copyA_Indices(const A_Indices *from)
    1179              : {
    1180         9029 :     A_Indices *newnode = makeNode(A_Indices);
    1181              : 
    1182         9029 :     COPY_SCALAR_FIELD(is_slice);
    1183         9029 :     COPY_NODE_FIELD(lidx);
    1184         9029 :     COPY_NODE_FIELD(uidx);
    1185              : 
    1186         9029 :     return newnode;
    1187              : }
    1188              : 
    1189              : static A_Indirection *
    1190        22872 : _copyA_Indirection(const A_Indirection *from)
    1191              : {
    1192        22872 :     A_Indirection *newnode = makeNode(A_Indirection);
    1193              : 
    1194        22872 :     COPY_NODE_FIELD(arg);
    1195        22872 :     COPY_NODE_FIELD(indirection);
    1196              : 
    1197        22872 :     return newnode;
    1198              : }
    1199              : 
    1200              : static A_ArrayExpr *
    1201         4374 : _copyA_ArrayExpr(const A_ArrayExpr *from)
    1202              : {
    1203         4374 :     A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
    1204              : 
    1205         4374 :     COPY_NODE_FIELD(elements);
    1206         4374 :     COPY_LOCATION_FIELD(list_start);
    1207         4374 :     COPY_LOCATION_FIELD(list_end);
    1208         4374 :     COPY_LOCATION_FIELD(location);
    1209              : 
    1210         4374 :     return newnode;
    1211              : }
    1212              : 
    1213              : static ResTarget *
    1214       765831 : _copyResTarget(const ResTarget *from)
    1215              : {
    1216       765831 :     ResTarget *newnode = makeNode(ResTarget);
    1217              : 
    1218       765831 :     COPY_STRING_FIELD(name);
    1219       765831 :     COPY_NODE_FIELD(indirection);
    1220       765831 :     COPY_NODE_FIELD(val);
    1221       765831 :     COPY_LOCATION_FIELD(location);
    1222              : 
    1223       765831 :     return newnode;
    1224              : }
    1225              : 
    1226              : static MultiAssignRef *
    1227          201 : _copyMultiAssignRef(const MultiAssignRef *from)
    1228              : {
    1229          201 :     MultiAssignRef *newnode = makeNode(MultiAssignRef);
    1230              : 
    1231          201 :     COPY_NODE_FIELD(source);
    1232          201 :     COPY_SCALAR_FIELD(colno);
    1233          201 :     COPY_SCALAR_FIELD(ncolumns);
    1234              : 
    1235          201 :     return newnode;
    1236              : }
    1237              : 
    1238              : static SortBy *
    1239        62096 : _copySortBy(const SortBy *from)
    1240              : {
    1241        62096 :     SortBy *newnode = makeNode(SortBy);
    1242              : 
    1243        62096 :     COPY_NODE_FIELD(node);
    1244        62096 :     COPY_SCALAR_FIELD(sortby_dir);
    1245        62096 :     COPY_SCALAR_FIELD(sortby_nulls);
    1246        62096 :     COPY_NODE_FIELD(useOp);
    1247        62096 :     COPY_LOCATION_FIELD(location);
    1248              : 
    1249        62096 :     return newnode;
    1250              : }
    1251              : 
    1252              : static WindowDef *
    1253         2452 : _copyWindowDef(const WindowDef *from)
    1254              : {
    1255         2452 :     WindowDef *newnode = makeNode(WindowDef);
    1256              : 
    1257         2452 :     COPY_STRING_FIELD(name);
    1258         2452 :     COPY_STRING_FIELD(refname);
    1259         2452 :     COPY_NODE_FIELD(partitionClause);
    1260         2452 :     COPY_NODE_FIELD(orderClause);
    1261         2452 :     COPY_SCALAR_FIELD(frameOptions);
    1262         2452 :     COPY_NODE_FIELD(startOffset);
    1263         2452 :     COPY_NODE_FIELD(endOffset);
    1264         2452 :     COPY_LOCATION_FIELD(location);
    1265              : 
    1266         2452 :     return newnode;
    1267              : }
    1268              : 
    1269              : static RangeSubselect *
    1270        12881 : _copyRangeSubselect(const RangeSubselect *from)
    1271              : {
    1272        12881 :     RangeSubselect *newnode = makeNode(RangeSubselect);
    1273              : 
    1274        12881 :     COPY_SCALAR_FIELD(lateral);
    1275        12881 :     COPY_NODE_FIELD(subquery);
    1276        12881 :     COPY_NODE_FIELD(alias);
    1277              : 
    1278        12881 :     return newnode;
    1279              : }
    1280              : 
    1281              : static RangeFunction *
    1282        28843 : _copyRangeFunction(const RangeFunction *from)
    1283              : {
    1284        28843 :     RangeFunction *newnode = makeNode(RangeFunction);
    1285              : 
    1286        28843 :     COPY_SCALAR_FIELD(lateral);
    1287        28843 :     COPY_SCALAR_FIELD(ordinality);
    1288        28843 :     COPY_SCALAR_FIELD(is_rowsfrom);
    1289        28843 :     COPY_NODE_FIELD(functions);
    1290        28843 :     COPY_NODE_FIELD(alias);
    1291        28843 :     COPY_NODE_FIELD(coldeflist);
    1292              : 
    1293        28843 :     return newnode;
    1294              : }
    1295              : 
    1296              : static RangeTableFunc *
    1297          130 : _copyRangeTableFunc(const RangeTableFunc *from)
    1298              : {
    1299          130 :     RangeTableFunc *newnode = makeNode(RangeTableFunc);
    1300              : 
    1301          130 :     COPY_SCALAR_FIELD(lateral);
    1302          130 :     COPY_NODE_FIELD(docexpr);
    1303          130 :     COPY_NODE_FIELD(rowexpr);
    1304          130 :     COPY_NODE_FIELD(namespaces);
    1305          130 :     COPY_NODE_FIELD(columns);
    1306          130 :     COPY_NODE_FIELD(alias);
    1307          130 :     COPY_LOCATION_FIELD(location);
    1308              : 
    1309          130 :     return newnode;
    1310              : }
    1311              : 
    1312              : static RangeTableFuncCol *
    1313          465 : _copyRangeTableFuncCol(const RangeTableFuncCol *from)
    1314              : {
    1315          465 :     RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
    1316              : 
    1317          465 :     COPY_STRING_FIELD(colname);
    1318          465 :     COPY_NODE_FIELD(typeName);
    1319          465 :     COPY_SCALAR_FIELD(for_ordinality);
    1320          465 :     COPY_SCALAR_FIELD(is_not_null);
    1321          465 :     COPY_NODE_FIELD(colexpr);
    1322          465 :     COPY_NODE_FIELD(coldefexpr);
    1323          465 :     COPY_LOCATION_FIELD(location);
    1324              : 
    1325          465 :     return newnode;
    1326              : }
    1327              : 
    1328              : static RangeTableSample *
    1329          146 : _copyRangeTableSample(const RangeTableSample *from)
    1330              : {
    1331          146 :     RangeTableSample *newnode = makeNode(RangeTableSample);
    1332              : 
    1333          146 :     COPY_NODE_FIELD(relation);
    1334          146 :     COPY_NODE_FIELD(method);
    1335          146 :     COPY_NODE_FIELD(args);
    1336          146 :     COPY_NODE_FIELD(repeatable);
    1337          146 :     COPY_LOCATION_FIELD(location);
    1338              : 
    1339          146 :     return newnode;
    1340              : }
    1341              : 
    1342              : static ColumnDef *
    1343        79005 : _copyColumnDef(const ColumnDef *from)
    1344              : {
    1345        79005 :     ColumnDef *newnode = makeNode(ColumnDef);
    1346              : 
    1347        79005 :     COPY_STRING_FIELD(colname);
    1348        79005 :     COPY_NODE_FIELD(typeName);
    1349        79005 :     COPY_STRING_FIELD(compression);
    1350        79005 :     COPY_SCALAR_FIELD(inhcount);
    1351        79005 :     COPY_SCALAR_FIELD(is_local);
    1352        79005 :     COPY_SCALAR_FIELD(is_not_null);
    1353        79005 :     COPY_SCALAR_FIELD(is_from_type);
    1354        79005 :     COPY_SCALAR_FIELD(storage);
    1355        79005 :     COPY_STRING_FIELD(storage_name);
    1356        79005 :     COPY_NODE_FIELD(raw_default);
    1357        79005 :     COPY_NODE_FIELD(cooked_default);
    1358        79005 :     COPY_SCALAR_FIELD(identity);
    1359        79005 :     COPY_NODE_FIELD(identitySequence);
    1360        79005 :     COPY_SCALAR_FIELD(generated);
    1361        79005 :     COPY_NODE_FIELD(collClause);
    1362        79005 :     COPY_SCALAR_FIELD(collOid);
    1363        79005 :     COPY_NODE_FIELD(constraints);
    1364        79005 :     COPY_NODE_FIELD(fdwoptions);
    1365        79005 :     COPY_LOCATION_FIELD(location);
    1366              : 
    1367        79005 :     return newnode;
    1368              : }
    1369              : 
    1370              : static TableLikeClause *
    1371          792 : _copyTableLikeClause(const TableLikeClause *from)
    1372              : {
    1373          792 :     TableLikeClause *newnode = makeNode(TableLikeClause);
    1374              : 
    1375          792 :     COPY_NODE_FIELD(relation);
    1376          792 :     COPY_SCALAR_FIELD(options);
    1377          792 :     COPY_SCALAR_FIELD(relationOid);
    1378              : 
    1379          792 :     return newnode;
    1380              : }
    1381              : 
    1382              : static IndexElem *
    1383        10662 : _copyIndexElem(const IndexElem *from)
    1384              : {
    1385        10662 :     IndexElem *newnode = makeNode(IndexElem);
    1386              : 
    1387        10662 :     COPY_STRING_FIELD(name);
    1388        10662 :     COPY_NODE_FIELD(expr);
    1389        10662 :     COPY_STRING_FIELD(indexcolname);
    1390        10662 :     COPY_NODE_FIELD(collation);
    1391        10662 :     COPY_NODE_FIELD(opclass);
    1392        10662 :     COPY_NODE_FIELD(opclassopts);
    1393        10662 :     COPY_SCALAR_FIELD(ordering);
    1394        10662 :     COPY_SCALAR_FIELD(nulls_ordering);
    1395        10662 :     COPY_LOCATION_FIELD(location);
    1396              : 
    1397        10662 :     return newnode;
    1398              : }
    1399              : 
    1400              : static DefElem *
    1401       183917 : _copyDefElem(const DefElem *from)
    1402              : {
    1403       183917 :     DefElem *newnode = makeNode(DefElem);
    1404              : 
    1405       183917 :     COPY_STRING_FIELD(defnamespace);
    1406       183917 :     COPY_STRING_FIELD(defname);
    1407       183917 :     COPY_NODE_FIELD(arg);
    1408       183917 :     COPY_SCALAR_FIELD(defaction);
    1409       183917 :     COPY_LOCATION_FIELD(location);
    1410              : 
    1411       183917 :     return newnode;
    1412              : }
    1413              : 
    1414              : static LockingClause *
    1415         5621 : _copyLockingClause(const LockingClause *from)
    1416              : {
    1417         5621 :     LockingClause *newnode = makeNode(LockingClause);
    1418              : 
    1419         5621 :     COPY_NODE_FIELD(lockedRels);
    1420         5621 :     COPY_SCALAR_FIELD(strength);
    1421         5621 :     COPY_SCALAR_FIELD(waitPolicy);
    1422              : 
    1423         5621 :     return newnode;
    1424              : }
    1425              : 
    1426              : static XmlSerialize *
    1427          125 : _copyXmlSerialize(const XmlSerialize *from)
    1428              : {
    1429          125 :     XmlSerialize *newnode = makeNode(XmlSerialize);
    1430              : 
    1431          125 :     COPY_SCALAR_FIELD(xmloption);
    1432          125 :     COPY_NODE_FIELD(expr);
    1433          125 :     COPY_NODE_FIELD(typeName);
    1434          125 :     COPY_SCALAR_FIELD(indent);
    1435          125 :     COPY_LOCATION_FIELD(location);
    1436              : 
    1437          125 :     return newnode;
    1438              : }
    1439              : 
    1440              : static PartitionElem *
    1441         6333 : _copyPartitionElem(const PartitionElem *from)
    1442              : {
    1443         6333 :     PartitionElem *newnode = makeNode(PartitionElem);
    1444              : 
    1445         6333 :     COPY_STRING_FIELD(name);
    1446         6333 :     COPY_NODE_FIELD(expr);
    1447         6333 :     COPY_NODE_FIELD(collation);
    1448         6333 :     COPY_NODE_FIELD(opclass);
    1449         6333 :     COPY_LOCATION_FIELD(location);
    1450              : 
    1451         6333 :     return newnode;
    1452              : }
    1453              : 
    1454              : static PartitionSpec *
    1455         5671 : _copyPartitionSpec(const PartitionSpec *from)
    1456              : {
    1457         5671 :     PartitionSpec *newnode = makeNode(PartitionSpec);
    1458              : 
    1459         5671 :     COPY_SCALAR_FIELD(strategy);
    1460         5671 :     COPY_NODE_FIELD(partParams);
    1461         5671 :     COPY_LOCATION_FIELD(location);
    1462              : 
    1463         5671 :     return newnode;
    1464              : }
    1465              : 
    1466              : static PartitionBoundSpec *
    1467        21110 : _copyPartitionBoundSpec(const PartitionBoundSpec *from)
    1468              : {
    1469        21110 :     PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
    1470              : 
    1471        21110 :     COPY_SCALAR_FIELD(strategy);
    1472        21110 :     COPY_SCALAR_FIELD(is_default);
    1473        21110 :     COPY_SCALAR_FIELD(modulus);
    1474        21110 :     COPY_SCALAR_FIELD(remainder);
    1475        21110 :     COPY_NODE_FIELD(listdatums);
    1476        21110 :     COPY_NODE_FIELD(lowerdatums);
    1477        21110 :     COPY_NODE_FIELD(upperdatums);
    1478        21110 :     COPY_LOCATION_FIELD(location);
    1479              : 
    1480        21110 :     return newnode;
    1481              : }
    1482              : 
    1483              : static PartitionRangeDatum *
    1484            8 : _copyPartitionRangeDatum(const PartitionRangeDatum *from)
    1485              : {
    1486            8 :     PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
    1487              : 
    1488            8 :     COPY_SCALAR_FIELD(kind);
    1489            8 :     COPY_NODE_FIELD(value);
    1490            8 :     COPY_LOCATION_FIELD(location);
    1491              : 
    1492            8 :     return newnode;
    1493              : }
    1494              : 
    1495              : static SinglePartitionSpec *
    1496         1654 : _copySinglePartitionSpec(const SinglePartitionSpec *from)
    1497              : {
    1498         1654 :     SinglePartitionSpec *newnode = makeNode(SinglePartitionSpec);
    1499              : 
    1500         1654 :     COPY_NODE_FIELD(name);
    1501         1654 :     COPY_NODE_FIELD(bound);
    1502              : 
    1503         1654 :     return newnode;
    1504              : }
    1505              : 
    1506              : static PartitionCmd *
    1507         6410 : _copyPartitionCmd(const PartitionCmd *from)
    1508              : {
    1509         6410 :     PartitionCmd *newnode = makeNode(PartitionCmd);
    1510              : 
    1511         6410 :     COPY_NODE_FIELD(name);
    1512         6410 :     COPY_NODE_FIELD(bound);
    1513         6410 :     COPY_NODE_FIELD(partlist);
    1514         6410 :     COPY_SCALAR_FIELD(concurrent);
    1515              : 
    1516         6410 :     return newnode;
    1517              : }
    1518              : 
    1519              : static RangeTblEntry *
    1520      1255724 : _copyRangeTblEntry(const RangeTblEntry *from)
    1521              : {
    1522      1255724 :     RangeTblEntry *newnode = makeNode(RangeTblEntry);
    1523              : 
    1524      1255724 :     COPY_NODE_FIELD(alias);
    1525      1255724 :     COPY_NODE_FIELD(eref);
    1526      1255724 :     COPY_SCALAR_FIELD(rtekind);
    1527      1255724 :     COPY_SCALAR_FIELD(relid);
    1528      1255724 :     COPY_SCALAR_FIELD(inh);
    1529      1255724 :     COPY_SCALAR_FIELD(relkind);
    1530      1255724 :     COPY_SCALAR_FIELD(rellockmode);
    1531      1255724 :     COPY_SCALAR_FIELD(perminfoindex);
    1532      1255724 :     COPY_NODE_FIELD(tablesample);
    1533      1255724 :     COPY_NODE_FIELD(subquery);
    1534      1255724 :     COPY_SCALAR_FIELD(security_barrier);
    1535      1255724 :     COPY_SCALAR_FIELD(jointype);
    1536      1255724 :     COPY_SCALAR_FIELD(joinmergedcols);
    1537      1255724 :     COPY_NODE_FIELD(joinaliasvars);
    1538      1255724 :     COPY_NODE_FIELD(joinleftcols);
    1539      1255724 :     COPY_NODE_FIELD(joinrightcols);
    1540      1255724 :     COPY_NODE_FIELD(join_using_alias);
    1541      1255724 :     COPY_NODE_FIELD(functions);
    1542      1255724 :     COPY_SCALAR_FIELD(funcordinality);
    1543      1255724 :     COPY_NODE_FIELD(tablefunc);
    1544      1255724 :     COPY_NODE_FIELD(values_lists);
    1545      1255724 :     COPY_STRING_FIELD(ctename);
    1546      1255724 :     COPY_SCALAR_FIELD(ctelevelsup);
    1547      1255724 :     COPY_SCALAR_FIELD(self_reference);
    1548      1255724 :     COPY_NODE_FIELD(coltypes);
    1549      1255724 :     COPY_NODE_FIELD(coltypmods);
    1550      1255724 :     COPY_NODE_FIELD(colcollations);
    1551      1255724 :     COPY_STRING_FIELD(enrname);
    1552      1255724 :     COPY_SCALAR_FIELD(enrtuples);
    1553      1255724 :     COPY_NODE_FIELD(groupexprs);
    1554      1255724 :     COPY_SCALAR_FIELD(lateral);
    1555      1255724 :     COPY_SCALAR_FIELD(inFromCl);
    1556      1255724 :     COPY_NODE_FIELD(securityQuals);
    1557              : 
    1558      1255724 :     return newnode;
    1559              : }
    1560              : 
    1561              : static RTEPermissionInfo *
    1562       735243 : _copyRTEPermissionInfo(const RTEPermissionInfo *from)
    1563              : {
    1564       735243 :     RTEPermissionInfo *newnode = makeNode(RTEPermissionInfo);
    1565              : 
    1566       735243 :     COPY_SCALAR_FIELD(relid);
    1567       735243 :     COPY_SCALAR_FIELD(inh);
    1568       735243 :     COPY_SCALAR_FIELD(requiredPerms);
    1569       735243 :     COPY_SCALAR_FIELD(checkAsUser);
    1570       735243 :     COPY_BITMAPSET_FIELD(selectedCols);
    1571       735243 :     COPY_BITMAPSET_FIELD(insertedCols);
    1572       735243 :     COPY_BITMAPSET_FIELD(updatedCols);
    1573              : 
    1574       735243 :     return newnode;
    1575              : }
    1576              : 
    1577              : static RangeTblFunction *
    1578        76857 : _copyRangeTblFunction(const RangeTblFunction *from)
    1579              : {
    1580        76857 :     RangeTblFunction *newnode = makeNode(RangeTblFunction);
    1581              : 
    1582        76857 :     COPY_NODE_FIELD(funcexpr);
    1583        76857 :     COPY_SCALAR_FIELD(funccolcount);
    1584        76857 :     COPY_NODE_FIELD(funccolnames);
    1585        76857 :     COPY_NODE_FIELD(funccoltypes);
    1586        76857 :     COPY_NODE_FIELD(funccoltypmods);
    1587        76857 :     COPY_NODE_FIELD(funccolcollations);
    1588        76857 :     COPY_BITMAPSET_FIELD(funcparams);
    1589              : 
    1590        76857 :     return newnode;
    1591              : }
    1592              : 
    1593              : static TableSampleClause *
    1594          369 : _copyTableSampleClause(const TableSampleClause *from)
    1595              : {
    1596          369 :     TableSampleClause *newnode = makeNode(TableSampleClause);
    1597              : 
    1598          369 :     COPY_SCALAR_FIELD(tsmhandler);
    1599          369 :     COPY_NODE_FIELD(args);
    1600          369 :     COPY_NODE_FIELD(repeatable);
    1601              : 
    1602          369 :     return newnode;
    1603              : }
    1604              : 
    1605              : static WithCheckOption *
    1606         3102 : _copyWithCheckOption(const WithCheckOption *from)
    1607              : {
    1608         3102 :     WithCheckOption *newnode = makeNode(WithCheckOption);
    1609              : 
    1610         3102 :     COPY_SCALAR_FIELD(kind);
    1611         3102 :     COPY_STRING_FIELD(relname);
    1612         3102 :     COPY_STRING_FIELD(polname);
    1613         3102 :     COPY_NODE_FIELD(qual);
    1614         3102 :     COPY_SCALAR_FIELD(cascaded);
    1615              : 
    1616         3102 :     return newnode;
    1617              : }
    1618              : 
    1619              : static SortGroupClause *
    1620       142899 : _copySortGroupClause(const SortGroupClause *from)
    1621              : {
    1622       142899 :     SortGroupClause *newnode = makeNode(SortGroupClause);
    1623              : 
    1624       142899 :     COPY_SCALAR_FIELD(tleSortGroupRef);
    1625       142899 :     COPY_SCALAR_FIELD(eqop);
    1626       142899 :     COPY_SCALAR_FIELD(sortop);
    1627       142899 :     COPY_SCALAR_FIELD(reverse_sort);
    1628       142899 :     COPY_SCALAR_FIELD(nulls_first);
    1629       142899 :     COPY_SCALAR_FIELD(hashable);
    1630              : 
    1631       142899 :     return newnode;
    1632              : }
    1633              : 
    1634              : static GroupingSet *
    1635         2634 : _copyGroupingSet(const GroupingSet *from)
    1636              : {
    1637         2634 :     GroupingSet *newnode = makeNode(GroupingSet);
    1638              : 
    1639         2634 :     COPY_SCALAR_FIELD(kind);
    1640         2634 :     COPY_NODE_FIELD(content);
    1641         2634 :     COPY_LOCATION_FIELD(location);
    1642              : 
    1643         2634 :     return newnode;
    1644              : }
    1645              : 
    1646              : static WindowClause *
    1647         2048 : _copyWindowClause(const WindowClause *from)
    1648              : {
    1649         2048 :     WindowClause *newnode = makeNode(WindowClause);
    1650              : 
    1651         2048 :     COPY_STRING_FIELD(name);
    1652         2048 :     COPY_STRING_FIELD(refname);
    1653         2048 :     COPY_NODE_FIELD(partitionClause);
    1654         2048 :     COPY_NODE_FIELD(orderClause);
    1655         2048 :     COPY_SCALAR_FIELD(frameOptions);
    1656         2048 :     COPY_NODE_FIELD(startOffset);
    1657         2048 :     COPY_NODE_FIELD(endOffset);
    1658         2048 :     COPY_SCALAR_FIELD(startInRangeFunc);
    1659         2048 :     COPY_SCALAR_FIELD(endInRangeFunc);
    1660         2048 :     COPY_SCALAR_FIELD(inRangeColl);
    1661         2048 :     COPY_SCALAR_FIELD(inRangeAsc);
    1662         2048 :     COPY_SCALAR_FIELD(inRangeNullsFirst);
    1663         2048 :     COPY_SCALAR_FIELD(winref);
    1664         2048 :     COPY_SCALAR_FIELD(copiedOrder);
    1665              : 
    1666         2048 :     return newnode;
    1667              : }
    1668              : 
    1669              : static RowMarkClause *
    1670        13768 : _copyRowMarkClause(const RowMarkClause *from)
    1671              : {
    1672        13768 :     RowMarkClause *newnode = makeNode(RowMarkClause);
    1673              : 
    1674        13768 :     COPY_SCALAR_FIELD(rti);
    1675        13768 :     COPY_SCALAR_FIELD(strength);
    1676        13768 :     COPY_SCALAR_FIELD(waitPolicy);
    1677        13768 :     COPY_SCALAR_FIELD(pushedDown);
    1678              : 
    1679        13768 :     return newnode;
    1680              : }
    1681              : 
    1682              : static WithClause *
    1683         1908 : _copyWithClause(const WithClause *from)
    1684              : {
    1685         1908 :     WithClause *newnode = makeNode(WithClause);
    1686              : 
    1687         1908 :     COPY_NODE_FIELD(ctes);
    1688         1908 :     COPY_SCALAR_FIELD(recursive);
    1689         1908 :     COPY_LOCATION_FIELD(location);
    1690              : 
    1691         1908 :     return newnode;
    1692              : }
    1693              : 
    1694              : static InferClause *
    1695         1068 : _copyInferClause(const InferClause *from)
    1696              : {
    1697         1068 :     InferClause *newnode = makeNode(InferClause);
    1698              : 
    1699         1068 :     COPY_NODE_FIELD(indexElems);
    1700         1068 :     COPY_NODE_FIELD(whereClause);
    1701         1068 :     COPY_STRING_FIELD(conname);
    1702         1068 :     COPY_LOCATION_FIELD(location);
    1703              : 
    1704         1068 :     return newnode;
    1705              : }
    1706              : 
    1707              : static OnConflictClause *
    1708         1200 : _copyOnConflictClause(const OnConflictClause *from)
    1709              : {
    1710         1200 :     OnConflictClause *newnode = makeNode(OnConflictClause);
    1711              : 
    1712         1200 :     COPY_SCALAR_FIELD(action);
    1713         1200 :     COPY_NODE_FIELD(infer);
    1714         1200 :     COPY_SCALAR_FIELD(lockStrength);
    1715         1200 :     COPY_NODE_FIELD(targetList);
    1716         1200 :     COPY_NODE_FIELD(whereClause);
    1717         1200 :     COPY_LOCATION_FIELD(location);
    1718              : 
    1719         1200 :     return newnode;
    1720              : }
    1721              : 
    1722              : static CTESearchClause *
    1723          153 : _copyCTESearchClause(const CTESearchClause *from)
    1724              : {
    1725          153 :     CTESearchClause *newnode = makeNode(CTESearchClause);
    1726              : 
    1727          153 :     COPY_NODE_FIELD(search_col_list);
    1728          153 :     COPY_SCALAR_FIELD(search_breadth_first);
    1729          153 :     COPY_STRING_FIELD(search_seq_column);
    1730          153 :     COPY_LOCATION_FIELD(location);
    1731              : 
    1732          153 :     return newnode;
    1733              : }
    1734              : 
    1735              : static CTECycleClause *
    1736          153 : _copyCTECycleClause(const CTECycleClause *from)
    1737              : {
    1738          153 :     CTECycleClause *newnode = makeNode(CTECycleClause);
    1739              : 
    1740          153 :     COPY_NODE_FIELD(cycle_col_list);
    1741          153 :     COPY_STRING_FIELD(cycle_mark_column);
    1742          153 :     COPY_NODE_FIELD(cycle_mark_value);
    1743          153 :     COPY_NODE_FIELD(cycle_mark_default);
    1744          153 :     COPY_STRING_FIELD(cycle_path_column);
    1745          153 :     COPY_LOCATION_FIELD(location);
    1746          153 :     COPY_SCALAR_FIELD(cycle_mark_type);
    1747          153 :     COPY_SCALAR_FIELD(cycle_mark_typmod);
    1748          153 :     COPY_SCALAR_FIELD(cycle_mark_collation);
    1749          153 :     COPY_SCALAR_FIELD(cycle_mark_neop);
    1750              : 
    1751          153 :     return newnode;
    1752              : }
    1753              : 
    1754              : static CommonTableExpr *
    1755         5783 : _copyCommonTableExpr(const CommonTableExpr *from)
    1756              : {
    1757         5783 :     CommonTableExpr *newnode = makeNode(CommonTableExpr);
    1758              : 
    1759         5783 :     COPY_STRING_FIELD(ctename);
    1760         5783 :     COPY_NODE_FIELD(aliascolnames);
    1761         5783 :     COPY_SCALAR_FIELD(ctematerialized);
    1762         5783 :     COPY_NODE_FIELD(ctequery);
    1763         5783 :     COPY_NODE_FIELD(search_clause);
    1764         5783 :     COPY_NODE_FIELD(cycle_clause);
    1765         5783 :     COPY_LOCATION_FIELD(location);
    1766         5783 :     COPY_SCALAR_FIELD(cterecursive);
    1767         5783 :     COPY_SCALAR_FIELD(cterefcount);
    1768         5783 :     COPY_NODE_FIELD(ctecolnames);
    1769         5783 :     COPY_NODE_FIELD(ctecoltypes);
    1770         5783 :     COPY_NODE_FIELD(ctecoltypmods);
    1771         5783 :     COPY_NODE_FIELD(ctecolcollations);
    1772              : 
    1773         5783 :     return newnode;
    1774              : }
    1775              : 
    1776              : static MergeWhenClause *
    1777         1756 : _copyMergeWhenClause(const MergeWhenClause *from)
    1778              : {
    1779         1756 :     MergeWhenClause *newnode = makeNode(MergeWhenClause);
    1780              : 
    1781         1756 :     COPY_SCALAR_FIELD(matchKind);
    1782         1756 :     COPY_SCALAR_FIELD(commandType);
    1783         1756 :     COPY_SCALAR_FIELD(override);
    1784         1756 :     COPY_NODE_FIELD(condition);
    1785         1756 :     COPY_NODE_FIELD(targetList);
    1786         1756 :     COPY_NODE_FIELD(values);
    1787              : 
    1788         1756 :     return newnode;
    1789              : }
    1790              : 
    1791              : static ReturningOption *
    1792           78 : _copyReturningOption(const ReturningOption *from)
    1793              : {
    1794           78 :     ReturningOption *newnode = makeNode(ReturningOption);
    1795              : 
    1796           78 :     COPY_SCALAR_FIELD(option);
    1797           78 :     COPY_STRING_FIELD(value);
    1798           78 :     COPY_LOCATION_FIELD(location);
    1799              : 
    1800           78 :     return newnode;
    1801              : }
    1802              : 
    1803              : static ReturningClause *
    1804         2113 : _copyReturningClause(const ReturningClause *from)
    1805              : {
    1806         2113 :     ReturningClause *newnode = makeNode(ReturningClause);
    1807              : 
    1808         2113 :     COPY_NODE_FIELD(options);
    1809         2113 :     COPY_NODE_FIELD(exprs);
    1810              : 
    1811         2113 :     return newnode;
    1812              : }
    1813              : 
    1814              : static TriggerTransition *
    1815          606 : _copyTriggerTransition(const TriggerTransition *from)
    1816              : {
    1817          606 :     TriggerTransition *newnode = makeNode(TriggerTransition);
    1818              : 
    1819          606 :     COPY_STRING_FIELD(name);
    1820          606 :     COPY_SCALAR_FIELD(isNew);
    1821          606 :     COPY_SCALAR_FIELD(isTable);
    1822              : 
    1823          606 :     return newnode;
    1824              : }
    1825              : 
    1826              : static JsonOutput *
    1827          800 : _copyJsonOutput(const JsonOutput *from)
    1828              : {
    1829          800 :     JsonOutput *newnode = makeNode(JsonOutput);
    1830              : 
    1831          800 :     COPY_NODE_FIELD(typeName);
    1832          800 :     COPY_NODE_FIELD(returning);
    1833              : 
    1834          800 :     return newnode;
    1835              : }
    1836              : 
    1837              : static JsonArgument *
    1838          315 : _copyJsonArgument(const JsonArgument *from)
    1839              : {
    1840          315 :     JsonArgument *newnode = makeNode(JsonArgument);
    1841              : 
    1842          315 :     COPY_NODE_FIELD(val);
    1843          315 :     COPY_STRING_FIELD(name);
    1844              : 
    1845          315 :     return newnode;
    1846              : }
    1847              : 
    1848              : static JsonFuncExpr *
    1849         1026 : _copyJsonFuncExpr(const JsonFuncExpr *from)
    1850              : {
    1851         1026 :     JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
    1852              : 
    1853         1026 :     COPY_SCALAR_FIELD(op);
    1854         1026 :     COPY_STRING_FIELD(column_name);
    1855         1026 :     COPY_NODE_FIELD(context_item);
    1856         1026 :     COPY_NODE_FIELD(pathspec);
    1857         1026 :     COPY_NODE_FIELD(passing);
    1858         1026 :     COPY_NODE_FIELD(output);
    1859         1026 :     COPY_NODE_FIELD(on_empty);
    1860         1026 :     COPY_NODE_FIELD(on_error);
    1861         1026 :     COPY_SCALAR_FIELD(wrapper);
    1862         1026 :     COPY_SCALAR_FIELD(quotes);
    1863         1026 :     COPY_LOCATION_FIELD(location);
    1864              : 
    1865         1026 :     return newnode;
    1866              : }
    1867              : 
    1868              : static JsonTablePathSpec *
    1869          992 : _copyJsonTablePathSpec(const JsonTablePathSpec *from)
    1870              : {
    1871          992 :     JsonTablePathSpec *newnode = makeNode(JsonTablePathSpec);
    1872              : 
    1873          992 :     COPY_NODE_FIELD(string);
    1874          992 :     COPY_STRING_FIELD(name);
    1875          992 :     COPY_LOCATION_FIELD(name_location);
    1876          992 :     COPY_LOCATION_FIELD(location);
    1877              : 
    1878          992 :     return newnode;
    1879              : }
    1880              : 
    1881              : static JsonTable *
    1882          301 : _copyJsonTable(const JsonTable *from)
    1883              : {
    1884          301 :     JsonTable *newnode = makeNode(JsonTable);
    1885              : 
    1886          301 :     COPY_NODE_FIELD(context_item);
    1887          301 :     COPY_NODE_FIELD(pathspec);
    1888          301 :     COPY_NODE_FIELD(passing);
    1889          301 :     COPY_NODE_FIELD(columns);
    1890          301 :     COPY_NODE_FIELD(on_error);
    1891          301 :     COPY_NODE_FIELD(alias);
    1892          301 :     COPY_SCALAR_FIELD(lateral);
    1893          301 :     COPY_LOCATION_FIELD(location);
    1894              : 
    1895          301 :     return newnode;
    1896              : }
    1897              : 
    1898              : static JsonTableColumn *
    1899          830 : _copyJsonTableColumn(const JsonTableColumn *from)
    1900              : {
    1901          830 :     JsonTableColumn *newnode = makeNode(JsonTableColumn);
    1902              : 
    1903          830 :     COPY_SCALAR_FIELD(coltype);
    1904          830 :     COPY_STRING_FIELD(name);
    1905          830 :     COPY_NODE_FIELD(typeName);
    1906          830 :     COPY_NODE_FIELD(pathspec);
    1907          830 :     COPY_NODE_FIELD(format);
    1908          830 :     COPY_SCALAR_FIELD(wrapper);
    1909          830 :     COPY_SCALAR_FIELD(quotes);
    1910          830 :     COPY_NODE_FIELD(columns);
    1911          830 :     COPY_NODE_FIELD(on_empty);
    1912          830 :     COPY_NODE_FIELD(on_error);
    1913          830 :     COPY_LOCATION_FIELD(location);
    1914              : 
    1915          830 :     return newnode;
    1916              : }
    1917              : 
    1918              : static JsonKeyValue *
    1919          437 : _copyJsonKeyValue(const JsonKeyValue *from)
    1920              : {
    1921          437 :     JsonKeyValue *newnode = makeNode(JsonKeyValue);
    1922              : 
    1923          437 :     COPY_NODE_FIELD(key);
    1924          437 :     COPY_NODE_FIELD(value);
    1925              : 
    1926          437 :     return newnode;
    1927              : }
    1928              : 
    1929              : static JsonParseExpr *
    1930           82 : _copyJsonParseExpr(const JsonParseExpr *from)
    1931              : {
    1932           82 :     JsonParseExpr *newnode = makeNode(JsonParseExpr);
    1933              : 
    1934           82 :     COPY_NODE_FIELD(expr);
    1935           82 :     COPY_NODE_FIELD(output);
    1936           82 :     COPY_SCALAR_FIELD(unique_keys);
    1937           82 :     COPY_LOCATION_FIELD(location);
    1938              : 
    1939           82 :     return newnode;
    1940              : }
    1941              : 
    1942              : static JsonScalarExpr *
    1943           56 : _copyJsonScalarExpr(const JsonScalarExpr *from)
    1944              : {
    1945           56 :     JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
    1946              : 
    1947           56 :     COPY_NODE_FIELD(expr);
    1948           56 :     COPY_NODE_FIELD(output);
    1949           56 :     COPY_LOCATION_FIELD(location);
    1950              : 
    1951           56 :     return newnode;
    1952              : }
    1953              : 
    1954              : static JsonSerializeExpr *
    1955           54 : _copyJsonSerializeExpr(const JsonSerializeExpr *from)
    1956              : {
    1957           54 :     JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
    1958              : 
    1959           54 :     COPY_NODE_FIELD(expr);
    1960           54 :     COPY_NODE_FIELD(output);
    1961           54 :     COPY_LOCATION_FIELD(location);
    1962              : 
    1963           54 :     return newnode;
    1964              : }
    1965              : 
    1966              : static JsonObjectConstructor *
    1967          229 : _copyJsonObjectConstructor(const JsonObjectConstructor *from)
    1968              : {
    1969          229 :     JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
    1970              : 
    1971          229 :     COPY_NODE_FIELD(exprs);
    1972          229 :     COPY_NODE_FIELD(output);
    1973          229 :     COPY_SCALAR_FIELD(absent_on_null);
    1974          229 :     COPY_SCALAR_FIELD(unique);
    1975          229 :     COPY_LOCATION_FIELD(location);
    1976              : 
    1977          229 :     return newnode;
    1978              : }
    1979              : 
    1980              : static JsonArrayConstructor *
    1981          112 : _copyJsonArrayConstructor(const JsonArrayConstructor *from)
    1982              : {
    1983          112 :     JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
    1984              : 
    1985          112 :     COPY_NODE_FIELD(exprs);
    1986          112 :     COPY_NODE_FIELD(output);
    1987          112 :     COPY_SCALAR_FIELD(absent_on_null);
    1988          112 :     COPY_LOCATION_FIELD(location);
    1989              : 
    1990          112 :     return newnode;
    1991              : }
    1992              : 
    1993              : static JsonArrayQueryConstructor *
    1994           33 : _copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
    1995              : {
    1996           33 :     JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
    1997              : 
    1998           33 :     COPY_NODE_FIELD(query);
    1999           33 :     COPY_NODE_FIELD(output);
    2000           33 :     COPY_NODE_FIELD(format);
    2001           33 :     COPY_SCALAR_FIELD(absent_on_null);
    2002           33 :     COPY_LOCATION_FIELD(location);
    2003              : 
    2004           33 :     return newnode;
    2005              : }
    2006              : 
    2007              : static JsonAggConstructor *
    2008          204 : _copyJsonAggConstructor(const JsonAggConstructor *from)
    2009              : {
    2010          204 :     JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
    2011              : 
    2012          204 :     COPY_NODE_FIELD(output);
    2013          204 :     COPY_NODE_FIELD(agg_filter);
    2014          204 :     COPY_NODE_FIELD(agg_order);
    2015          204 :     COPY_NODE_FIELD(over);
    2016          204 :     COPY_LOCATION_FIELD(location);
    2017              : 
    2018          204 :     return newnode;
    2019              : }
    2020              : 
    2021              : static JsonObjectAgg *
    2022          123 : _copyJsonObjectAgg(const JsonObjectAgg *from)
    2023              : {
    2024          123 :     JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
    2025              : 
    2026          123 :     COPY_NODE_FIELD(constructor);
    2027          123 :     COPY_NODE_FIELD(arg);
    2028          123 :     COPY_SCALAR_FIELD(absent_on_null);
    2029          123 :     COPY_SCALAR_FIELD(unique);
    2030              : 
    2031          123 :     return newnode;
    2032              : }
    2033              : 
    2034              : static JsonArrayAgg *
    2035           81 : _copyJsonArrayAgg(const JsonArrayAgg *from)
    2036              : {
    2037           81 :     JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
    2038              : 
    2039           81 :     COPY_NODE_FIELD(constructor);
    2040           81 :     COPY_NODE_FIELD(arg);
    2041           81 :     COPY_SCALAR_FIELD(absent_on_null);
    2042              : 
    2043           81 :     return newnode;
    2044              : }
    2045              : 
    2046              : static RawStmt *
    2047       424544 : _copyRawStmt(const RawStmt *from)
    2048              : {
    2049       424544 :     RawStmt *newnode = makeNode(RawStmt);
    2050              : 
    2051       424544 :     COPY_NODE_FIELD(stmt);
    2052       424544 :     COPY_LOCATION_FIELD(stmt_location);
    2053       424544 :     COPY_LOCATION_FIELD(stmt_len);
    2054              : 
    2055       424544 :     return newnode;
    2056              : }
    2057              : 
    2058              : static InsertStmt *
    2059        41383 : _copyInsertStmt(const InsertStmt *from)
    2060              : {
    2061        41383 :     InsertStmt *newnode = makeNode(InsertStmt);
    2062              : 
    2063        41383 :     COPY_NODE_FIELD(relation);
    2064        41383 :     COPY_NODE_FIELD(cols);
    2065        41383 :     COPY_NODE_FIELD(selectStmt);
    2066        41383 :     COPY_NODE_FIELD(onConflictClause);
    2067        41383 :     COPY_NODE_FIELD(returningClause);
    2068        41383 :     COPY_NODE_FIELD(withClause);
    2069        41383 :     COPY_SCALAR_FIELD(override);
    2070              : 
    2071        41383 :     return newnode;
    2072              : }
    2073              : 
    2074              : static DeleteStmt *
    2075         2423 : _copyDeleteStmt(const DeleteStmt *from)
    2076              : {
    2077         2423 :     DeleteStmt *newnode = makeNode(DeleteStmt);
    2078              : 
    2079         2423 :     COPY_NODE_FIELD(relation);
    2080         2423 :     COPY_NODE_FIELD(usingClause);
    2081         2423 :     COPY_NODE_FIELD(whereClause);
    2082         2423 :     COPY_NODE_FIELD(returningClause);
    2083         2423 :     COPY_NODE_FIELD(withClause);
    2084              : 
    2085         2423 :     return newnode;
    2086              : }
    2087              : 
    2088              : static UpdateStmt *
    2089         7701 : _copyUpdateStmt(const UpdateStmt *from)
    2090              : {
    2091         7701 :     UpdateStmt *newnode = makeNode(UpdateStmt);
    2092              : 
    2093         7701 :     COPY_NODE_FIELD(relation);
    2094         7701 :     COPY_NODE_FIELD(targetList);
    2095         7701 :     COPY_NODE_FIELD(whereClause);
    2096         7701 :     COPY_NODE_FIELD(fromClause);
    2097         7701 :     COPY_NODE_FIELD(returningClause);
    2098         7701 :     COPY_NODE_FIELD(withClause);
    2099              : 
    2100         7701 :     return newnode;
    2101              : }
    2102              : 
    2103              : static MergeStmt *
    2104         1108 : _copyMergeStmt(const MergeStmt *from)
    2105              : {
    2106         1108 :     MergeStmt *newnode = makeNode(MergeStmt);
    2107              : 
    2108         1108 :     COPY_NODE_FIELD(relation);
    2109         1108 :     COPY_NODE_FIELD(sourceRelation);
    2110         1108 :     COPY_NODE_FIELD(joinCondition);
    2111         1108 :     COPY_NODE_FIELD(mergeWhenClauses);
    2112         1108 :     COPY_NODE_FIELD(returningClause);
    2113         1108 :     COPY_NODE_FIELD(withClause);
    2114              : 
    2115         1108 :     return newnode;
    2116              : }
    2117              : 
    2118              : static SelectStmt *
    2119       317577 : _copySelectStmt(const SelectStmt *from)
    2120              : {
    2121       317577 :     SelectStmt *newnode = makeNode(SelectStmt);
    2122              : 
    2123       317577 :     COPY_NODE_FIELD(distinctClause);
    2124       317577 :     COPY_NODE_FIELD(intoClause);
    2125       317577 :     COPY_NODE_FIELD(targetList);
    2126       317577 :     COPY_NODE_FIELD(fromClause);
    2127       317577 :     COPY_NODE_FIELD(whereClause);
    2128       317577 :     COPY_NODE_FIELD(groupClause);
    2129       317577 :     COPY_SCALAR_FIELD(groupDistinct);
    2130       317577 :     COPY_SCALAR_FIELD(groupByAll);
    2131       317577 :     COPY_NODE_FIELD(havingClause);
    2132       317577 :     COPY_NODE_FIELD(windowClause);
    2133       317577 :     COPY_NODE_FIELD(valuesLists);
    2134       317577 :     COPY_NODE_FIELD(sortClause);
    2135       317577 :     COPY_NODE_FIELD(limitOffset);
    2136       317577 :     COPY_NODE_FIELD(limitCount);
    2137       317577 :     COPY_SCALAR_FIELD(limitOption);
    2138       317577 :     COPY_NODE_FIELD(lockingClause);
    2139       317577 :     COPY_NODE_FIELD(withClause);
    2140       317577 :     COPY_SCALAR_FIELD(op);
    2141       317577 :     COPY_SCALAR_FIELD(all);
    2142       317577 :     COPY_NODE_FIELD(larg);
    2143       317577 :     COPY_NODE_FIELD(rarg);
    2144              : 
    2145       317577 :     return newnode;
    2146              : }
    2147              : 
    2148              : static SetOperationStmt *
    2149        18041 : _copySetOperationStmt(const SetOperationStmt *from)
    2150              : {
    2151        18041 :     SetOperationStmt *newnode = makeNode(SetOperationStmt);
    2152              : 
    2153        18041 :     COPY_SCALAR_FIELD(op);
    2154        18041 :     COPY_SCALAR_FIELD(all);
    2155        18041 :     COPY_NODE_FIELD(larg);
    2156        18041 :     COPY_NODE_FIELD(rarg);
    2157        18041 :     COPY_NODE_FIELD(colTypes);
    2158        18041 :     COPY_NODE_FIELD(colTypmods);
    2159        18041 :     COPY_NODE_FIELD(colCollations);
    2160        18041 :     COPY_NODE_FIELD(groupClauses);
    2161              : 
    2162        18041 :     return newnode;
    2163              : }
    2164              : 
    2165              : static ReturnStmt *
    2166         4982 : _copyReturnStmt(const ReturnStmt *from)
    2167              : {
    2168         4982 :     ReturnStmt *newnode = makeNode(ReturnStmt);
    2169              : 
    2170         4982 :     COPY_NODE_FIELD(returnval);
    2171              : 
    2172         4982 :     return newnode;
    2173              : }
    2174              : 
    2175              : static PLAssignStmt *
    2176         2788 : _copyPLAssignStmt(const PLAssignStmt *from)
    2177              : {
    2178         2788 :     PLAssignStmt *newnode = makeNode(PLAssignStmt);
    2179              : 
    2180         2788 :     COPY_STRING_FIELD(name);
    2181         2788 :     COPY_NODE_FIELD(indirection);
    2182         2788 :     COPY_SCALAR_FIELD(nnames);
    2183         2788 :     COPY_NODE_FIELD(val);
    2184         2788 :     COPY_LOCATION_FIELD(location);
    2185              : 
    2186         2788 :     return newnode;
    2187              : }
    2188              : 
    2189              : static CreateSchemaStmt *
    2190         1149 : _copyCreateSchemaStmt(const CreateSchemaStmt *from)
    2191              : {
    2192         1149 :     CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
    2193              : 
    2194         1149 :     COPY_STRING_FIELD(schemaname);
    2195         1149 :     COPY_NODE_FIELD(authrole);
    2196         1149 :     COPY_NODE_FIELD(schemaElts);
    2197         1149 :     COPY_SCALAR_FIELD(if_not_exists);
    2198              : 
    2199         1149 :     return newnode;
    2200              : }
    2201              : 
    2202              : static AlterTableStmt *
    2203        32637 : _copyAlterTableStmt(const AlterTableStmt *from)
    2204              : {
    2205        32637 :     AlterTableStmt *newnode = makeNode(AlterTableStmt);
    2206              : 
    2207        32637 :     COPY_NODE_FIELD(relation);
    2208        32637 :     COPY_NODE_FIELD(cmds);
    2209        32637 :     COPY_SCALAR_FIELD(objtype);
    2210        32637 :     COPY_SCALAR_FIELD(missing_ok);
    2211              : 
    2212        32637 :     return newnode;
    2213              : }
    2214              : 
    2215              : static AlterTableCmd *
    2216        53603 : _copyAlterTableCmd(const AlterTableCmd *from)
    2217              : {
    2218        53603 :     AlterTableCmd *newnode = makeNode(AlterTableCmd);
    2219              : 
    2220        53603 :     COPY_SCALAR_FIELD(subtype);
    2221        53603 :     COPY_STRING_FIELD(name);
    2222        53603 :     COPY_SCALAR_FIELD(num);
    2223        53603 :     COPY_NODE_FIELD(newowner);
    2224        53603 :     COPY_NODE_FIELD(def);
    2225        53603 :     COPY_SCALAR_FIELD(behavior);
    2226        53603 :     COPY_SCALAR_FIELD(missing_ok);
    2227        53603 :     COPY_SCALAR_FIELD(recurse);
    2228              : 
    2229        53603 :     return newnode;
    2230              : }
    2231              : 
    2232              : static ATAlterConstraint *
    2233          450 : _copyATAlterConstraint(const ATAlterConstraint *from)
    2234              : {
    2235          450 :     ATAlterConstraint *newnode = makeNode(ATAlterConstraint);
    2236              : 
    2237          450 :     COPY_STRING_FIELD(conname);
    2238          450 :     COPY_SCALAR_FIELD(alterEnforceability);
    2239          450 :     COPY_SCALAR_FIELD(is_enforced);
    2240          450 :     COPY_SCALAR_FIELD(alterDeferrability);
    2241          450 :     COPY_SCALAR_FIELD(deferrable);
    2242          450 :     COPY_SCALAR_FIELD(initdeferred);
    2243          450 :     COPY_SCALAR_FIELD(alterInheritability);
    2244          450 :     COPY_SCALAR_FIELD(noinherit);
    2245              : 
    2246          450 :     return newnode;
    2247              : }
    2248              : 
    2249              : static ReplicaIdentityStmt *
    2250          741 : _copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
    2251              : {
    2252          741 :     ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
    2253              : 
    2254          741 :     COPY_SCALAR_FIELD(identity_type);
    2255          741 :     COPY_STRING_FIELD(name);
    2256              : 
    2257          741 :     return newnode;
    2258              : }
    2259              : 
    2260              : static AlterCollationStmt *
    2261            6 : _copyAlterCollationStmt(const AlterCollationStmt *from)
    2262              : {
    2263            6 :     AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
    2264              : 
    2265            6 :     COPY_NODE_FIELD(collname);
    2266              : 
    2267            6 :     return newnode;
    2268              : }
    2269              : 
    2270              : static AlterDomainStmt *
    2271          292 : _copyAlterDomainStmt(const AlterDomainStmt *from)
    2272              : {
    2273          292 :     AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
    2274              : 
    2275          292 :     COPY_SCALAR_FIELD(subtype);
    2276          292 :     COPY_NODE_FIELD(typeName);
    2277          292 :     COPY_STRING_FIELD(name);
    2278          292 :     COPY_NODE_FIELD(def);
    2279          292 :     COPY_SCALAR_FIELD(behavior);
    2280          292 :     COPY_SCALAR_FIELD(missing_ok);
    2281              : 
    2282          292 :     return newnode;
    2283              : }
    2284              : 
    2285              : static GrantStmt *
    2286        19880 : _copyGrantStmt(const GrantStmt *from)
    2287              : {
    2288        19880 :     GrantStmt *newnode = makeNode(GrantStmt);
    2289              : 
    2290        19880 :     COPY_SCALAR_FIELD(is_grant);
    2291        19880 :     COPY_SCALAR_FIELD(targtype);
    2292        19880 :     COPY_SCALAR_FIELD(objtype);
    2293        19880 :     COPY_NODE_FIELD(objects);
    2294        19880 :     COPY_NODE_FIELD(privileges);
    2295        19880 :     COPY_NODE_FIELD(grantees);
    2296        19880 :     COPY_SCALAR_FIELD(grant_option);
    2297        19880 :     COPY_NODE_FIELD(grantor);
    2298        19880 :     COPY_SCALAR_FIELD(behavior);
    2299              : 
    2300        19880 :     return newnode;
    2301              : }
    2302              : 
    2303              : static ObjectWithArgs *
    2304        14331 : _copyObjectWithArgs(const ObjectWithArgs *from)
    2305              : {
    2306        14331 :     ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
    2307              : 
    2308        14331 :     COPY_NODE_FIELD(objname);
    2309        14331 :     COPY_NODE_FIELD(objargs);
    2310        14331 :     COPY_NODE_FIELD(objfuncargs);
    2311        14331 :     COPY_SCALAR_FIELD(args_unspecified);
    2312              : 
    2313        14331 :     return newnode;
    2314              : }
    2315              : 
    2316              : static AccessPriv *
    2317        18272 : _copyAccessPriv(const AccessPriv *from)
    2318              : {
    2319        18272 :     AccessPriv *newnode = makeNode(AccessPriv);
    2320              : 
    2321        18272 :     COPY_STRING_FIELD(priv_name);
    2322        18272 :     COPY_NODE_FIELD(cols);
    2323              : 
    2324        18272 :     return newnode;
    2325              : }
    2326              : 
    2327              : static GrantRoleStmt *
    2328          707 : _copyGrantRoleStmt(const GrantRoleStmt *from)
    2329              : {
    2330          707 :     GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
    2331              : 
    2332          707 :     COPY_NODE_FIELD(granted_roles);
    2333          707 :     COPY_NODE_FIELD(grantee_roles);
    2334          707 :     COPY_SCALAR_FIELD(is_grant);
    2335          707 :     COPY_NODE_FIELD(opt);
    2336          707 :     COPY_NODE_FIELD(grantor);
    2337          707 :     COPY_SCALAR_FIELD(behavior);
    2338              : 
    2339          707 :     return newnode;
    2340              : }
    2341              : 
    2342              : static AlterDefaultPrivilegesStmt *
    2343          210 : _copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
    2344              : {
    2345          210 :     AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
    2346              : 
    2347          210 :     COPY_NODE_FIELD(options);
    2348          210 :     COPY_NODE_FIELD(action);
    2349              : 
    2350          210 :     return newnode;
    2351              : }
    2352              : 
    2353              : static CopyStmt *
    2354        11865 : _copyCopyStmt(const CopyStmt *from)
    2355              : {
    2356        11865 :     CopyStmt *newnode = makeNode(CopyStmt);
    2357              : 
    2358        11865 :     COPY_NODE_FIELD(relation);
    2359        11865 :     COPY_NODE_FIELD(query);
    2360        11865 :     COPY_NODE_FIELD(attlist);
    2361        11865 :     COPY_SCALAR_FIELD(is_from);
    2362        11865 :     COPY_SCALAR_FIELD(is_program);
    2363        11865 :     COPY_STRING_FIELD(filename);
    2364        11865 :     COPY_NODE_FIELD(options);
    2365        11865 :     COPY_NODE_FIELD(whereClause);
    2366              : 
    2367        11865 :     return newnode;
    2368              : }
    2369              : 
    2370              : static VariableSetStmt *
    2371        38233 : _copyVariableSetStmt(const VariableSetStmt *from)
    2372              : {
    2373        38233 :     VariableSetStmt *newnode = makeNode(VariableSetStmt);
    2374              : 
    2375        38233 :     COPY_SCALAR_FIELD(kind);
    2376        38233 :     COPY_STRING_FIELD(name);
    2377        38233 :     COPY_NODE_FIELD(args);
    2378        38233 :     COPY_SCALAR_FIELD(jumble_args);
    2379        38233 :     COPY_SCALAR_FIELD(is_local);
    2380        38233 :     COPY_LOCATION_FIELD(location);
    2381              : 
    2382        38233 :     return newnode;
    2383              : }
    2384              : 
    2385              : static VariableShowStmt *
    2386          960 : _copyVariableShowStmt(const VariableShowStmt *from)
    2387              : {
    2388          960 :     VariableShowStmt *newnode = makeNode(VariableShowStmt);
    2389              : 
    2390          960 :     COPY_STRING_FIELD(name);
    2391              : 
    2392          960 :     return newnode;
    2393              : }
    2394              : 
    2395              : static CreateStmt *
    2396        40697 : _copyCreateStmt(const CreateStmt *from)
    2397              : {
    2398        40697 :     CreateStmt *newnode = makeNode(CreateStmt);
    2399              : 
    2400        40697 :     COPY_NODE_FIELD(relation);
    2401        40697 :     COPY_NODE_FIELD(tableElts);
    2402        40697 :     COPY_NODE_FIELD(inhRelations);
    2403        40697 :     COPY_NODE_FIELD(partbound);
    2404        40697 :     COPY_NODE_FIELD(partspec);
    2405        40697 :     COPY_NODE_FIELD(ofTypename);
    2406        40697 :     COPY_NODE_FIELD(constraints);
    2407        40697 :     COPY_NODE_FIELD(nnconstraints);
    2408        40697 :     COPY_NODE_FIELD(options);
    2409        40697 :     COPY_SCALAR_FIELD(oncommit);
    2410        40697 :     COPY_STRING_FIELD(tablespacename);
    2411        40697 :     COPY_STRING_FIELD(accessMethod);
    2412        40697 :     COPY_SCALAR_FIELD(if_not_exists);
    2413              : 
    2414        40697 :     return newnode;
    2415              : }
    2416              : 
    2417              : static Constraint *
    2418        52634 : _copyConstraint(const Constraint *from)
    2419              : {
    2420        52634 :     Constraint *newnode = makeNode(Constraint);
    2421              : 
    2422        52634 :     COPY_SCALAR_FIELD(contype);
    2423        52634 :     COPY_STRING_FIELD(conname);
    2424        52634 :     COPY_SCALAR_FIELD(deferrable);
    2425        52634 :     COPY_SCALAR_FIELD(initdeferred);
    2426        52634 :     COPY_SCALAR_FIELD(is_enforced);
    2427        52634 :     COPY_SCALAR_FIELD(skip_validation);
    2428        52634 :     COPY_SCALAR_FIELD(initially_valid);
    2429        52634 :     COPY_SCALAR_FIELD(is_no_inherit);
    2430        52634 :     COPY_NODE_FIELD(raw_expr);
    2431        52634 :     COPY_STRING_FIELD(cooked_expr);
    2432        52634 :     COPY_SCALAR_FIELD(generated_when);
    2433        52634 :     COPY_SCALAR_FIELD(generated_kind);
    2434        52634 :     COPY_SCALAR_FIELD(nulls_not_distinct);
    2435        52634 :     COPY_NODE_FIELD(keys);
    2436        52634 :     COPY_SCALAR_FIELD(without_overlaps);
    2437        52634 :     COPY_NODE_FIELD(including);
    2438        52634 :     COPY_NODE_FIELD(exclusions);
    2439        52634 :     COPY_NODE_FIELD(options);
    2440        52634 :     COPY_STRING_FIELD(indexname);
    2441        52634 :     COPY_STRING_FIELD(indexspace);
    2442        52634 :     COPY_SCALAR_FIELD(reset_default_tblspc);
    2443        52634 :     COPY_STRING_FIELD(access_method);
    2444        52634 :     COPY_NODE_FIELD(where_clause);
    2445        52634 :     COPY_NODE_FIELD(pktable);
    2446        52634 :     COPY_NODE_FIELD(fk_attrs);
    2447        52634 :     COPY_NODE_FIELD(pk_attrs);
    2448        52634 :     COPY_SCALAR_FIELD(fk_with_period);
    2449        52634 :     COPY_SCALAR_FIELD(pk_with_period);
    2450        52634 :     COPY_SCALAR_FIELD(fk_matchtype);
    2451        52634 :     COPY_SCALAR_FIELD(fk_upd_action);
    2452        52634 :     COPY_SCALAR_FIELD(fk_del_action);
    2453        52634 :     COPY_NODE_FIELD(fk_del_set_cols);
    2454        52634 :     COPY_NODE_FIELD(old_conpfeqop);
    2455        52634 :     COPY_SCALAR_FIELD(old_pktable_oid);
    2456        52634 :     COPY_LOCATION_FIELD(location);
    2457              : 
    2458        52634 :     return newnode;
    2459              : }
    2460              : 
    2461              : static CreateTableSpaceStmt *
    2462          138 : _copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
    2463              : {
    2464          138 :     CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
    2465              : 
    2466          138 :     COPY_STRING_FIELD(tablespacename);
    2467          138 :     COPY_NODE_FIELD(owner);
    2468          138 :     COPY_STRING_FIELD(location);
    2469          138 :     COPY_NODE_FIELD(options);
    2470              : 
    2471          138 :     return newnode;
    2472              : }
    2473              : 
    2474              : static DropTableSpaceStmt *
    2475           64 : _copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
    2476              : {
    2477           64 :     DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
    2478              : 
    2479           64 :     COPY_STRING_FIELD(tablespacename);
    2480           64 :     COPY_SCALAR_FIELD(missing_ok);
    2481              : 
    2482           64 :     return newnode;
    2483              : }
    2484              : 
    2485              : static AlterTableSpaceOptionsStmt *
    2486           24 : _copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
    2487              : {
    2488           24 :     AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
    2489              : 
    2490           24 :     COPY_STRING_FIELD(tablespacename);
    2491           24 :     COPY_NODE_FIELD(options);
    2492           24 :     COPY_SCALAR_FIELD(isReset);
    2493              : 
    2494           24 :     return newnode;
    2495              : }
    2496              : 
    2497              : static AlterTableMoveAllStmt *
    2498           60 : _copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
    2499              : {
    2500           60 :     AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
    2501              : 
    2502           60 :     COPY_STRING_FIELD(orig_tablespacename);
    2503           60 :     COPY_SCALAR_FIELD(objtype);
    2504           60 :     COPY_NODE_FIELD(roles);
    2505           60 :     COPY_STRING_FIELD(new_tablespacename);
    2506           60 :     COPY_SCALAR_FIELD(nowait);
    2507              : 
    2508           60 :     return newnode;
    2509              : }
    2510              : 
    2511              : static CreateExtensionStmt *
    2512          591 : _copyCreateExtensionStmt(const CreateExtensionStmt *from)
    2513              : {
    2514          591 :     CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
    2515              : 
    2516          591 :     COPY_STRING_FIELD(extname);
    2517          591 :     COPY_SCALAR_FIELD(if_not_exists);
    2518          591 :     COPY_NODE_FIELD(options);
    2519              : 
    2520          591 :     return newnode;
    2521              : }
    2522              : 
    2523              : static AlterExtensionStmt *
    2524           43 : _copyAlterExtensionStmt(const AlterExtensionStmt *from)
    2525              : {
    2526           43 :     AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
    2527              : 
    2528           43 :     COPY_STRING_FIELD(extname);
    2529           43 :     COPY_NODE_FIELD(options);
    2530              : 
    2531           43 :     return newnode;
    2532              : }
    2533              : 
    2534              : static AlterExtensionContentsStmt *
    2535          267 : _copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
    2536              : {
    2537          267 :     AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
    2538              : 
    2539          267 :     COPY_STRING_FIELD(extname);
    2540          267 :     COPY_SCALAR_FIELD(action);
    2541          267 :     COPY_SCALAR_FIELD(objtype);
    2542          267 :     COPY_NODE_FIELD(object);
    2543              : 
    2544          267 :     return newnode;
    2545              : }
    2546              : 
    2547              : static CreateFdwStmt *
    2548          220 : _copyCreateFdwStmt(const CreateFdwStmt *from)
    2549              : {
    2550          220 :     CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
    2551              : 
    2552          220 :     COPY_STRING_FIELD(fdwname);
    2553          220 :     COPY_NODE_FIELD(func_options);
    2554          220 :     COPY_NODE_FIELD(options);
    2555              : 
    2556          220 :     return newnode;
    2557              : }
    2558              : 
    2559              : static AlterFdwStmt *
    2560          136 : _copyAlterFdwStmt(const AlterFdwStmt *from)
    2561              : {
    2562          136 :     AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
    2563              : 
    2564          136 :     COPY_STRING_FIELD(fdwname);
    2565          136 :     COPY_NODE_FIELD(func_options);
    2566          136 :     COPY_NODE_FIELD(options);
    2567              : 
    2568          136 :     return newnode;
    2569              : }
    2570              : 
    2571              : static CreateForeignServerStmt *
    2572          316 : _copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
    2573              : {
    2574          316 :     CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
    2575              : 
    2576          316 :     COPY_STRING_FIELD(servername);
    2577          316 :     COPY_STRING_FIELD(servertype);
    2578          316 :     COPY_STRING_FIELD(version);
    2579          316 :     COPY_STRING_FIELD(fdwname);
    2580          316 :     COPY_SCALAR_FIELD(if_not_exists);
    2581          316 :     COPY_NODE_FIELD(options);
    2582              : 
    2583          316 :     return newnode;
    2584              : }
    2585              : 
    2586              : static AlterForeignServerStmt *
    2587          232 : _copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
    2588              : {
    2589          232 :     AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
    2590              : 
    2591          232 :     COPY_STRING_FIELD(servername);
    2592          232 :     COPY_STRING_FIELD(version);
    2593          232 :     COPY_NODE_FIELD(options);
    2594          232 :     COPY_SCALAR_FIELD(has_version);
    2595              : 
    2596          232 :     return newnode;
    2597              : }
    2598              : 
    2599              : static CreateForeignTableStmt *
    2600          493 : _copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
    2601              : {
    2602          493 :     CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
    2603              : 
    2604          493 :     COPY_NODE_FIELD(base.relation);
    2605          493 :     COPY_NODE_FIELD(base.tableElts);
    2606          493 :     COPY_NODE_FIELD(base.inhRelations);
    2607          493 :     COPY_NODE_FIELD(base.partbound);
    2608          493 :     COPY_NODE_FIELD(base.partspec);
    2609          493 :     COPY_NODE_FIELD(base.ofTypename);
    2610          493 :     COPY_NODE_FIELD(base.constraints);
    2611          493 :     COPY_NODE_FIELD(base.nnconstraints);
    2612          493 :     COPY_NODE_FIELD(base.options);
    2613          493 :     COPY_SCALAR_FIELD(base.oncommit);
    2614          493 :     COPY_STRING_FIELD(base.tablespacename);
    2615          493 :     COPY_STRING_FIELD(base.accessMethod);
    2616          493 :     COPY_SCALAR_FIELD(base.if_not_exists);
    2617          493 :     COPY_STRING_FIELD(servername);
    2618          493 :     COPY_NODE_FIELD(options);
    2619              : 
    2620          493 :     return newnode;
    2621              : }
    2622              : 
    2623              : static CreateUserMappingStmt *
    2624          271 : _copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
    2625              : {
    2626          271 :     CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
    2627              : 
    2628          271 :     COPY_NODE_FIELD(user);
    2629          271 :     COPY_STRING_FIELD(servername);
    2630          271 :     COPY_SCALAR_FIELD(if_not_exists);
    2631          271 :     COPY_NODE_FIELD(options);
    2632              : 
    2633          271 :     return newnode;
    2634              : }
    2635              : 
    2636              : static AlterUserMappingStmt *
    2637          118 : _copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
    2638              : {
    2639          118 :     AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
    2640              : 
    2641          118 :     COPY_NODE_FIELD(user);
    2642          118 :     COPY_STRING_FIELD(servername);
    2643          118 :     COPY_NODE_FIELD(options);
    2644              : 
    2645          118 :     return newnode;
    2646              : }
    2647              : 
    2648              : static DropUserMappingStmt *
    2649          132 : _copyDropUserMappingStmt(const DropUserMappingStmt *from)
    2650              : {
    2651          132 :     DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
    2652              : 
    2653          132 :     COPY_NODE_FIELD(user);
    2654          132 :     COPY_STRING_FIELD(servername);
    2655          132 :     COPY_SCALAR_FIELD(missing_ok);
    2656              : 
    2657          132 :     return newnode;
    2658              : }
    2659              : 
    2660              : static ImportForeignSchemaStmt *
    2661           48 : _copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
    2662              : {
    2663           48 :     ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
    2664              : 
    2665           48 :     COPY_STRING_FIELD(server_name);
    2666           48 :     COPY_STRING_FIELD(remote_schema);
    2667           48 :     COPY_STRING_FIELD(local_schema);
    2668           48 :     COPY_SCALAR_FIELD(list_type);
    2669           48 :     COPY_NODE_FIELD(table_list);
    2670           48 :     COPY_NODE_FIELD(options);
    2671              : 
    2672           48 :     return newnode;
    2673              : }
    2674              : 
    2675              : static CreatePolicyStmt *
    2676          805 : _copyCreatePolicyStmt(const CreatePolicyStmt *from)
    2677              : {
    2678          805 :     CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
    2679              : 
    2680          805 :     COPY_STRING_FIELD(policy_name);
    2681          805 :     COPY_NODE_FIELD(table);
    2682          805 :     COPY_STRING_FIELD(cmd_name);
    2683          805 :     COPY_SCALAR_FIELD(permissive);
    2684          805 :     COPY_NODE_FIELD(roles);
    2685          805 :     COPY_NODE_FIELD(qual);
    2686          805 :     COPY_NODE_FIELD(with_check);
    2687              : 
    2688          805 :     return newnode;
    2689              : }
    2690              : 
    2691              : static AlterPolicyStmt *
    2692           87 : _copyAlterPolicyStmt(const AlterPolicyStmt *from)
    2693              : {
    2694           87 :     AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
    2695              : 
    2696           87 :     COPY_STRING_FIELD(policy_name);
    2697           87 :     COPY_NODE_FIELD(table);
    2698           87 :     COPY_NODE_FIELD(roles);
    2699           87 :     COPY_NODE_FIELD(qual);
    2700           87 :     COPY_NODE_FIELD(with_check);
    2701              : 
    2702           87 :     return newnode;
    2703              : }
    2704              : 
    2705              : static CreateAmStmt *
    2706           74 : _copyCreateAmStmt(const CreateAmStmt *from)
    2707              : {
    2708           74 :     CreateAmStmt *newnode = makeNode(CreateAmStmt);
    2709              : 
    2710           74 :     COPY_STRING_FIELD(amname);
    2711           74 :     COPY_NODE_FIELD(handler_name);
    2712           74 :     COPY_SCALAR_FIELD(amtype);
    2713              : 
    2714           74 :     return newnode;
    2715              : }
    2716              : 
    2717              : static CreateTrigStmt *
    2718         3692 : _copyCreateTrigStmt(const CreateTrigStmt *from)
    2719              : {
    2720         3692 :     CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
    2721              : 
    2722         3692 :     COPY_SCALAR_FIELD(replace);
    2723         3692 :     COPY_SCALAR_FIELD(isconstraint);
    2724         3692 :     COPY_STRING_FIELD(trigname);
    2725         3692 :     COPY_NODE_FIELD(relation);
    2726         3692 :     COPY_NODE_FIELD(funcname);
    2727         3692 :     COPY_NODE_FIELD(args);
    2728         3692 :     COPY_SCALAR_FIELD(row);
    2729         3692 :     COPY_SCALAR_FIELD(timing);
    2730         3692 :     COPY_SCALAR_FIELD(events);
    2731         3692 :     COPY_NODE_FIELD(columns);
    2732         3692 :     COPY_NODE_FIELD(whenClause);
    2733         3692 :     COPY_NODE_FIELD(transitionRels);
    2734         3692 :     COPY_SCALAR_FIELD(deferrable);
    2735         3692 :     COPY_SCALAR_FIELD(initdeferred);
    2736         3692 :     COPY_NODE_FIELD(constrrel);
    2737              : 
    2738         3692 :     return newnode;
    2739              : }
    2740              : 
    2741              : static CreateEventTrigStmt *
    2742          200 : _copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
    2743              : {
    2744          200 :     CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
    2745              : 
    2746          200 :     COPY_STRING_FIELD(trigname);
    2747          200 :     COPY_STRING_FIELD(eventname);
    2748          200 :     COPY_NODE_FIELD(whenclause);
    2749          200 :     COPY_NODE_FIELD(funcname);
    2750              : 
    2751          200 :     return newnode;
    2752              : }
    2753              : 
    2754              : static AlterEventTrigStmt *
    2755           48 : _copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
    2756              : {
    2757           48 :     AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
    2758              : 
    2759           48 :     COPY_STRING_FIELD(trigname);
    2760           48 :     COPY_SCALAR_FIELD(tgenabled);
    2761              : 
    2762           48 :     return newnode;
    2763              : }
    2764              : 
    2765              : static CreatePLangStmt *
    2766          144 : _copyCreatePLangStmt(const CreatePLangStmt *from)
    2767              : {
    2768          144 :     CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
    2769              : 
    2770          144 :     COPY_SCALAR_FIELD(replace);
    2771          144 :     COPY_STRING_FIELD(plname);
    2772          144 :     COPY_NODE_FIELD(plhandler);
    2773          144 :     COPY_NODE_FIELD(plinline);
    2774          144 :     COPY_NODE_FIELD(plvalidator);
    2775          144 :     COPY_SCALAR_FIELD(pltrusted);
    2776              : 
    2777          144 :     return newnode;
    2778              : }
    2779              : 
    2780              : static CreateRoleStmt *
    2781         1946 : _copyCreateRoleStmt(const CreateRoleStmt *from)
    2782              : {
    2783         1946 :     CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
    2784              : 
    2785         1946 :     COPY_SCALAR_FIELD(stmt_type);
    2786         1946 :     COPY_STRING_FIELD(role);
    2787         1946 :     COPY_NODE_FIELD(options);
    2788              : 
    2789         1946 :     return newnode;
    2790              : }
    2791              : 
    2792              : static AlterRoleStmt *
    2793          478 : _copyAlterRoleStmt(const AlterRoleStmt *from)
    2794              : {
    2795          478 :     AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
    2796              : 
    2797          478 :     COPY_NODE_FIELD(role);
    2798          478 :     COPY_NODE_FIELD(options);
    2799          478 :     COPY_SCALAR_FIELD(action);
    2800              : 
    2801          478 :     return newnode;
    2802              : }
    2803              : 
    2804              : static AlterRoleSetStmt *
    2805           92 : _copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
    2806              : {
    2807           92 :     AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
    2808              : 
    2809           92 :     COPY_NODE_FIELD(role);
    2810           92 :     COPY_STRING_FIELD(database);
    2811           92 :     COPY_NODE_FIELD(setstmt);
    2812              : 
    2813           92 :     return newnode;
    2814              : }
    2815              : 
    2816              : static DropRoleStmt *
    2817         1768 : _copyDropRoleStmt(const DropRoleStmt *from)
    2818              : {
    2819         1768 :     DropRoleStmt *newnode = makeNode(DropRoleStmt);
    2820              : 
    2821         1768 :     COPY_NODE_FIELD(roles);
    2822         1768 :     COPY_SCALAR_FIELD(missing_ok);
    2823              : 
    2824         1768 :     return newnode;
    2825              : }
    2826              : 
    2827              : static CreateSeqStmt *
    2828          763 : _copyCreateSeqStmt(const CreateSeqStmt *from)
    2829              : {
    2830          763 :     CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
    2831              : 
    2832          763 :     COPY_NODE_FIELD(sequence);
    2833          763 :     COPY_NODE_FIELD(options);
    2834          763 :     COPY_SCALAR_FIELD(ownerId);
    2835          763 :     COPY_SCALAR_FIELD(for_identity);
    2836          763 :     COPY_SCALAR_FIELD(if_not_exists);
    2837              : 
    2838          763 :     return newnode;
    2839              : }
    2840              : 
    2841              : static AlterSeqStmt *
    2842          252 : _copyAlterSeqStmt(const AlterSeqStmt *from)
    2843              : {
    2844          252 :     AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
    2845              : 
    2846          252 :     COPY_NODE_FIELD(sequence);
    2847          252 :     COPY_NODE_FIELD(options);
    2848          252 :     COPY_SCALAR_FIELD(for_identity);
    2849          252 :     COPY_SCALAR_FIELD(missing_ok);
    2850              : 
    2851          252 :     return newnode;
    2852              : }
    2853              : 
    2854              : static DefineStmt *
    2855         9823 : _copyDefineStmt(const DefineStmt *from)
    2856              : {
    2857         9823 :     DefineStmt *newnode = makeNode(DefineStmt);
    2858              : 
    2859         9823 :     COPY_SCALAR_FIELD(kind);
    2860         9823 :     COPY_SCALAR_FIELD(oldstyle);
    2861         9823 :     COPY_NODE_FIELD(defnames);
    2862         9823 :     COPY_NODE_FIELD(args);
    2863         9823 :     COPY_NODE_FIELD(definition);
    2864         9823 :     COPY_SCALAR_FIELD(if_not_exists);
    2865         9823 :     COPY_SCALAR_FIELD(replace);
    2866              : 
    2867         9823 :     return newnode;
    2868              : }
    2869              : 
    2870              : static CreateDomainStmt *
    2871         1501 : _copyCreateDomainStmt(const CreateDomainStmt *from)
    2872              : {
    2873         1501 :     CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
    2874              : 
    2875         1501 :     COPY_NODE_FIELD(domainname);
    2876         1501 :     COPY_NODE_FIELD(typeName);
    2877         1501 :     COPY_NODE_FIELD(collClause);
    2878         1501 :     COPY_NODE_FIELD(constraints);
    2879              : 
    2880         1501 :     return newnode;
    2881              : }
    2882              : 
    2883              : static CreateOpClassStmt *
    2884          562 : _copyCreateOpClassStmt(const CreateOpClassStmt *from)
    2885              : {
    2886          562 :     CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
    2887              : 
    2888          562 :     COPY_NODE_FIELD(opclassname);
    2889          562 :     COPY_NODE_FIELD(opfamilyname);
    2890          562 :     COPY_STRING_FIELD(amname);
    2891          562 :     COPY_NODE_FIELD(datatype);
    2892          562 :     COPY_NODE_FIELD(items);
    2893          562 :     COPY_SCALAR_FIELD(isDefault);
    2894              : 
    2895          562 :     return newnode;
    2896              : }
    2897              : 
    2898              : static CreateOpClassItem *
    2899         6911 : _copyCreateOpClassItem(const CreateOpClassItem *from)
    2900              : {
    2901         6911 :     CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
    2902              : 
    2903         6911 :     COPY_SCALAR_FIELD(itemtype);
    2904         6911 :     COPY_NODE_FIELD(name);
    2905         6911 :     COPY_SCALAR_FIELD(number);
    2906         6911 :     COPY_NODE_FIELD(order_family);
    2907         6911 :     COPY_NODE_FIELD(class_args);
    2908         6911 :     COPY_NODE_FIELD(storedtype);
    2909              : 
    2910         6911 :     return newnode;
    2911              : }
    2912              : 
    2913              : static CreateOpFamilyStmt *
    2914          152 : _copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
    2915              : {
    2916          152 :     CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
    2917              : 
    2918          152 :     COPY_NODE_FIELD(opfamilyname);
    2919          152 :     COPY_STRING_FIELD(amname);
    2920              : 
    2921          152 :     return newnode;
    2922              : }
    2923              : 
    2924              : static AlterOpFamilyStmt *
    2925          459 : _copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
    2926              : {
    2927          459 :     AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
    2928              : 
    2929          459 :     COPY_NODE_FIELD(opfamilyname);
    2930          459 :     COPY_STRING_FIELD(amname);
    2931          459 :     COPY_SCALAR_FIELD(isDrop);
    2932          459 :     COPY_NODE_FIELD(items);
    2933              : 
    2934          459 :     return newnode;
    2935              : }
    2936              : 
    2937              : static DropStmt *
    2938        27322 : _copyDropStmt(const DropStmt *from)
    2939              : {
    2940        27322 :     DropStmt *newnode = makeNode(DropStmt);
    2941              : 
    2942        27322 :     COPY_NODE_FIELD(objects);
    2943        27322 :     COPY_SCALAR_FIELD(removeType);
    2944        27322 :     COPY_SCALAR_FIELD(behavior);
    2945        27322 :     COPY_SCALAR_FIELD(missing_ok);
    2946        27322 :     COPY_SCALAR_FIELD(concurrent);
    2947              : 
    2948        27322 :     return newnode;
    2949              : }
    2950              : 
    2951              : static TruncateStmt *
    2952         1862 : _copyTruncateStmt(const TruncateStmt *from)
    2953              : {
    2954         1862 :     TruncateStmt *newnode = makeNode(TruncateStmt);
    2955              : 
    2956         1862 :     COPY_NODE_FIELD(relations);
    2957         1862 :     COPY_SCALAR_FIELD(restart_seqs);
    2958         1862 :     COPY_SCALAR_FIELD(behavior);
    2959              : 
    2960         1862 :     return newnode;
    2961              : }
    2962              : 
    2963              : static CommentStmt *
    2964         7690 : _copyCommentStmt(const CommentStmt *from)
    2965              : {
    2966         7690 :     CommentStmt *newnode = makeNode(CommentStmt);
    2967              : 
    2968         7690 :     COPY_SCALAR_FIELD(objtype);
    2969         7690 :     COPY_NODE_FIELD(object);
    2970         7690 :     COPY_STRING_FIELD(comment);
    2971              : 
    2972         7690 :     return newnode;
    2973              : }
    2974              : 
    2975              : static SecLabelStmt *
    2976          119 : _copySecLabelStmt(const SecLabelStmt *from)
    2977              : {
    2978          119 :     SecLabelStmt *newnode = makeNode(SecLabelStmt);
    2979              : 
    2980          119 :     COPY_SCALAR_FIELD(objtype);
    2981          119 :     COPY_NODE_FIELD(object);
    2982          119 :     COPY_STRING_FIELD(provider);
    2983          119 :     COPY_STRING_FIELD(label);
    2984              : 
    2985          119 :     return newnode;
    2986              : }
    2987              : 
    2988              : static DeclareCursorStmt *
    2989         8084 : _copyDeclareCursorStmt(const DeclareCursorStmt *from)
    2990              : {
    2991         8084 :     DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
    2992              : 
    2993         8084 :     COPY_STRING_FIELD(portalname);
    2994         8084 :     COPY_SCALAR_FIELD(options);
    2995         8084 :     COPY_NODE_FIELD(query);
    2996              : 
    2997         8084 :     return newnode;
    2998              : }
    2999              : 
    3000              : static ClosePortalStmt *
    3001         2262 : _copyClosePortalStmt(const ClosePortalStmt *from)
    3002              : {
    3003         2262 :     ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
    3004              : 
    3005         2262 :     COPY_STRING_FIELD(portalname);
    3006              : 
    3007         2262 :     return newnode;
    3008              : }
    3009              : 
    3010              : static FetchStmt *
    3011         7742 : _copyFetchStmt(const FetchStmt *from)
    3012              : {
    3013         7742 :     FetchStmt *newnode = makeNode(FetchStmt);
    3014              : 
    3015         7742 :     COPY_SCALAR_FIELD(direction);
    3016         7742 :     COPY_SCALAR_FIELD(howMany);
    3017         7742 :     COPY_STRING_FIELD(portalname);
    3018         7742 :     COPY_SCALAR_FIELD(ismove);
    3019         7742 :     COPY_SCALAR_FIELD(direction_keyword);
    3020         7742 :     COPY_LOCATION_FIELD(location);
    3021              : 
    3022         7742 :     return newnode;
    3023              : }
    3024              : 
    3025              : static IndexStmt *
    3026         7044 : _copyIndexStmt(const IndexStmt *from)
    3027              : {
    3028         7044 :     IndexStmt *newnode = makeNode(IndexStmt);
    3029              : 
    3030         7044 :     COPY_STRING_FIELD(idxname);
    3031         7044 :     COPY_NODE_FIELD(relation);
    3032         7044 :     COPY_STRING_FIELD(accessMethod);
    3033         7044 :     COPY_STRING_FIELD(tableSpace);
    3034         7044 :     COPY_NODE_FIELD(indexParams);
    3035         7044 :     COPY_NODE_FIELD(indexIncludingParams);
    3036         7044 :     COPY_NODE_FIELD(options);
    3037         7044 :     COPY_NODE_FIELD(whereClause);
    3038         7044 :     COPY_NODE_FIELD(excludeOpNames);
    3039         7044 :     COPY_STRING_FIELD(idxcomment);
    3040         7044 :     COPY_SCALAR_FIELD(indexOid);
    3041         7044 :     COPY_SCALAR_FIELD(oldNumber);
    3042         7044 :     COPY_SCALAR_FIELD(oldCreateSubid);
    3043         7044 :     COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
    3044         7044 :     COPY_SCALAR_FIELD(unique);
    3045         7044 :     COPY_SCALAR_FIELD(nulls_not_distinct);
    3046         7044 :     COPY_SCALAR_FIELD(primary);
    3047         7044 :     COPY_SCALAR_FIELD(isconstraint);
    3048         7044 :     COPY_SCALAR_FIELD(iswithoutoverlaps);
    3049         7044 :     COPY_SCALAR_FIELD(deferrable);
    3050         7044 :     COPY_SCALAR_FIELD(initdeferred);
    3051         7044 :     COPY_SCALAR_FIELD(transformed);
    3052         7044 :     COPY_SCALAR_FIELD(concurrent);
    3053         7044 :     COPY_SCALAR_FIELD(if_not_exists);
    3054         7044 :     COPY_SCALAR_FIELD(reset_default_tblspc);
    3055              : 
    3056         7044 :     return newnode;
    3057              : }
    3058              : 
    3059              : static CreateStatsStmt *
    3060          902 : _copyCreateStatsStmt(const CreateStatsStmt *from)
    3061              : {
    3062          902 :     CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
    3063              : 
    3064          902 :     COPY_NODE_FIELD(defnames);
    3065          902 :     COPY_NODE_FIELD(stat_types);
    3066          902 :     COPY_NODE_FIELD(exprs);
    3067          902 :     COPY_NODE_FIELD(relations);
    3068          902 :     COPY_STRING_FIELD(stxcomment);
    3069          902 :     COPY_SCALAR_FIELD(transformed);
    3070          902 :     COPY_SCALAR_FIELD(if_not_exists);
    3071              : 
    3072          902 :     return newnode;
    3073              : }
    3074              : 
    3075              : static StatsElem *
    3076         2106 : _copyStatsElem(const StatsElem *from)
    3077              : {
    3078         2106 :     StatsElem *newnode = makeNode(StatsElem);
    3079              : 
    3080         2106 :     COPY_STRING_FIELD(name);
    3081         2106 :     COPY_NODE_FIELD(expr);
    3082              : 
    3083         2106 :     return newnode;
    3084              : }
    3085              : 
    3086              : static AlterStatsStmt *
    3087           26 : _copyAlterStatsStmt(const AlterStatsStmt *from)
    3088              : {
    3089           26 :     AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
    3090              : 
    3091           26 :     COPY_NODE_FIELD(defnames);
    3092           26 :     COPY_NODE_FIELD(stxstattarget);
    3093           26 :     COPY_SCALAR_FIELD(missing_ok);
    3094              : 
    3095           26 :     return newnode;
    3096              : }
    3097              : 
    3098              : static CreateFunctionStmt *
    3099        22654 : _copyCreateFunctionStmt(const CreateFunctionStmt *from)
    3100              : {
    3101        22654 :     CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
    3102              : 
    3103        22654 :     COPY_SCALAR_FIELD(is_procedure);
    3104        22654 :     COPY_SCALAR_FIELD(replace);
    3105        22654 :     COPY_NODE_FIELD(funcname);
    3106        22654 :     COPY_NODE_FIELD(parameters);
    3107        22654 :     COPY_NODE_FIELD(returnType);
    3108        22654 :     COPY_NODE_FIELD(options);
    3109        22654 :     COPY_NODE_FIELD(sql_body);
    3110              : 
    3111        22654 :     return newnode;
    3112              : }
    3113              : 
    3114              : static FunctionParameter *
    3115        60757 : _copyFunctionParameter(const FunctionParameter *from)
    3116              : {
    3117        60757 :     FunctionParameter *newnode = makeNode(FunctionParameter);
    3118              : 
    3119        60757 :     COPY_STRING_FIELD(name);
    3120        60757 :     COPY_NODE_FIELD(argType);
    3121        60757 :     COPY_SCALAR_FIELD(mode);
    3122        60757 :     COPY_NODE_FIELD(defexpr);
    3123        60757 :     COPY_LOCATION_FIELD(location);
    3124              : 
    3125        60757 :     return newnode;
    3126              : }
    3127              : 
    3128              : static AlterFunctionStmt *
    3129          362 : _copyAlterFunctionStmt(const AlterFunctionStmt *from)
    3130              : {
    3131          362 :     AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
    3132              : 
    3133          362 :     COPY_SCALAR_FIELD(objtype);
    3134          362 :     COPY_NODE_FIELD(func);
    3135          362 :     COPY_NODE_FIELD(actions);
    3136              : 
    3137          362 :     return newnode;
    3138              : }
    3139              : 
    3140              : static DoStmt *
    3141         1412 : _copyDoStmt(const DoStmt *from)
    3142              : {
    3143         1412 :     DoStmt *newnode = makeNode(DoStmt);
    3144              : 
    3145         1412 :     COPY_NODE_FIELD(args);
    3146              : 
    3147         1412 :     return newnode;
    3148              : }
    3149              : 
    3150              : static CallStmt *
    3151          858 : _copyCallStmt(const CallStmt *from)
    3152              : {
    3153          858 :     CallStmt *newnode = makeNode(CallStmt);
    3154              : 
    3155          858 :     COPY_NODE_FIELD(funccall);
    3156          858 :     COPY_NODE_FIELD(funcexpr);
    3157          858 :     COPY_NODE_FIELD(outargs);
    3158              : 
    3159          858 :     return newnode;
    3160              : }
    3161              : 
    3162              : static RenameStmt *
    3163         1563 : _copyRenameStmt(const RenameStmt *from)
    3164              : {
    3165         1563 :     RenameStmt *newnode = makeNode(RenameStmt);
    3166              : 
    3167         1563 :     COPY_SCALAR_FIELD(renameType);
    3168         1563 :     COPY_SCALAR_FIELD(relationType);
    3169         1563 :     COPY_NODE_FIELD(relation);
    3170         1563 :     COPY_NODE_FIELD(object);
    3171         1563 :     COPY_STRING_FIELD(subname);
    3172         1563 :     COPY_STRING_FIELD(newname);
    3173         1563 :     COPY_SCALAR_FIELD(behavior);
    3174         1563 :     COPY_SCALAR_FIELD(missing_ok);
    3175              : 
    3176         1563 :     return newnode;
    3177              : }
    3178              : 
    3179              : static AlterObjectDependsStmt *
    3180           46 : _copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
    3181              : {
    3182           46 :     AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
    3183              : 
    3184           46 :     COPY_SCALAR_FIELD(objectType);
    3185           46 :     COPY_NODE_FIELD(relation);
    3186           46 :     COPY_NODE_FIELD(object);
    3187           46 :     COPY_NODE_FIELD(extname);
    3188           46 :     COPY_SCALAR_FIELD(remove);
    3189              : 
    3190           46 :     return newnode;
    3191              : }
    3192              : 
    3193              : static AlterObjectSchemaStmt *
    3194          400 : _copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
    3195              : {
    3196          400 :     AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
    3197              : 
    3198          400 :     COPY_SCALAR_FIELD(objectType);
    3199          400 :     COPY_NODE_FIELD(relation);
    3200          400 :     COPY_NODE_FIELD(object);
    3201          400 :     COPY_STRING_FIELD(newschema);
    3202          400 :     COPY_SCALAR_FIELD(missing_ok);
    3203              : 
    3204          400 :     return newnode;
    3205              : }
    3206              : 
    3207              : static AlterOwnerStmt *
    3208         1684 : _copyAlterOwnerStmt(const AlterOwnerStmt *from)
    3209              : {
    3210         1684 :     AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
    3211              : 
    3212         1684 :     COPY_SCALAR_FIELD(objectType);
    3213         1684 :     COPY_NODE_FIELD(relation);
    3214         1684 :     COPY_NODE_FIELD(object);
    3215         1684 :     COPY_NODE_FIELD(newowner);
    3216              : 
    3217         1684 :     return newnode;
    3218              : }
    3219              : 
    3220              : static AlterOperatorStmt *
    3221          608 : _copyAlterOperatorStmt(const AlterOperatorStmt *from)
    3222              : {
    3223          608 :     AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
    3224              : 
    3225          608 :     COPY_NODE_FIELD(opername);
    3226          608 :     COPY_NODE_FIELD(options);
    3227              : 
    3228          608 :     return newnode;
    3229              : }
    3230              : 
    3231              : static AlterTypeStmt *
    3232           64 : _copyAlterTypeStmt(const AlterTypeStmt *from)
    3233              : {
    3234           64 :     AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
    3235              : 
    3236           64 :     COPY_NODE_FIELD(typeName);
    3237           64 :     COPY_NODE_FIELD(options);
    3238              : 
    3239           64 :     return newnode;
    3240              : }
    3241              : 
    3242              : static RuleStmt *
    3243         1112 : _copyRuleStmt(const RuleStmt *from)
    3244              : {
    3245         1112 :     RuleStmt *newnode = makeNode(RuleStmt);
    3246              : 
    3247         1112 :     COPY_NODE_FIELD(relation);
    3248         1112 :     COPY_STRING_FIELD(rulename);
    3249         1112 :     COPY_NODE_FIELD(whereClause);
    3250         1112 :     COPY_SCALAR_FIELD(event);
    3251         1112 :     COPY_SCALAR_FIELD(instead);
    3252         1112 :     COPY_NODE_FIELD(actions);
    3253         1112 :     COPY_SCALAR_FIELD(replace);
    3254              : 
    3255         1112 :     return newnode;
    3256              : }
    3257              : 
    3258              : static NotifyStmt *
    3259          180 : _copyNotifyStmt(const NotifyStmt *from)
    3260              : {
    3261          180 :     NotifyStmt *newnode = makeNode(NotifyStmt);
    3262              : 
    3263          180 :     COPY_STRING_FIELD(conditionname);
    3264          180 :     COPY_STRING_FIELD(payload);
    3265              : 
    3266          180 :     return newnode;
    3267              : }
    3268              : 
    3269              : static ListenStmt *
    3270          116 : _copyListenStmt(const ListenStmt *from)
    3271              : {
    3272          116 :     ListenStmt *newnode = makeNode(ListenStmt);
    3273              : 
    3274          116 :     COPY_STRING_FIELD(conditionname);
    3275              : 
    3276          116 :     return newnode;
    3277              : }
    3278              : 
    3279              : static UnlistenStmt *
    3280          156 : _copyUnlistenStmt(const UnlistenStmt *from)
    3281              : {
    3282          156 :     UnlistenStmt *newnode = makeNode(UnlistenStmt);
    3283              : 
    3284          156 :     COPY_STRING_FIELD(conditionname);
    3285              : 
    3286          156 :     return newnode;
    3287              : }
    3288              : 
    3289              : static TransactionStmt *
    3290        50372 : _copyTransactionStmt(const TransactionStmt *from)
    3291              : {
    3292        50372 :     TransactionStmt *newnode = makeNode(TransactionStmt);
    3293              : 
    3294        50372 :     COPY_SCALAR_FIELD(kind);
    3295        50372 :     COPY_NODE_FIELD(options);
    3296        50372 :     COPY_STRING_FIELD(savepoint_name);
    3297        50372 :     COPY_STRING_FIELD(gid);
    3298        50372 :     COPY_SCALAR_FIELD(chain);
    3299        50372 :     COPY_LOCATION_FIELD(location);
    3300              : 
    3301        50372 :     return newnode;
    3302              : }
    3303              : 
    3304              : static CompositeTypeStmt *
    3305         4514 : _copyCompositeTypeStmt(const CompositeTypeStmt *from)
    3306              : {
    3307         4514 :     CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
    3308              : 
    3309         4514 :     COPY_NODE_FIELD(typevar);
    3310         4514 :     COPY_NODE_FIELD(coldeflist);
    3311              : 
    3312         4514 :     return newnode;
    3313              : }
    3314              : 
    3315              : static CreateEnumStmt *
    3316          352 : _copyCreateEnumStmt(const CreateEnumStmt *from)
    3317              : {
    3318          352 :     CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
    3319              : 
    3320          352 :     COPY_NODE_FIELD(typeName);
    3321          352 :     COPY_NODE_FIELD(vals);
    3322              : 
    3323          352 :     return newnode;
    3324              : }
    3325              : 
    3326              : static CreateRangeStmt *
    3327          185 : _copyCreateRangeStmt(const CreateRangeStmt *from)
    3328              : {
    3329          185 :     CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
    3330              : 
    3331          185 :     COPY_NODE_FIELD(typeName);
    3332          185 :     COPY_NODE_FIELD(params);
    3333              : 
    3334          185 :     return newnode;
    3335              : }
    3336              : 
    3337              : static AlterEnumStmt *
    3338          398 : _copyAlterEnumStmt(const AlterEnumStmt *from)
    3339              : {
    3340          398 :     AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
    3341              : 
    3342          398 :     COPY_NODE_FIELD(typeName);
    3343          398 :     COPY_STRING_FIELD(oldVal);
    3344          398 :     COPY_STRING_FIELD(newVal);
    3345          398 :     COPY_STRING_FIELD(newValNeighbor);
    3346          398 :     COPY_SCALAR_FIELD(newValIsAfter);
    3347          398 :     COPY_SCALAR_FIELD(skipIfNewValExists);
    3348              : 
    3349          398 :     return newnode;
    3350              : }
    3351              : 
    3352              : static ViewStmt *
    3353        17654 : _copyViewStmt(const ViewStmt *from)
    3354              : {
    3355        17654 :     ViewStmt *newnode = makeNode(ViewStmt);
    3356              : 
    3357        17654 :     COPY_NODE_FIELD(view);
    3358        17654 :     COPY_NODE_FIELD(aliases);
    3359        17654 :     COPY_NODE_FIELD(query);
    3360        17654 :     COPY_SCALAR_FIELD(replace);
    3361        17654 :     COPY_NODE_FIELD(options);
    3362        17654 :     COPY_SCALAR_FIELD(withCheckOption);
    3363              : 
    3364        17654 :     return newnode;
    3365              : }
    3366              : 
    3367              : static LoadStmt *
    3368           64 : _copyLoadStmt(const LoadStmt *from)
    3369              : {
    3370           64 :     LoadStmt *newnode = makeNode(LoadStmt);
    3371              : 
    3372           64 :     COPY_STRING_FIELD(filename);
    3373              : 
    3374           64 :     return newnode;
    3375              : }
    3376              : 
    3377              : static CreatedbStmt *
    3378          842 : _copyCreatedbStmt(const CreatedbStmt *from)
    3379              : {
    3380          842 :     CreatedbStmt *newnode = makeNode(CreatedbStmt);
    3381              : 
    3382          842 :     COPY_STRING_FIELD(dbname);
    3383          842 :     COPY_NODE_FIELD(options);
    3384              : 
    3385          842 :     return newnode;
    3386              : }
    3387              : 
    3388              : static AlterDatabaseStmt *
    3389           92 : _copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
    3390              : {
    3391           92 :     AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
    3392              : 
    3393           92 :     COPY_STRING_FIELD(dbname);
    3394           92 :     COPY_NODE_FIELD(options);
    3395              : 
    3396           92 :     return newnode;
    3397              : }
    3398              : 
    3399              : static AlterDatabaseRefreshCollStmt *
    3400            6 : _copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
    3401              : {
    3402            6 :     AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
    3403              : 
    3404            6 :     COPY_STRING_FIELD(dbname);
    3405              : 
    3406            6 :     return newnode;
    3407              : }
    3408              : 
    3409              : static AlterDatabaseSetStmt *
    3410         1278 : _copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
    3411              : {
    3412         1278 :     AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
    3413              : 
    3414         1278 :     COPY_STRING_FIELD(dbname);
    3415         1278 :     COPY_NODE_FIELD(setstmt);
    3416              : 
    3417         1278 :     return newnode;
    3418              : }
    3419              : 
    3420              : static DropdbStmt *
    3421          132 : _copyDropdbStmt(const DropdbStmt *from)
    3422              : {
    3423          132 :     DropdbStmt *newnode = makeNode(DropdbStmt);
    3424              : 
    3425          132 :     COPY_STRING_FIELD(dbname);
    3426          132 :     COPY_SCALAR_FIELD(missing_ok);
    3427          132 :     COPY_NODE_FIELD(options);
    3428              : 
    3429          132 :     return newnode;
    3430              : }
    3431              : 
    3432              : static AlterSystemStmt *
    3433          224 : _copyAlterSystemStmt(const AlterSystemStmt *from)
    3434              : {
    3435          224 :     AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
    3436              : 
    3437          224 :     COPY_NODE_FIELD(setstmt);
    3438              : 
    3439          224 :     return newnode;
    3440              : }
    3441              : 
    3442              : static VacuumStmt *
    3443        14822 : _copyVacuumStmt(const VacuumStmt *from)
    3444              : {
    3445        14822 :     VacuumStmt *newnode = makeNode(VacuumStmt);
    3446              : 
    3447        14822 :     COPY_NODE_FIELD(options);
    3448        14822 :     COPY_NODE_FIELD(rels);
    3449        14822 :     COPY_SCALAR_FIELD(is_vacuumcmd);
    3450              : 
    3451        14822 :     return newnode;
    3452              : }
    3453              : 
    3454              : static VacuumRelation *
    3455        14902 : _copyVacuumRelation(const VacuumRelation *from)
    3456              : {
    3457        14902 :     VacuumRelation *newnode = makeNode(VacuumRelation);
    3458              : 
    3459        14902 :     COPY_NODE_FIELD(relation);
    3460        14902 :     COPY_SCALAR_FIELD(oid);
    3461        14902 :     COPY_NODE_FIELD(va_cols);
    3462              : 
    3463        14902 :     return newnode;
    3464              : }
    3465              : 
    3466              : static RepackStmt *
    3467          290 : _copyRepackStmt(const RepackStmt *from)
    3468              : {
    3469          290 :     RepackStmt *newnode = makeNode(RepackStmt);
    3470              : 
    3471          290 :     COPY_SCALAR_FIELD(command);
    3472          290 :     COPY_NODE_FIELD(relation);
    3473          290 :     COPY_STRING_FIELD(indexname);
    3474          290 :     COPY_SCALAR_FIELD(usingindex);
    3475          290 :     COPY_NODE_FIELD(params);
    3476              : 
    3477          290 :     return newnode;
    3478              : }
    3479              : 
    3480              : static ExplainStmt *
    3481        41204 : _copyExplainStmt(const ExplainStmt *from)
    3482              : {
    3483        41204 :     ExplainStmt *newnode = makeNode(ExplainStmt);
    3484              : 
    3485        41204 :     COPY_NODE_FIELD(query);
    3486        41204 :     COPY_NODE_FIELD(options);
    3487              : 
    3488        41204 :     return newnode;
    3489              : }
    3490              : 
    3491              : static CreateTableAsStmt *
    3492         2130 : _copyCreateTableAsStmt(const CreateTableAsStmt *from)
    3493              : {
    3494         2130 :     CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
    3495              : 
    3496         2130 :     COPY_NODE_FIELD(query);
    3497         2130 :     COPY_NODE_FIELD(into);
    3498         2130 :     COPY_SCALAR_FIELD(objtype);
    3499         2130 :     COPY_SCALAR_FIELD(is_select_into);
    3500         2130 :     COPY_SCALAR_FIELD(if_not_exists);
    3501              : 
    3502         2130 :     return newnode;
    3503              : }
    3504              : 
    3505              : static RefreshMatViewStmt *
    3506          272 : _copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
    3507              : {
    3508          272 :     RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
    3509              : 
    3510          272 :     COPY_SCALAR_FIELD(concurrent);
    3511          272 :     COPY_SCALAR_FIELD(skipData);
    3512          272 :     COPY_NODE_FIELD(relation);
    3513              : 
    3514          272 :     return newnode;
    3515              : }
    3516              : 
    3517              : static CheckPointStmt *
    3518          589 : _copyCheckPointStmt(const CheckPointStmt *from)
    3519              : {
    3520          589 :     CheckPointStmt *newnode = makeNode(CheckPointStmt);
    3521              : 
    3522          589 :     COPY_NODE_FIELD(options);
    3523              : 
    3524          589 :     return newnode;
    3525              : }
    3526              : 
    3527              : static DiscardStmt *
    3528           38 : _copyDiscardStmt(const DiscardStmt *from)
    3529              : {
    3530           38 :     DiscardStmt *newnode = makeNode(DiscardStmt);
    3531              : 
    3532           38 :     COPY_SCALAR_FIELD(target);
    3533              : 
    3534           38 :     return newnode;
    3535              : }
    3536              : 
    3537              : static LockStmt *
    3538         1192 : _copyLockStmt(const LockStmt *from)
    3539              : {
    3540         1192 :     LockStmt *newnode = makeNode(LockStmt);
    3541              : 
    3542         1192 :     COPY_NODE_FIELD(relations);
    3543         1192 :     COPY_SCALAR_FIELD(mode);
    3544         1192 :     COPY_SCALAR_FIELD(nowait);
    3545              : 
    3546         1192 :     return newnode;
    3547              : }
    3548              : 
    3549              : static ConstraintsSetStmt *
    3550          106 : _copyConstraintsSetStmt(const ConstraintsSetStmt *from)
    3551              : {
    3552          106 :     ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
    3553              : 
    3554          106 :     COPY_NODE_FIELD(constraints);
    3555          106 :     COPY_SCALAR_FIELD(deferred);
    3556              : 
    3557          106 :     return newnode;
    3558              : }
    3559              : 
    3560              : static ReindexStmt *
    3561         1259 : _copyReindexStmt(const ReindexStmt *from)
    3562              : {
    3563         1259 :     ReindexStmt *newnode = makeNode(ReindexStmt);
    3564              : 
    3565         1259 :     COPY_SCALAR_FIELD(kind);
    3566         1259 :     COPY_NODE_FIELD(relation);
    3567         1259 :     COPY_STRING_FIELD(name);
    3568         1259 :     COPY_NODE_FIELD(params);
    3569              : 
    3570         1259 :     return newnode;
    3571              : }
    3572              : 
    3573              : static CreateConversionStmt *
    3574           65 : _copyCreateConversionStmt(const CreateConversionStmt *from)
    3575              : {
    3576           65 :     CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
    3577              : 
    3578           65 :     COPY_NODE_FIELD(conversion_name);
    3579           65 :     COPY_STRING_FIELD(for_encoding_name);
    3580           65 :     COPY_STRING_FIELD(to_encoding_name);
    3581           65 :     COPY_NODE_FIELD(func_name);
    3582           65 :     COPY_SCALAR_FIELD(def);
    3583              : 
    3584           65 :     return newnode;
    3585              : }
    3586              : 
    3587              : static CreateCastStmt *
    3588          282 : _copyCreateCastStmt(const CreateCastStmt *from)
    3589              : {
    3590          282 :     CreateCastStmt *newnode = makeNode(CreateCastStmt);
    3591              : 
    3592          282 :     COPY_NODE_FIELD(sourcetype);
    3593          282 :     COPY_NODE_FIELD(targettype);
    3594          282 :     COPY_NODE_FIELD(func);
    3595          282 :     COPY_SCALAR_FIELD(context);
    3596          282 :     COPY_SCALAR_FIELD(inout);
    3597              : 
    3598          282 :     return newnode;
    3599              : }
    3600              : 
    3601              : static CreateTransformStmt *
    3602           51 : _copyCreateTransformStmt(const CreateTransformStmt *from)
    3603              : {
    3604           51 :     CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
    3605              : 
    3606           51 :     COPY_SCALAR_FIELD(replace);
    3607           51 :     COPY_NODE_FIELD(type_name);
    3608           51 :     COPY_STRING_FIELD(lang);
    3609           51 :     COPY_NODE_FIELD(fromsql);
    3610           51 :     COPY_NODE_FIELD(tosql);
    3611              : 
    3612           51 :     return newnode;
    3613              : }
    3614              : 
    3615              : static PrepareStmt *
    3616         2170 : _copyPrepareStmt(const PrepareStmt *from)
    3617              : {
    3618         2170 :     PrepareStmt *newnode = makeNode(PrepareStmt);
    3619              : 
    3620         2170 :     COPY_STRING_FIELD(name);
    3621         2170 :     COPY_NODE_FIELD(argtypes);
    3622         2170 :     COPY_NODE_FIELD(query);
    3623              : 
    3624         2170 :     return newnode;
    3625              : }
    3626              : 
    3627              : static ExecuteStmt *
    3628        16890 : _copyExecuteStmt(const ExecuteStmt *from)
    3629              : {
    3630        16890 :     ExecuteStmt *newnode = makeNode(ExecuteStmt);
    3631              : 
    3632        16890 :     COPY_STRING_FIELD(name);
    3633        16890 :     COPY_NODE_FIELD(params);
    3634              : 
    3635        16890 :     return newnode;
    3636              : }
    3637              : 
    3638              : static DeallocateStmt *
    3639         4102 : _copyDeallocateStmt(const DeallocateStmt *from)
    3640              : {
    3641         4102 :     DeallocateStmt *newnode = makeNode(DeallocateStmt);
    3642              : 
    3643         4102 :     COPY_STRING_FIELD(name);
    3644         4102 :     COPY_SCALAR_FIELD(isall);
    3645         4102 :     COPY_LOCATION_FIELD(location);
    3646              : 
    3647         4102 :     return newnode;
    3648              : }
    3649              : 
    3650              : static DropOwnedStmt *
    3651          148 : _copyDropOwnedStmt(const DropOwnedStmt *from)
    3652              : {
    3653          148 :     DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
    3654              : 
    3655          148 :     COPY_NODE_FIELD(roles);
    3656          148 :     COPY_SCALAR_FIELD(behavior);
    3657              : 
    3658          148 :     return newnode;
    3659              : }
    3660              : 
    3661              : static ReassignOwnedStmt *
    3662           46 : _copyReassignOwnedStmt(const ReassignOwnedStmt *from)
    3663              : {
    3664           46 :     ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
    3665              : 
    3666           46 :     COPY_NODE_FIELD(roles);
    3667           46 :     COPY_NODE_FIELD(newrole);
    3668              : 
    3669           46 :     return newnode;
    3670              : }
    3671              : 
    3672              : static AlterTSDictionaryStmt *
    3673           40 : _copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
    3674              : {
    3675           40 :     AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
    3676              : 
    3677           40 :     COPY_NODE_FIELD(dictname);
    3678           40 :     COPY_NODE_FIELD(options);
    3679              : 
    3680           40 :     return newnode;
    3681              : }
    3682              : 
    3683              : static AlterTSConfigurationStmt *
    3684         9358 : _copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
    3685              : {
    3686         9358 :     AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
    3687              : 
    3688         9358 :     COPY_SCALAR_FIELD(kind);
    3689         9358 :     COPY_NODE_FIELD(cfgname);
    3690         9358 :     COPY_NODE_FIELD(tokentype);
    3691         9358 :     COPY_NODE_FIELD(dicts);
    3692         9358 :     COPY_SCALAR_FIELD(override);
    3693         9358 :     COPY_SCALAR_FIELD(replace);
    3694         9358 :     COPY_SCALAR_FIELD(missing_ok);
    3695              : 
    3696         9358 :     return newnode;
    3697              : }
    3698              : 
    3699              : static PublicationTable *
    3700         1512 : _copyPublicationTable(const PublicationTable *from)
    3701              : {
    3702         1512 :     PublicationTable *newnode = makeNode(PublicationTable);
    3703              : 
    3704         1512 :     COPY_NODE_FIELD(relation);
    3705         1512 :     COPY_NODE_FIELD(whereClause);
    3706         1512 :     COPY_NODE_FIELD(columns);
    3707         1512 :     COPY_SCALAR_FIELD(except);
    3708              : 
    3709         1512 :     return newnode;
    3710              : }
    3711              : 
    3712              : static PublicationObjSpec *
    3713         1908 : _copyPublicationObjSpec(const PublicationObjSpec *from)
    3714              : {
    3715         1908 :     PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
    3716              : 
    3717         1908 :     COPY_SCALAR_FIELD(pubobjtype);
    3718         1908 :     COPY_STRING_FIELD(name);
    3719         1908 :     COPY_NODE_FIELD(pubtable);
    3720         1908 :     COPY_LOCATION_FIELD(location);
    3721              : 
    3722         1908 :     return newnode;
    3723              : }
    3724              : 
    3725              : static PublicationAllObjSpec *
    3726            0 : _copyPublicationAllObjSpec(const PublicationAllObjSpec *from)
    3727              : {
    3728            0 :     PublicationAllObjSpec *newnode = makeNode(PublicationAllObjSpec);
    3729              : 
    3730            0 :     COPY_SCALAR_FIELD(pubobjtype);
    3731            0 :     COPY_NODE_FIELD(except_tables);
    3732            0 :     COPY_LOCATION_FIELD(location);
    3733              : 
    3734            0 :     return newnode;
    3735              : }
    3736              : 
    3737              : static CreatePublicationStmt *
    3738          960 : _copyCreatePublicationStmt(const CreatePublicationStmt *from)
    3739              : {
    3740          960 :     CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
    3741              : 
    3742          960 :     COPY_STRING_FIELD(pubname);
    3743          960 :     COPY_NODE_FIELD(options);
    3744          960 :     COPY_NODE_FIELD(pubobjects);
    3745          960 :     COPY_SCALAR_FIELD(for_all_tables);
    3746          960 :     COPY_SCALAR_FIELD(for_all_sequences);
    3747              : 
    3748          960 :     return newnode;
    3749              : }
    3750              : 
    3751              : static AlterPublicationStmt *
    3752         1106 : _copyAlterPublicationStmt(const AlterPublicationStmt *from)
    3753              : {
    3754         1106 :     AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
    3755              : 
    3756         1106 :     COPY_STRING_FIELD(pubname);
    3757         1106 :     COPY_NODE_FIELD(options);
    3758         1106 :     COPY_NODE_FIELD(pubobjects);
    3759         1106 :     COPY_SCALAR_FIELD(action);
    3760              : 
    3761         1106 :     return newnode;
    3762              : }
    3763              : 
    3764              : static CreateSubscriptionStmt *
    3765          522 : _copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
    3766              : {
    3767          522 :     CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
    3768              : 
    3769          522 :     COPY_STRING_FIELD(subname);
    3770          522 :     COPY_STRING_FIELD(servername);
    3771          522 :     COPY_STRING_FIELD(conninfo);
    3772          522 :     COPY_NODE_FIELD(publication);
    3773          522 :     COPY_NODE_FIELD(options);
    3774              : 
    3775          522 :     return newnode;
    3776              : }
    3777              : 
    3778              : static AlterSubscriptionStmt *
    3779          584 : _copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
    3780              : {
    3781          584 :     AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
    3782              : 
    3783          584 :     COPY_SCALAR_FIELD(kind);
    3784          584 :     COPY_STRING_FIELD(subname);
    3785          584 :     COPY_STRING_FIELD(servername);
    3786          584 :     COPY_STRING_FIELD(conninfo);
    3787          584 :     COPY_NODE_FIELD(publication);
    3788          584 :     COPY_NODE_FIELD(options);
    3789              : 
    3790          584 :     return newnode;
    3791              : }
    3792              : 
    3793              : static DropSubscriptionStmt *
    3794          274 : _copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
    3795              : {
    3796          274 :     DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
    3797              : 
    3798          274 :     COPY_STRING_FIELD(subname);
    3799          274 :     COPY_SCALAR_FIELD(missing_ok);
    3800          274 :     COPY_SCALAR_FIELD(behavior);
    3801              : 
    3802          274 :     return newnode;
    3803              : }
    3804              : 
    3805              : static WaitStmt *
    3806          110 : _copyWaitStmt(const WaitStmt *from)
    3807              : {
    3808          110 :     WaitStmt *newnode = makeNode(WaitStmt);
    3809              : 
    3810          110 :     COPY_STRING_FIELD(lsn_literal);
    3811          110 :     COPY_NODE_FIELD(options);
    3812              : 
    3813          110 :     return newnode;
    3814              : }
    3815              : 
    3816              : static PathKey *
    3817            0 : _copyPathKey(const PathKey *from)
    3818              : {
    3819            0 :     PathKey *newnode = makeNode(PathKey);
    3820              : 
    3821            0 :     COPY_SCALAR_FIELD(pk_eclass);
    3822            0 :     COPY_SCALAR_FIELD(pk_opfamily);
    3823            0 :     COPY_SCALAR_FIELD(pk_cmptype);
    3824            0 :     COPY_SCALAR_FIELD(pk_nulls_first);
    3825              : 
    3826            0 :     return newnode;
    3827              : }
    3828              : 
    3829              : static GroupByOrdering *
    3830            0 : _copyGroupByOrdering(const GroupByOrdering *from)
    3831              : {
    3832            0 :     GroupByOrdering *newnode = makeNode(GroupByOrdering);
    3833              : 
    3834            0 :     COPY_NODE_FIELD(pathkeys);
    3835            0 :     COPY_NODE_FIELD(clauses);
    3836              : 
    3837            0 :     return newnode;
    3838              : }
    3839              : 
    3840              : static RestrictInfo *
    3841            0 : _copyRestrictInfo(const RestrictInfo *from)
    3842              : {
    3843            0 :     RestrictInfo *newnode = makeNode(RestrictInfo);
    3844              : 
    3845            0 :     COPY_NODE_FIELD(clause);
    3846            0 :     COPY_SCALAR_FIELD(is_pushed_down);
    3847            0 :     COPY_SCALAR_FIELD(can_join);
    3848            0 :     COPY_SCALAR_FIELD(pseudoconstant);
    3849            0 :     COPY_SCALAR_FIELD(has_clone);
    3850            0 :     COPY_SCALAR_FIELD(is_clone);
    3851            0 :     COPY_SCALAR_FIELD(leakproof);
    3852            0 :     COPY_SCALAR_FIELD(has_volatile);
    3853            0 :     COPY_SCALAR_FIELD(security_level);
    3854            0 :     COPY_SCALAR_FIELD(num_base_rels);
    3855            0 :     COPY_BITMAPSET_FIELD(clause_relids);
    3856            0 :     COPY_BITMAPSET_FIELD(required_relids);
    3857            0 :     COPY_BITMAPSET_FIELD(incompatible_relids);
    3858            0 :     COPY_BITMAPSET_FIELD(outer_relids);
    3859            0 :     COPY_BITMAPSET_FIELD(left_relids);
    3860            0 :     COPY_BITMAPSET_FIELD(right_relids);
    3861            0 :     COPY_NODE_FIELD(orclause);
    3862            0 :     COPY_SCALAR_FIELD(rinfo_serial);
    3863            0 :     COPY_SCALAR_FIELD(parent_ec);
    3864            0 :     COPY_SCALAR_FIELD(eval_cost);
    3865            0 :     COPY_SCALAR_FIELD(norm_selec);
    3866            0 :     COPY_SCALAR_FIELD(outer_selec);
    3867            0 :     COPY_NODE_FIELD(mergeopfamilies);
    3868            0 :     COPY_SCALAR_FIELD(left_ec);
    3869            0 :     COPY_SCALAR_FIELD(right_ec);
    3870            0 :     COPY_SCALAR_FIELD(left_em);
    3871            0 :     COPY_SCALAR_FIELD(right_em);
    3872            0 :     newnode->scansel_cache = NIL;
    3873            0 :     COPY_SCALAR_FIELD(outer_is_left);
    3874            0 :     COPY_SCALAR_FIELD(hashjoinoperator);
    3875            0 :     COPY_SCALAR_FIELD(left_bucketsize);
    3876            0 :     COPY_SCALAR_FIELD(right_bucketsize);
    3877            0 :     COPY_SCALAR_FIELD(left_mcvfreq);
    3878            0 :     COPY_SCALAR_FIELD(right_mcvfreq);
    3879            0 :     COPY_SCALAR_FIELD(left_hasheqoperator);
    3880            0 :     COPY_SCALAR_FIELD(right_hasheqoperator);
    3881              : 
    3882            0 :     return newnode;
    3883              : }
    3884              : 
    3885              : static PlaceHolderVar *
    3886         8189 : _copyPlaceHolderVar(const PlaceHolderVar *from)
    3887              : {
    3888         8189 :     PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
    3889              : 
    3890         8189 :     COPY_NODE_FIELD(phexpr);
    3891         8189 :     COPY_BITMAPSET_FIELD(phrels);
    3892         8189 :     COPY_BITMAPSET_FIELD(phnullingrels);
    3893         8189 :     COPY_SCALAR_FIELD(phid);
    3894         8189 :     COPY_SCALAR_FIELD(phlevelsup);
    3895              : 
    3896         8189 :     return newnode;
    3897              : }
    3898              : 
    3899              : static SpecialJoinInfo *
    3900            0 : _copySpecialJoinInfo(const SpecialJoinInfo *from)
    3901              : {
    3902            0 :     SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
    3903              : 
    3904            0 :     COPY_BITMAPSET_FIELD(min_lefthand);
    3905            0 :     COPY_BITMAPSET_FIELD(min_righthand);
    3906            0 :     COPY_BITMAPSET_FIELD(syn_lefthand);
    3907            0 :     COPY_BITMAPSET_FIELD(syn_righthand);
    3908            0 :     COPY_SCALAR_FIELD(jointype);
    3909            0 :     COPY_SCALAR_FIELD(ojrelid);
    3910            0 :     COPY_BITMAPSET_FIELD(commute_above_l);
    3911            0 :     COPY_BITMAPSET_FIELD(commute_above_r);
    3912            0 :     COPY_BITMAPSET_FIELD(commute_below_l);
    3913            0 :     COPY_BITMAPSET_FIELD(commute_below_r);
    3914            0 :     COPY_SCALAR_FIELD(lhs_strict);
    3915            0 :     COPY_SCALAR_FIELD(semi_can_btree);
    3916            0 :     COPY_SCALAR_FIELD(semi_can_hash);
    3917            0 :     COPY_NODE_FIELD(semi_operators);
    3918            0 :     COPY_NODE_FIELD(semi_rhs_exprs);
    3919              : 
    3920            0 :     return newnode;
    3921              : }
    3922              : 
    3923              : static AppendRelInfo *
    3924        33938 : _copyAppendRelInfo(const AppendRelInfo *from)
    3925              : {
    3926        33938 :     AppendRelInfo *newnode = makeNode(AppendRelInfo);
    3927              : 
    3928        33938 :     COPY_SCALAR_FIELD(parent_relid);
    3929        33938 :     COPY_SCALAR_FIELD(child_relid);
    3930        33938 :     COPY_SCALAR_FIELD(parent_reltype);
    3931        33938 :     COPY_SCALAR_FIELD(child_reltype);
    3932        33938 :     COPY_NODE_FIELD(translated_vars);
    3933        33938 :     COPY_SCALAR_FIELD(num_child_cols);
    3934        33938 :     COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
    3935        33938 :     COPY_SCALAR_FIELD(parent_reloid);
    3936              : 
    3937        33938 :     return newnode;
    3938              : }
    3939              : 
    3940              : static PlaceHolderInfo *
    3941            0 : _copyPlaceHolderInfo(const PlaceHolderInfo *from)
    3942              : {
    3943            0 :     PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
    3944              : 
    3945            0 :     COPY_SCALAR_FIELD(phid);
    3946            0 :     COPY_NODE_FIELD(ph_var);
    3947            0 :     COPY_BITMAPSET_FIELD(ph_eval_at);
    3948            0 :     COPY_BITMAPSET_FIELD(ph_lateral);
    3949            0 :     COPY_BITMAPSET_FIELD(ph_needed);
    3950            0 :     COPY_SCALAR_FIELD(ph_width);
    3951              : 
    3952            0 :     return newnode;
    3953              : }
    3954              : 
    3955              : static AggClauseInfo *
    3956            0 : _copyAggClauseInfo(const AggClauseInfo *from)
    3957              : {
    3958            0 :     AggClauseInfo *newnode = makeNode(AggClauseInfo);
    3959              : 
    3960            0 :     COPY_NODE_FIELD(aggref);
    3961            0 :     COPY_BITMAPSET_FIELD(agg_eval_at);
    3962              : 
    3963            0 :     return newnode;
    3964              : }
    3965              : 
    3966              : static GroupingExprInfo *
    3967            0 : _copyGroupingExprInfo(const GroupingExprInfo *from)
    3968              : {
    3969            0 :     GroupingExprInfo *newnode = makeNode(GroupingExprInfo);
    3970              : 
    3971            0 :     COPY_NODE_FIELD(expr);
    3972            0 :     COPY_SCALAR_FIELD(sortgroupref);
    3973            0 :     COPY_SCALAR_FIELD(ec);
    3974              : 
    3975            0 :     return newnode;
    3976              : }
    3977              : 
    3978              : static PlannedStmt *
    3979       306660 : _copyPlannedStmt(const PlannedStmt *from)
    3980              : {
    3981       306660 :     PlannedStmt *newnode = makeNode(PlannedStmt);
    3982              : 
    3983       306660 :     COPY_SCALAR_FIELD(commandType);
    3984       306660 :     COPY_SCALAR_FIELD(queryId);
    3985       306660 :     COPY_SCALAR_FIELD(planId);
    3986       306660 :     COPY_SCALAR_FIELD(planOrigin);
    3987       306660 :     COPY_SCALAR_FIELD(hasReturning);
    3988       306660 :     COPY_SCALAR_FIELD(hasModifyingCTE);
    3989       306660 :     COPY_SCALAR_FIELD(canSetTag);
    3990       306660 :     COPY_SCALAR_FIELD(transientPlan);
    3991       306660 :     COPY_SCALAR_FIELD(dependsOnRole);
    3992       306660 :     COPY_SCALAR_FIELD(parallelModeNeeded);
    3993       306660 :     COPY_SCALAR_FIELD(jitFlags);
    3994       306660 :     COPY_NODE_FIELD(planTree);
    3995       306660 :     COPY_NODE_FIELD(partPruneInfos);
    3996       306660 :     COPY_NODE_FIELD(rtable);
    3997       306660 :     COPY_BITMAPSET_FIELD(unprunableRelids);
    3998       306660 :     COPY_NODE_FIELD(permInfos);
    3999       306660 :     COPY_NODE_FIELD(resultRelations);
    4000       306660 :     COPY_NODE_FIELD(appendRelations);
    4001       306660 :     COPY_NODE_FIELD(subplans);
    4002       306660 :     COPY_NODE_FIELD(subrtinfos);
    4003       306660 :     COPY_BITMAPSET_FIELD(rewindPlanIDs);
    4004       306660 :     COPY_NODE_FIELD(rowMarks);
    4005       306660 :     COPY_NODE_FIELD(relationOids);
    4006       306660 :     COPY_NODE_FIELD(invalItems);
    4007       306660 :     COPY_NODE_FIELD(paramExecTypes);
    4008       306660 :     COPY_NODE_FIELD(utilityStmt);
    4009       306660 :     COPY_NODE_FIELD(elidedNodes);
    4010       306660 :     COPY_NODE_FIELD(extension_state);
    4011       306660 :     COPY_LOCATION_FIELD(stmt_location);
    4012       306660 :     COPY_LOCATION_FIELD(stmt_len);
    4013              : 
    4014       306660 :     return newnode;
    4015              : }
    4016              : 
    4017              : static Result *
    4018       133805 : _copyResult(const Result *from)
    4019              : {
    4020       133805 :     Result *newnode = makeNode(Result);
    4021              : 
    4022       133805 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    4023       133805 :     COPY_SCALAR_FIELD(plan.startup_cost);
    4024       133805 :     COPY_SCALAR_FIELD(plan.total_cost);
    4025       133805 :     COPY_SCALAR_FIELD(plan.plan_rows);
    4026       133805 :     COPY_SCALAR_FIELD(plan.plan_width);
    4027       133805 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    4028       133805 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    4029       133805 :     COPY_SCALAR_FIELD(plan.async_capable);
    4030       133805 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    4031       133805 :     COPY_NODE_FIELD(plan.targetlist);
    4032       133805 :     COPY_NODE_FIELD(plan.qual);
    4033       133805 :     COPY_NODE_FIELD(plan.lefttree);
    4034       133805 :     COPY_NODE_FIELD(plan.righttree);
    4035       133805 :     COPY_NODE_FIELD(plan.initPlan);
    4036       133805 :     COPY_BITMAPSET_FIELD(plan.extParam);
    4037       133805 :     COPY_BITMAPSET_FIELD(plan.allParam);
    4038       133805 :     COPY_SCALAR_FIELD(result_type);
    4039       133805 :     COPY_NODE_FIELD(resconstantqual);
    4040       133805 :     COPY_BITMAPSET_FIELD(relids);
    4041              : 
    4042       133805 :     return newnode;
    4043              : }
    4044              : 
    4045              : static ProjectSet *
    4046         6878 : _copyProjectSet(const ProjectSet *from)
    4047              : {
    4048         6878 :     ProjectSet *newnode = makeNode(ProjectSet);
    4049              : 
    4050         6878 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    4051         6878 :     COPY_SCALAR_FIELD(plan.startup_cost);
    4052         6878 :     COPY_SCALAR_FIELD(plan.total_cost);
    4053         6878 :     COPY_SCALAR_FIELD(plan.plan_rows);
    4054         6878 :     COPY_SCALAR_FIELD(plan.plan_width);
    4055         6878 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    4056         6878 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    4057         6878 :     COPY_SCALAR_FIELD(plan.async_capable);
    4058         6878 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    4059         6878 :     COPY_NODE_FIELD(plan.targetlist);
    4060         6878 :     COPY_NODE_FIELD(plan.qual);
    4061         6878 :     COPY_NODE_FIELD(plan.lefttree);
    4062         6878 :     COPY_NODE_FIELD(plan.righttree);
    4063         6878 :     COPY_NODE_FIELD(plan.initPlan);
    4064         6878 :     COPY_BITMAPSET_FIELD(plan.extParam);
    4065         6878 :     COPY_BITMAPSET_FIELD(plan.allParam);
    4066              : 
    4067         6878 :     return newnode;
    4068              : }
    4069              : 
    4070              : static ModifyTable *
    4071        52430 : _copyModifyTable(const ModifyTable *from)
    4072              : {
    4073        52430 :     ModifyTable *newnode = makeNode(ModifyTable);
    4074              : 
    4075        52430 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    4076        52430 :     COPY_SCALAR_FIELD(plan.startup_cost);
    4077        52430 :     COPY_SCALAR_FIELD(plan.total_cost);
    4078        52430 :     COPY_SCALAR_FIELD(plan.plan_rows);
    4079        52430 :     COPY_SCALAR_FIELD(plan.plan_width);
    4080        52430 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    4081        52430 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    4082        52430 :     COPY_SCALAR_FIELD(plan.async_capable);
    4083        52430 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    4084        52430 :     COPY_NODE_FIELD(plan.targetlist);
    4085        52430 :     COPY_NODE_FIELD(plan.qual);
    4086        52430 :     COPY_NODE_FIELD(plan.lefttree);
    4087        52430 :     COPY_NODE_FIELD(plan.righttree);
    4088        52430 :     COPY_NODE_FIELD(plan.initPlan);
    4089        52430 :     COPY_BITMAPSET_FIELD(plan.extParam);
    4090        52430 :     COPY_BITMAPSET_FIELD(plan.allParam);
    4091        52430 :     COPY_SCALAR_FIELD(operation);
    4092        52430 :     COPY_SCALAR_FIELD(canSetTag);
    4093        52430 :     COPY_SCALAR_FIELD(nominalRelation);
    4094        52430 :     COPY_SCALAR_FIELD(rootRelation);
    4095        52430 :     COPY_NODE_FIELD(resultRelations);
    4096        52430 :     COPY_NODE_FIELD(updateColnosLists);
    4097        52430 :     COPY_NODE_FIELD(withCheckOptionLists);
    4098        52430 :     COPY_STRING_FIELD(returningOldAlias);
    4099        52430 :     COPY_STRING_FIELD(returningNewAlias);
    4100        52430 :     COPY_NODE_FIELD(returningLists);
    4101        52430 :     COPY_NODE_FIELD(fdwPrivLists);
    4102        52430 :     COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
    4103        52430 :     COPY_NODE_FIELD(rowMarks);
    4104        52430 :     COPY_SCALAR_FIELD(epqParam);
    4105        52430 :     COPY_SCALAR_FIELD(onConflictAction);
    4106        52430 :     COPY_NODE_FIELD(arbiterIndexes);
    4107        52430 :     COPY_SCALAR_FIELD(onConflictLockStrength);
    4108        52430 :     COPY_NODE_FIELD(onConflictSet);
    4109        52430 :     COPY_NODE_FIELD(onConflictCols);
    4110        52430 :     COPY_NODE_FIELD(onConflictWhere);
    4111        52430 :     COPY_SCALAR_FIELD(exclRelRTI);
    4112        52430 :     COPY_NODE_FIELD(exclRelTlist);
    4113        52430 :     COPY_NODE_FIELD(mergeActionLists);
    4114        52430 :     COPY_NODE_FIELD(mergeJoinConditions);
    4115              : 
    4116        52430 :     return newnode;
    4117              : }
    4118              : 
    4119              : static Append *
    4120         9748 : _copyAppend(const Append *from)
    4121              : {
    4122         9748 :     Append *newnode = makeNode(Append);
    4123              : 
    4124         9748 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    4125         9748 :     COPY_SCALAR_FIELD(plan.startup_cost);
    4126         9748 :     COPY_SCALAR_FIELD(plan.total_cost);
    4127         9748 :     COPY_SCALAR_FIELD(plan.plan_rows);
    4128         9748 :     COPY_SCALAR_FIELD(plan.plan_width);
    4129         9748 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    4130         9748 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    4131         9748 :     COPY_SCALAR_FIELD(plan.async_capable);
    4132         9748 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    4133         9748 :     COPY_NODE_FIELD(plan.targetlist);
    4134         9748 :     COPY_NODE_FIELD(plan.qual);
    4135         9748 :     COPY_NODE_FIELD(plan.lefttree);
    4136         9748 :     COPY_NODE_FIELD(plan.righttree);
    4137         9748 :     COPY_NODE_FIELD(plan.initPlan);
    4138         9748 :     COPY_BITMAPSET_FIELD(plan.extParam);
    4139         9748 :     COPY_BITMAPSET_FIELD(plan.allParam);
    4140         9748 :     COPY_BITMAPSET_FIELD(apprelids);
    4141         9748 :     COPY_NODE_FIELD(child_append_relid_sets);
    4142         9748 :     COPY_NODE_FIELD(appendplans);
    4143         9748 :     COPY_SCALAR_FIELD(nasyncplans);
    4144         9748 :     COPY_SCALAR_FIELD(first_partial_plan);
    4145         9748 :     COPY_SCALAR_FIELD(part_prune_index);
    4146              : 
    4147         9748 :     return newnode;
    4148              : }
    4149              : 
    4150              : static MergeAppend *
    4151          305 : _copyMergeAppend(const MergeAppend *from)
    4152              : {
    4153          305 :     MergeAppend *newnode = makeNode(MergeAppend);
    4154              : 
    4155          305 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    4156          305 :     COPY_SCALAR_FIELD(plan.startup_cost);
    4157          305 :     COPY_SCALAR_FIELD(plan.total_cost);
    4158          305 :     COPY_SCALAR_FIELD(plan.plan_rows);
    4159          305 :     COPY_SCALAR_FIELD(plan.plan_width);
    4160          305 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    4161          305 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    4162          305 :     COPY_SCALAR_FIELD(plan.async_capable);
    4163          305 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    4164          305 :     COPY_NODE_FIELD(plan.targetlist);
    4165          305 :     COPY_NODE_FIELD(plan.qual);
    4166          305 :     COPY_NODE_FIELD(plan.lefttree);
    4167          305 :     COPY_NODE_FIELD(plan.righttree);
    4168          305 :     COPY_NODE_FIELD(plan.initPlan);
    4169          305 :     COPY_BITMAPSET_FIELD(plan.extParam);
    4170          305 :     COPY_BITMAPSET_FIELD(plan.allParam);
    4171          305 :     COPY_BITMAPSET_FIELD(apprelids);
    4172          305 :     COPY_NODE_FIELD(child_append_relid_sets);
    4173          305 :     COPY_NODE_FIELD(mergeplans);
    4174          305 :     COPY_SCALAR_FIELD(numCols);
    4175          305 :     COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
    4176          305 :     COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
    4177          305 :     COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
    4178          305 :     COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
    4179          305 :     COPY_SCALAR_FIELD(part_prune_index);
    4180              : 
    4181          305 :     return newnode;
    4182              : }
    4183              : 
    4184              : static RecursiveUnion *
    4185          538 : _copyRecursiveUnion(const RecursiveUnion *from)
    4186              : {
    4187          538 :     RecursiveUnion *newnode = makeNode(RecursiveUnion);
    4188              : 
    4189          538 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    4190          538 :     COPY_SCALAR_FIELD(plan.startup_cost);
    4191          538 :     COPY_SCALAR_FIELD(plan.total_cost);
    4192          538 :     COPY_SCALAR_FIELD(plan.plan_rows);
    4193          538 :     COPY_SCALAR_FIELD(plan.plan_width);
    4194          538 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    4195          538 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    4196          538 :     COPY_SCALAR_FIELD(plan.async_capable);
    4197          538 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    4198          538 :     COPY_NODE_FIELD(plan.targetlist);
    4199          538 :     COPY_NODE_FIELD(plan.qual);
    4200          538 :     COPY_NODE_FIELD(plan.lefttree);
    4201          538 :     COPY_NODE_FIELD(plan.righttree);
    4202          538 :     COPY_NODE_FIELD(plan.initPlan);
    4203          538 :     COPY_BITMAPSET_FIELD(plan.extParam);
    4204          538 :     COPY_BITMAPSET_FIELD(plan.allParam);
    4205          538 :     COPY_SCALAR_FIELD(wtParam);
    4206          538 :     COPY_SCALAR_FIELD(numCols);
    4207          538 :     COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
    4208          538 :     COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
    4209          538 :     COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
    4210          538 :     COPY_SCALAR_FIELD(numGroups);
    4211              : 
    4212          538 :     return newnode;
    4213              : }
    4214              : 
    4215              : static BitmapAnd *
    4216          127 : _copyBitmapAnd(const BitmapAnd *from)
    4217              : {
    4218          127 :     BitmapAnd *newnode = makeNode(BitmapAnd);
    4219              : 
    4220          127 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    4221          127 :     COPY_SCALAR_FIELD(plan.startup_cost);
    4222          127 :     COPY_SCALAR_FIELD(plan.total_cost);
    4223          127 :     COPY_SCALAR_FIELD(plan.plan_rows);
    4224          127 :     COPY_SCALAR_FIELD(plan.plan_width);
    4225          127 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    4226          127 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    4227          127 :     COPY_SCALAR_FIELD(plan.async_capable);
    4228          127 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    4229          127 :     COPY_NODE_FIELD(plan.targetlist);
    4230          127 :     COPY_NODE_FIELD(plan.qual);
    4231          127 :     COPY_NODE_FIELD(plan.lefttree);
    4232          127 :     COPY_NODE_FIELD(plan.righttree);
    4233          127 :     COPY_NODE_FIELD(plan.initPlan);
    4234          127 :     COPY_BITMAPSET_FIELD(plan.extParam);
    4235          127 :     COPY_BITMAPSET_FIELD(plan.allParam);
    4236          127 :     COPY_NODE_FIELD(bitmapplans);
    4237              : 
    4238          127 :     return newnode;
    4239              : }
    4240              : 
    4241              : static BitmapOr *
    4242          218 : _copyBitmapOr(const BitmapOr *from)
    4243              : {
    4244          218 :     BitmapOr *newnode = makeNode(BitmapOr);
    4245              : 
    4246          218 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    4247          218 :     COPY_SCALAR_FIELD(plan.startup_cost);
    4248          218 :     COPY_SCALAR_FIELD(plan.total_cost);
    4249          218 :     COPY_SCALAR_FIELD(plan.plan_rows);
    4250          218 :     COPY_SCALAR_FIELD(plan.plan_width);
    4251          218 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    4252          218 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    4253          218 :     COPY_SCALAR_FIELD(plan.async_capable);
    4254          218 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    4255          218 :     COPY_NODE_FIELD(plan.targetlist);
    4256          218 :     COPY_NODE_FIELD(plan.qual);
    4257          218 :     COPY_NODE_FIELD(plan.lefttree);
    4258          218 :     COPY_NODE_FIELD(plan.righttree);
    4259          218 :     COPY_NODE_FIELD(plan.initPlan);
    4260          218 :     COPY_BITMAPSET_FIELD(plan.extParam);
    4261          218 :     COPY_BITMAPSET_FIELD(plan.allParam);
    4262          218 :     COPY_SCALAR_FIELD(isshared);
    4263          218 :     COPY_NODE_FIELD(bitmapplans);
    4264              : 
    4265          218 :     return newnode;
    4266              : }
    4267              : 
    4268              : static SeqScan *
    4269       135059 : _copySeqScan(const SeqScan *from)
    4270              : {
    4271       135059 :     SeqScan *newnode = makeNode(SeqScan);
    4272              : 
    4273       135059 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4274       135059 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4275       135059 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4276       135059 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4277       135059 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4278       135059 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4279       135059 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4280       135059 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4281       135059 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4282       135059 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4283       135059 :     COPY_NODE_FIELD(scan.plan.qual);
    4284       135059 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4285       135059 :     COPY_NODE_FIELD(scan.plan.righttree);
    4286       135059 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4287       135059 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4288       135059 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4289       135059 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4290              : 
    4291       135059 :     return newnode;
    4292              : }
    4293              : 
    4294              : static SampleScan *
    4295          156 : _copySampleScan(const SampleScan *from)
    4296              : {
    4297          156 :     SampleScan *newnode = makeNode(SampleScan);
    4298              : 
    4299          156 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4300          156 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4301          156 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4302          156 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4303          156 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4304          156 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4305          156 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4306          156 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4307          156 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4308          156 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4309          156 :     COPY_NODE_FIELD(scan.plan.qual);
    4310          156 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4311          156 :     COPY_NODE_FIELD(scan.plan.righttree);
    4312          156 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4313          156 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4314          156 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4315          156 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4316          156 :     COPY_NODE_FIELD(tablesample);
    4317              : 
    4318          156 :     return newnode;
    4319              : }
    4320              : 
    4321              : static IndexScan *
    4322        84304 : _copyIndexScan(const IndexScan *from)
    4323              : {
    4324        84304 :     IndexScan *newnode = makeNode(IndexScan);
    4325              : 
    4326        84304 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4327        84304 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4328        84304 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4329        84304 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4330        84304 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4331        84304 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4332        84304 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4333        84304 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4334        84304 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4335        84304 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4336        84304 :     COPY_NODE_FIELD(scan.plan.qual);
    4337        84304 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4338        84304 :     COPY_NODE_FIELD(scan.plan.righttree);
    4339        84304 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4340        84304 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4341        84304 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4342        84304 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4343        84304 :     COPY_SCALAR_FIELD(indexid);
    4344        84304 :     COPY_NODE_FIELD(indexqual);
    4345        84304 :     COPY_NODE_FIELD(indexqualorig);
    4346        84304 :     COPY_NODE_FIELD(indexorderby);
    4347        84304 :     COPY_NODE_FIELD(indexorderbyorig);
    4348        84304 :     COPY_NODE_FIELD(indexorderbyops);
    4349        84304 :     COPY_SCALAR_FIELD(indexorderdir);
    4350              : 
    4351        84304 :     return newnode;
    4352              : }
    4353              : 
    4354              : static IndexOnlyScan *
    4355        11006 : _copyIndexOnlyScan(const IndexOnlyScan *from)
    4356              : {
    4357        11006 :     IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
    4358              : 
    4359        11006 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4360        11006 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4361        11006 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4362        11006 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4363        11006 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4364        11006 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4365        11006 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4366        11006 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4367        11006 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4368        11006 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4369        11006 :     COPY_NODE_FIELD(scan.plan.qual);
    4370        11006 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4371        11006 :     COPY_NODE_FIELD(scan.plan.righttree);
    4372        11006 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4373        11006 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4374        11006 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4375        11006 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4376        11006 :     COPY_SCALAR_FIELD(indexid);
    4377        11006 :     COPY_NODE_FIELD(indexqual);
    4378        11006 :     COPY_NODE_FIELD(recheckqual);
    4379        11006 :     COPY_NODE_FIELD(indexorderby);
    4380        11006 :     COPY_NODE_FIELD(indextlist);
    4381        11006 :     COPY_SCALAR_FIELD(indexorderdir);
    4382              : 
    4383        11006 :     return newnode;
    4384              : }
    4385              : 
    4386              : static BitmapIndexScan *
    4387        14520 : _copyBitmapIndexScan(const BitmapIndexScan *from)
    4388              : {
    4389        14520 :     BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
    4390              : 
    4391        14520 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4392        14520 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4393        14520 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4394        14520 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4395        14520 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4396        14520 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4397        14520 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4398        14520 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4399        14520 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4400        14520 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4401        14520 :     COPY_NODE_FIELD(scan.plan.qual);
    4402        14520 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4403        14520 :     COPY_NODE_FIELD(scan.plan.righttree);
    4404        14520 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4405        14520 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4406        14520 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4407        14520 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4408        14520 :     COPY_SCALAR_FIELD(indexid);
    4409        14520 :     COPY_SCALAR_FIELD(isshared);
    4410        14520 :     COPY_NODE_FIELD(indexqual);
    4411        14520 :     COPY_NODE_FIELD(indexqualorig);
    4412              : 
    4413        14520 :     return newnode;
    4414              : }
    4415              : 
    4416              : static BitmapHeapScan *
    4417        14172 : _copyBitmapHeapScan(const BitmapHeapScan *from)
    4418              : {
    4419        14172 :     BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
    4420              : 
    4421        14172 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4422        14172 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4423        14172 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4424        14172 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4425        14172 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4426        14172 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4427        14172 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4428        14172 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4429        14172 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4430        14172 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4431        14172 :     COPY_NODE_FIELD(scan.plan.qual);
    4432        14172 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4433        14172 :     COPY_NODE_FIELD(scan.plan.righttree);
    4434        14172 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4435        14172 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4436        14172 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4437        14172 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4438        14172 :     COPY_NODE_FIELD(bitmapqualorig);
    4439              : 
    4440        14172 :     return newnode;
    4441              : }
    4442              : 
    4443              : static TidScan *
    4444          510 : _copyTidScan(const TidScan *from)
    4445              : {
    4446          510 :     TidScan *newnode = makeNode(TidScan);
    4447              : 
    4448          510 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4449          510 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4450          510 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4451          510 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4452          510 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4453          510 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4454          510 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4455          510 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4456          510 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4457          510 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4458          510 :     COPY_NODE_FIELD(scan.plan.qual);
    4459          510 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4460          510 :     COPY_NODE_FIELD(scan.plan.righttree);
    4461          510 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4462          510 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4463          510 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4464          510 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4465          510 :     COPY_NODE_FIELD(tidquals);
    4466              : 
    4467          510 :     return newnode;
    4468              : }
    4469              : 
    4470              : static TidRangeScan *
    4471         1884 : _copyTidRangeScan(const TidRangeScan *from)
    4472              : {
    4473         1884 :     TidRangeScan *newnode = makeNode(TidRangeScan);
    4474              : 
    4475         1884 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4476         1884 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4477         1884 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4478         1884 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4479         1884 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4480         1884 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4481         1884 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4482         1884 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4483         1884 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4484         1884 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4485         1884 :     COPY_NODE_FIELD(scan.plan.qual);
    4486         1884 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4487         1884 :     COPY_NODE_FIELD(scan.plan.righttree);
    4488         1884 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4489         1884 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4490         1884 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4491         1884 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4492         1884 :     COPY_NODE_FIELD(tidrangequals);
    4493              : 
    4494         1884 :     return newnode;
    4495              : }
    4496              : 
    4497              : static SubqueryScan *
    4498        12922 : _copySubqueryScan(const SubqueryScan *from)
    4499              : {
    4500        12922 :     SubqueryScan *newnode = makeNode(SubqueryScan);
    4501              : 
    4502        12922 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4503        12922 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4504        12922 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4505        12922 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4506        12922 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4507        12922 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4508        12922 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4509        12922 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4510        12922 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4511        12922 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4512        12922 :     COPY_NODE_FIELD(scan.plan.qual);
    4513        12922 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4514        12922 :     COPY_NODE_FIELD(scan.plan.righttree);
    4515        12922 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4516        12922 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4517        12922 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4518        12922 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4519        12922 :     COPY_NODE_FIELD(subplan);
    4520        12922 :     COPY_SCALAR_FIELD(scanstatus);
    4521              : 
    4522        12922 :     return newnode;
    4523              : }
    4524              : 
    4525              : static FunctionScan *
    4526        29546 : _copyFunctionScan(const FunctionScan *from)
    4527              : {
    4528        29546 :     FunctionScan *newnode = makeNode(FunctionScan);
    4529              : 
    4530        29546 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4531        29546 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4532        29546 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4533        29546 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4534        29546 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4535        29546 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4536        29546 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4537        29546 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4538        29546 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4539        29546 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4540        29546 :     COPY_NODE_FIELD(scan.plan.qual);
    4541        29546 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4542        29546 :     COPY_NODE_FIELD(scan.plan.righttree);
    4543        29546 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4544        29546 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4545        29546 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4546        29546 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4547        29546 :     COPY_NODE_FIELD(functions);
    4548        29546 :     COPY_SCALAR_FIELD(funcordinality);
    4549              : 
    4550        29546 :     return newnode;
    4551              : }
    4552              : 
    4553              : static ValuesScan *
    4554         4428 : _copyValuesScan(const ValuesScan *from)
    4555              : {
    4556         4428 :     ValuesScan *newnode = makeNode(ValuesScan);
    4557              : 
    4558         4428 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4559         4428 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4560         4428 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4561         4428 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4562         4428 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4563         4428 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4564         4428 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4565         4428 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4566         4428 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4567         4428 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4568         4428 :     COPY_NODE_FIELD(scan.plan.qual);
    4569         4428 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4570         4428 :     COPY_NODE_FIELD(scan.plan.righttree);
    4571         4428 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4572         4428 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4573         4428 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4574         4428 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4575         4428 :     COPY_NODE_FIELD(values_lists);
    4576              : 
    4577         4428 :     return newnode;
    4578              : }
    4579              : 
    4580              : static TableFuncScan *
    4581          316 : _copyTableFuncScan(const TableFuncScan *from)
    4582              : {
    4583          316 :     TableFuncScan *newnode = makeNode(TableFuncScan);
    4584              : 
    4585          316 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4586          316 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4587          316 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4588          316 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4589          316 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4590          316 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4591          316 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4592          316 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4593          316 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4594          316 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4595          316 :     COPY_NODE_FIELD(scan.plan.qual);
    4596          316 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4597          316 :     COPY_NODE_FIELD(scan.plan.righttree);
    4598          316 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4599          316 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4600          316 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4601          316 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4602          316 :     COPY_NODE_FIELD(tablefunc);
    4603              : 
    4604          316 :     return newnode;
    4605              : }
    4606              : 
    4607              : static CteScan *
    4608         2477 : _copyCteScan(const CteScan *from)
    4609              : {
    4610         2477 :     CteScan *newnode = makeNode(CteScan);
    4611              : 
    4612         2477 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4613         2477 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4614         2477 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4615         2477 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4616         2477 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4617         2477 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4618         2477 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4619         2477 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4620         2477 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4621         2477 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4622         2477 :     COPY_NODE_FIELD(scan.plan.qual);
    4623         2477 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4624         2477 :     COPY_NODE_FIELD(scan.plan.righttree);
    4625         2477 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4626         2477 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4627         2477 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4628         2477 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4629         2477 :     COPY_SCALAR_FIELD(ctePlanId);
    4630         2477 :     COPY_SCALAR_FIELD(cteParam);
    4631              : 
    4632         2477 :     return newnode;
    4633              : }
    4634              : 
    4635              : static NamedTuplestoreScan *
    4636          460 : _copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
    4637              : {
    4638          460 :     NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
    4639              : 
    4640          460 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4641          460 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4642          460 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4643          460 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4644          460 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4645          460 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4646          460 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4647          460 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4648          460 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4649          460 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4650          460 :     COPY_NODE_FIELD(scan.plan.qual);
    4651          460 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4652          460 :     COPY_NODE_FIELD(scan.plan.righttree);
    4653          460 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4654          460 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4655          460 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4656          460 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4657          460 :     COPY_STRING_FIELD(enrname);
    4658              : 
    4659          460 :     return newnode;
    4660              : }
    4661              : 
    4662              : static WorkTableScan *
    4663          538 : _copyWorkTableScan(const WorkTableScan *from)
    4664              : {
    4665          538 :     WorkTableScan *newnode = makeNode(WorkTableScan);
    4666              : 
    4667          538 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4668          538 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4669          538 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4670          538 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4671          538 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4672          538 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4673          538 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4674          538 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4675          538 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4676          538 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4677          538 :     COPY_NODE_FIELD(scan.plan.qual);
    4678          538 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4679          538 :     COPY_NODE_FIELD(scan.plan.righttree);
    4680          538 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4681          538 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4682          538 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4683          538 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4684          538 :     COPY_SCALAR_FIELD(wtParam);
    4685              : 
    4686          538 :     return newnode;
    4687              : }
    4688              : 
    4689              : static ForeignScan *
    4690         1068 : _copyForeignScan(const ForeignScan *from)
    4691              : {
    4692         1068 :     ForeignScan *newnode = makeNode(ForeignScan);
    4693              : 
    4694         1068 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4695         1068 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4696         1068 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4697         1068 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4698         1068 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4699         1068 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4700         1068 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4701         1068 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4702         1068 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4703         1068 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4704         1068 :     COPY_NODE_FIELD(scan.plan.qual);
    4705         1068 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4706         1068 :     COPY_NODE_FIELD(scan.plan.righttree);
    4707         1068 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4708         1068 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4709         1068 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4710         1068 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4711         1068 :     COPY_SCALAR_FIELD(operation);
    4712         1068 :     COPY_SCALAR_FIELD(resultRelation);
    4713         1068 :     COPY_SCALAR_FIELD(checkAsUser);
    4714         1068 :     COPY_SCALAR_FIELD(fs_server);
    4715         1068 :     COPY_NODE_FIELD(fdw_exprs);
    4716         1068 :     COPY_NODE_FIELD(fdw_private);
    4717         1068 :     COPY_NODE_FIELD(fdw_scan_tlist);
    4718         1068 :     COPY_NODE_FIELD(fdw_recheck_quals);
    4719         1068 :     COPY_BITMAPSET_FIELD(fs_relids);
    4720         1068 :     COPY_BITMAPSET_FIELD(fs_base_relids);
    4721         1068 :     COPY_SCALAR_FIELD(fsSystemCol);
    4722              : 
    4723         1068 :     return newnode;
    4724              : }
    4725              : 
    4726              : static CustomScan *
    4727            0 : _copyCustomScan(const CustomScan *from)
    4728              : {
    4729            0 :     CustomScan *newnode = makeNode(CustomScan);
    4730              : 
    4731            0 :     COPY_SCALAR_FIELD(scan.plan.disabled_nodes);
    4732            0 :     COPY_SCALAR_FIELD(scan.plan.startup_cost);
    4733            0 :     COPY_SCALAR_FIELD(scan.plan.total_cost);
    4734            0 :     COPY_SCALAR_FIELD(scan.plan.plan_rows);
    4735            0 :     COPY_SCALAR_FIELD(scan.plan.plan_width);
    4736            0 :     COPY_SCALAR_FIELD(scan.plan.parallel_aware);
    4737            0 :     COPY_SCALAR_FIELD(scan.plan.parallel_safe);
    4738            0 :     COPY_SCALAR_FIELD(scan.plan.async_capable);
    4739            0 :     COPY_SCALAR_FIELD(scan.plan.plan_node_id);
    4740            0 :     COPY_NODE_FIELD(scan.plan.targetlist);
    4741            0 :     COPY_NODE_FIELD(scan.plan.qual);
    4742            0 :     COPY_NODE_FIELD(scan.plan.lefttree);
    4743            0 :     COPY_NODE_FIELD(scan.plan.righttree);
    4744            0 :     COPY_NODE_FIELD(scan.plan.initPlan);
    4745            0 :     COPY_BITMAPSET_FIELD(scan.plan.extParam);
    4746            0 :     COPY_BITMAPSET_FIELD(scan.plan.allParam);
    4747            0 :     COPY_SCALAR_FIELD(scan.scanrelid);
    4748            0 :     COPY_SCALAR_FIELD(flags);
    4749            0 :     COPY_NODE_FIELD(custom_plans);
    4750            0 :     COPY_NODE_FIELD(custom_exprs);
    4751            0 :     COPY_NODE_FIELD(custom_private);
    4752            0 :     COPY_NODE_FIELD(custom_scan_tlist);
    4753            0 :     COPY_BITMAPSET_FIELD(custom_relids);
    4754            0 :     COPY_SCALAR_FIELD(methods);
    4755              : 
    4756            0 :     return newnode;
    4757              : }
    4758              : 
    4759              : static NestLoop *
    4760        58716 : _copyNestLoop(const NestLoop *from)
    4761              : {
    4762        58716 :     NestLoop *newnode = makeNode(NestLoop);
    4763              : 
    4764        58716 :     COPY_SCALAR_FIELD(join.plan.disabled_nodes);
    4765        58716 :     COPY_SCALAR_FIELD(join.plan.startup_cost);
    4766        58716 :     COPY_SCALAR_FIELD(join.plan.total_cost);
    4767        58716 :     COPY_SCALAR_FIELD(join.plan.plan_rows);
    4768        58716 :     COPY_SCALAR_FIELD(join.plan.plan_width);
    4769        58716 :     COPY_SCALAR_FIELD(join.plan.parallel_aware);
    4770        58716 :     COPY_SCALAR_FIELD(join.plan.parallel_safe);
    4771        58716 :     COPY_SCALAR_FIELD(join.plan.async_capable);
    4772        58716 :     COPY_SCALAR_FIELD(join.plan.plan_node_id);
    4773        58716 :     COPY_NODE_FIELD(join.plan.targetlist);
    4774        58716 :     COPY_NODE_FIELD(join.plan.qual);
    4775        58716 :     COPY_NODE_FIELD(join.plan.lefttree);
    4776        58716 :     COPY_NODE_FIELD(join.plan.righttree);
    4777        58716 :     COPY_NODE_FIELD(join.plan.initPlan);
    4778        58716 :     COPY_BITMAPSET_FIELD(join.plan.extParam);
    4779        58716 :     COPY_BITMAPSET_FIELD(join.plan.allParam);
    4780        58716 :     COPY_SCALAR_FIELD(join.jointype);
    4781        58716 :     COPY_SCALAR_FIELD(join.inner_unique);
    4782        58716 :     COPY_NODE_FIELD(join.joinqual);
    4783        58716 :     COPY_NODE_FIELD(nestParams);
    4784              : 
    4785        58716 :     return newnode;
    4786              : }
    4787              : 
    4788              : static NestLoopParam *
    4789        37239 : _copyNestLoopParam(const NestLoopParam *from)
    4790              : {
    4791        37239 :     NestLoopParam *newnode = makeNode(NestLoopParam);
    4792              : 
    4793        37239 :     COPY_SCALAR_FIELD(paramno);
    4794        37239 :     COPY_NODE_FIELD(paramval);
    4795              : 
    4796        37239 :     return newnode;
    4797              : }
    4798              : 
    4799              : static MergeJoin *
    4800         4848 : _copyMergeJoin(const MergeJoin *from)
    4801              : {
    4802         4848 :     MergeJoin *newnode = makeNode(MergeJoin);
    4803              : 
    4804         4848 :     COPY_SCALAR_FIELD(join.plan.disabled_nodes);
    4805         4848 :     COPY_SCALAR_FIELD(join.plan.startup_cost);
    4806         4848 :     COPY_SCALAR_FIELD(join.plan.total_cost);
    4807         4848 :     COPY_SCALAR_FIELD(join.plan.plan_rows);
    4808         4848 :     COPY_SCALAR_FIELD(join.plan.plan_width);
    4809         4848 :     COPY_SCALAR_FIELD(join.plan.parallel_aware);
    4810         4848 :     COPY_SCALAR_FIELD(join.plan.parallel_safe);
    4811         4848 :     COPY_SCALAR_FIELD(join.plan.async_capable);
    4812         4848 :     COPY_SCALAR_FIELD(join.plan.plan_node_id);
    4813         4848 :     COPY_NODE_FIELD(join.plan.targetlist);
    4814         4848 :     COPY_NODE_FIELD(join.plan.qual);
    4815         4848 :     COPY_NODE_FIELD(join.plan.lefttree);
    4816         4848 :     COPY_NODE_FIELD(join.plan.righttree);
    4817         4848 :     COPY_NODE_FIELD(join.plan.initPlan);
    4818         4848 :     COPY_BITMAPSET_FIELD(join.plan.extParam);
    4819         4848 :     COPY_BITMAPSET_FIELD(join.plan.allParam);
    4820         4848 :     COPY_SCALAR_FIELD(join.jointype);
    4821         4848 :     COPY_SCALAR_FIELD(join.inner_unique);
    4822         4848 :     COPY_NODE_FIELD(join.joinqual);
    4823         4848 :     COPY_SCALAR_FIELD(skip_mark_restore);
    4824         4848 :     COPY_NODE_FIELD(mergeclauses);
    4825         4848 :     COPY_POINTER_FIELD(mergeFamilies, list_length(from->mergeclauses) * sizeof(Oid));
    4826         4848 :     COPY_POINTER_FIELD(mergeCollations, list_length(from->mergeclauses) * sizeof(Oid));
    4827         4848 :     COPY_POINTER_FIELD(mergeReversals, list_length(from->mergeclauses) * sizeof(bool));
    4828         4848 :     COPY_POINTER_FIELD(mergeNullsFirst, list_length(from->mergeclauses) * sizeof(bool));
    4829              : 
    4830         4848 :     return newnode;
    4831              : }
    4832              : 
    4833              : static HashJoin *
    4834        22519 : _copyHashJoin(const HashJoin *from)
    4835              : {
    4836        22519 :     HashJoin *newnode = makeNode(HashJoin);
    4837              : 
    4838        22519 :     COPY_SCALAR_FIELD(join.plan.disabled_nodes);
    4839        22519 :     COPY_SCALAR_FIELD(join.plan.startup_cost);
    4840        22519 :     COPY_SCALAR_FIELD(join.plan.total_cost);
    4841        22519 :     COPY_SCALAR_FIELD(join.plan.plan_rows);
    4842        22519 :     COPY_SCALAR_FIELD(join.plan.plan_width);
    4843        22519 :     COPY_SCALAR_FIELD(join.plan.parallel_aware);
    4844        22519 :     COPY_SCALAR_FIELD(join.plan.parallel_safe);
    4845        22519 :     COPY_SCALAR_FIELD(join.plan.async_capable);
    4846        22519 :     COPY_SCALAR_FIELD(join.plan.plan_node_id);
    4847        22519 :     COPY_NODE_FIELD(join.plan.targetlist);
    4848        22519 :     COPY_NODE_FIELD(join.plan.qual);
    4849        22519 :     COPY_NODE_FIELD(join.plan.lefttree);
    4850        22519 :     COPY_NODE_FIELD(join.plan.righttree);
    4851        22519 :     COPY_NODE_FIELD(join.plan.initPlan);
    4852        22519 :     COPY_BITMAPSET_FIELD(join.plan.extParam);
    4853        22519 :     COPY_BITMAPSET_FIELD(join.plan.allParam);
    4854        22519 :     COPY_SCALAR_FIELD(join.jointype);
    4855        22519 :     COPY_SCALAR_FIELD(join.inner_unique);
    4856        22519 :     COPY_NODE_FIELD(join.joinqual);
    4857        22519 :     COPY_NODE_FIELD(hashclauses);
    4858        22519 :     COPY_NODE_FIELD(hashoperators);
    4859        22519 :     COPY_NODE_FIELD(hashcollations);
    4860        22519 :     COPY_NODE_FIELD(hashkeys);
    4861              : 
    4862        22519 :     return newnode;
    4863              : }
    4864              : 
    4865              : static Material *
    4866         2462 : _copyMaterial(const Material *from)
    4867              : {
    4868         2462 :     Material *newnode = makeNode(Material);
    4869              : 
    4870         2462 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    4871         2462 :     COPY_SCALAR_FIELD(plan.startup_cost);
    4872         2462 :     COPY_SCALAR_FIELD(plan.total_cost);
    4873         2462 :     COPY_SCALAR_FIELD(plan.plan_rows);
    4874         2462 :     COPY_SCALAR_FIELD(plan.plan_width);
    4875         2462 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    4876         2462 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    4877         2462 :     COPY_SCALAR_FIELD(plan.async_capable);
    4878         2462 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    4879         2462 :     COPY_NODE_FIELD(plan.targetlist);
    4880         2462 :     COPY_NODE_FIELD(plan.qual);
    4881         2462 :     COPY_NODE_FIELD(plan.lefttree);
    4882         2462 :     COPY_NODE_FIELD(plan.righttree);
    4883         2462 :     COPY_NODE_FIELD(plan.initPlan);
    4884         2462 :     COPY_BITMAPSET_FIELD(plan.extParam);
    4885         2462 :     COPY_BITMAPSET_FIELD(plan.allParam);
    4886              : 
    4887         2462 :     return newnode;
    4888              : }
    4889              : 
    4890              : static Memoize *
    4891         1287 : _copyMemoize(const Memoize *from)
    4892              : {
    4893         1287 :     Memoize *newnode = makeNode(Memoize);
    4894              : 
    4895         1287 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    4896         1287 :     COPY_SCALAR_FIELD(plan.startup_cost);
    4897         1287 :     COPY_SCALAR_FIELD(plan.total_cost);
    4898         1287 :     COPY_SCALAR_FIELD(plan.plan_rows);
    4899         1287 :     COPY_SCALAR_FIELD(plan.plan_width);
    4900         1287 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    4901         1287 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    4902         1287 :     COPY_SCALAR_FIELD(plan.async_capable);
    4903         1287 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    4904         1287 :     COPY_NODE_FIELD(plan.targetlist);
    4905         1287 :     COPY_NODE_FIELD(plan.qual);
    4906         1287 :     COPY_NODE_FIELD(plan.lefttree);
    4907         1287 :     COPY_NODE_FIELD(plan.righttree);
    4908         1287 :     COPY_NODE_FIELD(plan.initPlan);
    4909         1287 :     COPY_BITMAPSET_FIELD(plan.extParam);
    4910         1287 :     COPY_BITMAPSET_FIELD(plan.allParam);
    4911         1287 :     COPY_SCALAR_FIELD(numKeys);
    4912         1287 :     COPY_POINTER_FIELD(hashOperators, from->numKeys * sizeof(Oid));
    4913         1287 :     COPY_POINTER_FIELD(collations, from->numKeys * sizeof(Oid));
    4914         1287 :     COPY_NODE_FIELD(param_exprs);
    4915         1287 :     COPY_SCALAR_FIELD(singlerow);
    4916         1287 :     COPY_SCALAR_FIELD(binary_mode);
    4917         1287 :     COPY_SCALAR_FIELD(est_entries);
    4918         1287 :     COPY_BITMAPSET_FIELD(keyparamids);
    4919         1287 :     COPY_SCALAR_FIELD(est_calls);
    4920         1287 :     COPY_SCALAR_FIELD(est_unique_keys);
    4921         1287 :     COPY_SCALAR_FIELD(est_hit_ratio);
    4922              : 
    4923         1287 :     return newnode;
    4924              : }
    4925              : 
    4926              : static Sort *
    4927        46064 : _copySort(const Sort *from)
    4928              : {
    4929        46064 :     Sort *newnode = makeNode(Sort);
    4930              : 
    4931        46064 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    4932        46064 :     COPY_SCALAR_FIELD(plan.startup_cost);
    4933        46064 :     COPY_SCALAR_FIELD(plan.total_cost);
    4934        46064 :     COPY_SCALAR_FIELD(plan.plan_rows);
    4935        46064 :     COPY_SCALAR_FIELD(plan.plan_width);
    4936        46064 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    4937        46064 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    4938        46064 :     COPY_SCALAR_FIELD(plan.async_capable);
    4939        46064 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    4940        46064 :     COPY_NODE_FIELD(plan.targetlist);
    4941        46064 :     COPY_NODE_FIELD(plan.qual);
    4942        46064 :     COPY_NODE_FIELD(plan.lefttree);
    4943        46064 :     COPY_NODE_FIELD(plan.righttree);
    4944        46064 :     COPY_NODE_FIELD(plan.initPlan);
    4945        46064 :     COPY_BITMAPSET_FIELD(plan.extParam);
    4946        46064 :     COPY_BITMAPSET_FIELD(plan.allParam);
    4947        46064 :     COPY_SCALAR_FIELD(numCols);
    4948        46064 :     COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
    4949        46064 :     COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
    4950        46064 :     COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
    4951        46064 :     COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
    4952              : 
    4953        46064 :     return newnode;
    4954              : }
    4955              : 
    4956              : static IncrementalSort *
    4957          632 : _copyIncrementalSort(const IncrementalSort *from)
    4958              : {
    4959          632 :     IncrementalSort *newnode = makeNode(IncrementalSort);
    4960              : 
    4961          632 :     COPY_SCALAR_FIELD(sort.plan.disabled_nodes);
    4962          632 :     COPY_SCALAR_FIELD(sort.plan.startup_cost);
    4963          632 :     COPY_SCALAR_FIELD(sort.plan.total_cost);
    4964          632 :     COPY_SCALAR_FIELD(sort.plan.plan_rows);
    4965          632 :     COPY_SCALAR_FIELD(sort.plan.plan_width);
    4966          632 :     COPY_SCALAR_FIELD(sort.plan.parallel_aware);
    4967          632 :     COPY_SCALAR_FIELD(sort.plan.parallel_safe);
    4968          632 :     COPY_SCALAR_FIELD(sort.plan.async_capable);
    4969          632 :     COPY_SCALAR_FIELD(sort.plan.plan_node_id);
    4970          632 :     COPY_NODE_FIELD(sort.plan.targetlist);
    4971          632 :     COPY_NODE_FIELD(sort.plan.qual);
    4972          632 :     COPY_NODE_FIELD(sort.plan.lefttree);
    4973          632 :     COPY_NODE_FIELD(sort.plan.righttree);
    4974          632 :     COPY_NODE_FIELD(sort.plan.initPlan);
    4975          632 :     COPY_BITMAPSET_FIELD(sort.plan.extParam);
    4976          632 :     COPY_BITMAPSET_FIELD(sort.plan.allParam);
    4977          632 :     COPY_SCALAR_FIELD(sort.numCols);
    4978          632 :     COPY_POINTER_FIELD(sort.sortColIdx, from->sort.numCols * sizeof(AttrNumber));
    4979          632 :     COPY_POINTER_FIELD(sort.sortOperators, from->sort.numCols * sizeof(Oid));
    4980          632 :     COPY_POINTER_FIELD(sort.collations, from->sort.numCols * sizeof(Oid));
    4981          632 :     COPY_POINTER_FIELD(sort.nullsFirst, from->sort.numCols * sizeof(bool));
    4982          632 :     COPY_SCALAR_FIELD(nPresortedCols);
    4983              : 
    4984          632 :     return newnode;
    4985              : }
    4986              : 
    4987              : static Group *
    4988          129 : _copyGroup(const Group *from)
    4989              : {
    4990          129 :     Group *newnode = makeNode(Group);
    4991              : 
    4992          129 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    4993          129 :     COPY_SCALAR_FIELD(plan.startup_cost);
    4994          129 :     COPY_SCALAR_FIELD(plan.total_cost);
    4995          129 :     COPY_SCALAR_FIELD(plan.plan_rows);
    4996          129 :     COPY_SCALAR_FIELD(plan.plan_width);
    4997          129 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    4998          129 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    4999          129 :     COPY_SCALAR_FIELD(plan.async_capable);
    5000          129 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    5001          129 :     COPY_NODE_FIELD(plan.targetlist);
    5002          129 :     COPY_NODE_FIELD(plan.qual);
    5003          129 :     COPY_NODE_FIELD(plan.lefttree);
    5004          129 :     COPY_NODE_FIELD(plan.righttree);
    5005          129 :     COPY_NODE_FIELD(plan.initPlan);
    5006          129 :     COPY_BITMAPSET_FIELD(plan.extParam);
    5007          129 :     COPY_BITMAPSET_FIELD(plan.allParam);
    5008          129 :     COPY_SCALAR_FIELD(numCols);
    5009          129 :     COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
    5010          129 :     COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
    5011          129 :     COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
    5012              : 
    5013          129 :     return newnode;
    5014              : }
    5015              : 
    5016              : static Agg *
    5017        28485 : _copyAgg(const Agg *from)
    5018              : {
    5019        28485 :     Agg *newnode = makeNode(Agg);
    5020              : 
    5021        28485 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    5022        28485 :     COPY_SCALAR_FIELD(plan.startup_cost);
    5023        28485 :     COPY_SCALAR_FIELD(plan.total_cost);
    5024        28485 :     COPY_SCALAR_FIELD(plan.plan_rows);
    5025        28485 :     COPY_SCALAR_FIELD(plan.plan_width);
    5026        28485 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    5027        28485 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    5028        28485 :     COPY_SCALAR_FIELD(plan.async_capable);
    5029        28485 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    5030        28485 :     COPY_NODE_FIELD(plan.targetlist);
    5031        28485 :     COPY_NODE_FIELD(plan.qual);
    5032        28485 :     COPY_NODE_FIELD(plan.lefttree);
    5033        28485 :     COPY_NODE_FIELD(plan.righttree);
    5034        28485 :     COPY_NODE_FIELD(plan.initPlan);
    5035        28485 :     COPY_BITMAPSET_FIELD(plan.extParam);
    5036        28485 :     COPY_BITMAPSET_FIELD(plan.allParam);
    5037        28485 :     COPY_SCALAR_FIELD(aggstrategy);
    5038        28485 :     COPY_SCALAR_FIELD(aggsplit);
    5039        28485 :     COPY_SCALAR_FIELD(numCols);
    5040        28485 :     COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
    5041        28485 :     COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
    5042        28485 :     COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
    5043        28485 :     COPY_SCALAR_FIELD(numGroups);
    5044        28485 :     COPY_SCALAR_FIELD(transitionSpace);
    5045        28485 :     COPY_BITMAPSET_FIELD(aggParams);
    5046        28485 :     COPY_NODE_FIELD(groupingSets);
    5047        28485 :     COPY_NODE_FIELD(chain);
    5048              : 
    5049        28485 :     return newnode;
    5050              : }
    5051              : 
    5052              : static WindowAgg *
    5053         1459 : _copyWindowAgg(const WindowAgg *from)
    5054              : {
    5055         1459 :     WindowAgg *newnode = makeNode(WindowAgg);
    5056              : 
    5057         1459 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    5058         1459 :     COPY_SCALAR_FIELD(plan.startup_cost);
    5059         1459 :     COPY_SCALAR_FIELD(plan.total_cost);
    5060         1459 :     COPY_SCALAR_FIELD(plan.plan_rows);
    5061         1459 :     COPY_SCALAR_FIELD(plan.plan_width);
    5062         1459 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    5063         1459 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    5064         1459 :     COPY_SCALAR_FIELD(plan.async_capable);
    5065         1459 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    5066         1459 :     COPY_NODE_FIELD(plan.targetlist);
    5067         1459 :     COPY_NODE_FIELD(plan.qual);
    5068         1459 :     COPY_NODE_FIELD(plan.lefttree);
    5069         1459 :     COPY_NODE_FIELD(plan.righttree);
    5070         1459 :     COPY_NODE_FIELD(plan.initPlan);
    5071         1459 :     COPY_BITMAPSET_FIELD(plan.extParam);
    5072         1459 :     COPY_BITMAPSET_FIELD(plan.allParam);
    5073         1459 :     COPY_STRING_FIELD(winname);
    5074         1459 :     COPY_SCALAR_FIELD(winref);
    5075         1459 :     COPY_SCALAR_FIELD(partNumCols);
    5076         1459 :     COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
    5077         1459 :     COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
    5078         1459 :     COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
    5079         1459 :     COPY_SCALAR_FIELD(ordNumCols);
    5080         1459 :     COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
    5081         1459 :     COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
    5082         1459 :     COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
    5083         1459 :     COPY_SCALAR_FIELD(frameOptions);
    5084         1459 :     COPY_NODE_FIELD(startOffset);
    5085         1459 :     COPY_NODE_FIELD(endOffset);
    5086         1459 :     COPY_NODE_FIELD(runCondition);
    5087         1459 :     COPY_NODE_FIELD(runConditionOrig);
    5088         1459 :     COPY_SCALAR_FIELD(startInRangeFunc);
    5089         1459 :     COPY_SCALAR_FIELD(endInRangeFunc);
    5090         1459 :     COPY_SCALAR_FIELD(inRangeColl);
    5091         1459 :     COPY_SCALAR_FIELD(inRangeAsc);
    5092         1459 :     COPY_SCALAR_FIELD(inRangeNullsFirst);
    5093         1459 :     COPY_SCALAR_FIELD(topWindow);
    5094              : 
    5095         1459 :     return newnode;
    5096              : }
    5097              : 
    5098              : static Unique *
    5099         3004 : _copyUnique(const Unique *from)
    5100              : {
    5101         3004 :     Unique *newnode = makeNode(Unique);
    5102              : 
    5103         3004 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    5104         3004 :     COPY_SCALAR_FIELD(plan.startup_cost);
    5105         3004 :     COPY_SCALAR_FIELD(plan.total_cost);
    5106         3004 :     COPY_SCALAR_FIELD(plan.plan_rows);
    5107         3004 :     COPY_SCALAR_FIELD(plan.plan_width);
    5108         3004 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    5109         3004 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    5110         3004 :     COPY_SCALAR_FIELD(plan.async_capable);
    5111         3004 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    5112         3004 :     COPY_NODE_FIELD(plan.targetlist);
    5113         3004 :     COPY_NODE_FIELD(plan.qual);
    5114         3004 :     COPY_NODE_FIELD(plan.lefttree);
    5115         3004 :     COPY_NODE_FIELD(plan.righttree);
    5116         3004 :     COPY_NODE_FIELD(plan.initPlan);
    5117         3004 :     COPY_BITMAPSET_FIELD(plan.extParam);
    5118         3004 :     COPY_BITMAPSET_FIELD(plan.allParam);
    5119         3004 :     COPY_SCALAR_FIELD(numCols);
    5120         3004 :     COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
    5121         3004 :     COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
    5122         3004 :     COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
    5123              : 
    5124         3004 :     return newnode;
    5125              : }
    5126              : 
    5127              : static Gather *
    5128          625 : _copyGather(const Gather *from)
    5129              : {
    5130          625 :     Gather *newnode = makeNode(Gather);
    5131              : 
    5132          625 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    5133          625 :     COPY_SCALAR_FIELD(plan.startup_cost);
    5134          625 :     COPY_SCALAR_FIELD(plan.total_cost);
    5135          625 :     COPY_SCALAR_FIELD(plan.plan_rows);
    5136          625 :     COPY_SCALAR_FIELD(plan.plan_width);
    5137          625 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    5138          625 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    5139          625 :     COPY_SCALAR_FIELD(plan.async_capable);
    5140          625 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    5141          625 :     COPY_NODE_FIELD(plan.targetlist);
    5142          625 :     COPY_NODE_FIELD(plan.qual);
    5143          625 :     COPY_NODE_FIELD(plan.lefttree);
    5144          625 :     COPY_NODE_FIELD(plan.righttree);
    5145          625 :     COPY_NODE_FIELD(plan.initPlan);
    5146          625 :     COPY_BITMAPSET_FIELD(plan.extParam);
    5147          625 :     COPY_BITMAPSET_FIELD(plan.allParam);
    5148          625 :     COPY_SCALAR_FIELD(num_workers);
    5149          625 :     COPY_SCALAR_FIELD(rescan_param);
    5150          625 :     COPY_SCALAR_FIELD(single_copy);
    5151          625 :     COPY_SCALAR_FIELD(invisible);
    5152          625 :     COPY_BITMAPSET_FIELD(initParam);
    5153              : 
    5154          625 :     return newnode;
    5155              : }
    5156              : 
    5157              : static GatherMerge *
    5158          180 : _copyGatherMerge(const GatherMerge *from)
    5159              : {
    5160          180 :     GatherMerge *newnode = makeNode(GatherMerge);
    5161              : 
    5162          180 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    5163          180 :     COPY_SCALAR_FIELD(plan.startup_cost);
    5164          180 :     COPY_SCALAR_FIELD(plan.total_cost);
    5165          180 :     COPY_SCALAR_FIELD(plan.plan_rows);
    5166          180 :     COPY_SCALAR_FIELD(plan.plan_width);
    5167          180 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    5168          180 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    5169          180 :     COPY_SCALAR_FIELD(plan.async_capable);
    5170          180 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    5171          180 :     COPY_NODE_FIELD(plan.targetlist);
    5172          180 :     COPY_NODE_FIELD(plan.qual);
    5173          180 :     COPY_NODE_FIELD(plan.lefttree);
    5174          180 :     COPY_NODE_FIELD(plan.righttree);
    5175          180 :     COPY_NODE_FIELD(plan.initPlan);
    5176          180 :     COPY_BITMAPSET_FIELD(plan.extParam);
    5177          180 :     COPY_BITMAPSET_FIELD(plan.allParam);
    5178          180 :     COPY_SCALAR_FIELD(num_workers);
    5179          180 :     COPY_SCALAR_FIELD(rescan_param);
    5180          180 :     COPY_SCALAR_FIELD(numCols);
    5181          180 :     COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
    5182          180 :     COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
    5183          180 :     COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
    5184          180 :     COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
    5185          180 :     COPY_BITMAPSET_FIELD(initParam);
    5186              : 
    5187          180 :     return newnode;
    5188              : }
    5189              : 
    5190              : static Hash *
    5191        22519 : _copyHash(const Hash *from)
    5192              : {
    5193        22519 :     Hash *newnode = makeNode(Hash);
    5194              : 
    5195        22519 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    5196        22519 :     COPY_SCALAR_FIELD(plan.startup_cost);
    5197        22519 :     COPY_SCALAR_FIELD(plan.total_cost);
    5198        22519 :     COPY_SCALAR_FIELD(plan.plan_rows);
    5199        22519 :     COPY_SCALAR_FIELD(plan.plan_width);
    5200        22519 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    5201        22519 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    5202        22519 :     COPY_SCALAR_FIELD(plan.async_capable);
    5203        22519 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    5204        22519 :     COPY_NODE_FIELD(plan.targetlist);
    5205        22519 :     COPY_NODE_FIELD(plan.qual);
    5206        22519 :     COPY_NODE_FIELD(plan.lefttree);
    5207        22519 :     COPY_NODE_FIELD(plan.righttree);
    5208        22519 :     COPY_NODE_FIELD(plan.initPlan);
    5209        22519 :     COPY_BITMAPSET_FIELD(plan.extParam);
    5210        22519 :     COPY_BITMAPSET_FIELD(plan.allParam);
    5211        22519 :     COPY_NODE_FIELD(hashkeys);
    5212        22519 :     COPY_SCALAR_FIELD(skewTable);
    5213        22519 :     COPY_SCALAR_FIELD(skewColumn);
    5214        22519 :     COPY_SCALAR_FIELD(skewInherit);
    5215        22519 :     COPY_SCALAR_FIELD(rows_total);
    5216              : 
    5217        22519 :     return newnode;
    5218              : }
    5219              : 
    5220              : static SetOp *
    5221          394 : _copySetOp(const SetOp *from)
    5222              : {
    5223          394 :     SetOp *newnode = makeNode(SetOp);
    5224              : 
    5225          394 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    5226          394 :     COPY_SCALAR_FIELD(plan.startup_cost);
    5227          394 :     COPY_SCALAR_FIELD(plan.total_cost);
    5228          394 :     COPY_SCALAR_FIELD(plan.plan_rows);
    5229          394 :     COPY_SCALAR_FIELD(plan.plan_width);
    5230          394 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    5231          394 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    5232          394 :     COPY_SCALAR_FIELD(plan.async_capable);
    5233          394 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    5234          394 :     COPY_NODE_FIELD(plan.targetlist);
    5235          394 :     COPY_NODE_FIELD(plan.qual);
    5236          394 :     COPY_NODE_FIELD(plan.lefttree);
    5237          394 :     COPY_NODE_FIELD(plan.righttree);
    5238          394 :     COPY_NODE_FIELD(plan.initPlan);
    5239          394 :     COPY_BITMAPSET_FIELD(plan.extParam);
    5240          394 :     COPY_BITMAPSET_FIELD(plan.allParam);
    5241          394 :     COPY_SCALAR_FIELD(cmd);
    5242          394 :     COPY_SCALAR_FIELD(strategy);
    5243          394 :     COPY_SCALAR_FIELD(numCols);
    5244          394 :     COPY_POINTER_FIELD(cmpColIdx, from->numCols * sizeof(AttrNumber));
    5245          394 :     COPY_POINTER_FIELD(cmpOperators, from->numCols * sizeof(Oid));
    5246          394 :     COPY_POINTER_FIELD(cmpCollations, from->numCols * sizeof(Oid));
    5247          394 :     COPY_POINTER_FIELD(cmpNullsFirst, from->numCols * sizeof(bool));
    5248          394 :     COPY_SCALAR_FIELD(numGroups);
    5249              : 
    5250          394 :     return newnode;
    5251              : }
    5252              : 
    5253              : static LockRows *
    5254         9903 : _copyLockRows(const LockRows *from)
    5255              : {
    5256         9903 :     LockRows *newnode = makeNode(LockRows);
    5257              : 
    5258         9903 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    5259         9903 :     COPY_SCALAR_FIELD(plan.startup_cost);
    5260         9903 :     COPY_SCALAR_FIELD(plan.total_cost);
    5261         9903 :     COPY_SCALAR_FIELD(plan.plan_rows);
    5262         9903 :     COPY_SCALAR_FIELD(plan.plan_width);
    5263         9903 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    5264         9903 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    5265         9903 :     COPY_SCALAR_FIELD(plan.async_capable);
    5266         9903 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    5267         9903 :     COPY_NODE_FIELD(plan.targetlist);
    5268         9903 :     COPY_NODE_FIELD(plan.qual);
    5269         9903 :     COPY_NODE_FIELD(plan.lefttree);
    5270         9903 :     COPY_NODE_FIELD(plan.righttree);
    5271         9903 :     COPY_NODE_FIELD(plan.initPlan);
    5272         9903 :     COPY_BITMAPSET_FIELD(plan.extParam);
    5273         9903 :     COPY_BITMAPSET_FIELD(plan.allParam);
    5274         9903 :     COPY_NODE_FIELD(rowMarks);
    5275         9903 :     COPY_SCALAR_FIELD(epqParam);
    5276              : 
    5277         9903 :     return newnode;
    5278              : }
    5279              : 
    5280              : static Limit *
    5281         2779 : _copyLimit(const Limit *from)
    5282              : {
    5283         2779 :     Limit *newnode = makeNode(Limit);
    5284              : 
    5285         2779 :     COPY_SCALAR_FIELD(plan.disabled_nodes);
    5286         2779 :     COPY_SCALAR_FIELD(plan.startup_cost);
    5287         2779 :     COPY_SCALAR_FIELD(plan.total_cost);
    5288         2779 :     COPY_SCALAR_FIELD(plan.plan_rows);
    5289         2779 :     COPY_SCALAR_FIELD(plan.plan_width);
    5290         2779 :     COPY_SCALAR_FIELD(plan.parallel_aware);
    5291         2779 :     COPY_SCALAR_FIELD(plan.parallel_safe);
    5292         2779 :     COPY_SCALAR_FIELD(plan.async_capable);
    5293         2779 :     COPY_SCALAR_FIELD(plan.plan_node_id);
    5294         2779 :     COPY_NODE_FIELD(plan.targetlist);
    5295         2779 :     COPY_NODE_FIELD(plan.qual);
    5296         2779 :     COPY_NODE_FIELD(plan.lefttree);
    5297         2779 :     COPY_NODE_FIELD(plan.righttree);
    5298         2779 :     COPY_NODE_FIELD(plan.initPlan);
    5299         2779 :     COPY_BITMAPSET_FIELD(plan.extParam);
    5300         2779 :     COPY_BITMAPSET_FIELD(plan.allParam);
    5301         2779 :     COPY_NODE_FIELD(limitOffset);
    5302         2779 :     COPY_NODE_FIELD(limitCount);
    5303         2779 :     COPY_SCALAR_FIELD(limitOption);
    5304         2779 :     COPY_SCALAR_FIELD(uniqNumCols);
    5305         2779 :     COPY_POINTER_FIELD(uniqColIdx, from->uniqNumCols * sizeof(AttrNumber));
    5306         2779 :     COPY_POINTER_FIELD(uniqOperators, from->uniqNumCols * sizeof(Oid));
    5307         2779 :     COPY_POINTER_FIELD(uniqCollations, from->uniqNumCols * sizeof(Oid));
    5308              : 
    5309         2779 :     return newnode;
    5310              : }
    5311              : 
    5312              : static PlanRowMark *
    5313        27270 : _copyPlanRowMark(const PlanRowMark *from)
    5314              : {
    5315        27270 :     PlanRowMark *newnode = makeNode(PlanRowMark);
    5316              : 
    5317        27270 :     COPY_SCALAR_FIELD(rti);
    5318        27270 :     COPY_SCALAR_FIELD(prti);
    5319        27270 :     COPY_SCALAR_FIELD(rowmarkId);
    5320        27270 :     COPY_SCALAR_FIELD(markType);
    5321        27270 :     COPY_SCALAR_FIELD(allMarkTypes);
    5322        27270 :     COPY_SCALAR_FIELD(strength);
    5323        27270 :     COPY_SCALAR_FIELD(waitPolicy);
    5324        27270 :     COPY_SCALAR_FIELD(isParent);
    5325              : 
    5326        27270 :     return newnode;
    5327              : }
    5328              : 
    5329              : static PartitionPruneInfo *
    5330          383 : _copyPartitionPruneInfo(const PartitionPruneInfo *from)
    5331              : {
    5332          383 :     PartitionPruneInfo *newnode = makeNode(PartitionPruneInfo);
    5333              : 
    5334          383 :     COPY_BITMAPSET_FIELD(relids);
    5335          383 :     COPY_NODE_FIELD(prune_infos);
    5336          383 :     COPY_BITMAPSET_FIELD(other_subplans);
    5337              : 
    5338          383 :     return newnode;
    5339              : }
    5340              : 
    5341              : static PartitionedRelPruneInfo *
    5342          719 : _copyPartitionedRelPruneInfo(const PartitionedRelPruneInfo *from)
    5343              : {
    5344          719 :     PartitionedRelPruneInfo *newnode = makeNode(PartitionedRelPruneInfo);
    5345              : 
    5346          719 :     COPY_SCALAR_FIELD(rtindex);
    5347          719 :     COPY_BITMAPSET_FIELD(present_parts);
    5348          719 :     COPY_SCALAR_FIELD(nparts);
    5349          719 :     COPY_POINTER_FIELD(subplan_map, from->nparts * sizeof(int));
    5350          719 :     COPY_POINTER_FIELD(subpart_map, from->nparts * sizeof(int));
    5351          719 :     COPY_POINTER_FIELD(leafpart_rti_map, from->nparts * sizeof(int));
    5352          719 :     COPY_POINTER_FIELD(relid_map, from->nparts * sizeof(Oid));
    5353          719 :     COPY_NODE_FIELD(initial_pruning_steps);
    5354          719 :     COPY_NODE_FIELD(exec_pruning_steps);
    5355          719 :     COPY_BITMAPSET_FIELD(execparamids);
    5356              : 
    5357          719 :     return newnode;
    5358              : }
    5359              : 
    5360              : static PartitionPruneStepOp *
    5361          716 : _copyPartitionPruneStepOp(const PartitionPruneStepOp *from)
    5362              : {
    5363          716 :     PartitionPruneStepOp *newnode = makeNode(PartitionPruneStepOp);
    5364              : 
    5365          716 :     COPY_SCALAR_FIELD(step.step_id);
    5366          716 :     COPY_SCALAR_FIELD(opstrategy);
    5367          716 :     COPY_NODE_FIELD(exprs);
    5368          716 :     COPY_NODE_FIELD(cmpfns);
    5369          716 :     COPY_BITMAPSET_FIELD(nullkeys);
    5370              : 
    5371          716 :     return newnode;
    5372              : }
    5373              : 
    5374              : static PartitionPruneStepCombine *
    5375          146 : _copyPartitionPruneStepCombine(const PartitionPruneStepCombine *from)
    5376              : {
    5377          146 :     PartitionPruneStepCombine *newnode = makeNode(PartitionPruneStepCombine);
    5378              : 
    5379          146 :     COPY_SCALAR_FIELD(step.step_id);
    5380          146 :     COPY_SCALAR_FIELD(combineOp);
    5381          146 :     COPY_NODE_FIELD(source_stepids);
    5382              : 
    5383          146 :     return newnode;
    5384              : }
    5385              : 
    5386              : static PlanInvalItem *
    5387        31466 : _copyPlanInvalItem(const PlanInvalItem *from)
    5388              : {
    5389        31466 :     PlanInvalItem *newnode = makeNode(PlanInvalItem);
    5390              : 
    5391        31466 :     COPY_SCALAR_FIELD(cacheId);
    5392        31466 :     COPY_SCALAR_FIELD(hashValue);
    5393              : 
    5394        31466 :     return newnode;
    5395              : }
    5396              : 
    5397              : static SubPlanRTInfo *
    5398        49176 : _copySubPlanRTInfo(const SubPlanRTInfo *from)
    5399              : {
    5400        49176 :     SubPlanRTInfo *newnode = makeNode(SubPlanRTInfo);
    5401              : 
    5402        49176 :     COPY_STRING_FIELD(plan_name);
    5403        49176 :     COPY_SCALAR_FIELD(rtoffset);
    5404        49176 :     COPY_SCALAR_FIELD(dummy);
    5405              : 
    5406        49176 :     return newnode;
    5407              : }
    5408              : 
    5409              : static ElidedNode *
    5410        15215 : _copyElidedNode(const ElidedNode *from)
    5411              : {
    5412        15215 :     ElidedNode *newnode = makeNode(ElidedNode);
    5413              : 
    5414        15215 :     COPY_SCALAR_FIELD(plan_node_id);
    5415        15215 :     COPY_SCALAR_FIELD(elided_type);
    5416        15215 :     COPY_BITMAPSET_FIELD(relids);
    5417              : 
    5418        15215 :     return newnode;
    5419              : }
    5420              : 
    5421              : static Integer *
    5422        19311 : _copyInteger(const Integer *from)
    5423              : {
    5424        19311 :     Integer *newnode = makeNode(Integer);
    5425              : 
    5426        19311 :     COPY_SCALAR_FIELD(ival);
    5427              : 
    5428        19311 :     return newnode;
    5429              : }
    5430              : 
    5431              : static Float *
    5432          141 : _copyFloat(const Float *from)
    5433              : {
    5434          141 :     Float *newnode = makeNode(Float);
    5435              : 
    5436          141 :     COPY_STRING_FIELD(fval);
    5437              : 
    5438          141 :     return newnode;
    5439              : }
    5440              : 
    5441              : static Boolean *
    5442        15103 : _copyBoolean(const Boolean *from)
    5443              : {
    5444        15103 :     Boolean *newnode = makeNode(Boolean);
    5445              : 
    5446        15103 :     COPY_SCALAR_FIELD(boolval);
    5447              : 
    5448        15103 :     return newnode;
    5449              : }
    5450              : 
    5451              : static String *
    5452     18945848 : _copyString(const String *from)
    5453              : {
    5454     18945848 :     String *newnode = makeNode(String);
    5455              : 
    5456     18945848 :     COPY_STRING_FIELD(sval);
    5457              : 
    5458     18945848 :     return newnode;
    5459              : }
    5460              : 
    5461              : static BitString *
    5462            0 : _copyBitString(const BitString *from)
    5463              : {
    5464            0 :     BitString *newnode = makeNode(BitString);
    5465              : 
    5466            0 :     COPY_STRING_FIELD(bsval);
    5467              : 
    5468            0 :     return newnode;
    5469              : }
    5470              : 
    5471              : static ForeignKeyCacheInfo *
    5472         2166 : _copyForeignKeyCacheInfo(const ForeignKeyCacheInfo *from)
    5473              : {
    5474         2166 :     ForeignKeyCacheInfo *newnode = makeNode(ForeignKeyCacheInfo);
    5475              : 
    5476         2166 :     COPY_SCALAR_FIELD(conoid);
    5477         2166 :     COPY_SCALAR_FIELD(conrelid);
    5478         2166 :     COPY_SCALAR_FIELD(confrelid);
    5479         2166 :     COPY_SCALAR_FIELD(nkeys);
    5480         2166 :     COPY_SCALAR_FIELD(conenforced);
    5481         2166 :     COPY_ARRAY_FIELD(conkey);
    5482         2166 :     COPY_ARRAY_FIELD(confkey);
    5483         2166 :     COPY_ARRAY_FIELD(conpfeqop);
    5484              : 
    5485         2166 :     return newnode;
    5486              : }
        

Generated by: LCOV version 2.0-1