summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2022-07-09 13:06:01 +0000
committerPeter Eisentraut2022-07-09 13:06:01 +0000
commit2be87f092a2ac786264b2020797aafa837de5a8e (patch)
tree4847dd981c6204119358be6668af88bb3177b164
parent3e44aee3cea426e331c5cec6452b52bf8dd25e19 (diff)
Remove code sections obsoleted by node support automation
This removes the code sections that were ifdef'ed out by 964d01ae90c314eb31132c2e7712d5d9fc237331.
-rw-r--r--src/backend/nodes/copyfuncs.c6357
-rw-r--r--src/backend/nodes/equalfuncs.c4206
-rw-r--r--src/backend/nodes/outfuncs.c3908
-rw-r--r--src/backend/nodes/readfuncs.c2744
-rw-r--r--src/include/nodes/nodes.h531
5 files changed, 9 insertions, 17737 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index b72c79f2df..b8e40a4195 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -3,13 +3,6 @@
* copyfuncs.c
* Copy functions for Postgres tree nodes.
*
- * NOTE: we currently support copying all node types found in parse and
- * plan trees. We do not support copying executor state trees; there
- * is no need for that, and no point in maintaining all the code that
- * would be needed. We also do not support copying Path trees, mainly
- * because the circular linkages between RelOptInfo and Path nodes can't
- * be handled easily in a simple depth-first traversal.
- *
*
* Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
@@ -71,1370 +64,11 @@
#include "copyfuncs.funcs.c"
-#ifdef OBSOLETE
-/* ****************************************************************
- * plannodes.h copy functions
- * ****************************************************************
- */
-
-/*
- * _copyPlannedStmt
- */
-static PlannedStmt *
-_copyPlannedStmt(const PlannedStmt *from)
-{
- PlannedStmt *newnode = makeNode(PlannedStmt);
-
- COPY_SCALAR_FIELD(commandType);
- COPY_SCALAR_FIELD(queryId);
- COPY_SCALAR_FIELD(hasReturning);
- COPY_SCALAR_FIELD(hasModifyingCTE);
- COPY_SCALAR_FIELD(canSetTag);
- COPY_SCALAR_FIELD(transientPlan);
- COPY_SCALAR_FIELD(dependsOnRole);
- COPY_SCALAR_FIELD(parallelModeNeeded);
- COPY_SCALAR_FIELD(jitFlags);
- COPY_NODE_FIELD(planTree);
- COPY_NODE_FIELD(rtable);
- COPY_NODE_FIELD(resultRelations);
- COPY_NODE_FIELD(appendRelations);
- COPY_NODE_FIELD(subplans);
- COPY_BITMAPSET_FIELD(rewindPlanIDs);
- COPY_NODE_FIELD(rowMarks);
- COPY_NODE_FIELD(relationOids);
- COPY_NODE_FIELD(invalItems);
- COPY_NODE_FIELD(paramExecTypes);
- COPY_NODE_FIELD(utilityStmt);
- COPY_LOCATION_FIELD(stmt_location);
- COPY_SCALAR_FIELD(stmt_len);
-
- return newnode;
-}
-
-/*
- * CopyPlanFields
- *
- * This function copies the fields of the Plan node. It is used by
- * all the copy functions for classes which inherit from Plan.
- */
-static void
-CopyPlanFields(const Plan *from, Plan *newnode)
-{
- COPY_SCALAR_FIELD(startup_cost);
- COPY_SCALAR_FIELD(total_cost);
- COPY_SCALAR_FIELD(plan_rows);
- COPY_SCALAR_FIELD(plan_width);
- COPY_SCALAR_FIELD(parallel_aware);
- COPY_SCALAR_FIELD(parallel_safe);
- COPY_SCALAR_FIELD(async_capable);
- COPY_SCALAR_FIELD(plan_node_id);
- COPY_NODE_FIELD(targetlist);
- COPY_NODE_FIELD(qual);
- COPY_NODE_FIELD(lefttree);
- COPY_NODE_FIELD(righttree);
- COPY_NODE_FIELD(initPlan);
- COPY_BITMAPSET_FIELD(extParam);
- COPY_BITMAPSET_FIELD(allParam);
-}
-
-/*
- * _copyResult
- */
-static Result *
-_copyResult(const Result *from)
-{
- Result *newnode = makeNode(Result);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(resconstantqual);
-
- return newnode;
-}
-
-/*
- * _copyProjectSet
- */
-static ProjectSet *
-_copyProjectSet(const ProjectSet *from)
-{
- ProjectSet *newnode = makeNode(ProjectSet);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- return newnode;
-}
-
-/*
- * _copyModifyTable
- */
-static ModifyTable *
-_copyModifyTable(const ModifyTable *from)
-{
- ModifyTable *newnode = makeNode(ModifyTable);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(operation);
- COPY_SCALAR_FIELD(canSetTag);
- COPY_SCALAR_FIELD(nominalRelation);
- COPY_SCALAR_FIELD(rootRelation);
- COPY_SCALAR_FIELD(partColsUpdated);
- COPY_NODE_FIELD(resultRelations);
- COPY_NODE_FIELD(updateColnosLists);
- COPY_NODE_FIELD(withCheckOptionLists);
- COPY_NODE_FIELD(returningLists);
- COPY_NODE_FIELD(fdwPrivLists);
- COPY_BITMAPSET_FIELD(fdwDirectModifyPlans);
- COPY_NODE_FIELD(rowMarks);
- COPY_SCALAR_FIELD(epqParam);
- COPY_SCALAR_FIELD(onConflictAction);
- COPY_NODE_FIELD(arbiterIndexes);
- COPY_NODE_FIELD(onConflictSet);
- COPY_NODE_FIELD(onConflictCols);
- COPY_NODE_FIELD(onConflictWhere);
- COPY_SCALAR_FIELD(exclRelRTI);
- COPY_NODE_FIELD(exclRelTlist);
- COPY_NODE_FIELD(mergeActionLists);
-
- return newnode;
-}
-
-/*
- * _copyAppend
- */
-static Append *
-_copyAppend(const Append *from)
-{
- Append *newnode = makeNode(Append);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_BITMAPSET_FIELD(apprelids);
- COPY_NODE_FIELD(appendplans);
- COPY_SCALAR_FIELD(nasyncplans);
- COPY_SCALAR_FIELD(first_partial_plan);
- COPY_NODE_FIELD(part_prune_info);
-
- return newnode;
-}
-
-/*
- * _copyMergeAppend
- */
-static MergeAppend *
-_copyMergeAppend(const MergeAppend *from)
-{
- MergeAppend *newnode = makeNode(MergeAppend);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_BITMAPSET_FIELD(apprelids);
- COPY_NODE_FIELD(mergeplans);
- COPY_SCALAR_FIELD(numCols);
- COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
- COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
- COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
- COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
- COPY_NODE_FIELD(part_prune_info);
-
- return newnode;
-}
-
-/*
- * _copyRecursiveUnion
- */
-static RecursiveUnion *
-_copyRecursiveUnion(const RecursiveUnion *from)
-{
- RecursiveUnion *newnode = makeNode(RecursiveUnion);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(wtParam);
- COPY_SCALAR_FIELD(numCols);
- COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
- COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
- COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
- COPY_SCALAR_FIELD(numGroups);
-
- return newnode;
-}
-
-/*
- * _copyBitmapAnd
- */
-static BitmapAnd *
-_copyBitmapAnd(const BitmapAnd *from)
-{
- BitmapAnd *newnode = makeNode(BitmapAnd);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(bitmapplans);
-
- return newnode;
-}
-
-/*
- * _copyBitmapOr
- */
-static BitmapOr *
-_copyBitmapOr(const BitmapOr *from)
-{
- BitmapOr *newnode = makeNode(BitmapOr);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(isshared);
- COPY_NODE_FIELD(bitmapplans);
-
- return newnode;
-}
-
-/*
- * _copyGather
- */
-static Gather *
-_copyGather(const Gather *from)
-{
- Gather *newnode = makeNode(Gather);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(num_workers);
- COPY_SCALAR_FIELD(rescan_param);
- COPY_SCALAR_FIELD(single_copy);
- COPY_SCALAR_FIELD(invisible);
- COPY_BITMAPSET_FIELD(initParam);
-
- return newnode;
-}
-
-/*
- * _copyGatherMerge
- */
-static GatherMerge *
-_copyGatherMerge(const GatherMerge *from)
-{
- GatherMerge *newnode = makeNode(GatherMerge);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(num_workers);
- COPY_SCALAR_FIELD(rescan_param);
- COPY_SCALAR_FIELD(numCols);
- COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
- COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
- COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
- COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
- COPY_BITMAPSET_FIELD(initParam);
-
- return newnode;
-}
-
-/*
- * CopyScanFields
- *
- * This function copies the fields of the Scan node. It is used by
- * all the copy functions for classes which inherit from Scan.
- */
-static void
-CopyScanFields(const Scan *from, Scan *newnode)
-{
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- COPY_SCALAR_FIELD(scanrelid);
-}
-
-/*
- * _copyScan
- */
-static Scan *
-_copyScan(const Scan *from)
-{
- Scan *newnode = makeNode(Scan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- return newnode;
-}
-
-/*
- * _copySeqScan
- */
-static SeqScan *
-_copySeqScan(const SeqScan *from)
-{
- SeqScan *newnode = makeNode(SeqScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- return newnode;
-}
-
-/*
- * _copySampleScan
- */
-static SampleScan *
-_copySampleScan(const SampleScan *from)
-{
- SampleScan *newnode = makeNode(SampleScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(tablesample);
-
- return newnode;
-}
-
-/*
- * _copyIndexScan
- */
-static IndexScan *
-_copyIndexScan(const IndexScan *from)
-{
- IndexScan *newnode = makeNode(IndexScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(indexid);
- COPY_NODE_FIELD(indexqual);
- COPY_NODE_FIELD(indexqualorig);
- COPY_NODE_FIELD(indexorderby);
- COPY_NODE_FIELD(indexorderbyorig);
- COPY_NODE_FIELD(indexorderbyops);
- COPY_SCALAR_FIELD(indexorderdir);
-
- return newnode;
-}
-
-/*
- * _copyIndexOnlyScan
- */
-static IndexOnlyScan *
-_copyIndexOnlyScan(const IndexOnlyScan *from)
-{
- IndexOnlyScan *newnode = makeNode(IndexOnlyScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(indexid);
- COPY_NODE_FIELD(indexqual);
- COPY_NODE_FIELD(recheckqual);
- COPY_NODE_FIELD(indexorderby);
- COPY_NODE_FIELD(indextlist);
- COPY_SCALAR_FIELD(indexorderdir);
-
- return newnode;
-}
-
-/*
- * _copyBitmapIndexScan
- */
-static BitmapIndexScan *
-_copyBitmapIndexScan(const BitmapIndexScan *from)
-{
- BitmapIndexScan *newnode = makeNode(BitmapIndexScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(indexid);
- COPY_SCALAR_FIELD(isshared);
- COPY_NODE_FIELD(indexqual);
- COPY_NODE_FIELD(indexqualorig);
-
- return newnode;
-}
-
-/*
- * _copyBitmapHeapScan
- */
-static BitmapHeapScan *
-_copyBitmapHeapScan(const BitmapHeapScan *from)
-{
- BitmapHeapScan *newnode = makeNode(BitmapHeapScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(bitmapqualorig);
-
- return newnode;
-}
-
-/*
- * _copyTidScan
- */
-static TidScan *
-_copyTidScan(const TidScan *from)
-{
- TidScan *newnode = makeNode(TidScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(tidquals);
-
- return newnode;
-}
-
-/*
- * _copyTidRangeScan
- */
-static TidRangeScan *
-_copyTidRangeScan(const TidRangeScan *from)
-{
- TidRangeScan *newnode = makeNode(TidRangeScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(tidrangequals);
-
- return newnode;
-}
-
-/*
- * _copySubqueryScan
- */
-static SubqueryScan *
-_copySubqueryScan(const SubqueryScan *from)
-{
- SubqueryScan *newnode = makeNode(SubqueryScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(subplan);
- COPY_SCALAR_FIELD(scanstatus);
-
- return newnode;
-}
-
-/*
- * _copyFunctionScan
- */
-static FunctionScan *
-_copyFunctionScan(const FunctionScan *from)
-{
- FunctionScan *newnode = makeNode(FunctionScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(functions);
- COPY_SCALAR_FIELD(funcordinality);
-
- return newnode;
-}
-
-/*
- * _copyTableFuncScan
- */
-static TableFuncScan *
-_copyTableFuncScan(const TableFuncScan *from)
-{
- TableFuncScan *newnode = makeNode(TableFuncScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(tablefunc);
-
- return newnode;
-}
-
-/*
- * _copyValuesScan
- */
-static ValuesScan *
-_copyValuesScan(const ValuesScan *from)
-{
- ValuesScan *newnode = makeNode(ValuesScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(values_lists);
-
- return newnode;
-}
-
-/*
- * _copyCteScan
- */
-static CteScan *
-_copyCteScan(const CteScan *from)
-{
- CteScan *newnode = makeNode(CteScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(ctePlanId);
- COPY_SCALAR_FIELD(cteParam);
-
- return newnode;
-}
-
-/*
- * _copyNamedTuplestoreScan
- */
-static NamedTuplestoreScan *
-_copyNamedTuplestoreScan(const NamedTuplestoreScan *from)
-{
- NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_STRING_FIELD(enrname);
-
- return newnode;
-}
-
-/*
- * _copyWorkTableScan
- */
-static WorkTableScan *
-_copyWorkTableScan(const WorkTableScan *from)
-{
- WorkTableScan *newnode = makeNode(WorkTableScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(wtParam);
-
- return newnode;
-}
-
-/*
- * _copyForeignScan
- */
-static ForeignScan *
-_copyForeignScan(const ForeignScan *from)
-{
- ForeignScan *newnode = makeNode(ForeignScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(operation);
- COPY_SCALAR_FIELD(resultRelation);
- COPY_SCALAR_FIELD(fs_server);
- COPY_NODE_FIELD(fdw_exprs);
- COPY_NODE_FIELD(fdw_private);
- COPY_NODE_FIELD(fdw_scan_tlist);
- COPY_NODE_FIELD(fdw_recheck_quals);
- COPY_BITMAPSET_FIELD(fs_relids);
- COPY_SCALAR_FIELD(fsSystemCol);
-
- return newnode;
-}
-
-/*
- * _copyCustomScan
- */
-static CustomScan *
-_copyCustomScan(const CustomScan *from)
-{
- CustomScan *newnode = makeNode(CustomScan);
-
- /*
- * copy node superclass fields
- */
- CopyScanFields((const Scan *) from, (Scan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(flags);
- COPY_NODE_FIELD(custom_plans);
- COPY_NODE_FIELD(custom_exprs);
- COPY_NODE_FIELD(custom_private);
- COPY_NODE_FIELD(custom_scan_tlist);
- COPY_BITMAPSET_FIELD(custom_relids);
-
- /*
- * NOTE: The method field of CustomScan is required to be a pointer to a
- * static table of callback functions. So we don't copy the table itself,
- * just reference the original one.
- */
- COPY_SCALAR_FIELD(methods);
-
- return newnode;
-}
-
-/*
- * CopyJoinFields
- *
- * This function copies the fields of the Join node. It is used by
- * all the copy functions for classes which inherit from Join.
- */
-static void
-CopyJoinFields(const Join *from, Join *newnode)
-{
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- COPY_SCALAR_FIELD(jointype);
- COPY_SCALAR_FIELD(inner_unique);
- COPY_NODE_FIELD(joinqual);
-}
-
-
-/*
- * _copyNestLoop
- */
-static NestLoop *
-_copyNestLoop(const NestLoop *from)
-{
- NestLoop *newnode = makeNode(NestLoop);
-
- /*
- * copy node superclass fields
- */
- CopyJoinFields((const Join *) from, (Join *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(nestParams);
-
- return newnode;
-}
-
-
-/*
- * _copyMergeJoin
- */
-static MergeJoin *
-_copyMergeJoin(const MergeJoin *from)
-{
- MergeJoin *newnode = makeNode(MergeJoin);
- int numCols;
-
- /*
- * copy node superclass fields
- */
- CopyJoinFields((const Join *) from, (Join *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(skip_mark_restore);
- COPY_NODE_FIELD(mergeclauses);
- numCols = list_length(from->mergeclauses);
- COPY_POINTER_FIELD(mergeFamilies, numCols * sizeof(Oid));
- COPY_POINTER_FIELD(mergeCollations, numCols * sizeof(Oid));
- COPY_POINTER_FIELD(mergeStrategies, numCols * sizeof(int));
- COPY_POINTER_FIELD(mergeNullsFirst, numCols * sizeof(bool));
-
- return newnode;
-}
-
-/*
- * _copyHashJoin
- */
-static HashJoin *
-_copyHashJoin(const HashJoin *from)
-{
- HashJoin *newnode = makeNode(HashJoin);
-
- /*
- * copy node superclass fields
- */
- CopyJoinFields((const Join *) from, (Join *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(hashclauses);
- COPY_NODE_FIELD(hashoperators);
- COPY_NODE_FIELD(hashcollations);
- COPY_NODE_FIELD(hashkeys);
-
- return newnode;
-}
-
-
-/*
- * _copyMaterial
- */
-static Material *
-_copyMaterial(const Material *from)
-{
- Material *newnode = makeNode(Material);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- return newnode;
-}
-
/*
- * _copyMemoize
+ * Support functions for nodes with custom_copy_equal attribute
*/
-static Memoize *
-_copyMemoize(const Memoize *from)
-{
- Memoize *newnode = makeNode(Memoize);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(numKeys);
- COPY_POINTER_FIELD(hashOperators, sizeof(Oid) * from->numKeys);
- COPY_POINTER_FIELD(collations, sizeof(Oid) * from->numKeys);
- COPY_NODE_FIELD(param_exprs);
- COPY_SCALAR_FIELD(singlerow);
- COPY_SCALAR_FIELD(binary_mode);
- COPY_SCALAR_FIELD(est_entries);
- COPY_BITMAPSET_FIELD(keyparamids);
-
- return newnode;
-}
-
-/*
- * CopySortFields
- *
- * This function copies the fields of the Sort node. It is used by
- * all the copy functions for classes which inherit from Sort.
- */
-static void
-CopySortFields(const Sort *from, Sort *newnode)
-{
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- COPY_SCALAR_FIELD(numCols);
- COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
- COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
- COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid));
- COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
-}
-
-/*
- * _copySort
- */
-static Sort *
-_copySort(const Sort *from)
-{
- Sort *newnode = makeNode(Sort);
-
- /*
- * copy node superclass fields
- */
- CopySortFields(from, newnode);
-
- return newnode;
-}
-
-
-/*
- * _copyIncrementalSort
- */
-static IncrementalSort *
-_copyIncrementalSort(const IncrementalSort *from)
-{
- IncrementalSort *newnode = makeNode(IncrementalSort);
-
- /*
- * copy node superclass fields
- */
- CopySortFields((const Sort *) from, (Sort *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(nPresortedCols);
-
- return newnode;
-}
-
-
-/*
- * _copyGroup
- */
-static Group *
-_copyGroup(const Group *from)
-{
- Group *newnode = makeNode(Group);
-
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- COPY_SCALAR_FIELD(numCols);
- COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
- COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
- COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
-
- return newnode;
-}
-
-/*
- * _copyAgg
- */
-static Agg *
-_copyAgg(const Agg *from)
-{
- Agg *newnode = makeNode(Agg);
-
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- COPY_SCALAR_FIELD(aggstrategy);
- COPY_SCALAR_FIELD(aggsplit);
- COPY_SCALAR_FIELD(numCols);
- COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
- COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
- COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid));
- COPY_SCALAR_FIELD(numGroups);
- COPY_SCALAR_FIELD(transitionSpace);
- COPY_BITMAPSET_FIELD(aggParams);
- COPY_NODE_FIELD(groupingSets);
- COPY_NODE_FIELD(chain);
-
- return newnode;
-}
-
-/*
- * _copyWindowAgg
- */
-static WindowAgg *
-_copyWindowAgg(const WindowAgg *from)
-{
- WindowAgg *newnode = makeNode(WindowAgg);
-
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- COPY_SCALAR_FIELD(winref);
- COPY_SCALAR_FIELD(partNumCols);
- COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber));
- COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid));
- COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid));
- COPY_SCALAR_FIELD(ordNumCols);
- COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber));
- COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid));
- COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid));
- COPY_SCALAR_FIELD(frameOptions);
- COPY_NODE_FIELD(startOffset);
- COPY_NODE_FIELD(endOffset);
- COPY_NODE_FIELD(runCondition);
- COPY_NODE_FIELD(runConditionOrig);
- COPY_SCALAR_FIELD(startInRangeFunc);
- COPY_SCALAR_FIELD(endInRangeFunc);
- COPY_SCALAR_FIELD(inRangeColl);
- COPY_SCALAR_FIELD(inRangeAsc);
- COPY_SCALAR_FIELD(inRangeNullsFirst);
- COPY_SCALAR_FIELD(topWindow);
-
- return newnode;
-}
-
-/*
- * _copyUnique
- */
-static Unique *
-_copyUnique(const Unique *from)
-{
- Unique *newnode = makeNode(Unique);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(numCols);
- COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
- COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
- COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid));
-
- return newnode;
-}
-
-/*
- * _copyHash
- */
-static Hash *
-_copyHash(const Hash *from)
-{
- Hash *newnode = makeNode(Hash);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(hashkeys);
- COPY_SCALAR_FIELD(skewTable);
- COPY_SCALAR_FIELD(skewColumn);
- COPY_SCALAR_FIELD(skewInherit);
- COPY_SCALAR_FIELD(rows_total);
-
- return newnode;
-}
-
-/*
- * _copySetOp
- */
-static SetOp *
-_copySetOp(const SetOp *from)
-{
- SetOp *newnode = makeNode(SetOp);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_SCALAR_FIELD(cmd);
- COPY_SCALAR_FIELD(strategy);
- COPY_SCALAR_FIELD(numCols);
- COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
- COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
- COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid));
- COPY_SCALAR_FIELD(flagColIdx);
- COPY_SCALAR_FIELD(firstFlag);
- COPY_SCALAR_FIELD(numGroups);
-
- return newnode;
-}
-
-/*
- * _copyLockRows
- */
-static LockRows *
-_copyLockRows(const LockRows *from)
-{
- LockRows *newnode = makeNode(LockRows);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(rowMarks);
- COPY_SCALAR_FIELD(epqParam);
-
- return newnode;
-}
-
-/*
- * _copyLimit
- */
-static Limit *
-_copyLimit(const Limit *from)
-{
- Limit *newnode = makeNode(Limit);
-
- /*
- * copy node superclass fields
- */
- CopyPlanFields((const Plan *) from, (Plan *) newnode);
-
- /*
- * copy remainder of node
- */
- COPY_NODE_FIELD(limitOffset);
- COPY_NODE_FIELD(limitCount);
- COPY_SCALAR_FIELD(limitOption);
- COPY_SCALAR_FIELD(uniqNumCols);
- COPY_POINTER_FIELD(uniqColIdx, from->uniqNumCols * sizeof(AttrNumber));
- COPY_POINTER_FIELD(uniqOperators, from->uniqNumCols * sizeof(Oid));
- COPY_POINTER_FIELD(uniqCollations, from->uniqNumCols * sizeof(Oid));
-
- return newnode;
-}
-
-/*
- * _copyNestLoopParam
- */
-static NestLoopParam *
-_copyNestLoopParam(const NestLoopParam *from)
-{
- NestLoopParam *newnode = makeNode(NestLoopParam);
-
- COPY_SCALAR_FIELD(paramno);
- COPY_NODE_FIELD(paramval);
-
- return newnode;
-}
-
-/*
- * _copyPlanRowMark
- */
-static PlanRowMark *
-_copyPlanRowMark(const PlanRowMark *from)
-{
- PlanRowMark *newnode = makeNode(PlanRowMark);
-
- COPY_SCALAR_FIELD(rti);
- COPY_SCALAR_FIELD(prti);
- COPY_SCALAR_FIELD(rowmarkId);
- COPY_SCALAR_FIELD(markType);
- COPY_SCALAR_FIELD(allMarkTypes);
- COPY_SCALAR_FIELD(strength);
- COPY_SCALAR_FIELD(waitPolicy);
- COPY_SCALAR_FIELD(isParent);
-
- return newnode;
-}
-
-static PartitionPruneInfo *
-_copyPartitionPruneInfo(const PartitionPruneInfo *from)
-{
- PartitionPruneInfo *newnode = makeNode(PartitionPruneInfo);
-
- COPY_NODE_FIELD(prune_infos);
- COPY_BITMAPSET_FIELD(other_subplans);
-
- return newnode;
-}
-
-static PartitionedRelPruneInfo *
-_copyPartitionedRelPruneInfo(const PartitionedRelPruneInfo *from)
-{
- PartitionedRelPruneInfo *newnode = makeNode(PartitionedRelPruneInfo);
-
- COPY_SCALAR_FIELD(rtindex);
- COPY_BITMAPSET_FIELD(present_parts);
- COPY_SCALAR_FIELD(nparts);
- COPY_POINTER_FIELD(subplan_map, from->nparts * sizeof(int));
- COPY_POINTER_FIELD(subpart_map, from->nparts * sizeof(int));
- COPY_POINTER_FIELD(relid_map, from->nparts * sizeof(Oid));
- COPY_NODE_FIELD(initial_pruning_steps);
- COPY_NODE_FIELD(exec_pruning_steps);
- COPY_BITMAPSET_FIELD(execparamids);
-
- return newnode;
-}
-
-/*
- * _copyPartitionPruneStepOp
- */
-static PartitionPruneStepOp *
-_copyPartitionPruneStepOp(const PartitionPruneStepOp *from)
-{
- PartitionPruneStepOp *newnode = makeNode(PartitionPruneStepOp);
-
- COPY_SCALAR_FIELD(step.step_id);
- COPY_SCALAR_FIELD(opstrategy);
- COPY_NODE_FIELD(exprs);
- COPY_NODE_FIELD(cmpfns);
- COPY_BITMAPSET_FIELD(nullkeys);
-
- return newnode;
-}
-
-/*
- * _copyPartitionPruneStepCombine
- */
-static PartitionPruneStepCombine *
-_copyPartitionPruneStepCombine(const PartitionPruneStepCombine *from)
-{
- PartitionPruneStepCombine *newnode = makeNode(PartitionPruneStepCombine);
-
- COPY_SCALAR_FIELD(step.step_id);
- COPY_SCALAR_FIELD(combineOp);
- COPY_NODE_FIELD(source_stepids);
-
- return newnode;
-}
-
-/*
- * _copyPlanInvalItem
- */
-static PlanInvalItem *
-_copyPlanInvalItem(const PlanInvalItem *from)
-{
- PlanInvalItem *newnode = makeNode(PlanInvalItem);
-
- COPY_SCALAR_FIELD(cacheId);
- COPY_SCALAR_FIELD(hashValue);
-
- return newnode;
-}
-
-/* ****************************************************************
- * primnodes.h copy functions
- * ****************************************************************
- */
-
-/*
- * _copyAlias
- */
-static Alias *
-_copyAlias(const Alias *from)
-{
- Alias *newnode = makeNode(Alias);
-
- COPY_STRING_FIELD(aliasname);
- COPY_NODE_FIELD(colnames);
-
- return newnode;
-}
-
-/*
- * _copyRangeVar
- */
-static RangeVar *
-_copyRangeVar(const RangeVar *from)
-{
- RangeVar *newnode = makeNode(RangeVar);
-
- COPY_STRING_FIELD(catalogname);
- COPY_STRING_FIELD(schemaname);
- COPY_STRING_FIELD(relname);
- COPY_SCALAR_FIELD(inh);
- COPY_SCALAR_FIELD(relpersistence);
- COPY_NODE_FIELD(alias);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyTableFunc
- */
-static TableFunc *
-_copyTableFunc(const TableFunc *from)
-{
- TableFunc *newnode = makeNode(TableFunc);
-
- COPY_SCALAR_FIELD(functype);
- COPY_NODE_FIELD(ns_uris);
- COPY_NODE_FIELD(ns_names);
- COPY_NODE_FIELD(docexpr);
- COPY_NODE_FIELD(rowexpr);
- COPY_NODE_FIELD(colnames);
- COPY_NODE_FIELD(coltypes);
- COPY_NODE_FIELD(coltypmods);
- COPY_NODE_FIELD(colcollations);
- COPY_NODE_FIELD(colexprs);
- COPY_NODE_FIELD(coldefexprs);
- COPY_NODE_FIELD(colvalexprs);
- COPY_BITMAPSET_FIELD(notnulls);
- COPY_NODE_FIELD(plan);
- COPY_SCALAR_FIELD(ordinalitycol);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyIntoClause
- */
-static IntoClause *
-_copyIntoClause(const IntoClause *from)
-{
- IntoClause *newnode = makeNode(IntoClause);
-
- COPY_NODE_FIELD(rel);
- COPY_NODE_FIELD(colNames);
- COPY_STRING_FIELD(accessMethod);
- COPY_NODE_FIELD(options);
- COPY_SCALAR_FIELD(onCommit);
- COPY_STRING_FIELD(tableSpaceName);
- COPY_NODE_FIELD(viewQuery);
- COPY_SCALAR_FIELD(skipData);
-
- return newnode;
-}
-
-/*
- * We don't need a _copyExpr because Expr is an abstract supertype which
- * should never actually get instantiated. Also, since it has no common
- * fields except NodeTag, there's no need for a helper routine to factor
- * out copying the common fields...
- */
-
-/*
- * _copyVar
- */
-static Var *
-_copyVar(const Var *from)
-{
- Var *newnode = makeNode(Var);
-
- COPY_SCALAR_FIELD(varno);
- COPY_SCALAR_FIELD(varattno);
- COPY_SCALAR_FIELD(vartype);
- COPY_SCALAR_FIELD(vartypmod);
- COPY_SCALAR_FIELD(varcollid);
- COPY_SCALAR_FIELD(varlevelsup);
- COPY_SCALAR_FIELD(varnosyn);
- COPY_SCALAR_FIELD(varattnosyn);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-#endif /* OBSOLETE */
-
-/*
- * _copyConst
- */
static Const *
_copyConst(const Const *from)
{
@@ -1470,1753 +104,6 @@ _copyConst(const Const *from)
return newnode;
}
-#ifdef OBSOLETE
-/*
- * _copyParam
- */
-static Param *
-_copyParam(const Param *from)
-{
- Param *newnode = makeNode(Param);
-
- COPY_SCALAR_FIELD(paramkind);
- COPY_SCALAR_FIELD(paramid);
- COPY_SCALAR_FIELD(paramtype);
- COPY_SCALAR_FIELD(paramtypmod);
- COPY_SCALAR_FIELD(paramcollid);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyAggref
- */
-static Aggref *
-_copyAggref(const Aggref *from)
-{
- Aggref *newnode = makeNode(Aggref);
-
- COPY_SCALAR_FIELD(aggfnoid);
- COPY_SCALAR_FIELD(aggtype);
- COPY_SCALAR_FIELD(aggcollid);
- COPY_SCALAR_FIELD(inputcollid);
- COPY_SCALAR_FIELD(aggtranstype);
- COPY_NODE_FIELD(aggargtypes);
- COPY_NODE_FIELD(aggdirectargs);
- COPY_NODE_FIELD(args);
- COPY_NODE_FIELD(aggorder);
- COPY_NODE_FIELD(aggdistinct);
- COPY_NODE_FIELD(aggfilter);
- COPY_SCALAR_FIELD(aggstar);
- COPY_SCALAR_FIELD(aggvariadic);
- COPY_SCALAR_FIELD(aggkind);
- COPY_SCALAR_FIELD(agglevelsup);
- COPY_SCALAR_FIELD(aggsplit);
- COPY_SCALAR_FIELD(aggno);
- COPY_SCALAR_FIELD(aggtransno);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyGroupingFunc
- */
-static GroupingFunc *
-_copyGroupingFunc(const GroupingFunc *from)
-{
- GroupingFunc *newnode = makeNode(GroupingFunc);
-
- COPY_NODE_FIELD(args);
- COPY_NODE_FIELD(refs);
- COPY_NODE_FIELD(cols);
- COPY_SCALAR_FIELD(agglevelsup);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyWindowFunc
- */
-static WindowFunc *
-_copyWindowFunc(const WindowFunc *from)
-{
- WindowFunc *newnode = makeNode(WindowFunc);
-
- COPY_SCALAR_FIELD(winfnoid);
- COPY_SCALAR_FIELD(wintype);
- COPY_SCALAR_FIELD(wincollid);
- COPY_SCALAR_FIELD(inputcollid);
- COPY_NODE_FIELD(args);
- COPY_NODE_FIELD(aggfilter);
- COPY_SCALAR_FIELD(winref);
- COPY_SCALAR_FIELD(winstar);
- COPY_SCALAR_FIELD(winagg);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copySubscriptingRef
- */
-static SubscriptingRef *
-_copySubscriptingRef(const SubscriptingRef *from)
-{
- SubscriptingRef *newnode = makeNode(SubscriptingRef);
-
- COPY_SCALAR_FIELD(refcontainertype);
- COPY_SCALAR_FIELD(refelemtype);
- COPY_SCALAR_FIELD(refrestype);
- COPY_SCALAR_FIELD(reftypmod);
- COPY_SCALAR_FIELD(refcollid);
- COPY_NODE_FIELD(refupperindexpr);
- COPY_NODE_FIELD(reflowerindexpr);
- COPY_NODE_FIELD(refexpr);
- COPY_NODE_FIELD(refassgnexpr);
-
- return newnode;
-}
-
-/*
- * _copyFuncExpr
- */
-static FuncExpr *
-_copyFuncExpr(const FuncExpr *from)
-{
- FuncExpr *newnode = makeNode(FuncExpr);
-
- COPY_SCALAR_FIELD(funcid);
- COPY_SCALAR_FIELD(funcresulttype);
- COPY_SCALAR_FIELD(funcretset);
- COPY_SCALAR_FIELD(funcvariadic);
- COPY_SCALAR_FIELD(funcformat);
- COPY_SCALAR_FIELD(funccollid);
- COPY_SCALAR_FIELD(inputcollid);
- COPY_NODE_FIELD(args);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyNamedArgExpr *
- */
-static NamedArgExpr *
-_copyNamedArgExpr(const NamedArgExpr *from)
-{
- NamedArgExpr *newnode = makeNode(NamedArgExpr);
-
- COPY_NODE_FIELD(arg);
- COPY_STRING_FIELD(name);
- COPY_SCALAR_FIELD(argnumber);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyOpExpr
- */
-static OpExpr *
-_copyOpExpr(const OpExpr *from)
-{
- OpExpr *newnode = makeNode(OpExpr);
-
- COPY_SCALAR_FIELD(opno);
- COPY_SCALAR_FIELD(opfuncid);
- COPY_SCALAR_FIELD(opresulttype);
- COPY_SCALAR_FIELD(opretset);
- COPY_SCALAR_FIELD(opcollid);
- COPY_SCALAR_FIELD(inputcollid);
- COPY_NODE_FIELD(args);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyDistinctExpr (same as OpExpr)
- */
-static DistinctExpr *
-_copyDistinctExpr(const DistinctExpr *from)
-{
- DistinctExpr *newnode = makeNode(DistinctExpr);
-
- COPY_SCALAR_FIELD(opno);
- COPY_SCALAR_FIELD(opfuncid);
- COPY_SCALAR_FIELD(opresulttype);
- COPY_SCALAR_FIELD(opretset);
- COPY_SCALAR_FIELD(opcollid);
- COPY_SCALAR_FIELD(inputcollid);
- COPY_NODE_FIELD(args);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyNullIfExpr (same as OpExpr)
- */
-static NullIfExpr *
-_copyNullIfExpr(const NullIfExpr *from)
-{
- NullIfExpr *newnode = makeNode(NullIfExpr);
-
- COPY_SCALAR_FIELD(opno);
- COPY_SCALAR_FIELD(opfuncid);
- COPY_SCALAR_FIELD(opresulttype);
- COPY_SCALAR_FIELD(opretset);
- COPY_SCALAR_FIELD(opcollid);
- COPY_SCALAR_FIELD(inputcollid);
- COPY_NODE_FIELD(args);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyScalarArrayOpExpr
- */
-static ScalarArrayOpExpr *
-_copyScalarArrayOpExpr(const ScalarArrayOpExpr *from)
-{
- ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
-
- COPY_SCALAR_FIELD(opno);
- COPY_SCALAR_FIELD(opfuncid);
- COPY_SCALAR_FIELD(hashfuncid);
- COPY_SCALAR_FIELD(negfuncid);
- COPY_SCALAR_FIELD(useOr);
- COPY_SCALAR_FIELD(inputcollid);
- COPY_NODE_FIELD(args);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyBoolExpr
- */
-static BoolExpr *
-_copyBoolExpr(const BoolExpr *from)
-{
- BoolExpr *newnode = makeNode(BoolExpr);
-
- COPY_SCALAR_FIELD(boolop);
- COPY_NODE_FIELD(args);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copySubLink
- */
-static SubLink *
-_copySubLink(const SubLink *from)
-{
- SubLink *newnode = makeNode(SubLink);
-
- COPY_SCALAR_FIELD(subLinkType);
- COPY_SCALAR_FIELD(subLinkId);
- COPY_NODE_FIELD(testexpr);
- COPY_NODE_FIELD(operName);
- COPY_NODE_FIELD(subselect);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copySubPlan
- */
-static SubPlan *
-_copySubPlan(const SubPlan *from)
-{
- SubPlan *newnode = makeNode(SubPlan);
-
- COPY_SCALAR_FIELD(subLinkType);
- COPY_NODE_FIELD(testexpr);
- COPY_NODE_FIELD(paramIds);
- COPY_SCALAR_FIELD(plan_id);
- COPY_STRING_FIELD(plan_name);
- COPY_SCALAR_FIELD(firstColType);
- COPY_SCALAR_FIELD(firstColTypmod);
- COPY_SCALAR_FIELD(firstColCollation);
- COPY_SCALAR_FIELD(useHashTable);
- COPY_SCALAR_FIELD(unknownEqFalse);
- COPY_SCALAR_FIELD(parallel_safe);
- COPY_NODE_FIELD(setParam);
- COPY_NODE_FIELD(parParam);
- COPY_NODE_FIELD(args);
- COPY_SCALAR_FIELD(startup_cost);
- COPY_SCALAR_FIELD(per_call_cost);
-
- return newnode;
-}
-
-/*
- * _copyAlternativeSubPlan
- */
-static AlternativeSubPlan *
-_copyAlternativeSubPlan(const AlternativeSubPlan *from)
-{
- AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan);
-
- COPY_NODE_FIELD(subplans);
-
- return newnode;
-}
-
-/*
- * _copyFieldSelect
- */
-static FieldSelect *
-_copyFieldSelect(const FieldSelect *from)
-{
- FieldSelect *newnode = makeNode(FieldSelect);
-
- COPY_NODE_FIELD(arg);
- COPY_SCALAR_FIELD(fieldnum);
- COPY_SCALAR_FIELD(resulttype);
- COPY_SCALAR_FIELD(resulttypmod);
- COPY_SCALAR_FIELD(resultcollid);
-
- return newnode;
-}
-
-/*
- * _copyFieldStore
- */
-static FieldStore *
-_copyFieldStore(const FieldStore *from)
-{
- FieldStore *newnode = makeNode(FieldStore);
-
- COPY_NODE_FIELD(arg);
- COPY_NODE_FIELD(newvals);
- COPY_NODE_FIELD(fieldnums);
- COPY_SCALAR_FIELD(resulttype);
-
- return newnode;
-}
-
-/*
- * _copyRelabelType
- */
-static RelabelType *
-_copyRelabelType(const RelabelType *from)
-{
- RelabelType *newnode = makeNode(RelabelType);
-
- COPY_NODE_FIELD(arg);
- COPY_SCALAR_FIELD(resulttype);
- COPY_SCALAR_FIELD(resulttypmod);
- COPY_SCALAR_FIELD(resultcollid);
- COPY_SCALAR_FIELD(relabelformat);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyCoerceViaIO
- */
-static CoerceViaIO *
-_copyCoerceViaIO(const CoerceViaIO *from)
-{
- CoerceViaIO *newnode = makeNode(CoerceViaIO);
-
- COPY_NODE_FIELD(arg);
- COPY_SCALAR_FIELD(resulttype);
- COPY_SCALAR_FIELD(resultcollid);
- COPY_SCALAR_FIELD(coerceformat);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyArrayCoerceExpr
- */
-static ArrayCoerceExpr *
-_copyArrayCoerceExpr(const ArrayCoerceExpr *from)
-{
- ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr);
-
- COPY_NODE_FIELD(arg);
- COPY_NODE_FIELD(elemexpr);
- COPY_SCALAR_FIELD(resulttype);
- COPY_SCALAR_FIELD(resulttypmod);
- COPY_SCALAR_FIELD(resultcollid);
- COPY_SCALAR_FIELD(coerceformat);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyConvertRowtypeExpr
- */
-static ConvertRowtypeExpr *
-_copyConvertRowtypeExpr(const ConvertRowtypeExpr *from)
-{
- ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
-
- COPY_NODE_FIELD(arg);
- COPY_SCALAR_FIELD(resulttype);
- COPY_SCALAR_FIELD(convertformat);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyCollateExpr
- */
-static CollateExpr *
-_copyCollateExpr(const CollateExpr *from)
-{
- CollateExpr *newnode = makeNode(CollateExpr);
-
- COPY_NODE_FIELD(arg);
- COPY_SCALAR_FIELD(collOid);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyCaseExpr
- */
-static CaseExpr *
-_copyCaseExpr(const CaseExpr *from)
-{
- CaseExpr *newnode = makeNode(CaseExpr);
-
- COPY_SCALAR_FIELD(casetype);
- COPY_SCALAR_FIELD(casecollid);
- COPY_NODE_FIELD(arg);
- COPY_NODE_FIELD(args);
- COPY_NODE_FIELD(defresult);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyCaseWhen
- */
-static CaseWhen *
-_copyCaseWhen(const CaseWhen *from)
-{
- CaseWhen *newnode = makeNode(CaseWhen);
-
- COPY_NODE_FIELD(expr);
- COPY_NODE_FIELD(result);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyCaseTestExpr
- */
-static CaseTestExpr *
-_copyCaseTestExpr(const CaseTestExpr *from)
-{
- CaseTestExpr *newnode = makeNode(CaseTestExpr);
-
- COPY_SCALAR_FIELD(typeId);
- COPY_SCALAR_FIELD(typeMod);
- COPY_SCALAR_FIELD(collation);
-
- return newnode;
-}
-
-/*
- * _copyArrayExpr
- */
-static ArrayExpr *
-_copyArrayExpr(const ArrayExpr *from)
-{
- ArrayExpr *newnode = makeNode(ArrayExpr);
-
- COPY_SCALAR_FIELD(array_typeid);
- COPY_SCALAR_FIELD(array_collid);
- COPY_SCALAR_FIELD(element_typeid);
- COPY_NODE_FIELD(elements);
- COPY_SCALAR_FIELD(multidims);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyRowExpr
- */
-static RowExpr *
-_copyRowExpr(const RowExpr *from)
-{
- RowExpr *newnode = makeNode(RowExpr);
-
- COPY_NODE_FIELD(args);
- COPY_SCALAR_FIELD(row_typeid);
- COPY_SCALAR_FIELD(row_format);
- COPY_NODE_FIELD(colnames);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyRowCompareExpr
- */
-static RowCompareExpr *
-_copyRowCompareExpr(const RowCompareExpr *from)
-{
- RowCompareExpr *newnode = makeNode(RowCompareExpr);
-
- COPY_SCALAR_FIELD(rctype);
- COPY_NODE_FIELD(opnos);
- COPY_NODE_FIELD(opfamilies);
- COPY_NODE_FIELD(inputcollids);
- COPY_NODE_FIELD(largs);
- COPY_NODE_FIELD(rargs);
-
- return newnode;
-}
-
-/*
- * _copyCoalesceExpr
- */
-static CoalesceExpr *
-_copyCoalesceExpr(const CoalesceExpr *from)
-{
- CoalesceExpr *newnode = makeNode(CoalesceExpr);
-
- COPY_SCALAR_FIELD(coalescetype);
- COPY_SCALAR_FIELD(coalescecollid);
- COPY_NODE_FIELD(args);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyMinMaxExpr
- */
-static MinMaxExpr *
-_copyMinMaxExpr(const MinMaxExpr *from)
-{
- MinMaxExpr *newnode = makeNode(MinMaxExpr);
-
- COPY_SCALAR_FIELD(minmaxtype);
- COPY_SCALAR_FIELD(minmaxcollid);
- COPY_SCALAR_FIELD(inputcollid);
- COPY_SCALAR_FIELD(op);
- COPY_NODE_FIELD(args);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copySQLValueFunction
- */
-static SQLValueFunction *
-_copySQLValueFunction(const SQLValueFunction *from)
-{
- SQLValueFunction *newnode = makeNode(SQLValueFunction);
-
- COPY_SCALAR_FIELD(op);
- COPY_SCALAR_FIELD(type);
- COPY_SCALAR_FIELD(typmod);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyXmlExpr
- */
-static XmlExpr *
-_copyXmlExpr(const XmlExpr *from)
-{
- XmlExpr *newnode = makeNode(XmlExpr);
-
- COPY_SCALAR_FIELD(op);
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(named_args);
- COPY_NODE_FIELD(arg_names);
- COPY_NODE_FIELD(args);
- COPY_SCALAR_FIELD(xmloption);
- COPY_SCALAR_FIELD(type);
- COPY_SCALAR_FIELD(typmod);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyNullTest
- */
-static NullTest *
-_copyNullTest(const NullTest *from)
-{
- NullTest *newnode = makeNode(NullTest);
-
- COPY_NODE_FIELD(arg);
- COPY_SCALAR_FIELD(nulltesttype);
- COPY_SCALAR_FIELD(argisrow);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyBooleanTest
- */
-static BooleanTest *
-_copyBooleanTest(const BooleanTest *from)
-{
- BooleanTest *newnode = makeNode(BooleanTest);
-
- COPY_NODE_FIELD(arg);
- COPY_SCALAR_FIELD(booltesttype);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyCoerceToDomain
- */
-static CoerceToDomain *
-_copyCoerceToDomain(const CoerceToDomain *from)
-{
- CoerceToDomain *newnode = makeNode(CoerceToDomain);
-
- COPY_NODE_FIELD(arg);
- COPY_SCALAR_FIELD(resulttype);
- COPY_SCALAR_FIELD(resulttypmod);
- COPY_SCALAR_FIELD(resultcollid);
- COPY_SCALAR_FIELD(coercionformat);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyCoerceToDomainValue
- */
-static CoerceToDomainValue *
-_copyCoerceToDomainValue(const CoerceToDomainValue *from)
-{
- CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
-
- COPY_SCALAR_FIELD(typeId);
- COPY_SCALAR_FIELD(typeMod);
- COPY_SCALAR_FIELD(collation);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copySetToDefault
- */
-static SetToDefault *
-_copySetToDefault(const SetToDefault *from)
-{
- SetToDefault *newnode = makeNode(SetToDefault);
-
- COPY_SCALAR_FIELD(typeId);
- COPY_SCALAR_FIELD(typeMod);
- COPY_SCALAR_FIELD(collation);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyCurrentOfExpr
- */
-static CurrentOfExpr *
-_copyCurrentOfExpr(const CurrentOfExpr *from)
-{
- CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
-
- COPY_SCALAR_FIELD(cvarno);
- COPY_STRING_FIELD(cursor_name);
- COPY_SCALAR_FIELD(cursor_param);
-
- return newnode;
-}
-
- /*
- * _copyNextValueExpr
- */
-static NextValueExpr *
-_copyNextValueExpr(const NextValueExpr *from)
-{
- NextValueExpr *newnode = makeNode(NextValueExpr);
-
- COPY_SCALAR_FIELD(seqid);
- COPY_SCALAR_FIELD(typeId);
-
- return newnode;
-}
-
-/*
- * _copyInferenceElem
- */
-static InferenceElem *
-_copyInferenceElem(const InferenceElem *from)
-{
- InferenceElem *newnode = makeNode(InferenceElem);
-
- COPY_NODE_FIELD(expr);
- COPY_SCALAR_FIELD(infercollid);
- COPY_SCALAR_FIELD(inferopclass);
-
- return newnode;
-}
-
-/*
- * _copyTargetEntry
- */
-static TargetEntry *
-_copyTargetEntry(const TargetEntry *from)
-{
- TargetEntry *newnode = makeNode(TargetEntry);
-
- COPY_NODE_FIELD(expr);
- COPY_SCALAR_FIELD(resno);
- COPY_STRING_FIELD(resname);
- COPY_SCALAR_FIELD(ressortgroupref);
- COPY_SCALAR_FIELD(resorigtbl);
- COPY_SCALAR_FIELD(resorigcol);
- COPY_SCALAR_FIELD(resjunk);
-
- return newnode;
-}
-
-/*
- * _copyRangeTblRef
- */
-static RangeTblRef *
-_copyRangeTblRef(const RangeTblRef *from)
-{
- RangeTblRef *newnode = makeNode(RangeTblRef);
-
- COPY_SCALAR_FIELD(rtindex);
-
- return newnode;
-}
-
-/*
- * _copyJoinExpr
- */
-static JoinExpr *
-_copyJoinExpr(const JoinExpr *from)
-{
- JoinExpr *newnode = makeNode(JoinExpr);
-
- COPY_SCALAR_FIELD(jointype);
- COPY_SCALAR_FIELD(isNatural);
- COPY_NODE_FIELD(larg);
- COPY_NODE_FIELD(rarg);
- COPY_NODE_FIELD(usingClause);
- COPY_NODE_FIELD(join_using_alias);
- COPY_NODE_FIELD(quals);
- COPY_NODE_FIELD(alias);
- COPY_SCALAR_FIELD(rtindex);
-
- return newnode;
-}
-
-/*
- * _copyFromExpr
- */
-static FromExpr *
-_copyFromExpr(const FromExpr *from)
-{
- FromExpr *newnode = makeNode(FromExpr);
-
- COPY_NODE_FIELD(fromlist);
- COPY_NODE_FIELD(quals);
-
- return newnode;
-}
-
-/*
- * _copyOnConflictExpr
- */
-static OnConflictExpr *
-_copyOnConflictExpr(const OnConflictExpr *from)
-{
- OnConflictExpr *newnode = makeNode(OnConflictExpr);
-
- COPY_SCALAR_FIELD(action);
- COPY_NODE_FIELD(arbiterElems);
- COPY_NODE_FIELD(arbiterWhere);
- COPY_SCALAR_FIELD(constraint);
- COPY_NODE_FIELD(onConflictSet);
- COPY_NODE_FIELD(onConflictWhere);
- COPY_SCALAR_FIELD(exclRelIndex);
- COPY_NODE_FIELD(exclRelTlist);
-
- return newnode;
-}
-
-
-/*
- * _copyJsonFormat
- */
-static JsonFormat *
-_copyJsonFormat(const JsonFormat *from)
-{
- JsonFormat *newnode = makeNode(JsonFormat);
-
- COPY_SCALAR_FIELD(format_type);
- COPY_SCALAR_FIELD(encoding);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonReturning
- */
-static JsonReturning *
-_copyJsonReturning(const JsonReturning *from)
-{
- JsonReturning *newnode = makeNode(JsonReturning);
-
- COPY_NODE_FIELD(format);
- COPY_SCALAR_FIELD(typid);
- COPY_SCALAR_FIELD(typmod);
-
- return newnode;
-}
-
-/*
- * _copyJsonValueExpr
- */
-static JsonValueExpr *
-_copyJsonValueExpr(const JsonValueExpr *from)
-{
- JsonValueExpr *newnode = makeNode(JsonValueExpr);
-
- COPY_NODE_FIELD(raw_expr);
- COPY_NODE_FIELD(formatted_expr);
- COPY_NODE_FIELD(format);
-
- return newnode;
-}
-
-/*
- * _copyJsonParseExpr
- */
-static JsonParseExpr *
-_copyJsonParseExpr(const JsonParseExpr *from)
-{
- JsonParseExpr *newnode = makeNode(JsonParseExpr);
-
- COPY_NODE_FIELD(expr);
- COPY_NODE_FIELD(output);
- COPY_SCALAR_FIELD(unique_keys);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonScalarExpr
- */
-static JsonScalarExpr *
-_copyJsonScalarExpr(const JsonScalarExpr *from)
-{
- JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
-
- COPY_NODE_FIELD(expr);
- COPY_NODE_FIELD(output);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonSerializeExpr
- */
-static JsonSerializeExpr *
-_copyJsonSerializeExpr(const JsonSerializeExpr *from)
-{
- JsonSerializeExpr *newnode = makeNode(JsonSerializeExpr);
-
- COPY_NODE_FIELD(expr);
- COPY_NODE_FIELD(output);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonConstructorExpr
- */
-static JsonConstructorExpr *
-_copyJsonConstructorExpr(const JsonConstructorExpr *from)
-{
- JsonConstructorExpr *newnode = makeNode(JsonConstructorExpr);
-
- COPY_SCALAR_FIELD(type);
- COPY_NODE_FIELD(args);
- COPY_NODE_FIELD(func);
- COPY_NODE_FIELD(coercion);
- COPY_NODE_FIELD(returning);
- COPY_SCALAR_FIELD(absent_on_null);
- COPY_SCALAR_FIELD(unique);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonKeyValue
- */
-static JsonKeyValue *
-_copyJsonKeyValue(const JsonKeyValue *from)
-{
- JsonKeyValue *newnode = makeNode(JsonKeyValue);
-
- COPY_NODE_FIELD(key);
- COPY_NODE_FIELD(value);
-
- return newnode;
-}
-
-/*
- * _copyJsonObjectConstructor
- */
-static JsonObjectConstructor *
-_copyJsonObjectConstructor(const JsonObjectConstructor *from)
-{
- JsonObjectConstructor *newnode = makeNode(JsonObjectConstructor);
-
- COPY_NODE_FIELD(exprs);
- COPY_NODE_FIELD(output);
- COPY_SCALAR_FIELD(absent_on_null);
- COPY_SCALAR_FIELD(unique);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonAggConstructor
- */
-static JsonAggConstructor *
-_copyJsonAggConstructor(const JsonAggConstructor *from)
-{
- JsonAggConstructor *newnode = makeNode(JsonAggConstructor);
-
- COPY_NODE_FIELD(output);
- COPY_NODE_FIELD(agg_filter);
- COPY_NODE_FIELD(agg_order);
- COPY_NODE_FIELD(over);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonObjectAgg
- */
-static JsonObjectAgg *
-_copyJsonObjectAgg(const JsonObjectAgg *from)
-{
- JsonObjectAgg *newnode = makeNode(JsonObjectAgg);
-
- COPY_NODE_FIELD(constructor);
- COPY_NODE_FIELD(arg);
- COPY_SCALAR_FIELD(absent_on_null);
- COPY_SCALAR_FIELD(unique);
-
- return newnode;
-}
-
-/*
- * _copyJsonOutput
- */
-static JsonOutput *
-_copyJsonOutput(const JsonOutput *from)
-{
- JsonOutput *newnode = makeNode(JsonOutput);
-
- COPY_NODE_FIELD(typeName);
- COPY_NODE_FIELD(returning);
-
- return newnode;
-}
-
-/*
- * _copyJsonArrayConstructor
- */
-static JsonArrayConstructor *
-_copyJsonArrayConstructor(const JsonArrayConstructor *from)
-{
- JsonArrayConstructor *newnode = makeNode(JsonArrayConstructor);
-
- COPY_NODE_FIELD(exprs);
- COPY_NODE_FIELD(output);
- COPY_SCALAR_FIELD(absent_on_null);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonArrayAgg
- */
-static JsonArrayAgg *
-_copyJsonArrayAgg(const JsonArrayAgg *from)
-{
- JsonArrayAgg *newnode = makeNode(JsonArrayAgg);
-
- COPY_NODE_FIELD(constructor);
- COPY_NODE_FIELD(arg);
- COPY_SCALAR_FIELD(absent_on_null);
-
- return newnode;
-}
-
-/*
- * _copyJsonArrayQueryConstructor
- */
-static JsonArrayQueryConstructor *
-_copyJsonArrayQueryConstructor(const JsonArrayQueryConstructor *from)
-{
- JsonArrayQueryConstructor *newnode = makeNode(JsonArrayQueryConstructor);
-
- COPY_NODE_FIELD(query);
- COPY_NODE_FIELD(output);
- COPY_NODE_FIELD(format);
- COPY_SCALAR_FIELD(absent_on_null);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonExpr
- */
-static JsonExpr *
-_copyJsonExpr(const JsonExpr *from)
-{
- JsonExpr *newnode = makeNode(JsonExpr);
-
- COPY_SCALAR_FIELD(op);
- COPY_NODE_FIELD(formatted_expr);
- COPY_NODE_FIELD(result_coercion);
- COPY_NODE_FIELD(format);
- COPY_NODE_FIELD(path_spec);
- COPY_NODE_FIELD(passing_names);
- COPY_NODE_FIELD(passing_values);
- COPY_NODE_FIELD(returning);
- COPY_NODE_FIELD(on_empty);
- COPY_NODE_FIELD(on_error);
- COPY_NODE_FIELD(coercions);
- COPY_SCALAR_FIELD(wrapper);
- COPY_SCALAR_FIELD(omit_quotes);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonCoercion
- */
-static JsonCoercion *
-_copyJsonCoercion(const JsonCoercion *from)
-{
- JsonCoercion *newnode = makeNode(JsonCoercion);
-
- COPY_NODE_FIELD(expr);
- COPY_SCALAR_FIELD(via_populate);
- COPY_SCALAR_FIELD(via_io);
- COPY_SCALAR_FIELD(collation);
-
- return newnode;
-}
-
-/*
- * _copyJsonItemCoercions
- */
-static JsonItemCoercions *
-_copyJsonItemCoercions(const JsonItemCoercions *from)
-{
- JsonItemCoercions *newnode = makeNode(JsonItemCoercions);
-
- COPY_NODE_FIELD(null);
- COPY_NODE_FIELD(string);
- COPY_NODE_FIELD(numeric);
- COPY_NODE_FIELD(boolean);
- COPY_NODE_FIELD(date);
- COPY_NODE_FIELD(time);
- COPY_NODE_FIELD(timetz);
- COPY_NODE_FIELD(timestamp);
- COPY_NODE_FIELD(timestamptz);
- COPY_NODE_FIELD(composite);
-
- return newnode;
-}
-
-/*
- * _copyJsonFuncExpr
- */
-static JsonFuncExpr *
-_copyJsonFuncExpr(const JsonFuncExpr *from)
-{
- JsonFuncExpr *newnode = makeNode(JsonFuncExpr);
-
- COPY_SCALAR_FIELD(op);
- COPY_NODE_FIELD(common);
- COPY_NODE_FIELD(output);
- COPY_NODE_FIELD(on_empty);
- COPY_NODE_FIELD(on_error);
- COPY_SCALAR_FIELD(wrapper);
- COPY_SCALAR_FIELD(omit_quotes);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonIsPredicate
- */
-static JsonIsPredicate *
-_copyJsonIsPredicate(const JsonIsPredicate *from)
-{
- JsonIsPredicate *newnode = makeNode(JsonIsPredicate);
-
- COPY_NODE_FIELD(expr);
- COPY_NODE_FIELD(format);
- COPY_SCALAR_FIELD(item_type);
- COPY_SCALAR_FIELD(unique_keys);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonBehavior
- */
-static JsonBehavior *
-_copyJsonBehavior(const JsonBehavior *from)
-{
- JsonBehavior *newnode = makeNode(JsonBehavior);
-
- COPY_SCALAR_FIELD(btype);
- COPY_NODE_FIELD(default_expr);
-
- return newnode;
-}
-
-/*
- * _copyJsonCommon
- */
-static JsonCommon *
-_copyJsonCommon(const JsonCommon *from)
-{
- JsonCommon *newnode = makeNode(JsonCommon);
-
- COPY_NODE_FIELD(expr);
- COPY_NODE_FIELD(pathspec);
- COPY_STRING_FIELD(pathname);
- COPY_NODE_FIELD(passing);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonArgument
- */
-static JsonArgument *
-_copyJsonArgument(const JsonArgument *from)
-{
- JsonArgument *newnode = makeNode(JsonArgument);
-
- COPY_NODE_FIELD(val);
- COPY_STRING_FIELD(name);
-
- return newnode;
-}
-
-/*
- * _copyJsonTable
- */
-static JsonTable *
-_copyJsonTable(const JsonTable *from)
-{
- JsonTable *newnode = makeNode(JsonTable);
-
- COPY_NODE_FIELD(common);
- COPY_NODE_FIELD(columns);
- COPY_NODE_FIELD(plan);
- COPY_NODE_FIELD(on_error);
- COPY_NODE_FIELD(alias);
- COPY_SCALAR_FIELD(lateral);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonTableColumn
- */
-static JsonTableColumn *
-_copyJsonTableColumn(const JsonTableColumn *from)
-{
- JsonTableColumn *newnode = makeNode(JsonTableColumn);
-
- COPY_SCALAR_FIELD(coltype);
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(typeName);
- COPY_STRING_FIELD(pathspec);
- COPY_STRING_FIELD(pathname);
- COPY_NODE_FIELD(format);
- COPY_SCALAR_FIELD(wrapper);
- COPY_SCALAR_FIELD(omit_quotes);
- COPY_NODE_FIELD(columns);
- COPY_NODE_FIELD(on_empty);
- COPY_NODE_FIELD(on_error);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonTablePlan
- */
-static JsonTablePlan *
-_copyJsonTablePlan(const JsonTablePlan *from)
-{
- JsonTablePlan *newnode = makeNode(JsonTablePlan);
-
- COPY_SCALAR_FIELD(plan_type);
- COPY_SCALAR_FIELD(join_type);
- COPY_NODE_FIELD(plan1);
- COPY_NODE_FIELD(plan2);
- COPY_STRING_FIELD(pathname);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-/*
- * _copyJsonTableParent
- */
-static JsonTableParent *
-_copyJsonTableParent(const JsonTableParent *from)
-{
- JsonTableParent *newnode = makeNode(JsonTableParent);
-
- COPY_NODE_FIELD(path);
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(child);
- COPY_SCALAR_FIELD(outerJoin);
- COPY_SCALAR_FIELD(colMin);
- COPY_SCALAR_FIELD(colMax);
- COPY_SCALAR_FIELD(errorOnError);
-
- return newnode;
-}
-
-/*
- * _copyJsonTableSibling
- */
-static JsonTableSibling *
-_copyJsonTableSibling(const JsonTableSibling *from)
-{
- JsonTableSibling *newnode = makeNode(JsonTableSibling);
-
- COPY_NODE_FIELD(larg);
- COPY_NODE_FIELD(rarg);
- COPY_SCALAR_FIELD(cross);
-
- return newnode;
-}
-
-/* ****************************************************************
- * pathnodes.h copy functions
- *
- * We don't support copying RelOptInfo, IndexOptInfo, or Path nodes.
- * There are some subsidiary structs that are useful to copy, though.
- * ****************************************************************
- */
-
-/*
- * _copyPathKey
- */
-static PathKey *
-_copyPathKey(const PathKey *from)
-{
- PathKey *newnode = makeNode(PathKey);
-
- /* EquivalenceClasses are never moved, so just shallow-copy the pointer */
- COPY_SCALAR_FIELD(pk_eclass);
- COPY_SCALAR_FIELD(pk_opfamily);
- COPY_SCALAR_FIELD(pk_strategy);
- COPY_SCALAR_FIELD(pk_nulls_first);
-
- return newnode;
-}
-
-/*
- * _copyRestrictInfo
- */
-static RestrictInfo *
-_copyRestrictInfo(const RestrictInfo *from)
-{
- RestrictInfo *newnode = makeNode(RestrictInfo);
-
- COPY_NODE_FIELD(clause);
- COPY_SCALAR_FIELD(is_pushed_down);
- COPY_SCALAR_FIELD(outerjoin_delayed);
- COPY_SCALAR_FIELD(can_join);
- COPY_SCALAR_FIELD(pseudoconstant);
- COPY_SCALAR_FIELD(leakproof);
- COPY_SCALAR_FIELD(has_volatile);
- COPY_SCALAR_FIELD(security_level);
- COPY_BITMAPSET_FIELD(clause_relids);
- COPY_BITMAPSET_FIELD(required_relids);
- COPY_BITMAPSET_FIELD(outer_relids);
- COPY_BITMAPSET_FIELD(nullable_relids);
- COPY_BITMAPSET_FIELD(left_relids);
- COPY_BITMAPSET_FIELD(right_relids);
- COPY_NODE_FIELD(orclause);
- /* EquivalenceClasses are never copied, so shallow-copy the pointers */
- COPY_SCALAR_FIELD(parent_ec);
- COPY_SCALAR_FIELD(eval_cost);
- COPY_SCALAR_FIELD(norm_selec);
- COPY_SCALAR_FIELD(outer_selec);
- COPY_NODE_FIELD(mergeopfamilies);
- /* EquivalenceClasses are never copied, so shallow-copy the pointers */
- COPY_SCALAR_FIELD(left_ec);
- COPY_SCALAR_FIELD(right_ec);
- COPY_SCALAR_FIELD(left_em);
- COPY_SCALAR_FIELD(right_em);
- /* MergeScanSelCache isn't a Node, so hard to copy; just reset cache */
- newnode->scansel_cache = NIL;
- COPY_SCALAR_FIELD(outer_is_left);
- COPY_SCALAR_FIELD(hashjoinoperator);
- COPY_SCALAR_FIELD(left_bucketsize);
- COPY_SCALAR_FIELD(right_bucketsize);
- COPY_SCALAR_FIELD(left_mcvfreq);
- COPY_SCALAR_FIELD(right_mcvfreq);
- COPY_SCALAR_FIELD(left_hasheqoperator);
- COPY_SCALAR_FIELD(right_hasheqoperator);
-
- return newnode;
-}
-
-/*
- * _copyPlaceHolderVar
- */
-static PlaceHolderVar *
-_copyPlaceHolderVar(const PlaceHolderVar *from)
-{
- PlaceHolderVar *newnode = makeNode(PlaceHolderVar);
-
- COPY_NODE_FIELD(phexpr);
- COPY_BITMAPSET_FIELD(phrels);
- COPY_SCALAR_FIELD(phid);
- COPY_SCALAR_FIELD(phlevelsup);
-
- return newnode;
-}
-
-/*
- * _copySpecialJoinInfo
- */
-static SpecialJoinInfo *
-_copySpecialJoinInfo(const SpecialJoinInfo *from)
-{
- SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo);
-
- COPY_BITMAPSET_FIELD(min_lefthand);
- COPY_BITMAPSET_FIELD(min_righthand);
- COPY_BITMAPSET_FIELD(syn_lefthand);
- COPY_BITMAPSET_FIELD(syn_righthand);
- COPY_SCALAR_FIELD(jointype);
- COPY_SCALAR_FIELD(lhs_strict);
- COPY_SCALAR_FIELD(delay_upper_joins);
- COPY_SCALAR_FIELD(semi_can_btree);
- COPY_SCALAR_FIELD(semi_can_hash);
- COPY_NODE_FIELD(semi_operators);
- COPY_NODE_FIELD(semi_rhs_exprs);
-
- return newnode;
-}
-
-/*
- * _copyAppendRelInfo
- */
-static AppendRelInfo *
-_copyAppendRelInfo(const AppendRelInfo *from)
-{
- AppendRelInfo *newnode = makeNode(AppendRelInfo);
-
- COPY_SCALAR_FIELD(parent_relid);
- COPY_SCALAR_FIELD(child_relid);
- COPY_SCALAR_FIELD(parent_reltype);
- COPY_SCALAR_FIELD(child_reltype);
- COPY_NODE_FIELD(translated_vars);
- COPY_SCALAR_FIELD(num_child_cols);
- COPY_POINTER_FIELD(parent_colnos, from->num_child_cols * sizeof(AttrNumber));
- COPY_SCALAR_FIELD(parent_reloid);
-
- return newnode;
-}
-
-/*
- * _copyPlaceHolderInfo
- */
-static PlaceHolderInfo *
-_copyPlaceHolderInfo(const PlaceHolderInfo *from)
-{
- PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo);
-
- COPY_SCALAR_FIELD(phid);
- COPY_NODE_FIELD(ph_var);
- COPY_BITMAPSET_FIELD(ph_eval_at);
- COPY_BITMAPSET_FIELD(ph_lateral);
- COPY_BITMAPSET_FIELD(ph_needed);
- COPY_SCALAR_FIELD(ph_width);
-
- return newnode;
-}
-
-/* ****************************************************************
- * parsenodes.h copy functions
- * ****************************************************************
- */
-
-static RangeTblEntry *
-_copyRangeTblEntry(const RangeTblEntry *from)
-{
- RangeTblEntry *newnode = makeNode(RangeTblEntry);
-
- COPY_SCALAR_FIELD(rtekind);
- COPY_SCALAR_FIELD(relid);
- COPY_SCALAR_FIELD(relkind);
- COPY_SCALAR_FIELD(rellockmode);
- COPY_NODE_FIELD(tablesample);
- COPY_NODE_FIELD(subquery);
- COPY_SCALAR_FIELD(security_barrier);
- COPY_SCALAR_FIELD(jointype);
- COPY_SCALAR_FIELD(joinmergedcols);
- COPY_NODE_FIELD(joinaliasvars);
- COPY_NODE_FIELD(joinleftcols);
- COPY_NODE_FIELD(joinrightcols);
- COPY_NODE_FIELD(join_using_alias);
- COPY_NODE_FIELD(functions);
- COPY_SCALAR_FIELD(funcordinality);
- COPY_NODE_FIELD(tablefunc);
- COPY_NODE_FIELD(values_lists);
- COPY_STRING_FIELD(ctename);
- COPY_SCALAR_FIELD(ctelevelsup);
- COPY_SCALAR_FIELD(self_reference);
- COPY_NODE_FIELD(coltypes);
- COPY_NODE_FIELD(coltypmods);
- COPY_NODE_FIELD(colcollations);
- COPY_STRING_FIELD(enrname);
- COPY_SCALAR_FIELD(enrtuples);
- COPY_NODE_FIELD(alias);
- COPY_NODE_FIELD(eref);
- COPY_SCALAR_FIELD(lateral);
- COPY_SCALAR_FIELD(inh);
- COPY_SCALAR_FIELD(inFromCl);
- COPY_SCALAR_FIELD(requiredPerms);
- COPY_SCALAR_FIELD(checkAsUser);
- COPY_BITMAPSET_FIELD(selectedCols);
- COPY_BITMAPSET_FIELD(insertedCols);
- COPY_BITMAPSET_FIELD(updatedCols);
- COPY_BITMAPSET_FIELD(extraUpdatedCols);
- COPY_NODE_FIELD(securityQuals);
-
- return newnode;
-}
-
-static RangeTblFunction *
-_copyRangeTblFunction(const RangeTblFunction *from)
-{
- RangeTblFunction *newnode = makeNode(RangeTblFunction);
-
- COPY_NODE_FIELD(funcexpr);
- COPY_SCALAR_FIELD(funccolcount);
- COPY_NODE_FIELD(funccolnames);
- COPY_NODE_FIELD(funccoltypes);
- COPY_NODE_FIELD(funccoltypmods);
- COPY_NODE_FIELD(funccolcollations);
- COPY_BITMAPSET_FIELD(funcparams);
-
- return newnode;
-}
-
-static TableSampleClause *
-_copyTableSampleClause(const TableSampleClause *from)
-{
- TableSampleClause *newnode = makeNode(TableSampleClause);
-
- COPY_SCALAR_FIELD(tsmhandler);
- COPY_NODE_FIELD(args);
- COPY_NODE_FIELD(repeatable);
-
- return newnode;
-}
-
-static WithCheckOption *
-_copyWithCheckOption(const WithCheckOption *from)
-{
- WithCheckOption *newnode = makeNode(WithCheckOption);
-
- COPY_SCALAR_FIELD(kind);
- COPY_STRING_FIELD(relname);
- COPY_STRING_FIELD(polname);
- COPY_NODE_FIELD(qual);
- COPY_SCALAR_FIELD(cascaded);
-
- return newnode;
-}
-
-static SortGroupClause *
-_copySortGroupClause(const SortGroupClause *from)
-{
- SortGroupClause *newnode = makeNode(SortGroupClause);
-
- COPY_SCALAR_FIELD(tleSortGroupRef);
- COPY_SCALAR_FIELD(eqop);
- COPY_SCALAR_FIELD(sortop);
- COPY_SCALAR_FIELD(nulls_first);
- COPY_SCALAR_FIELD(hashable);
-
- return newnode;
-}
-
-static GroupingSet *
-_copyGroupingSet(const GroupingSet *from)
-{
- GroupingSet *newnode = makeNode(GroupingSet);
-
- COPY_SCALAR_FIELD(kind);
- COPY_NODE_FIELD(content);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static WindowClause *
-_copyWindowClause(const WindowClause *from)
-{
- WindowClause *newnode = makeNode(WindowClause);
-
- COPY_STRING_FIELD(name);
- COPY_STRING_FIELD(refname);
- COPY_NODE_FIELD(partitionClause);
- COPY_NODE_FIELD(orderClause);
- COPY_SCALAR_FIELD(frameOptions);
- COPY_NODE_FIELD(startOffset);
- COPY_NODE_FIELD(endOffset);
- COPY_NODE_FIELD(runCondition);
- COPY_SCALAR_FIELD(startInRangeFunc);
- COPY_SCALAR_FIELD(endInRangeFunc);
- COPY_SCALAR_FIELD(inRangeColl);
- COPY_SCALAR_FIELD(inRangeAsc);
- COPY_SCALAR_FIELD(inRangeNullsFirst);
- COPY_SCALAR_FIELD(winref);
- COPY_SCALAR_FIELD(copiedOrder);
-
- return newnode;
-}
-
-static RowMarkClause *
-_copyRowMarkClause(const RowMarkClause *from)
-{
- RowMarkClause *newnode = makeNode(RowMarkClause);
-
- COPY_SCALAR_FIELD(rti);
- COPY_SCALAR_FIELD(strength);
- COPY_SCALAR_FIELD(waitPolicy);
- COPY_SCALAR_FIELD(pushedDown);
-
- return newnode;
-}
-
-static WithClause *
-_copyWithClause(const WithClause *from)
-{
- WithClause *newnode = makeNode(WithClause);
-
- COPY_NODE_FIELD(ctes);
- COPY_SCALAR_FIELD(recursive);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static InferClause *
-_copyInferClause(const InferClause *from)
-{
- InferClause *newnode = makeNode(InferClause);
-
- COPY_NODE_FIELD(indexElems);
- COPY_NODE_FIELD(whereClause);
- COPY_STRING_FIELD(conname);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static OnConflictClause *
-_copyOnConflictClause(const OnConflictClause *from)
-{
- OnConflictClause *newnode = makeNode(OnConflictClause);
-
- COPY_SCALAR_FIELD(action);
- COPY_NODE_FIELD(infer);
- COPY_NODE_FIELD(targetList);
- COPY_NODE_FIELD(whereClause);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static CTESearchClause *
-_copyCTESearchClause(const CTESearchClause *from)
-{
- CTESearchClause *newnode = makeNode(CTESearchClause);
-
- COPY_NODE_FIELD(search_col_list);
- COPY_SCALAR_FIELD(search_breadth_first);
- COPY_STRING_FIELD(search_seq_column);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static CTECycleClause *
-_copyCTECycleClause(const CTECycleClause *from)
-{
- CTECycleClause *newnode = makeNode(CTECycleClause);
-
- COPY_NODE_FIELD(cycle_col_list);
- COPY_STRING_FIELD(cycle_mark_column);
- COPY_NODE_FIELD(cycle_mark_value);
- COPY_NODE_FIELD(cycle_mark_default);
- COPY_STRING_FIELD(cycle_path_column);
- COPY_LOCATION_FIELD(location);
- COPY_SCALAR_FIELD(cycle_mark_type);
- COPY_SCALAR_FIELD(cycle_mark_typmod);
- COPY_SCALAR_FIELD(cycle_mark_collation);
- COPY_SCALAR_FIELD(cycle_mark_neop);
-
- return newnode;
-}
-
-static CommonTableExpr *
-_copyCommonTableExpr(const CommonTableExpr *from)
-{
- CommonTableExpr *newnode = makeNode(CommonTableExpr);
-
- COPY_STRING_FIELD(ctename);
- COPY_NODE_FIELD(aliascolnames);
- COPY_SCALAR_FIELD(ctematerialized);
- COPY_NODE_FIELD(ctequery);
- COPY_NODE_FIELD(search_clause);
- COPY_NODE_FIELD(cycle_clause);
- COPY_LOCATION_FIELD(location);
- COPY_SCALAR_FIELD(cterecursive);
- COPY_SCALAR_FIELD(cterefcount);
- COPY_NODE_FIELD(ctecolnames);
- COPY_NODE_FIELD(ctecoltypes);
- COPY_NODE_FIELD(ctecoltypmods);
- COPY_NODE_FIELD(ctecolcollations);
-
- return newnode;
-}
-
-static MergeWhenClause *
-_copyMergeWhenClause(const MergeWhenClause *from)
-{
- MergeWhenClause *newnode = makeNode(MergeWhenClause);
-
- COPY_SCALAR_FIELD(matched);
- COPY_SCALAR_FIELD(commandType);
- COPY_SCALAR_FIELD(override);
- COPY_NODE_FIELD(condition);
- COPY_NODE_FIELD(targetList);
- COPY_NODE_FIELD(values);
- return newnode;
-}
-
-static MergeAction *
-_copyMergeAction(const MergeAction *from)
-{
- MergeAction *newnode = makeNode(MergeAction);
-
- COPY_SCALAR_FIELD(matched);
- COPY_SCALAR_FIELD(commandType);
- COPY_SCALAR_FIELD(override);
- COPY_NODE_FIELD(qual);
- COPY_NODE_FIELD(targetList);
- COPY_NODE_FIELD(updateColnos);
-
- return newnode;
-}
-
-static A_Expr *
-_copyA_Expr(const A_Expr *from)
-{
- A_Expr *newnode = makeNode(A_Expr);
-
- COPY_SCALAR_FIELD(kind);
- COPY_NODE_FIELD(name);
- COPY_NODE_FIELD(lexpr);
- COPY_NODE_FIELD(rexpr);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static ColumnRef *
-_copyColumnRef(const ColumnRef *from)
-{
- ColumnRef *newnode = makeNode(ColumnRef);
-
- COPY_NODE_FIELD(fields);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static ParamRef *
-_copyParamRef(const ParamRef *from)
-{
- ParamRef *newnode = makeNode(ParamRef);
-
- COPY_SCALAR_FIELD(number);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-#endif /* OBSOLETE */
-
static A_Const *
_copyA_Const(const A_Const *from)
{
@@ -3256,2178 +143,6 @@ _copyA_Const(const A_Const *from)
return newnode;
}
-#ifdef OBSOLETE
-static FuncCall *
-_copyFuncCall(const FuncCall *from)
-{
- FuncCall *newnode = makeNode(FuncCall);
-
- COPY_NODE_FIELD(funcname);
- COPY_NODE_FIELD(args);
- COPY_NODE_FIELD(agg_order);
- COPY_NODE_FIELD(agg_filter);
- COPY_NODE_FIELD(over);
- COPY_SCALAR_FIELD(agg_within_group);
- COPY_SCALAR_FIELD(agg_star);
- COPY_SCALAR_FIELD(agg_distinct);
- COPY_SCALAR_FIELD(func_variadic);
- COPY_SCALAR_FIELD(funcformat);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static A_Star *
-_copyA_Star(const A_Star *from)
-{
- A_Star *newnode = makeNode(A_Star);
-
- return newnode;
-}
-
-static A_Indices *
-_copyA_Indices(const A_Indices *from)
-{
- A_Indices *newnode = makeNode(A_Indices);
-
- COPY_SCALAR_FIELD(is_slice);
- COPY_NODE_FIELD(lidx);
- COPY_NODE_FIELD(uidx);
-
- return newnode;
-}
-
-static A_Indirection *
-_copyA_Indirection(const A_Indirection *from)
-{
- A_Indirection *newnode = makeNode(A_Indirection);
-
- COPY_NODE_FIELD(arg);
- COPY_NODE_FIELD(indirection);
-
- return newnode;
-}
-
-static A_ArrayExpr *
-_copyA_ArrayExpr(const A_ArrayExpr *from)
-{
- A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
-
- COPY_NODE_FIELD(elements);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static ResTarget *
-_copyResTarget(const ResTarget *from)
-{
- ResTarget *newnode = makeNode(ResTarget);
-
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(indirection);
- COPY_NODE_FIELD(val);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static MultiAssignRef *
-_copyMultiAssignRef(const MultiAssignRef *from)
-{
- MultiAssignRef *newnode = makeNode(MultiAssignRef);
-
- COPY_NODE_FIELD(source);
- COPY_SCALAR_FIELD(colno);
- COPY_SCALAR_FIELD(ncolumns);
-
- return newnode;
-}
-
-static TypeName *
-_copyTypeName(const TypeName *from)
-{
- TypeName *newnode = makeNode(TypeName);
-
- COPY_NODE_FIELD(names);
- COPY_SCALAR_FIELD(typeOid);
- COPY_SCALAR_FIELD(setof);
- COPY_SCALAR_FIELD(pct_type);
- COPY_NODE_FIELD(typmods);
- COPY_SCALAR_FIELD(typemod);
- COPY_NODE_FIELD(arrayBounds);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static SortBy *
-_copySortBy(const SortBy *from)
-{
- SortBy *newnode = makeNode(SortBy);
-
- COPY_NODE_FIELD(node);
- COPY_SCALAR_FIELD(sortby_dir);
- COPY_SCALAR_FIELD(sortby_nulls);
- COPY_NODE_FIELD(useOp);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static WindowDef *
-_copyWindowDef(const WindowDef *from)
-{
- WindowDef *newnode = makeNode(WindowDef);
-
- COPY_STRING_FIELD(name);
- COPY_STRING_FIELD(refname);
- COPY_NODE_FIELD(partitionClause);
- COPY_NODE_FIELD(orderClause);
- COPY_SCALAR_FIELD(frameOptions);
- COPY_NODE_FIELD(startOffset);
- COPY_NODE_FIELD(endOffset);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static RangeSubselect *
-_copyRangeSubselect(const RangeSubselect *from)
-{
- RangeSubselect *newnode = makeNode(RangeSubselect);
-
- COPY_SCALAR_FIELD(lateral);
- COPY_NODE_FIELD(subquery);
- COPY_NODE_FIELD(alias);
-
- return newnode;
-}
-
-static RangeFunction *
-_copyRangeFunction(const RangeFunction *from)
-{
- RangeFunction *newnode = makeNode(RangeFunction);
-
- COPY_SCALAR_FIELD(lateral);
- COPY_SCALAR_FIELD(ordinality);
- COPY_SCALAR_FIELD(is_rowsfrom);
- COPY_NODE_FIELD(functions);
- COPY_NODE_FIELD(alias);
- COPY_NODE_FIELD(coldeflist);
-
- return newnode;
-}
-
-static RangeTableSample *
-_copyRangeTableSample(const RangeTableSample *from)
-{
- RangeTableSample *newnode = makeNode(RangeTableSample);
-
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(method);
- COPY_NODE_FIELD(args);
- COPY_NODE_FIELD(repeatable);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static RangeTableFunc *
-_copyRangeTableFunc(const RangeTableFunc *from)
-{
- RangeTableFunc *newnode = makeNode(RangeTableFunc);
-
- COPY_SCALAR_FIELD(lateral);
- COPY_NODE_FIELD(docexpr);
- COPY_NODE_FIELD(rowexpr);
- COPY_NODE_FIELD(namespaces);
- COPY_NODE_FIELD(columns);
- COPY_NODE_FIELD(alias);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static RangeTableFuncCol *
-_copyRangeTableFuncCol(const RangeTableFuncCol *from)
-{
- RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol);
-
- COPY_STRING_FIELD(colname);
- COPY_NODE_FIELD(typeName);
- COPY_SCALAR_FIELD(for_ordinality);
- COPY_SCALAR_FIELD(is_not_null);
- COPY_NODE_FIELD(colexpr);
- COPY_NODE_FIELD(coldefexpr);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static TypeCast *
-_copyTypeCast(const TypeCast *from)
-{
- TypeCast *newnode = makeNode(TypeCast);
-
- COPY_NODE_FIELD(arg);
- COPY_NODE_FIELD(typeName);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static CollateClause *
-_copyCollateClause(const CollateClause *from)
-{
- CollateClause *newnode = makeNode(CollateClause);
-
- COPY_NODE_FIELD(arg);
- COPY_NODE_FIELD(collname);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static IndexElem *
-_copyIndexElem(const IndexElem *from)
-{
- IndexElem *newnode = makeNode(IndexElem);
-
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(expr);
- COPY_STRING_FIELD(indexcolname);
- COPY_NODE_FIELD(collation);
- COPY_NODE_FIELD(opclass);
- COPY_NODE_FIELD(opclassopts);
- COPY_SCALAR_FIELD(ordering);
- COPY_SCALAR_FIELD(nulls_ordering);
-
- return newnode;
-}
-
-static StatsElem *
-_copyStatsElem(const StatsElem *from)
-{
- StatsElem *newnode = makeNode(StatsElem);
-
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(expr);
-
- return newnode;
-}
-
-static ColumnDef *
-_copyColumnDef(const ColumnDef *from)
-{
- ColumnDef *newnode = makeNode(ColumnDef);
-
- COPY_STRING_FIELD(colname);
- COPY_NODE_FIELD(typeName);
- COPY_STRING_FIELD(compression);
- COPY_SCALAR_FIELD(inhcount);
- COPY_SCALAR_FIELD(is_local);
- COPY_SCALAR_FIELD(is_not_null);
- COPY_SCALAR_FIELD(is_from_type);
- COPY_SCALAR_FIELD(storage);
- COPY_NODE_FIELD(raw_default);
- COPY_NODE_FIELD(cooked_default);
- COPY_SCALAR_FIELD(identity);
- COPY_NODE_FIELD(identitySequence);
- COPY_SCALAR_FIELD(generated);
- COPY_NODE_FIELD(collClause);
- COPY_SCALAR_FIELD(collOid);
- COPY_NODE_FIELD(constraints);
- COPY_NODE_FIELD(fdwoptions);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static Constraint *
-_copyConstraint(const Constraint *from)
-{
- Constraint *newnode = makeNode(Constraint);
-
- COPY_SCALAR_FIELD(contype);
- COPY_STRING_FIELD(conname);
- COPY_SCALAR_FIELD(deferrable);
- COPY_SCALAR_FIELD(initdeferred);
- COPY_LOCATION_FIELD(location);
- COPY_SCALAR_FIELD(is_no_inherit);
- COPY_NODE_FIELD(raw_expr);
- COPY_STRING_FIELD(cooked_expr);
- COPY_SCALAR_FIELD(generated_when);
- COPY_SCALAR_FIELD(nulls_not_distinct);
- COPY_NODE_FIELD(keys);
- COPY_NODE_FIELD(including);
- COPY_NODE_FIELD(exclusions);
- COPY_NODE_FIELD(options);
- COPY_STRING_FIELD(indexname);
- COPY_STRING_FIELD(indexspace);
- COPY_SCALAR_FIELD(reset_default_tblspc);
- COPY_STRING_FIELD(access_method);
- COPY_NODE_FIELD(where_clause);
- COPY_NODE_FIELD(pktable);
- COPY_NODE_FIELD(fk_attrs);
- COPY_NODE_FIELD(pk_attrs);
- COPY_SCALAR_FIELD(fk_matchtype);
- COPY_SCALAR_FIELD(fk_upd_action);
- COPY_SCALAR_FIELD(fk_del_action);
- COPY_NODE_FIELD(fk_del_set_cols);
- COPY_NODE_FIELD(old_conpfeqop);
- COPY_SCALAR_FIELD(old_pktable_oid);
- COPY_SCALAR_FIELD(skip_validation);
- COPY_SCALAR_FIELD(initially_valid);
-
- return newnode;
-}
-
-static DefElem *
-_copyDefElem(const DefElem *from)
-{
- DefElem *newnode = makeNode(DefElem);
-
- COPY_STRING_FIELD(defnamespace);
- COPY_STRING_FIELD(defname);
- COPY_NODE_FIELD(arg);
- COPY_SCALAR_FIELD(defaction);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static LockingClause *
-_copyLockingClause(const LockingClause *from)
-{
- LockingClause *newnode = makeNode(LockingClause);
-
- COPY_NODE_FIELD(lockedRels);
- COPY_SCALAR_FIELD(strength);
- COPY_SCALAR_FIELD(waitPolicy);
-
- return newnode;
-}
-
-static XmlSerialize *
-_copyXmlSerialize(const XmlSerialize *from)
-{
- XmlSerialize *newnode = makeNode(XmlSerialize);
-
- COPY_SCALAR_FIELD(xmloption);
- COPY_NODE_FIELD(expr);
- COPY_NODE_FIELD(typeName);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static RoleSpec *
-_copyRoleSpec(const RoleSpec *from)
-{
- RoleSpec *newnode = makeNode(RoleSpec);
-
- COPY_SCALAR_FIELD(roletype);
- COPY_STRING_FIELD(rolename);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static TriggerTransition *
-_copyTriggerTransition(const TriggerTransition *from)
-{
- TriggerTransition *newnode = makeNode(TriggerTransition);
-
- COPY_STRING_FIELD(name);
- COPY_SCALAR_FIELD(isNew);
- COPY_SCALAR_FIELD(isTable);
-
- return newnode;
-}
-
-static Query *
-_copyQuery(const Query *from)
-{
- Query *newnode = makeNode(Query);
-
- COPY_SCALAR_FIELD(commandType);
- COPY_SCALAR_FIELD(querySource);
- COPY_SCALAR_FIELD(queryId);
- COPY_SCALAR_FIELD(canSetTag);
- COPY_NODE_FIELD(utilityStmt);
- COPY_SCALAR_FIELD(resultRelation);
- COPY_SCALAR_FIELD(hasAggs);
- COPY_SCALAR_FIELD(hasWindowFuncs);
- COPY_SCALAR_FIELD(hasTargetSRFs);
- COPY_SCALAR_FIELD(hasSubLinks);
- COPY_SCALAR_FIELD(hasDistinctOn);
- COPY_SCALAR_FIELD(hasRecursive);
- COPY_SCALAR_FIELD(hasModifyingCTE);
- COPY_SCALAR_FIELD(hasForUpdate);
- COPY_SCALAR_FIELD(hasRowSecurity);
- COPY_SCALAR_FIELD(isReturn);
- COPY_NODE_FIELD(cteList);
- COPY_NODE_FIELD(rtable);
- COPY_NODE_FIELD(jointree);
- COPY_NODE_FIELD(targetList);
- COPY_SCALAR_FIELD(override);
- COPY_NODE_FIELD(onConflict);
- COPY_NODE_FIELD(returningList);
- COPY_NODE_FIELD(groupClause);
- COPY_SCALAR_FIELD(groupDistinct);
- COPY_NODE_FIELD(groupingSets);
- COPY_NODE_FIELD(havingQual);
- COPY_NODE_FIELD(windowClause);
- COPY_NODE_FIELD(distinctClause);
- COPY_NODE_FIELD(sortClause);
- COPY_NODE_FIELD(limitOffset);
- COPY_NODE_FIELD(limitCount);
- COPY_SCALAR_FIELD(limitOption);
- COPY_NODE_FIELD(rowMarks);
- COPY_NODE_FIELD(setOperations);
- COPY_NODE_FIELD(constraintDeps);
- COPY_NODE_FIELD(withCheckOptions);
- COPY_NODE_FIELD(mergeActionList);
- COPY_SCALAR_FIELD(mergeUseOuterJoin);
- COPY_LOCATION_FIELD(stmt_location);
- COPY_SCALAR_FIELD(stmt_len);
-
- return newnode;
-}
-
-static RawStmt *
-_copyRawStmt(const RawStmt *from)
-{
- RawStmt *newnode = makeNode(RawStmt);
-
- COPY_NODE_FIELD(stmt);
- COPY_LOCATION_FIELD(stmt_location);
- COPY_SCALAR_FIELD(stmt_len);
-
- return newnode;
-}
-
-static InsertStmt *
-_copyInsertStmt(const InsertStmt *from)
-{
- InsertStmt *newnode = makeNode(InsertStmt);
-
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(cols);
- COPY_NODE_FIELD(selectStmt);
- COPY_NODE_FIELD(onConflictClause);
- COPY_NODE_FIELD(returningList);
- COPY_NODE_FIELD(withClause);
- COPY_SCALAR_FIELD(override);
-
- return newnode;
-}
-
-static DeleteStmt *
-_copyDeleteStmt(const DeleteStmt *from)
-{
- DeleteStmt *newnode = makeNode(DeleteStmt);
-
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(usingClause);
- COPY_NODE_FIELD(whereClause);
- COPY_NODE_FIELD(returningList);
- COPY_NODE_FIELD(withClause);
-
- return newnode;
-}
-
-static UpdateStmt *
-_copyUpdateStmt(const UpdateStmt *from)
-{
- UpdateStmt *newnode = makeNode(UpdateStmt);
-
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(targetList);
- COPY_NODE_FIELD(whereClause);
- COPY_NODE_FIELD(fromClause);
- COPY_NODE_FIELD(returningList);
- COPY_NODE_FIELD(withClause);
-
- return newnode;
-}
-
-static MergeStmt *
-_copyMergeStmt(const MergeStmt *from)
-{
- MergeStmt *newnode = makeNode(MergeStmt);
-
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(sourceRelation);
- COPY_NODE_FIELD(joinCondition);
- COPY_NODE_FIELD(mergeWhenClauses);
- COPY_NODE_FIELD(withClause);
-
- return newnode;
-}
-
-static SelectStmt *
-_copySelectStmt(const SelectStmt *from)
-{
- SelectStmt *newnode = makeNode(SelectStmt);
-
- COPY_NODE_FIELD(distinctClause);
- COPY_NODE_FIELD(intoClause);
- COPY_NODE_FIELD(targetList);
- COPY_NODE_FIELD(fromClause);
- COPY_NODE_FIELD(whereClause);
- COPY_NODE_FIELD(groupClause);
- COPY_SCALAR_FIELD(groupDistinct);
- COPY_NODE_FIELD(havingClause);
- COPY_NODE_FIELD(windowClause);
- COPY_NODE_FIELD(valuesLists);
- COPY_NODE_FIELD(sortClause);
- COPY_NODE_FIELD(limitOffset);
- COPY_NODE_FIELD(limitCount);
- COPY_SCALAR_FIELD(limitOption);
- COPY_NODE_FIELD(lockingClause);
- COPY_NODE_FIELD(withClause);
- COPY_SCALAR_FIELD(op);
- COPY_SCALAR_FIELD(all);
- COPY_NODE_FIELD(larg);
- COPY_NODE_FIELD(rarg);
-
- return newnode;
-}
-
-static SetOperationStmt *
-_copySetOperationStmt(const SetOperationStmt *from)
-{
- SetOperationStmt *newnode = makeNode(SetOperationStmt);
-
- COPY_SCALAR_FIELD(op);
- COPY_SCALAR_FIELD(all);
- COPY_NODE_FIELD(larg);
- COPY_NODE_FIELD(rarg);
- COPY_NODE_FIELD(colTypes);
- COPY_NODE_FIELD(colTypmods);
- COPY_NODE_FIELD(colCollations);
- COPY_NODE_FIELD(groupClauses);
-
- return newnode;
-}
-
-static ReturnStmt *
-_copyReturnStmt(const ReturnStmt *from)
-{
- ReturnStmt *newnode = makeNode(ReturnStmt);
-
- COPY_NODE_FIELD(returnval);
-
- return newnode;
-}
-
-static PLAssignStmt *
-_copyPLAssignStmt(const PLAssignStmt *from)
-{
- PLAssignStmt *newnode = makeNode(PLAssignStmt);
-
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(indirection);
- COPY_SCALAR_FIELD(nnames);
- COPY_NODE_FIELD(val);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static AlterTableStmt *
-_copyAlterTableStmt(const AlterTableStmt *from)
-{
- AlterTableStmt *newnode = makeNode(AlterTableStmt);
-
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(cmds);
- COPY_SCALAR_FIELD(objtype);
- COPY_SCALAR_FIELD(missing_ok);
-
- return newnode;
-}
-
-static AlterTableCmd *
-_copyAlterTableCmd(const AlterTableCmd *from)
-{
- AlterTableCmd *newnode = makeNode(AlterTableCmd);
-
- COPY_SCALAR_FIELD(subtype);
- COPY_STRING_FIELD(name);
- COPY_SCALAR_FIELD(num);
- COPY_NODE_FIELD(newowner);
- COPY_NODE_FIELD(def);
- COPY_SCALAR_FIELD(behavior);
- COPY_SCALAR_FIELD(missing_ok);
-
- return newnode;
-}
-
-static AlterCollationStmt *
-_copyAlterCollationStmt(const AlterCollationStmt *from)
-{
- AlterCollationStmt *newnode = makeNode(AlterCollationStmt);
-
- COPY_NODE_FIELD(collname);
-
- return newnode;
-}
-
-static AlterDomainStmt *
-_copyAlterDomainStmt(const AlterDomainStmt *from)
-{
- AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
-
- COPY_SCALAR_FIELD(subtype);
- COPY_NODE_FIELD(typeName);
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(def);
- COPY_SCALAR_FIELD(behavior);
- COPY_SCALAR_FIELD(missing_ok);
-
- return newnode;
-}
-
-static GrantStmt *
-_copyGrantStmt(const GrantStmt *from)
-{
- GrantStmt *newnode = makeNode(GrantStmt);
-
- COPY_SCALAR_FIELD(is_grant);
- COPY_SCALAR_FIELD(targtype);
- COPY_SCALAR_FIELD(objtype);
- COPY_NODE_FIELD(objects);
- COPY_NODE_FIELD(privileges);
- COPY_NODE_FIELD(grantees);
- COPY_SCALAR_FIELD(grant_option);
- COPY_NODE_FIELD(grantor);
- COPY_SCALAR_FIELD(behavior);
-
- return newnode;
-}
-
-static ObjectWithArgs *
-_copyObjectWithArgs(const ObjectWithArgs *from)
-{
- ObjectWithArgs *newnode = makeNode(ObjectWithArgs);
-
- COPY_NODE_FIELD(objname);
- COPY_NODE_FIELD(objargs);
- COPY_NODE_FIELD(objfuncargs);
- COPY_SCALAR_FIELD(args_unspecified);
-
- return newnode;
-}
-
-static AccessPriv *
-_copyAccessPriv(const AccessPriv *from)
-{
- AccessPriv *newnode = makeNode(AccessPriv);
-
- COPY_STRING_FIELD(priv_name);
- COPY_NODE_FIELD(cols);
-
- return newnode;
-}
-
-static GrantRoleStmt *
-_copyGrantRoleStmt(const GrantRoleStmt *from)
-{
- GrantRoleStmt *newnode = makeNode(GrantRoleStmt);
-
- COPY_NODE_FIELD(granted_roles);
- COPY_NODE_FIELD(grantee_roles);
- COPY_SCALAR_FIELD(is_grant);
- COPY_SCALAR_FIELD(admin_opt);
- COPY_NODE_FIELD(grantor);
- COPY_SCALAR_FIELD(behavior);
-
- return newnode;
-}
-
-static AlterDefaultPrivilegesStmt *
-_copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from)
-{
- AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt);
-
- COPY_NODE_FIELD(options);
- COPY_NODE_FIELD(action);
-
- return newnode;
-}
-
-static DeclareCursorStmt *
-_copyDeclareCursorStmt(const DeclareCursorStmt *from)
-{
- DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
-
- COPY_STRING_FIELD(portalname);
- COPY_SCALAR_FIELD(options);
- COPY_NODE_FIELD(query);
-
- return newnode;
-}
-
-static ClosePortalStmt *
-_copyClosePortalStmt(const ClosePortalStmt *from)
-{
- ClosePortalStmt *newnode = makeNode(ClosePortalStmt);
-
- COPY_STRING_FIELD(portalname);
-
- return newnode;
-}
-
-static CallStmt *
-_copyCallStmt(const CallStmt *from)
-{
- CallStmt *newnode = makeNode(CallStmt);
-
- COPY_NODE_FIELD(funccall);
- COPY_NODE_FIELD(funcexpr);
- COPY_NODE_FIELD(outargs);
-
- return newnode;
-}
-
-static ClusterStmt *
-_copyClusterStmt(const ClusterStmt *from)
-{
- ClusterStmt *newnode = makeNode(ClusterStmt);
-
- COPY_NODE_FIELD(relation);
- COPY_STRING_FIELD(indexname);
- COPY_NODE_FIELD(params);
-
- return newnode;
-}
-
-static CopyStmt *
-_copyCopyStmt(const CopyStmt *from)
-{
- CopyStmt *newnode = makeNode(CopyStmt);
-
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(query);
- COPY_NODE_FIELD(attlist);
- COPY_SCALAR_FIELD(is_from);
- COPY_SCALAR_FIELD(is_program);
- COPY_STRING_FIELD(filename);
- COPY_NODE_FIELD(options);
- COPY_NODE_FIELD(whereClause);
-
- return newnode;
-}
-
-/*
- * CopyCreateStmtFields
- *
- * This function copies the fields of the CreateStmt node. It is used by
- * copy functions for classes which inherit from CreateStmt.
- */
-static void
-CopyCreateStmtFields(const CreateStmt *from, CreateStmt *newnode)
-{
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(tableElts);
- COPY_NODE_FIELD(inhRelations);
- COPY_NODE_FIELD(partspec);
- COPY_NODE_FIELD(partbound);
- COPY_NODE_FIELD(ofTypename);
- COPY_NODE_FIELD(constraints);
- COPY_NODE_FIELD(options);
- COPY_SCALAR_FIELD(oncommit);
- COPY_STRING_FIELD(tablespacename);
- COPY_STRING_FIELD(accessMethod);
- COPY_SCALAR_FIELD(if_not_exists);
-}
-
-static CreateStmt *
-_copyCreateStmt(const CreateStmt *from)
-{
- CreateStmt *newnode = makeNode(CreateStmt);
-
- CopyCreateStmtFields(from, newnode);
-
- return newnode;
-}
-
-static TableLikeClause *
-_copyTableLikeClause(const TableLikeClause *from)
-{
- TableLikeClause *newnode = makeNode(TableLikeClause);
-
- COPY_NODE_FIELD(relation);
- COPY_SCALAR_FIELD(options);
- COPY_SCALAR_FIELD(relationOid);
-
- return newnode;
-}
-
-static DefineStmt *
-_copyDefineStmt(const DefineStmt *from)
-{
- DefineStmt *newnode = makeNode(DefineStmt);
-
- COPY_SCALAR_FIELD(kind);
- COPY_SCALAR_FIELD(oldstyle);
- COPY_NODE_FIELD(defnames);
- COPY_NODE_FIELD(args);
- COPY_NODE_FIELD(definition);
- COPY_SCALAR_FIELD(if_not_exists);
- COPY_SCALAR_FIELD(replace);
-
- return newnode;
-}
-
-static DropStmt *
-_copyDropStmt(const DropStmt *from)
-{
- DropStmt *newnode = makeNode(DropStmt);
-
- COPY_NODE_FIELD(objects);
- COPY_SCALAR_FIELD(removeType);
- COPY_SCALAR_FIELD(behavior);
- COPY_SCALAR_FIELD(missing_ok);
- COPY_SCALAR_FIELD(concurrent);
-
- return newnode;
-}
-
-static TruncateStmt *
-_copyTruncateStmt(const TruncateStmt *from)
-{
- TruncateStmt *newnode = makeNode(TruncateStmt);
-
- COPY_NODE_FIELD(relations);
- COPY_SCALAR_FIELD(restart_seqs);
- COPY_SCALAR_FIELD(behavior);
-
- return newnode;
-}
-
-static CommentStmt *
-_copyCommentStmt(const CommentStmt *from)
-{
- CommentStmt *newnode = makeNode(CommentStmt);
-
- COPY_SCALAR_FIELD(objtype);
- COPY_NODE_FIELD(object);
- COPY_STRING_FIELD(comment);
-
- return newnode;
-}
-
-static SecLabelStmt *
-_copySecLabelStmt(const SecLabelStmt *from)
-{
- SecLabelStmt *newnode = makeNode(SecLabelStmt);
-
- COPY_SCALAR_FIELD(objtype);
- COPY_NODE_FIELD(object);
- COPY_STRING_FIELD(provider);
- COPY_STRING_FIELD(label);
-
- return newnode;
-}
-
-static FetchStmt *
-_copyFetchStmt(const FetchStmt *from)
-{
- FetchStmt *newnode = makeNode(FetchStmt);
-
- COPY_SCALAR_FIELD(direction);
- COPY_SCALAR_FIELD(howMany);
- COPY_STRING_FIELD(portalname);
- COPY_SCALAR_FIELD(ismove);
-
- return newnode;
-}
-
-static IndexStmt *
-_copyIndexStmt(const IndexStmt *from)
-{
- IndexStmt *newnode = makeNode(IndexStmt);
-
- COPY_STRING_FIELD(idxname);
- COPY_NODE_FIELD(relation);
- COPY_STRING_FIELD(accessMethod);
- COPY_STRING_FIELD(tableSpace);
- COPY_NODE_FIELD(indexParams);
- COPY_NODE_FIELD(indexIncludingParams);
- COPY_NODE_FIELD(options);
- COPY_NODE_FIELD(whereClause);
- COPY_NODE_FIELD(excludeOpNames);
- COPY_STRING_FIELD(idxcomment);
- COPY_SCALAR_FIELD(indexOid);
- COPY_SCALAR_FIELD(oldNumber);
- COPY_SCALAR_FIELD(oldCreateSubid);
- COPY_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
- COPY_SCALAR_FIELD(unique);
- COPY_SCALAR_FIELD(nulls_not_distinct);
- COPY_SCALAR_FIELD(primary);
- COPY_SCALAR_FIELD(isconstraint);
- COPY_SCALAR_FIELD(deferrable);
- COPY_SCALAR_FIELD(initdeferred);
- COPY_SCALAR_FIELD(transformed);
- COPY_SCALAR_FIELD(concurrent);
- COPY_SCALAR_FIELD(if_not_exists);
- COPY_SCALAR_FIELD(reset_default_tblspc);
-
- return newnode;
-}
-
-static CreateStatsStmt *
-_copyCreateStatsStmt(const CreateStatsStmt *from)
-{
- CreateStatsStmt *newnode = makeNode(CreateStatsStmt);
-
- COPY_NODE_FIELD(defnames);
- COPY_NODE_FIELD(stat_types);
- COPY_NODE_FIELD(exprs);
- COPY_NODE_FIELD(relations);
- COPY_STRING_FIELD(stxcomment);
- COPY_SCALAR_FIELD(transformed);
- COPY_SCALAR_FIELD(if_not_exists);
-
- return newnode;
-}
-
-static AlterStatsStmt *
-_copyAlterStatsStmt(const AlterStatsStmt *from)
-{
- AlterStatsStmt *newnode = makeNode(AlterStatsStmt);
-
- COPY_NODE_FIELD(defnames);
- COPY_SCALAR_FIELD(stxstattarget);
- COPY_SCALAR_FIELD(missing_ok);
-
- return newnode;
-}
-
-static CreateFunctionStmt *
-_copyCreateFunctionStmt(const CreateFunctionStmt *from)
-{
- CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt);
-
- COPY_SCALAR_FIELD(is_procedure);
- COPY_SCALAR_FIELD(replace);
- COPY_NODE_FIELD(funcname);
- COPY_NODE_FIELD(parameters);
- COPY_NODE_FIELD(returnType);
- COPY_NODE_FIELD(options);
- COPY_NODE_FIELD(sql_body);
-
- return newnode;
-}
-
-static FunctionParameter *
-_copyFunctionParameter(const FunctionParameter *from)
-{
- FunctionParameter *newnode = makeNode(FunctionParameter);
-
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(argType);
- COPY_SCALAR_FIELD(mode);
- COPY_NODE_FIELD(defexpr);
-
- return newnode;
-}
-
-static AlterFunctionStmt *
-_copyAlterFunctionStmt(const AlterFunctionStmt *from)
-{
- AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt);
-
- COPY_SCALAR_FIELD(objtype);
- COPY_NODE_FIELD(func);
- COPY_NODE_FIELD(actions);
-
- return newnode;
-}
-
-static DoStmt *
-_copyDoStmt(const DoStmt *from)
-{
- DoStmt *newnode = makeNode(DoStmt);
-
- COPY_NODE_FIELD(args);
-
- return newnode;
-}
-
-static RenameStmt *
-_copyRenameStmt(const RenameStmt *from)
-{
- RenameStmt *newnode = makeNode(RenameStmt);
-
- COPY_SCALAR_FIELD(renameType);
- COPY_SCALAR_FIELD(relationType);
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(object);
- COPY_STRING_FIELD(subname);
- COPY_STRING_FIELD(newname);
- COPY_SCALAR_FIELD(behavior);
- COPY_SCALAR_FIELD(missing_ok);
-
- return newnode;
-}
-
-static AlterObjectDependsStmt *
-_copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from)
-{
- AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt);
-
- COPY_SCALAR_FIELD(objectType);
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(object);
- COPY_NODE_FIELD(extname);
- COPY_SCALAR_FIELD(remove);
-
- return newnode;
-}
-
-static AlterObjectSchemaStmt *
-_copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from)
-{
- AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt);
-
- COPY_SCALAR_FIELD(objectType);
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(object);
- COPY_STRING_FIELD(newschema);
- COPY_SCALAR_FIELD(missing_ok);
-
- return newnode;
-}
-
-static AlterOwnerStmt *
-_copyAlterOwnerStmt(const AlterOwnerStmt *from)
-{
- AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt);
-
- COPY_SCALAR_FIELD(objectType);
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(object);
- COPY_NODE_FIELD(newowner);
-
- return newnode;
-}
-
-static AlterOperatorStmt *
-_copyAlterOperatorStmt(const AlterOperatorStmt *from)
-{
- AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
-
- COPY_NODE_FIELD(opername);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static AlterTypeStmt *
-_copyAlterTypeStmt(const AlterTypeStmt *from)
-{
- AlterTypeStmt *newnode = makeNode(AlterTypeStmt);
-
- COPY_NODE_FIELD(typeName);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static RuleStmt *
-_copyRuleStmt(const RuleStmt *from)
-{
- RuleStmt *newnode = makeNode(RuleStmt);
-
- COPY_NODE_FIELD(relation);
- COPY_STRING_FIELD(rulename);
- COPY_NODE_FIELD(whereClause);
- COPY_SCALAR_FIELD(event);
- COPY_SCALAR_FIELD(instead);
- COPY_NODE_FIELD(actions);
- COPY_SCALAR_FIELD(replace);
-
- return newnode;
-}
-
-static NotifyStmt *
-_copyNotifyStmt(const NotifyStmt *from)
-{
- NotifyStmt *newnode = makeNode(NotifyStmt);
-
- COPY_STRING_FIELD(conditionname);
- COPY_STRING_FIELD(payload);
-
- return newnode;
-}
-
-static ListenStmt *
-_copyListenStmt(const ListenStmt *from)
-{
- ListenStmt *newnode = makeNode(ListenStmt);
-
- COPY_STRING_FIELD(conditionname);
-
- return newnode;
-}
-
-static UnlistenStmt *
-_copyUnlistenStmt(const UnlistenStmt *from)
-{
- UnlistenStmt *newnode = makeNode(UnlistenStmt);
-
- COPY_STRING_FIELD(conditionname);
-
- return newnode;
-}
-
-static TransactionStmt *
-_copyTransactionStmt(const TransactionStmt *from)
-{
- TransactionStmt *newnode = makeNode(TransactionStmt);
-
- COPY_SCALAR_FIELD(kind);
- COPY_NODE_FIELD(options);
- COPY_STRING_FIELD(savepoint_name);
- COPY_STRING_FIELD(gid);
- COPY_SCALAR_FIELD(chain);
-
- return newnode;
-}
-
-static CompositeTypeStmt *
-_copyCompositeTypeStmt(const CompositeTypeStmt *from)
-{
- CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt);
-
- COPY_NODE_FIELD(typevar);
- COPY_NODE_FIELD(coldeflist);
-
- return newnode;
-}
-
-static CreateEnumStmt *
-_copyCreateEnumStmt(const CreateEnumStmt *from)
-{
- CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
-
- COPY_NODE_FIELD(typeName);
- COPY_NODE_FIELD(vals);
-
- return newnode;
-}
-
-static CreateRangeStmt *
-_copyCreateRangeStmt(const CreateRangeStmt *from)
-{
- CreateRangeStmt *newnode = makeNode(CreateRangeStmt);
-
- COPY_NODE_FIELD(typeName);
- COPY_NODE_FIELD(params);
-
- return newnode;
-}
-
-static AlterEnumStmt *
-_copyAlterEnumStmt(const AlterEnumStmt *from)
-{
- AlterEnumStmt *newnode = makeNode(AlterEnumStmt);
-
- COPY_NODE_FIELD(typeName);
- COPY_STRING_FIELD(oldVal);
- COPY_STRING_FIELD(newVal);
- COPY_STRING_FIELD(newValNeighbor);
- COPY_SCALAR_FIELD(newValIsAfter);
- COPY_SCALAR_FIELD(skipIfNewValExists);
-
- return newnode;
-}
-
-static ViewStmt *
-_copyViewStmt(const ViewStmt *from)
-{
- ViewStmt *newnode = makeNode(ViewStmt);
-
- COPY_NODE_FIELD(view);
- COPY_NODE_FIELD(aliases);
- COPY_NODE_FIELD(query);
- COPY_SCALAR_FIELD(replace);
- COPY_NODE_FIELD(options);
- COPY_SCALAR_FIELD(withCheckOption);
-
- return newnode;
-}
-
-static LoadStmt *
-_copyLoadStmt(const LoadStmt *from)
-{
- LoadStmt *newnode = makeNode(LoadStmt);
-
- COPY_STRING_FIELD(filename);
-
- return newnode;
-}
-
-static CreateDomainStmt *
-_copyCreateDomainStmt(const CreateDomainStmt *from)
-{
- CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
-
- COPY_NODE_FIELD(domainname);
- COPY_NODE_FIELD(typeName);
- COPY_NODE_FIELD(collClause);
- COPY_NODE_FIELD(constraints);
-
- return newnode;
-}
-
-static CreateOpClassStmt *
-_copyCreateOpClassStmt(const CreateOpClassStmt *from)
-{
- CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
-
- COPY_NODE_FIELD(opclassname);
- COPY_NODE_FIELD(opfamilyname);
- COPY_STRING_FIELD(amname);
- COPY_NODE_FIELD(datatype);
- COPY_NODE_FIELD(items);
- COPY_SCALAR_FIELD(isDefault);
-
- return newnode;
-}
-
-static CreateOpClassItem *
-_copyCreateOpClassItem(const CreateOpClassItem *from)
-{
- CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
-
- COPY_SCALAR_FIELD(itemtype);
- COPY_NODE_FIELD(name);
- COPY_SCALAR_FIELD(number);
- COPY_NODE_FIELD(order_family);
- COPY_NODE_FIELD(class_args);
- COPY_NODE_FIELD(storedtype);
-
- return newnode;
-}
-
-static CreateOpFamilyStmt *
-_copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from)
-{
- CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
-
- COPY_NODE_FIELD(opfamilyname);
- COPY_STRING_FIELD(amname);
-
- return newnode;
-}
-
-static AlterOpFamilyStmt *
-_copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from)
-{
- AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
-
- COPY_NODE_FIELD(opfamilyname);
- COPY_STRING_FIELD(amname);
- COPY_SCALAR_FIELD(isDrop);
- COPY_NODE_FIELD(items);
-
- return newnode;
-}
-
-static CreatedbStmt *
-_copyCreatedbStmt(const CreatedbStmt *from)
-{
- CreatedbStmt *newnode = makeNode(CreatedbStmt);
-
- COPY_STRING_FIELD(dbname);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static AlterDatabaseStmt *
-_copyAlterDatabaseStmt(const AlterDatabaseStmt *from)
-{
- AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt);
-
- COPY_STRING_FIELD(dbname);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static AlterDatabaseRefreshCollStmt *
-_copyAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *from)
-{
- AlterDatabaseRefreshCollStmt *newnode = makeNode(AlterDatabaseRefreshCollStmt);
-
- COPY_STRING_FIELD(dbname);
-
- return newnode;
-}
-
-static AlterDatabaseSetStmt *
-_copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from)
-{
- AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
-
- COPY_STRING_FIELD(dbname);
- COPY_NODE_FIELD(setstmt);
-
- return newnode;
-}
-
-static DropdbStmt *
-_copyDropdbStmt(const DropdbStmt *from)
-{
- DropdbStmt *newnode = makeNode(DropdbStmt);
-
- COPY_STRING_FIELD(dbname);
- COPY_SCALAR_FIELD(missing_ok);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static VacuumStmt *
-_copyVacuumStmt(const VacuumStmt *from)
-{
- VacuumStmt *newnode = makeNode(VacuumStmt);
-
- COPY_NODE_FIELD(options);
- COPY_NODE_FIELD(rels);
- COPY_SCALAR_FIELD(is_vacuumcmd);
-
- return newnode;
-}
-
-static VacuumRelation *
-_copyVacuumRelation(const VacuumRelation *from)
-{
- VacuumRelation *newnode = makeNode(VacuumRelation);
-
- COPY_NODE_FIELD(relation);
- COPY_SCALAR_FIELD(oid);
- COPY_NODE_FIELD(va_cols);
-
- return newnode;
-}
-
-static ExplainStmt *
-_copyExplainStmt(const ExplainStmt *from)
-{
- ExplainStmt *newnode = makeNode(ExplainStmt);
-
- COPY_NODE_FIELD(query);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static CreateTableAsStmt *
-_copyCreateTableAsStmt(const CreateTableAsStmt *from)
-{
- CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt);
-
- COPY_NODE_FIELD(query);
- COPY_NODE_FIELD(into);
- COPY_SCALAR_FIELD(objtype);
- COPY_SCALAR_FIELD(is_select_into);
- COPY_SCALAR_FIELD(if_not_exists);
-
- return newnode;
-}
-
-static RefreshMatViewStmt *
-_copyRefreshMatViewStmt(const RefreshMatViewStmt *from)
-{
- RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt);
-
- COPY_SCALAR_FIELD(concurrent);
- COPY_SCALAR_FIELD(skipData);
- COPY_NODE_FIELD(relation);
-
- return newnode;
-}
-
-static ReplicaIdentityStmt *
-_copyReplicaIdentityStmt(const ReplicaIdentityStmt *from)
-{
- ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt);
-
- COPY_SCALAR_FIELD(identity_type);
- COPY_STRING_FIELD(name);
-
- return newnode;
-}
-
-static AlterSystemStmt *
-_copyAlterSystemStmt(const AlterSystemStmt *from)
-{
- AlterSystemStmt *newnode = makeNode(AlterSystemStmt);
-
- COPY_NODE_FIELD(setstmt);
-
- return newnode;
-}
-
-static CreateSeqStmt *
-_copyCreateSeqStmt(const CreateSeqStmt *from)
-{
- CreateSeqStmt *newnode = makeNode(CreateSeqStmt);
-
- COPY_NODE_FIELD(sequence);
- COPY_NODE_FIELD(options);
- COPY_SCALAR_FIELD(ownerId);
- COPY_SCALAR_FIELD(for_identity);
- COPY_SCALAR_FIELD(if_not_exists);
-
- return newnode;
-}
-
-static AlterSeqStmt *
-_copyAlterSeqStmt(const AlterSeqStmt *from)
-{
- AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
-
- COPY_NODE_FIELD(sequence);
- COPY_NODE_FIELD(options);
- COPY_SCALAR_FIELD(for_identity);
- COPY_SCALAR_FIELD(missing_ok);
-
- return newnode;
-}
-
-static VariableSetStmt *
-_copyVariableSetStmt(const VariableSetStmt *from)
-{
- VariableSetStmt *newnode = makeNode(VariableSetStmt);
-
- COPY_SCALAR_FIELD(kind);
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(args);
- COPY_SCALAR_FIELD(is_local);
-
- return newnode;
-}
-
-static VariableShowStmt *
-_copyVariableShowStmt(const VariableShowStmt *from)
-{
- VariableShowStmt *newnode = makeNode(VariableShowStmt);
-
- COPY_STRING_FIELD(name);
-
- return newnode;
-}
-
-static DiscardStmt *
-_copyDiscardStmt(const DiscardStmt *from)
-{
- DiscardStmt *newnode = makeNode(DiscardStmt);
-
- COPY_SCALAR_FIELD(target);
-
- return newnode;
-}
-
-static CreateTableSpaceStmt *
-_copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from)
-{
- CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
-
- COPY_STRING_FIELD(tablespacename);
- COPY_NODE_FIELD(owner);
- COPY_STRING_FIELD(location);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static DropTableSpaceStmt *
-_copyDropTableSpaceStmt(const DropTableSpaceStmt *from)
-{
- DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
-
- COPY_STRING_FIELD(tablespacename);
- COPY_SCALAR_FIELD(missing_ok);
-
- return newnode;
-}
-
-static AlterTableSpaceOptionsStmt *
-_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
-{
- AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
-
- COPY_STRING_FIELD(tablespacename);
- COPY_NODE_FIELD(options);
- COPY_SCALAR_FIELD(isReset);
-
- return newnode;
-}
-
-static AlterTableMoveAllStmt *
-_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from)
-{
- AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt);
-
- COPY_STRING_FIELD(orig_tablespacename);
- COPY_SCALAR_FIELD(objtype);
- COPY_NODE_FIELD(roles);
- COPY_STRING_FIELD(new_tablespacename);
- COPY_SCALAR_FIELD(nowait);
-
- return newnode;
-}
-
-static CreateExtensionStmt *
-_copyCreateExtensionStmt(const CreateExtensionStmt *from)
-{
- CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt);
-
- COPY_STRING_FIELD(extname);
- COPY_SCALAR_FIELD(if_not_exists);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static AlterExtensionStmt *
-_copyAlterExtensionStmt(const AlterExtensionStmt *from)
-{
- AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt);
-
- COPY_STRING_FIELD(extname);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static AlterExtensionContentsStmt *
-_copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from)
-{
- AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt);
-
- COPY_STRING_FIELD(extname);
- COPY_SCALAR_FIELD(action);
- COPY_SCALAR_FIELD(objtype);
- COPY_NODE_FIELD(object);
-
- return newnode;
-}
-
-static CreateFdwStmt *
-_copyCreateFdwStmt(const CreateFdwStmt *from)
-{
- CreateFdwStmt *newnode = makeNode(CreateFdwStmt);
-
- COPY_STRING_FIELD(fdwname);
- COPY_NODE_FIELD(func_options);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static AlterFdwStmt *
-_copyAlterFdwStmt(const AlterFdwStmt *from)
-{
- AlterFdwStmt *newnode = makeNode(AlterFdwStmt);
-
- COPY_STRING_FIELD(fdwname);
- COPY_NODE_FIELD(func_options);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static CreateForeignServerStmt *
-_copyCreateForeignServerStmt(const CreateForeignServerStmt *from)
-{
- CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt);
-
- COPY_STRING_FIELD(servername);
- COPY_STRING_FIELD(servertype);
- COPY_STRING_FIELD(version);
- COPY_STRING_FIELD(fdwname);
- COPY_SCALAR_FIELD(if_not_exists);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static AlterForeignServerStmt *
-_copyAlterForeignServerStmt(const AlterForeignServerStmt *from)
-{
- AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt);
-
- COPY_STRING_FIELD(servername);
- COPY_STRING_FIELD(version);
- COPY_NODE_FIELD(options);
- COPY_SCALAR_FIELD(has_version);
-
- return newnode;
-}
-
-static CreateUserMappingStmt *
-_copyCreateUserMappingStmt(const CreateUserMappingStmt *from)
-{
- CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt);
-
- COPY_NODE_FIELD(user);
- COPY_STRING_FIELD(servername);
- COPY_SCALAR_FIELD(if_not_exists);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static AlterUserMappingStmt *
-_copyAlterUserMappingStmt(const AlterUserMappingStmt *from)
-{
- AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt);
-
- COPY_NODE_FIELD(user);
- COPY_STRING_FIELD(servername);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static DropUserMappingStmt *
-_copyDropUserMappingStmt(const DropUserMappingStmt *from)
-{
- DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt);
-
- COPY_NODE_FIELD(user);
- COPY_STRING_FIELD(servername);
- COPY_SCALAR_FIELD(missing_ok);
-
- return newnode;
-}
-
-static CreateForeignTableStmt *
-_copyCreateForeignTableStmt(const CreateForeignTableStmt *from)
-{
- CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt);
-
- CopyCreateStmtFields((const CreateStmt *) from, (CreateStmt *) newnode);
-
- COPY_STRING_FIELD(servername);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static ImportForeignSchemaStmt *
-_copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
-{
- ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt);
-
- COPY_STRING_FIELD(server_name);
- COPY_STRING_FIELD(remote_schema);
- COPY_STRING_FIELD(local_schema);
- COPY_SCALAR_FIELD(list_type);
- COPY_NODE_FIELD(table_list);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static CreateTransformStmt *
-_copyCreateTransformStmt(const CreateTransformStmt *from)
-{
- CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
-
- COPY_SCALAR_FIELD(replace);
- COPY_NODE_FIELD(type_name);
- COPY_STRING_FIELD(lang);
- COPY_NODE_FIELD(fromsql);
- COPY_NODE_FIELD(tosql);
-
- return newnode;
-}
-
-static CreateAmStmt *
-_copyCreateAmStmt(const CreateAmStmt *from)
-{
- CreateAmStmt *newnode = makeNode(CreateAmStmt);
-
- COPY_STRING_FIELD(amname);
- COPY_NODE_FIELD(handler_name);
- COPY_SCALAR_FIELD(amtype);
-
- return newnode;
-}
-
-static CreateTrigStmt *
-_copyCreateTrigStmt(const CreateTrigStmt *from)
-{
- CreateTrigStmt *newnode = makeNode(CreateTrigStmt);
-
- COPY_SCALAR_FIELD(replace);
- COPY_SCALAR_FIELD(isconstraint);
- COPY_STRING_FIELD(trigname);
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(funcname);
- COPY_NODE_FIELD(args);
- COPY_SCALAR_FIELD(row);
- COPY_SCALAR_FIELD(timing);
- COPY_SCALAR_FIELD(events);
- COPY_NODE_FIELD(columns);
- COPY_NODE_FIELD(whenClause);
- COPY_NODE_FIELD(transitionRels);
- COPY_SCALAR_FIELD(deferrable);
- COPY_SCALAR_FIELD(initdeferred);
- COPY_NODE_FIELD(constrrel);
-
- return newnode;
-}
-
-static CreateEventTrigStmt *
-_copyCreateEventTrigStmt(const CreateEventTrigStmt *from)
-{
- CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt);
-
- COPY_STRING_FIELD(trigname);
- COPY_STRING_FIELD(eventname);
- COPY_NODE_FIELD(whenclause);
- COPY_NODE_FIELD(funcname);
-
- return newnode;
-}
-
-static AlterEventTrigStmt *
-_copyAlterEventTrigStmt(const AlterEventTrigStmt *from)
-{
- AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt);
-
- COPY_STRING_FIELD(trigname);
- COPY_SCALAR_FIELD(tgenabled);
-
- return newnode;
-}
-
-static CreatePLangStmt *
-_copyCreatePLangStmt(const CreatePLangStmt *from)
-{
- CreatePLangStmt *newnode = makeNode(CreatePLangStmt);
-
- COPY_SCALAR_FIELD(replace);
- COPY_STRING_FIELD(plname);
- COPY_NODE_FIELD(plhandler);
- COPY_NODE_FIELD(plinline);
- COPY_NODE_FIELD(plvalidator);
- COPY_SCALAR_FIELD(pltrusted);
-
- return newnode;
-}
-
-static CreateRoleStmt *
-_copyCreateRoleStmt(const CreateRoleStmt *from)
-{
- CreateRoleStmt *newnode = makeNode(CreateRoleStmt);
-
- COPY_SCALAR_FIELD(stmt_type);
- COPY_STRING_FIELD(role);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static AlterRoleStmt *
-_copyAlterRoleStmt(const AlterRoleStmt *from)
-{
- AlterRoleStmt *newnode = makeNode(AlterRoleStmt);
-
- COPY_NODE_FIELD(role);
- COPY_NODE_FIELD(options);
- COPY_SCALAR_FIELD(action);
-
- return newnode;
-}
-
-static AlterRoleSetStmt *
-_copyAlterRoleSetStmt(const AlterRoleSetStmt *from)
-{
- AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
-
- COPY_NODE_FIELD(role);
- COPY_STRING_FIELD(database);
- COPY_NODE_FIELD(setstmt);
-
- return newnode;
-}
-
-static DropRoleStmt *
-_copyDropRoleStmt(const DropRoleStmt *from)
-{
- DropRoleStmt *newnode = makeNode(DropRoleStmt);
-
- COPY_NODE_FIELD(roles);
- COPY_SCALAR_FIELD(missing_ok);
-
- return newnode;
-}
-
-static LockStmt *
-_copyLockStmt(const LockStmt *from)
-{
- LockStmt *newnode = makeNode(LockStmt);
-
- COPY_NODE_FIELD(relations);
- COPY_SCALAR_FIELD(mode);
- COPY_SCALAR_FIELD(nowait);
-
- return newnode;
-}
-
-static ConstraintsSetStmt *
-_copyConstraintsSetStmt(const ConstraintsSetStmt *from)
-{
- ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt);
-
- COPY_NODE_FIELD(constraints);
- COPY_SCALAR_FIELD(deferred);
-
- return newnode;
-}
-
-static ReindexStmt *
-_copyReindexStmt(const ReindexStmt *from)
-{
- ReindexStmt *newnode = makeNode(ReindexStmt);
-
- COPY_SCALAR_FIELD(kind);
- COPY_NODE_FIELD(relation);
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(params);
-
- return newnode;
-}
-
-static CreateSchemaStmt *
-_copyCreateSchemaStmt(const CreateSchemaStmt *from)
-{
- CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt);
-
- COPY_STRING_FIELD(schemaname);
- COPY_NODE_FIELD(authrole);
- COPY_NODE_FIELD(schemaElts);
- COPY_SCALAR_FIELD(if_not_exists);
-
- return newnode;
-}
-
-static CreateConversionStmt *
-_copyCreateConversionStmt(const CreateConversionStmt *from)
-{
- CreateConversionStmt *newnode = makeNode(CreateConversionStmt);
-
- COPY_NODE_FIELD(conversion_name);
- COPY_STRING_FIELD(for_encoding_name);
- COPY_STRING_FIELD(to_encoding_name);
- COPY_NODE_FIELD(func_name);
- COPY_SCALAR_FIELD(def);
-
- return newnode;
-}
-
-static CreateCastStmt *
-_copyCreateCastStmt(const CreateCastStmt *from)
-{
- CreateCastStmt *newnode = makeNode(CreateCastStmt);
-
- COPY_NODE_FIELD(sourcetype);
- COPY_NODE_FIELD(targettype);
- COPY_NODE_FIELD(func);
- COPY_SCALAR_FIELD(context);
- COPY_SCALAR_FIELD(inout);
-
- return newnode;
-}
-
-static PrepareStmt *
-_copyPrepareStmt(const PrepareStmt *from)
-{
- PrepareStmt *newnode = makeNode(PrepareStmt);
-
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(argtypes);
- COPY_NODE_FIELD(query);
-
- return newnode;
-}
-
-static ExecuteStmt *
-_copyExecuteStmt(const ExecuteStmt *from)
-{
- ExecuteStmt *newnode = makeNode(ExecuteStmt);
-
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(params);
-
- return newnode;
-}
-
-static DeallocateStmt *
-_copyDeallocateStmt(const DeallocateStmt *from)
-{
- DeallocateStmt *newnode = makeNode(DeallocateStmt);
-
- COPY_STRING_FIELD(name);
-
- return newnode;
-}
-
-static DropOwnedStmt *
-_copyDropOwnedStmt(const DropOwnedStmt *from)
-{
- DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
-
- COPY_NODE_FIELD(roles);
- COPY_SCALAR_FIELD(behavior);
-
- return newnode;
-}
-
-static ReassignOwnedStmt *
-_copyReassignOwnedStmt(const ReassignOwnedStmt *from)
-{
- ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
-
- COPY_NODE_FIELD(roles);
- COPY_NODE_FIELD(newrole);
-
- return newnode;
-}
-
-static AlterTSDictionaryStmt *
-_copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from)
-{
- AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt);
-
- COPY_NODE_FIELD(dictname);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static AlterTSConfigurationStmt *
-_copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from)
-{
- AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt);
-
- COPY_SCALAR_FIELD(kind);
- COPY_NODE_FIELD(cfgname);
- COPY_NODE_FIELD(tokentype);
- COPY_NODE_FIELD(dicts);
- COPY_SCALAR_FIELD(override);
- COPY_SCALAR_FIELD(replace);
- COPY_SCALAR_FIELD(missing_ok);
-
- return newnode;
-}
-
-static CreatePolicyStmt *
-_copyCreatePolicyStmt(const CreatePolicyStmt *from)
-{
- CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt);
-
- COPY_STRING_FIELD(policy_name);
- COPY_NODE_FIELD(table);
- COPY_STRING_FIELD(cmd_name);
- COPY_SCALAR_FIELD(permissive);
- COPY_NODE_FIELD(roles);
- COPY_NODE_FIELD(qual);
- COPY_NODE_FIELD(with_check);
-
- return newnode;
-}
-
-static AlterPolicyStmt *
-_copyAlterPolicyStmt(const AlterPolicyStmt *from)
-{
- AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt);
-
- COPY_STRING_FIELD(policy_name);
- COPY_NODE_FIELD(table);
- COPY_NODE_FIELD(roles);
- COPY_NODE_FIELD(qual);
- COPY_NODE_FIELD(with_check);
-
- return newnode;
-}
-
-static PartitionElem *
-_copyPartitionElem(const PartitionElem *from)
-{
- PartitionElem *newnode = makeNode(PartitionElem);
-
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(expr);
- COPY_NODE_FIELD(collation);
- COPY_NODE_FIELD(opclass);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static PartitionSpec *
-_copyPartitionSpec(const PartitionSpec *from)
-{
- PartitionSpec *newnode = makeNode(PartitionSpec);
-
- COPY_STRING_FIELD(strategy);
- COPY_NODE_FIELD(partParams);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static PartitionBoundSpec *
-_copyPartitionBoundSpec(const PartitionBoundSpec *from)
-{
- PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec);
-
- COPY_SCALAR_FIELD(strategy);
- COPY_SCALAR_FIELD(is_default);
- COPY_SCALAR_FIELD(modulus);
- COPY_SCALAR_FIELD(remainder);
- COPY_NODE_FIELD(listdatums);
- COPY_NODE_FIELD(lowerdatums);
- COPY_NODE_FIELD(upperdatums);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static PartitionRangeDatum *
-_copyPartitionRangeDatum(const PartitionRangeDatum *from)
-{
- PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum);
-
- COPY_SCALAR_FIELD(kind);
- COPY_NODE_FIELD(value);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static PartitionCmd *
-_copyPartitionCmd(const PartitionCmd *from)
-{
- PartitionCmd *newnode = makeNode(PartitionCmd);
-
- COPY_NODE_FIELD(name);
- COPY_NODE_FIELD(bound);
- COPY_SCALAR_FIELD(concurrent);
-
- return newnode;
-}
-
-static PublicationObjSpec *
-_copyPublicationObject(const PublicationObjSpec *from)
-{
- PublicationObjSpec *newnode = makeNode(PublicationObjSpec);
-
- COPY_SCALAR_FIELD(pubobjtype);
- COPY_STRING_FIELD(name);
- COPY_NODE_FIELD(pubtable);
- COPY_LOCATION_FIELD(location);
-
- return newnode;
-}
-
-static PublicationTable *
-_copyPublicationTable(const PublicationTable *from)
-{
- PublicationTable *newnode = makeNode(PublicationTable);
-
- COPY_NODE_FIELD(relation);
- COPY_NODE_FIELD(whereClause);
- COPY_NODE_FIELD(columns);
-
- return newnode;
-}
-
-static CreatePublicationStmt *
-_copyCreatePublicationStmt(const CreatePublicationStmt *from)
-{
- CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt);
-
- COPY_STRING_FIELD(pubname);
- COPY_NODE_FIELD(options);
- COPY_NODE_FIELD(pubobjects);
- COPY_SCALAR_FIELD(for_all_tables);
-
- return newnode;
-}
-
-static AlterPublicationStmt *
-_copyAlterPublicationStmt(const AlterPublicationStmt *from)
-{
- AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt);
-
- COPY_STRING_FIELD(pubname);
- COPY_NODE_FIELD(options);
- COPY_NODE_FIELD(pubobjects);
- COPY_SCALAR_FIELD(for_all_tables);
- COPY_SCALAR_FIELD(action);
-
- return newnode;
-}
-
-static CreateSubscriptionStmt *
-_copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from)
-{
- CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt);
-
- COPY_STRING_FIELD(subname);
- COPY_STRING_FIELD(conninfo);
- COPY_NODE_FIELD(publication);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static AlterSubscriptionStmt *
-_copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from)
-{
- AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt);
-
- COPY_SCALAR_FIELD(kind);
- COPY_STRING_FIELD(subname);
- COPY_STRING_FIELD(conninfo);
- COPY_NODE_FIELD(publication);
- COPY_NODE_FIELD(options);
-
- return newnode;
-}
-
-static DropSubscriptionStmt *
-_copyDropSubscriptionStmt(const DropSubscriptionStmt *from)
-{
- DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt);
-
- COPY_STRING_FIELD(subname);
- COPY_SCALAR_FIELD(missing_ok);
- COPY_SCALAR_FIELD(behavior);
-
- return newnode;
-}
-#endif /* OBSOLETE */
-
-/* ****************************************************************
- * extensible.h copy functions
- * ****************************************************************
- */
static ExtensibleNode *
_copyExtensibleNode(const ExtensibleNode *from)
{
@@ -5445,78 +160,6 @@ _copyExtensibleNode(const ExtensibleNode *from)
return newnode;
}
-#ifdef OBSOLETE
-/* ****************************************************************
- * value.h copy functions
- * ****************************************************************
- */
-static Integer *
-_copyInteger(const Integer *from)
-{
- Integer *newnode = makeNode(Integer);
-
- COPY_SCALAR_FIELD(ival);
-
- return newnode;
-}
-
-static Float *
-_copyFloat(const Float *from)
-{
- Float *newnode = makeNode(Float);
-
- COPY_STRING_FIELD(fval);
-
- return newnode;
-}
-
-static Boolean *
-_copyBoolean(const Boolean *from)
-{
- Boolean *newnode = makeNode(Boolean);
-
- COPY_SCALAR_FIELD(boolval);
-
- return newnode;
-}
-
-static String *
-_copyString(const String *from)
-{
- String *newnode = makeNode(String);
-
- COPY_STRING_FIELD(sval);
-
- return newnode;
-}
-
-static BitString *
-_copyBitString(const BitString *from)
-{
- BitString *newnode = makeNode(BitString);
-
- COPY_STRING_FIELD(bsval);
-
- return newnode;
-}
-
-
-static ForeignKeyCacheInfo *
-_copyForeignKeyCacheInfo(const ForeignKeyCacheInfo *from)
-{
- ForeignKeyCacheInfo *newnode = makeNode(ForeignKeyCacheInfo);
-
- COPY_SCALAR_FIELD(conoid);
- COPY_SCALAR_FIELD(conrelid);
- COPY_SCALAR_FIELD(confrelid);
- COPY_SCALAR_FIELD(nkeys);
- COPY_ARRAY_FIELD(conkey);
- COPY_ARRAY_FIELD(confkey);
- COPY_ARRAY_FIELD(conpfeqop);
-
- return newnode;
-}
-#endif /* OBSOLETE */
/*
* copyObjectImpl -- implementation of copyObject(); see nodes/nodes.h
@@ -5538,450 +181,7 @@ copyObjectImpl(const void *from)
switch (nodeTag(from))
{
#include "copyfuncs.switch.c"
-#ifdef OBSOLETE
- /*
- * PLAN NODES
- */
- case T_PlannedStmt:
- retval = _copyPlannedStmt(from);
- break;
- case T_Result:
- retval = _copyResult(from);
- break;
- case T_ProjectSet:
- retval = _copyProjectSet(from);
- break;
- case T_ModifyTable:
- retval = _copyModifyTable(from);
- break;
- case T_Append:
- retval = _copyAppend(from);
- break;
- case T_MergeAppend:
- retval = _copyMergeAppend(from);
- break;
- case T_RecursiveUnion:
- retval = _copyRecursiveUnion(from);
- break;
- case T_BitmapAnd:
- retval = _copyBitmapAnd(from);
- break;
- case T_BitmapOr:
- retval = _copyBitmapOr(from);
- break;
- case T_Scan:
- retval = _copyScan(from);
- break;
- case T_Gather:
- retval = _copyGather(from);
- break;
- case T_GatherMerge:
- retval = _copyGatherMerge(from);
- break;
- case T_SeqScan:
- retval = _copySeqScan(from);
- break;
- case T_SampleScan:
- retval = _copySampleScan(from);
- break;
- case T_IndexScan:
- retval = _copyIndexScan(from);
- break;
- case T_IndexOnlyScan:
- retval = _copyIndexOnlyScan(from);
- break;
- case T_BitmapIndexScan:
- retval = _copyBitmapIndexScan(from);
- break;
- case T_BitmapHeapScan:
- retval = _copyBitmapHeapScan(from);
- break;
- case T_TidScan:
- retval = _copyTidScan(from);
- break;
- case T_TidRangeScan:
- retval = _copyTidRangeScan(from);
- break;
- case T_SubqueryScan:
- retval = _copySubqueryScan(from);
- break;
- case T_FunctionScan:
- retval = _copyFunctionScan(from);
- break;
- case T_TableFuncScan:
- retval = _copyTableFuncScan(from);
- break;
- case T_ValuesScan:
- retval = _copyValuesScan(from);
- break;
- case T_CteScan:
- retval = _copyCteScan(from);
- break;
- case T_NamedTuplestoreScan:
- retval = _copyNamedTuplestoreScan(from);
- break;
- case T_WorkTableScan:
- retval = _copyWorkTableScan(from);
- break;
- case T_ForeignScan:
- retval = _copyForeignScan(from);
- break;
- case T_CustomScan:
- retval = _copyCustomScan(from);
- break;
- case T_NestLoop:
- retval = _copyNestLoop(from);
- break;
- case T_MergeJoin:
- retval = _copyMergeJoin(from);
- break;
- case T_HashJoin:
- retval = _copyHashJoin(from);
- break;
- case T_Material:
- retval = _copyMaterial(from);
- break;
- case T_Memoize:
- retval = _copyMemoize(from);
- break;
- case T_Sort:
- retval = _copySort(from);
- break;
- case T_IncrementalSort:
- retval = _copyIncrementalSort(from);
- break;
- case T_Group:
- retval = _copyGroup(from);
- break;
- case T_Agg:
- retval = _copyAgg(from);
- break;
- case T_WindowAgg:
- retval = _copyWindowAgg(from);
- break;
- case T_Unique:
- retval = _copyUnique(from);
- break;
- case T_Hash:
- retval = _copyHash(from);
- break;
- case T_SetOp:
- retval = _copySetOp(from);
- break;
- case T_LockRows:
- retval = _copyLockRows(from);
- break;
- case T_Limit:
- retval = _copyLimit(from);
- break;
- case T_NestLoopParam:
- retval = _copyNestLoopParam(from);
- break;
- case T_PlanRowMark:
- retval = _copyPlanRowMark(from);
- break;
- case T_PartitionPruneInfo:
- retval = _copyPartitionPruneInfo(from);
- break;
- case T_PartitionedRelPruneInfo:
- retval = _copyPartitionedRelPruneInfo(from);
- break;
- case T_PartitionPruneStepOp:
- retval = _copyPartitionPruneStepOp(from);
- break;
- case T_PartitionPruneStepCombine:
- retval = _copyPartitionPruneStepCombine(from);
- break;
- case T_PlanInvalItem:
- retval = _copyPlanInvalItem(from);
- break;
-
- /*
- * PRIMITIVE NODES
- */
- case T_Alias:
- retval = _copyAlias(from);
- break;
- case T_RangeVar:
- retval = _copyRangeVar(from);
- break;
- case T_TableFunc:
- retval = _copyTableFunc(from);
- break;
- case T_IntoClause:
- retval = _copyIntoClause(from);
- break;
- case T_Var:
- retval = _copyVar(from);
- break;
- case T_Const:
- retval = _copyConst(from);
- break;
- case T_Param:
- retval = _copyParam(from);
- break;
- case T_Aggref:
- retval = _copyAggref(from);
- break;
- case T_GroupingFunc:
- retval = _copyGroupingFunc(from);
- break;
- case T_WindowFunc:
- retval = _copyWindowFunc(from);
- break;
- case T_SubscriptingRef:
- retval = _copySubscriptingRef(from);
- break;
- case T_FuncExpr:
- retval = _copyFuncExpr(from);
- break;
- case T_NamedArgExpr:
- retval = _copyNamedArgExpr(from);
- break;
- case T_OpExpr:
- retval = _copyOpExpr(from);
- break;
- case T_DistinctExpr:
- retval = _copyDistinctExpr(from);
- break;
- case T_NullIfExpr:
- retval = _copyNullIfExpr(from);
- break;
- case T_ScalarArrayOpExpr:
- retval = _copyScalarArrayOpExpr(from);
- break;
- case T_BoolExpr:
- retval = _copyBoolExpr(from);
- break;
- case T_SubLink:
- retval = _copySubLink(from);
- break;
- case T_SubPlan:
- retval = _copySubPlan(from);
- break;
- case T_AlternativeSubPlan:
- retval = _copyAlternativeSubPlan(from);
- break;
- case T_FieldSelect:
- retval = _copyFieldSelect(from);
- break;
- case T_FieldStore:
- retval = _copyFieldStore(from);
- break;
- case T_RelabelType:
- retval = _copyRelabelType(from);
- break;
- case T_CoerceViaIO:
- retval = _copyCoerceViaIO(from);
- break;
- case T_ArrayCoerceExpr:
- retval = _copyArrayCoerceExpr(from);
- break;
- case T_ConvertRowtypeExpr:
- retval = _copyConvertRowtypeExpr(from);
- break;
- case T_CollateExpr:
- retval = _copyCollateExpr(from);
- break;
- case T_CaseExpr:
- retval = _copyCaseExpr(from);
- break;
- case T_CaseWhen:
- retval = _copyCaseWhen(from);
- break;
- case T_CaseTestExpr:
- retval = _copyCaseTestExpr(from);
- break;
- case T_ArrayExpr:
- retval = _copyArrayExpr(from);
- break;
- case T_RowExpr:
- retval = _copyRowExpr(from);
- break;
- case T_RowCompareExpr:
- retval = _copyRowCompareExpr(from);
- break;
- case T_CoalesceExpr:
- retval = _copyCoalesceExpr(from);
- break;
- case T_MinMaxExpr:
- retval = _copyMinMaxExpr(from);
- break;
- case T_SQLValueFunction:
- retval = _copySQLValueFunction(from);
- break;
- case T_XmlExpr:
- retval = _copyXmlExpr(from);
- break;
- case T_NullTest:
- retval = _copyNullTest(from);
- break;
- case T_BooleanTest:
- retval = _copyBooleanTest(from);
- break;
- case T_CoerceToDomain:
- retval = _copyCoerceToDomain(from);
- break;
- case T_CoerceToDomainValue:
- retval = _copyCoerceToDomainValue(from);
- break;
- case T_SetToDefault:
- retval = _copySetToDefault(from);
- break;
- case T_CurrentOfExpr:
- retval = _copyCurrentOfExpr(from);
- break;
- case T_NextValueExpr:
- retval = _copyNextValueExpr(from);
- break;
- case T_InferenceElem:
- retval = _copyInferenceElem(from);
- break;
- case T_TargetEntry:
- retval = _copyTargetEntry(from);
- break;
- case T_RangeTblRef:
- retval = _copyRangeTblRef(from);
- break;
- case T_JoinExpr:
- retval = _copyJoinExpr(from);
- break;
- case T_FromExpr:
- retval = _copyFromExpr(from);
- break;
- case T_OnConflictExpr:
- retval = _copyOnConflictExpr(from);
- break;
- case T_JsonFormat:
- retval = _copyJsonFormat(from);
- break;
- case T_JsonReturning:
- retval = _copyJsonReturning(from);
- break;
- case T_JsonValueExpr:
- retval = _copyJsonValueExpr(from);
- break;
- case T_JsonParseExpr:
- retval = _copyJsonParseExpr(from);
- break;
- case T_JsonScalarExpr:
- retval = _copyJsonScalarExpr(from);
- break;
- case T_JsonSerializeExpr:
- retval = _copyJsonSerializeExpr(from);
- break;
- case T_JsonKeyValue:
- retval = _copyJsonKeyValue(from);
- break;
- case T_JsonConstructorExpr:
- retval = _copyJsonConstructorExpr(from);
- break;
- case T_JsonObjectConstructor:
- retval = _copyJsonObjectConstructor(from);
- break;
- case T_JsonAggConstructor:
- retval = _copyJsonAggConstructor(from);
- break;
- case T_JsonObjectAgg:
- retval = _copyJsonObjectAgg(from);
- break;
- case T_JsonOutput:
- retval = _copyJsonOutput(from);
- break;
- case T_JsonArrayConstructor:
- retval = _copyJsonArrayConstructor(from);
- break;
- case T_JsonArrayQueryConstructor:
- retval = _copyJsonArrayQueryConstructor(from);
- break;
- case T_JsonArrayAgg:
- retval = _copyJsonArrayAgg(from);
- break;
- case T_JsonIsPredicate:
- retval = _copyJsonIsPredicate(from);
- break;
- case T_JsonFuncExpr:
- retval = _copyJsonFuncExpr(from);
- break;
- case T_JsonExpr:
- retval = _copyJsonExpr(from);
- break;
- case T_JsonCommon:
- retval = _copyJsonCommon(from);
- break;
- case T_JsonBehavior:
- retval = _copyJsonBehavior(from);
- break;
- case T_JsonArgument:
- retval = _copyJsonArgument(from);
- break;
- case T_JsonCoercion:
- retval = _copyJsonCoercion(from);
- break;
- case T_JsonItemCoercions:
- retval = _copyJsonItemCoercions(from);
- break;
- case T_JsonTable:
- retval = _copyJsonTable(from);
- break;
- case T_JsonTableColumn:
- retval = _copyJsonTableColumn(from);
- break;
- case T_JsonTablePlan:
- retval = _copyJsonTablePlan(from);
- break;
- case T_JsonTableParent:
- retval = _copyJsonTableParent(from);
- break;
- case T_JsonTableSibling:
- retval = _copyJsonTableSibling(from);
- break;
- /*
- * RELATION NODES
- */
- case T_PathKey:
- retval = _copyPathKey(from);
- break;
- case T_RestrictInfo:
- retval = _copyRestrictInfo(from);
- break;
- case T_PlaceHolderVar:
- retval = _copyPlaceHolderVar(from);
- break;
- case T_SpecialJoinInfo:
- retval = _copySpecialJoinInfo(from);
- break;
- case T_AppendRelInfo:
- retval = _copyAppendRelInfo(from);
- break;
- case T_PlaceHolderInfo:
- retval = _copyPlaceHolderInfo(from);
- break;
-
- /*
- * VALUE NODES
- */
- case T_Integer:
- retval = _copyInteger(from);
- break;
- case T_Float:
- retval = _copyFloat(from);
- break;
- case T_Boolean:
- retval = _copyBoolean(from);
- break;
- case T_String:
- retval = _copyString(from);
- break;
- case T_BitString:
- retval = _copyBitString(from);
- break;
-#endif /* OBSOLETE */
-
- /*
- * LIST NODES
- */
case T_List:
retval = list_copy_deep(from);
break;
@@ -5995,561 +195,6 @@ copyObjectImpl(const void *from)
retval = list_copy(from);
break;
-#ifdef OBSOLETE
-
- /*
- * EXTENSIBLE NODES
- */
- case T_ExtensibleNode:
- retval = _copyExtensibleNode(from);
- break;
-
- /*
- * PARSE NODES
- */
- case T_Query:
- retval = _copyQuery(from);
- break;
- case T_RawStmt:
- retval = _copyRawStmt(from);
- break;
- case T_InsertStmt:
- retval = _copyInsertStmt(from);
- break;
- case T_DeleteStmt:
- retval = _copyDeleteStmt(from);
- break;
- case T_UpdateStmt:
- retval = _copyUpdateStmt(from);
- break;
- case T_MergeStmt:
- retval = _copyMergeStmt(from);
- break;
- case T_SelectStmt:
- retval = _copySelectStmt(from);
- break;
- case T_SetOperationStmt:
- retval = _copySetOperationStmt(from);
- break;
- case T_ReturnStmt:
- retval = _copyReturnStmt(from);
- break;
- case T_PLAssignStmt:
- retval = _copyPLAssignStmt(from);
- break;
- case T_AlterTableStmt:
- retval = _copyAlterTableStmt(from);
- break;
- case T_AlterTableCmd:
- retval = _copyAlterTableCmd(from);
- break;
- case T_AlterCollationStmt:
- retval = _copyAlterCollationStmt(from);
- break;
- case T_AlterDomainStmt:
- retval = _copyAlterDomainStmt(from);
- break;
- case T_GrantStmt:
- retval = _copyGrantStmt(from);
- break;
- case T_GrantRoleStmt:
- retval = _copyGrantRoleStmt(from);
- break;
- case T_AlterDefaultPrivilegesStmt:
- retval = _copyAlterDefaultPrivilegesStmt(from);
- break;
- case T_DeclareCursorStmt:
- retval = _copyDeclareCursorStmt(from);
- break;
- case T_ClosePortalStmt:
- retval = _copyClosePortalStmt(from);
- break;
- case T_CallStmt:
- retval = _copyCallStmt(from);
- break;
- case T_ClusterStmt:
- retval = _copyClusterStmt(from);
- break;
- case T_CopyStmt:
- retval = _copyCopyStmt(from);
- break;
- case T_CreateStmt:
- retval = _copyCreateStmt(from);
- break;
- case T_TableLikeClause:
- retval = _copyTableLikeClause(from);
- break;
- case T_DefineStmt:
- retval = _copyDefineStmt(from);
- break;
- case T_DropStmt:
- retval = _copyDropStmt(from);
- break;
- case T_TruncateStmt:
- retval = _copyTruncateStmt(from);
- break;
- case T_CommentStmt:
- retval = _copyCommentStmt(from);
- break;
- case T_SecLabelStmt:
- retval = _copySecLabelStmt(from);
- break;
- case T_FetchStmt:
- retval = _copyFetchStmt(from);
- break;
- case T_IndexStmt:
- retval = _copyIndexStmt(from);
- break;
- case T_CreateStatsStmt:
- retval = _copyCreateStatsStmt(from);
- break;
- case T_AlterStatsStmt:
- retval = _copyAlterStatsStmt(from);
- break;
- case T_CreateFunctionStmt:
- retval = _copyCreateFunctionStmt(from);
- break;
- case T_FunctionParameter:
- retval = _copyFunctionParameter(from);
- break;
- case T_AlterFunctionStmt:
- retval = _copyAlterFunctionStmt(from);
- break;
- case T_DoStmt:
- retval = _copyDoStmt(from);
- break;
- case T_RenameStmt:
- retval = _copyRenameStmt(from);
- break;
- case T_AlterObjectDependsStmt:
- retval = _copyAlterObjectDependsStmt(from);
- break;
- case T_AlterObjectSchemaStmt:
- retval = _copyAlterObjectSchemaStmt(from);
- break;
- case T_AlterOwnerStmt:
- retval = _copyAlterOwnerStmt(from);
- break;
- case T_AlterOperatorStmt:
- retval = _copyAlterOperatorStmt(from);
- break;
- case T_AlterTypeStmt:
- retval = _copyAlterTypeStmt(from);
- break;
- case T_RuleStmt:
- retval = _copyRuleStmt(from);
- break;
- case T_NotifyStmt:
- retval = _copyNotifyStmt(from);
- break;
- case T_ListenStmt:
- retval = _copyListenStmt(from);
- break;
- case T_UnlistenStmt:
- retval = _copyUnlistenStmt(from);
- break;
- case T_TransactionStmt:
- retval = _copyTransactionStmt(from);
- break;
- case T_CompositeTypeStmt:
- retval = _copyCompositeTypeStmt(from);
- break;
- case T_CreateEnumStmt:
- retval = _copyCreateEnumStmt(from);
- break;
- case T_CreateRangeStmt:
- retval = _copyCreateRangeStmt(from);
- break;
- case T_AlterEnumStmt:
- retval = _copyAlterEnumStmt(from);
- break;
- case T_ViewStmt:
- retval = _copyViewStmt(from);
- break;
- case T_LoadStmt:
- retval = _copyLoadStmt(from);
- break;
- case T_CreateDomainStmt:
- retval = _copyCreateDomainStmt(from);
- break;
- case T_CreateOpClassStmt:
- retval = _copyCreateOpClassStmt(from);
- break;
- case T_CreateOpClassItem:
- retval = _copyCreateOpClassItem(from);
- break;
- case T_CreateOpFamilyStmt:
- retval = _copyCreateOpFamilyStmt(from);
- break;
- case T_AlterOpFamilyStmt:
- retval = _copyAlterOpFamilyStmt(from);
- break;
- case T_CreatedbStmt:
- retval = _copyCreatedbStmt(from);
- break;
- case T_AlterDatabaseStmt:
- retval = _copyAlterDatabaseStmt(from);
- break;
- case T_AlterDatabaseRefreshCollStmt:
- retval = _copyAlterDatabaseRefreshCollStmt(from);
- break;
- case T_AlterDatabaseSetStmt:
- retval = _copyAlterDatabaseSetStmt(from);
- break;
- case T_DropdbStmt:
- retval = _copyDropdbStmt(from);
- break;
- case T_VacuumStmt:
- retval = _copyVacuumStmt(from);
- break;
- case T_VacuumRelation:
- retval = _copyVacuumRelation(from);
- break;
- case T_ExplainStmt:
- retval = _copyExplainStmt(from);
- break;
- case T_CreateTableAsStmt:
- retval = _copyCreateTableAsStmt(from);
- break;
- case T_RefreshMatViewStmt:
- retval = _copyRefreshMatViewStmt(from);
- break;
- case T_ReplicaIdentityStmt:
- retval = _copyReplicaIdentityStmt(from);
- break;
- case T_AlterSystemStmt:
- retval = _copyAlterSystemStmt(from);
- break;
- case T_CreateSeqStmt:
- retval = _copyCreateSeqStmt(from);
- break;
- case T_AlterSeqStmt:
- retval = _copyAlterSeqStmt(from);
- break;
- case T_VariableSetStmt:
- retval = _copyVariableSetStmt(from);
- break;
- case T_VariableShowStmt:
- retval = _copyVariableShowStmt(from);
- break;
- case T_DiscardStmt:
- retval = _copyDiscardStmt(from);
- break;
- case T_CreateTableSpaceStmt:
- retval = _copyCreateTableSpaceStmt(from);
- break;
- case T_DropTableSpaceStmt:
- retval = _copyDropTableSpaceStmt(from);
- break;
- case T_AlterTableSpaceOptionsStmt:
- retval = _copyAlterTableSpaceOptionsStmt(from);
- break;
- case T_AlterTableMoveAllStmt:
- retval = _copyAlterTableMoveAllStmt(from);
- break;
- case T_CreateExtensionStmt:
- retval = _copyCreateExtensionStmt(from);
- break;
- case T_AlterExtensionStmt:
- retval = _copyAlterExtensionStmt(from);
- break;
- case T_AlterExtensionContentsStmt:
- retval = _copyAlterExtensionContentsStmt(from);
- break;
- case T_CreateFdwStmt:
- retval = _copyCreateFdwStmt(from);
- break;
- case T_AlterFdwStmt:
- retval = _copyAlterFdwStmt(from);
- break;
- case T_CreateForeignServerStmt:
- retval = _copyCreateForeignServerStmt(from);
- break;
- case T_AlterForeignServerStmt:
- retval = _copyAlterForeignServerStmt(from);
- break;
- case T_CreateUserMappingStmt:
- retval = _copyCreateUserMappingStmt(from);
- break;
- case T_AlterUserMappingStmt:
- retval = _copyAlterUserMappingStmt(from);
- break;
- case T_DropUserMappingStmt:
- retval = _copyDropUserMappingStmt(from);
- break;
- case T_CreateForeignTableStmt:
- retval = _copyCreateForeignTableStmt(from);
- break;
- case T_ImportForeignSchemaStmt:
- retval = _copyImportForeignSchemaStmt(from);
- break;
- case T_CreateTransformStmt:
- retval = _copyCreateTransformStmt(from);
- break;
- case T_CreateAmStmt:
- retval = _copyCreateAmStmt(from);
- break;
- case T_CreateTrigStmt:
- retval = _copyCreateTrigStmt(from);
- break;
- case T_CreateEventTrigStmt:
- retval = _copyCreateEventTrigStmt(from);
- break;
- case T_AlterEventTrigStmt:
- retval = _copyAlterEventTrigStmt(from);
- break;
- case T_CreatePLangStmt:
- retval = _copyCreatePLangStmt(from);
- break;
- case T_CreateRoleStmt:
- retval = _copyCreateRoleStmt(from);
- break;
- case T_AlterRoleStmt:
- retval = _copyAlterRoleStmt(from);
- break;
- case T_AlterRoleSetStmt:
- retval = _copyAlterRoleSetStmt(from);
- break;
- case T_DropRoleStmt:
- retval = _copyDropRoleStmt(from);
- break;
- case T_LockStmt:
- retval = _copyLockStmt(from);
- break;
- case T_ConstraintsSetStmt:
- retval = _copyConstraintsSetStmt(from);
- break;
- case T_ReindexStmt:
- retval = _copyReindexStmt(from);
- break;
- case T_CheckPointStmt:
- retval = (void *) makeNode(CheckPointStmt);
- break;
- case T_CreateSchemaStmt:
- retval = _copyCreateSchemaStmt(from);
- break;
- case T_CreateConversionStmt:
- retval = _copyCreateConversionStmt(from);
- break;
- case T_CreateCastStmt:
- retval = _copyCreateCastStmt(from);
- break;
- case T_PrepareStmt:
- retval = _copyPrepareStmt(from);
- break;
- case T_ExecuteStmt:
- retval = _copyExecuteStmt(from);
- break;
- case T_DeallocateStmt:
- retval = _copyDeallocateStmt(from);
- break;
- case T_DropOwnedStmt:
- retval = _copyDropOwnedStmt(from);
- break;
- case T_ReassignOwnedStmt:
- retval = _copyReassignOwnedStmt(from);
- break;
- case T_AlterTSDictionaryStmt:
- retval = _copyAlterTSDictionaryStmt(from);
- break;
- case T_AlterTSConfigurationStmt:
- retval = _copyAlterTSConfigurationStmt(from);
- break;
- case T_CreatePolicyStmt:
- retval = _copyCreatePolicyStmt(from);
- break;
- case T_AlterPolicyStmt:
- retval = _copyAlterPolicyStmt(from);
- break;
- case T_CreatePublicationStmt:
- retval = _copyCreatePublicationStmt(from);
- break;
- case T_AlterPublicationStmt:
- retval = _copyAlterPublicationStmt(from);
- break;
- case T_CreateSubscriptionStmt:
- retval = _copyCreateSubscriptionStmt(from);
- break;
- case T_AlterSubscriptionStmt:
- retval = _copyAlterSubscriptionStmt(from);
- break;
- case T_DropSubscriptionStmt:
- retval = _copyDropSubscriptionStmt(from);
- break;
- case T_A_Expr:
- retval = _copyA_Expr(from);
- break;
- case T_ColumnRef:
- retval = _copyColumnRef(from);
- break;
- case T_ParamRef:
- retval = _copyParamRef(from);
- break;
- case T_A_Const:
- retval = _copyA_Const(from);
- break;
- case T_FuncCall:
- retval = _copyFuncCall(from);
- break;
- case T_A_Star:
- retval = _copyA_Star(from);
- break;
- case T_A_Indices:
- retval = _copyA_Indices(from);
- break;
- case T_A_Indirection:
- retval = _copyA_Indirection(from);
- break;
- case T_A_ArrayExpr:
- retval = _copyA_ArrayExpr(from);
- break;
- case T_ResTarget:
- retval = _copyResTarget(from);
- break;
- case T_MultiAssignRef:
- retval = _copyMultiAssignRef(from);
- break;
- case T_TypeCast:
- retval = _copyTypeCast(from);
- break;
- case T_CollateClause:
- retval = _copyCollateClause(from);
- break;
- case T_SortBy:
- retval = _copySortBy(from);
- break;
- case T_WindowDef:
- retval = _copyWindowDef(from);
- break;
- case T_RangeSubselect:
- retval = _copyRangeSubselect(from);
- break;
- case T_RangeFunction:
- retval = _copyRangeFunction(from);
- break;
- case T_RangeTableSample:
- retval = _copyRangeTableSample(from);
- break;
- case T_RangeTableFunc:
- retval = _copyRangeTableFunc(from);
- break;
- case T_RangeTableFuncCol:
- retval = _copyRangeTableFuncCol(from);
- break;
- case T_TypeName:
- retval = _copyTypeName(from);
- break;
- case T_IndexElem:
- retval = _copyIndexElem(from);
- break;
- case T_StatsElem:
- retval = _copyStatsElem(from);
- break;
- case T_ColumnDef:
- retval = _copyColumnDef(from);
- break;
- case T_Constraint:
- retval = _copyConstraint(from);
- break;
- case T_DefElem:
- retval = _copyDefElem(from);
- break;
- case T_LockingClause:
- retval = _copyLockingClause(from);
- break;
- case T_RangeTblEntry:
- retval = _copyRangeTblEntry(from);
- break;
- case T_RangeTblFunction:
- retval = _copyRangeTblFunction(from);
- break;
- case T_TableSampleClause:
- retval = _copyTableSampleClause(from);
- break;
- case T_WithCheckOption:
- retval = _copyWithCheckOption(from);
- break;
- case T_SortGroupClause:
- retval = _copySortGroupClause(from);
- break;
- case T_GroupingSet:
- retval = _copyGroupingSet(from);
- break;
- case T_WindowClause:
- retval = _copyWindowClause(from);
- break;
- case T_RowMarkClause:
- retval = _copyRowMarkClause(from);
- break;
- case T_WithClause:
- retval = _copyWithClause(from);
- break;
- case T_InferClause:
- retval = _copyInferClause(from);
- break;
- case T_OnConflictClause:
- retval = _copyOnConflictClause(from);
- break;
- case T_CTESearchClause:
- retval = _copyCTESearchClause(from);
- break;
- case T_CTECycleClause:
- retval = _copyCTECycleClause(from);
- break;
- case T_CommonTableExpr:
- retval = _copyCommonTableExpr(from);
- break;
- case T_MergeWhenClause:
- retval = _copyMergeWhenClause(from);
- break;
- case T_MergeAction:
- retval = _copyMergeAction(from);
- break;
- case T_ObjectWithArgs:
- retval = _copyObjectWithArgs(from);
- break;
- case T_AccessPriv:
- retval = _copyAccessPriv(from);
- break;
- case T_XmlSerialize:
- retval = _copyXmlSerialize(from);
- break;
- case T_RoleSpec:
- retval = _copyRoleSpec(from);
- break;
- case T_TriggerTransition:
- retval = _copyTriggerTransition(from);
- break;
- case T_PartitionElem:
- retval = _copyPartitionElem(from);
- break;
- case T_PartitionSpec:
- retval = _copyPartitionSpec(from);
- break;
- case T_PartitionBoundSpec:
- retval = _copyPartitionBoundSpec(from);
- break;
- case T_PartitionRangeDatum:
- retval = _copyPartitionRangeDatum(from);
- break;
- case T_PartitionCmd:
- retval = _copyPartitionCmd(from);
- break;
- case T_PublicationObjSpec:
- retval = _copyPublicationObject(from);
- break;
- case T_PublicationTable:
- retval = _copyPublicationTable(from);
- break;
-
- /*
- * MISCELLANEOUS NODES
- */
- case T_ForeignKeyCacheInfo:
- retval = _copyForeignKeyCacheInfo(from);
- break;
-#endif /* OBSOLETE */
-
default:
elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from));
retval = 0; /* keep compiler quiet */
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
index 8d18548ade..8d54e1a486 100644
--- a/src/backend/nodes/equalfuncs.c
+++ b/src/backend/nodes/equalfuncs.c
@@ -3,13 +3,6 @@
* equalfuncs.c
* Equality functions to compare node trees.
*
- * NOTE: we currently support comparing all node types found in parse
- * trees. We do not support comparing executor state trees; there
- * is no need for that, and no point in maintaining all the code that
- * would be needed. We also do not support comparing Path trees, mainly
- * because the circular linkages between RelOptInfo and Path nodes can't
- * be handled easily in a simple depth-first traversal.
- *
* NOTE: it is intentional that parse location fields (in nodes that have
* one) are not compared. This is because we want, for example, a variable
* "x" to be considered equal() to another reference to "x" in the query.
@@ -94,171 +87,12 @@
#include "equalfuncs.funcs.c"
-#ifdef OBSOLETE
-/*
- * Stuff from primnodes.h
- */
-
-static bool
-_equalAlias(const Alias *a, const Alias *b)
-{
- COMPARE_STRING_FIELD(aliasname);
- COMPARE_NODE_FIELD(colnames);
-
- return true;
-}
-
-static bool
-_equalRangeVar(const RangeVar *a, const RangeVar *b)
-{
- COMPARE_STRING_FIELD(catalogname);
- COMPARE_STRING_FIELD(schemaname);
- COMPARE_STRING_FIELD(relname);
- COMPARE_SCALAR_FIELD(inh);
- COMPARE_SCALAR_FIELD(relpersistence);
- COMPARE_NODE_FIELD(alias);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalTableFunc(const TableFunc *a, const TableFunc *b)
-{
- COMPARE_SCALAR_FIELD(functype);
- COMPARE_NODE_FIELD(ns_uris);
- COMPARE_NODE_FIELD(ns_names);
- COMPARE_NODE_FIELD(docexpr);
- COMPARE_NODE_FIELD(rowexpr);
- COMPARE_NODE_FIELD(colnames);
- COMPARE_NODE_FIELD(coltypes);
- COMPARE_NODE_FIELD(coltypmods);
- COMPARE_NODE_FIELD(colcollations);
- COMPARE_NODE_FIELD(colexprs);
- COMPARE_NODE_FIELD(coldefexprs);
- COMPARE_NODE_FIELD(colvalexprs);
- COMPARE_BITMAPSET_FIELD(notnulls);
- COMPARE_NODE_FIELD(plan);
- COMPARE_SCALAR_FIELD(ordinalitycol);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonTablePlan(const JsonTablePlan *a, const JsonTablePlan *b)
-{
- COMPARE_SCALAR_FIELD(plan_type);
- COMPARE_SCALAR_FIELD(join_type);
- COMPARE_NODE_FIELD(plan1);
- COMPARE_NODE_FIELD(plan2);
- COMPARE_STRING_FIELD(pathname);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonTable(const JsonTable *a, const JsonTable *b)
-{
- COMPARE_NODE_FIELD(common);
- COMPARE_NODE_FIELD(columns);
- COMPARE_NODE_FIELD(plan);
- COMPARE_NODE_FIELD(on_error);
- COMPARE_NODE_FIELD(alias);
- COMPARE_SCALAR_FIELD(lateral);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonTableColumn(const JsonTableColumn *a, const JsonTableColumn *b)
-{
- COMPARE_SCALAR_FIELD(coltype);
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(typeName);
- COMPARE_STRING_FIELD(pathspec);
- COMPARE_STRING_FIELD(pathname);
- COMPARE_NODE_FIELD(format);
- COMPARE_SCALAR_FIELD(wrapper);
- COMPARE_SCALAR_FIELD(omit_quotes);
- COMPARE_NODE_FIELD(columns);
- COMPARE_NODE_FIELD(on_empty);
- COMPARE_NODE_FIELD(on_error);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonTableParent(const JsonTableParent *a, const JsonTableParent *b)
-{
- COMPARE_NODE_FIELD(path);
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(child);
- COMPARE_SCALAR_FIELD(outerJoin);
- COMPARE_SCALAR_FIELD(colMin);
- COMPARE_SCALAR_FIELD(colMax);
- COMPARE_SCALAR_FIELD(errorOnError);
-
- return true;
-}
-
-static bool
-_equalJsonTableSibling(const JsonTableSibling *a, const JsonTableSibling *b)
-{
- COMPARE_NODE_FIELD(larg);
- COMPARE_NODE_FIELD(rarg);
- COMPARE_SCALAR_FIELD(cross);
-
- return true;
-}
-
-static bool
-_equalIntoClause(const IntoClause *a, const IntoClause *b)
-{
- COMPARE_NODE_FIELD(rel);
- COMPARE_NODE_FIELD(colNames);
- COMPARE_STRING_FIELD(accessMethod);
- COMPARE_NODE_FIELD(options);
- COMPARE_SCALAR_FIELD(onCommit);
- COMPARE_STRING_FIELD(tableSpaceName);
- COMPARE_NODE_FIELD(viewQuery);
- COMPARE_SCALAR_FIELD(skipData);
-
- return true;
-}
/*
- * We don't need an _equalExpr because Expr is an abstract supertype which
- * should never actually get instantiated. Also, since it has no common
- * fields except NodeTag, there's no need for a helper routine to factor
- * out comparing the common fields...
+ * Support functions for nodes with custom_copy_equal attribute
*/
static bool
-_equalVar(const Var *a, const Var *b)
-{
- COMPARE_SCALAR_FIELD(varno);
- COMPARE_SCALAR_FIELD(varattno);
- COMPARE_SCALAR_FIELD(vartype);
- COMPARE_SCALAR_FIELD(vartypmod);
- COMPARE_SCALAR_FIELD(varcollid);
- COMPARE_SCALAR_FIELD(varlevelsup);
-
- /*
- * varnosyn/varattnosyn are intentionally ignored here, because Vars with
- * different syntactic identifiers are semantically the same as long as
- * their varno/varattno match.
- */
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-#endif /* OBSOLETE */
-
-static bool
_equalConst(const Const *a, const Const *b)
{
COMPARE_SCALAR_FIELD(consttype);
@@ -279,1036 +113,6 @@ _equalConst(const Const *a, const Const *b)
a->constbyval, a->constlen);
}
-#ifdef OBSOLETE
-static bool
-_equalParam(const Param *a, const Param *b)
-{
- COMPARE_SCALAR_FIELD(paramkind);
- COMPARE_SCALAR_FIELD(paramid);
- COMPARE_SCALAR_FIELD(paramtype);
- COMPARE_SCALAR_FIELD(paramtypmod);
- COMPARE_SCALAR_FIELD(paramcollid);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalAggref(const Aggref *a, const Aggref *b)
-{
- COMPARE_SCALAR_FIELD(aggfnoid);
- COMPARE_SCALAR_FIELD(aggtype);
- COMPARE_SCALAR_FIELD(aggcollid);
- COMPARE_SCALAR_FIELD(inputcollid);
- /* ignore aggtranstype since it might not be set yet */
- COMPARE_NODE_FIELD(aggargtypes);
- COMPARE_NODE_FIELD(aggdirectargs);
- COMPARE_NODE_FIELD(args);
- COMPARE_NODE_FIELD(aggorder);
- COMPARE_NODE_FIELD(aggdistinct);
- COMPARE_NODE_FIELD(aggfilter);
- COMPARE_SCALAR_FIELD(aggstar);
- COMPARE_SCALAR_FIELD(aggvariadic);
- COMPARE_SCALAR_FIELD(aggkind);
- COMPARE_SCALAR_FIELD(agglevelsup);
- COMPARE_SCALAR_FIELD(aggsplit);
- COMPARE_SCALAR_FIELD(aggno);
- COMPARE_SCALAR_FIELD(aggtransno);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalGroupingFunc(const GroupingFunc *a, const GroupingFunc *b)
-{
- COMPARE_NODE_FIELD(args);
-
- /*
- * We must not compare the refs or cols field
- */
-
- COMPARE_SCALAR_FIELD(agglevelsup);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalWindowFunc(const WindowFunc *a, const WindowFunc *b)
-{
- COMPARE_SCALAR_FIELD(winfnoid);
- COMPARE_SCALAR_FIELD(wintype);
- COMPARE_SCALAR_FIELD(wincollid);
- COMPARE_SCALAR_FIELD(inputcollid);
- COMPARE_NODE_FIELD(args);
- COMPARE_NODE_FIELD(aggfilter);
- COMPARE_SCALAR_FIELD(winref);
- COMPARE_SCALAR_FIELD(winstar);
- COMPARE_SCALAR_FIELD(winagg);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalSubscriptingRef(const SubscriptingRef *a, const SubscriptingRef *b)
-{
- COMPARE_SCALAR_FIELD(refcontainertype);
- COMPARE_SCALAR_FIELD(refelemtype);
- COMPARE_SCALAR_FIELD(refrestype);
- COMPARE_SCALAR_FIELD(reftypmod);
- COMPARE_SCALAR_FIELD(refcollid);
- COMPARE_NODE_FIELD(refupperindexpr);
- COMPARE_NODE_FIELD(reflowerindexpr);
- COMPARE_NODE_FIELD(refexpr);
- COMPARE_NODE_FIELD(refassgnexpr);
-
- return true;
-}
-
-static bool
-_equalFuncExpr(const FuncExpr *a, const FuncExpr *b)
-{
- COMPARE_SCALAR_FIELD(funcid);
- COMPARE_SCALAR_FIELD(funcresulttype);
- COMPARE_SCALAR_FIELD(funcretset);
- COMPARE_SCALAR_FIELD(funcvariadic);
- COMPARE_COERCIONFORM_FIELD(funcformat);
- COMPARE_SCALAR_FIELD(funccollid);
- COMPARE_SCALAR_FIELD(inputcollid);
- COMPARE_NODE_FIELD(args);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalNamedArgExpr(const NamedArgExpr *a, const NamedArgExpr *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_STRING_FIELD(name);
- COMPARE_SCALAR_FIELD(argnumber);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalOpExpr(const OpExpr *a, const OpExpr *b)
-{
- COMPARE_SCALAR_FIELD(opno);
-
- /*
- * Special-case opfuncid: it is allowable for it to differ if one node
- * contains zero and the other doesn't. This just means that the one node
- * isn't as far along in the parse/plan pipeline and hasn't had the
- * opfuncid cache filled yet.
- */
- if (a->opfuncid != b->opfuncid &&
- a->opfuncid != 0 &&
- b->opfuncid != 0)
- return false;
-
- COMPARE_SCALAR_FIELD(opresulttype);
- COMPARE_SCALAR_FIELD(opretset);
- COMPARE_SCALAR_FIELD(opcollid);
- COMPARE_SCALAR_FIELD(inputcollid);
- COMPARE_NODE_FIELD(args);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalDistinctExpr(const DistinctExpr *a, const DistinctExpr *b)
-{
- COMPARE_SCALAR_FIELD(opno);
-
- /*
- * Special-case opfuncid: it is allowable for it to differ if one node
- * contains zero and the other doesn't. This just means that the one node
- * isn't as far along in the parse/plan pipeline and hasn't had the
- * opfuncid cache filled yet.
- */
- if (a->opfuncid != b->opfuncid &&
- a->opfuncid != 0 &&
- b->opfuncid != 0)
- return false;
-
- COMPARE_SCALAR_FIELD(opresulttype);
- COMPARE_SCALAR_FIELD(opretset);
- COMPARE_SCALAR_FIELD(opcollid);
- COMPARE_SCALAR_FIELD(inputcollid);
- COMPARE_NODE_FIELD(args);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalNullIfExpr(const NullIfExpr *a, const NullIfExpr *b)
-{
- COMPARE_SCALAR_FIELD(opno);
-
- /*
- * Special-case opfuncid: it is allowable for it to differ if one node
- * contains zero and the other doesn't. This just means that the one node
- * isn't as far along in the parse/plan pipeline and hasn't had the
- * opfuncid cache filled yet.
- */
- if (a->opfuncid != b->opfuncid &&
- a->opfuncid != 0 &&
- b->opfuncid != 0)
- return false;
-
- COMPARE_SCALAR_FIELD(opresulttype);
- COMPARE_SCALAR_FIELD(opretset);
- COMPARE_SCALAR_FIELD(opcollid);
- COMPARE_SCALAR_FIELD(inputcollid);
- COMPARE_NODE_FIELD(args);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalScalarArrayOpExpr(const ScalarArrayOpExpr *a, const ScalarArrayOpExpr *b)
-{
- COMPARE_SCALAR_FIELD(opno);
-
- /*
- * Special-case opfuncid: it is allowable for it to differ if one node
- * contains zero and the other doesn't. This just means that the one node
- * isn't as far along in the parse/plan pipeline and hasn't had the
- * opfuncid cache filled yet.
- */
- if (a->opfuncid != b->opfuncid &&
- a->opfuncid != 0 &&
- b->opfuncid != 0)
- return false;
-
- /* As above, hashfuncid may differ too */
- if (a->hashfuncid != b->hashfuncid &&
- a->hashfuncid != 0 &&
- b->hashfuncid != 0)
- return false;
-
- /* Likewise for the negfuncid */
- if (a->negfuncid != b->negfuncid &&
- a->negfuncid != 0 &&
- b->negfuncid != 0)
- return false;
-
- COMPARE_SCALAR_FIELD(useOr);
- COMPARE_SCALAR_FIELD(inputcollid);
- COMPARE_NODE_FIELD(args);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalBoolExpr(const BoolExpr *a, const BoolExpr *b)
-{
- COMPARE_SCALAR_FIELD(boolop);
- COMPARE_NODE_FIELD(args);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalSubLink(const SubLink *a, const SubLink *b)
-{
- COMPARE_SCALAR_FIELD(subLinkType);
- COMPARE_SCALAR_FIELD(subLinkId);
- COMPARE_NODE_FIELD(testexpr);
- COMPARE_NODE_FIELD(operName);
- COMPARE_NODE_FIELD(subselect);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalSubPlan(const SubPlan *a, const SubPlan *b)
-{
- COMPARE_SCALAR_FIELD(subLinkType);
- COMPARE_NODE_FIELD(testexpr);
- COMPARE_NODE_FIELD(paramIds);
- COMPARE_SCALAR_FIELD(plan_id);
- COMPARE_STRING_FIELD(plan_name);
- COMPARE_SCALAR_FIELD(firstColType);
- COMPARE_SCALAR_FIELD(firstColTypmod);
- COMPARE_SCALAR_FIELD(firstColCollation);
- COMPARE_SCALAR_FIELD(useHashTable);
- COMPARE_SCALAR_FIELD(unknownEqFalse);
- COMPARE_SCALAR_FIELD(parallel_safe);
- COMPARE_NODE_FIELD(setParam);
- COMPARE_NODE_FIELD(parParam);
- COMPARE_NODE_FIELD(args);
- COMPARE_SCALAR_FIELD(startup_cost);
- COMPARE_SCALAR_FIELD(per_call_cost);
-
- return true;
-}
-
-static bool
-_equalAlternativeSubPlan(const AlternativeSubPlan *a, const AlternativeSubPlan *b)
-{
- COMPARE_NODE_FIELD(subplans);
-
- return true;
-}
-
-static bool
-_equalFieldSelect(const FieldSelect *a, const FieldSelect *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_SCALAR_FIELD(fieldnum);
- COMPARE_SCALAR_FIELD(resulttype);
- COMPARE_SCALAR_FIELD(resulttypmod);
- COMPARE_SCALAR_FIELD(resultcollid);
-
- return true;
-}
-
-static bool
-_equalFieldStore(const FieldStore *a, const FieldStore *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_NODE_FIELD(newvals);
- COMPARE_NODE_FIELD(fieldnums);
- COMPARE_SCALAR_FIELD(resulttype);
-
- return true;
-}
-
-static bool
-_equalRelabelType(const RelabelType *a, const RelabelType *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_SCALAR_FIELD(resulttype);
- COMPARE_SCALAR_FIELD(resulttypmod);
- COMPARE_SCALAR_FIELD(resultcollid);
- COMPARE_COERCIONFORM_FIELD(relabelformat);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalCoerceViaIO(const CoerceViaIO *a, const CoerceViaIO *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_SCALAR_FIELD(resulttype);
- COMPARE_SCALAR_FIELD(resultcollid);
- COMPARE_COERCIONFORM_FIELD(coerceformat);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalArrayCoerceExpr(const ArrayCoerceExpr *a, const ArrayCoerceExpr *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_NODE_FIELD(elemexpr);
- COMPARE_SCALAR_FIELD(resulttype);
- COMPARE_SCALAR_FIELD(resulttypmod);
- COMPARE_SCALAR_FIELD(resultcollid);
- COMPARE_COERCIONFORM_FIELD(coerceformat);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalConvertRowtypeExpr(const ConvertRowtypeExpr *a, const ConvertRowtypeExpr *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_SCALAR_FIELD(resulttype);
- COMPARE_COERCIONFORM_FIELD(convertformat);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalCollateExpr(const CollateExpr *a, const CollateExpr *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_SCALAR_FIELD(collOid);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalCaseExpr(const CaseExpr *a, const CaseExpr *b)
-{
- COMPARE_SCALAR_FIELD(casetype);
- COMPARE_SCALAR_FIELD(casecollid);
- COMPARE_NODE_FIELD(arg);
- COMPARE_NODE_FIELD(args);
- COMPARE_NODE_FIELD(defresult);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalCaseWhen(const CaseWhen *a, const CaseWhen *b)
-{
- COMPARE_NODE_FIELD(expr);
- COMPARE_NODE_FIELD(result);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalCaseTestExpr(const CaseTestExpr *a, const CaseTestExpr *b)
-{
- COMPARE_SCALAR_FIELD(typeId);
- COMPARE_SCALAR_FIELD(typeMod);
- COMPARE_SCALAR_FIELD(collation);
-
- return true;
-}
-
-static bool
-_equalArrayExpr(const ArrayExpr *a, const ArrayExpr *b)
-{
- COMPARE_SCALAR_FIELD(array_typeid);
- COMPARE_SCALAR_FIELD(array_collid);
- COMPARE_SCALAR_FIELD(element_typeid);
- COMPARE_NODE_FIELD(elements);
- COMPARE_SCALAR_FIELD(multidims);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalRowExpr(const RowExpr *a, const RowExpr *b)
-{
- COMPARE_NODE_FIELD(args);
- COMPARE_SCALAR_FIELD(row_typeid);
- COMPARE_COERCIONFORM_FIELD(row_format);
- COMPARE_NODE_FIELD(colnames);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalRowCompareExpr(const RowCompareExpr *a, const RowCompareExpr *b)
-{
- COMPARE_SCALAR_FIELD(rctype);
- COMPARE_NODE_FIELD(opnos);
- COMPARE_NODE_FIELD(opfamilies);
- COMPARE_NODE_FIELD(inputcollids);
- COMPARE_NODE_FIELD(largs);
- COMPARE_NODE_FIELD(rargs);
-
- return true;
-}
-
-static bool
-_equalCoalesceExpr(const CoalesceExpr *a, const CoalesceExpr *b)
-{
- COMPARE_SCALAR_FIELD(coalescetype);
- COMPARE_SCALAR_FIELD(coalescecollid);
- COMPARE_NODE_FIELD(args);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalMinMaxExpr(const MinMaxExpr *a, const MinMaxExpr *b)
-{
- COMPARE_SCALAR_FIELD(minmaxtype);
- COMPARE_SCALAR_FIELD(minmaxcollid);
- COMPARE_SCALAR_FIELD(inputcollid);
- COMPARE_SCALAR_FIELD(op);
- COMPARE_NODE_FIELD(args);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalSQLValueFunction(const SQLValueFunction *a, const SQLValueFunction *b)
-{
- COMPARE_SCALAR_FIELD(op);
- COMPARE_SCALAR_FIELD(type);
- COMPARE_SCALAR_FIELD(typmod);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalXmlExpr(const XmlExpr *a, const XmlExpr *b)
-{
- COMPARE_SCALAR_FIELD(op);
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(named_args);
- COMPARE_NODE_FIELD(arg_names);
- COMPARE_NODE_FIELD(args);
- COMPARE_SCALAR_FIELD(xmloption);
- COMPARE_SCALAR_FIELD(type);
- COMPARE_SCALAR_FIELD(typmod);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalNullTest(const NullTest *a, const NullTest *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_SCALAR_FIELD(nulltesttype);
- COMPARE_SCALAR_FIELD(argisrow);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalBooleanTest(const BooleanTest *a, const BooleanTest *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_SCALAR_FIELD(booltesttype);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalCoerceToDomain(const CoerceToDomain *a, const CoerceToDomain *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_SCALAR_FIELD(resulttype);
- COMPARE_SCALAR_FIELD(resulttypmod);
- COMPARE_SCALAR_FIELD(resultcollid);
- COMPARE_COERCIONFORM_FIELD(coercionformat);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalCoerceToDomainValue(const CoerceToDomainValue *a, const CoerceToDomainValue *b)
-{
- COMPARE_SCALAR_FIELD(typeId);
- COMPARE_SCALAR_FIELD(typeMod);
- COMPARE_SCALAR_FIELD(collation);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalSetToDefault(const SetToDefault *a, const SetToDefault *b)
-{
- COMPARE_SCALAR_FIELD(typeId);
- COMPARE_SCALAR_FIELD(typeMod);
- COMPARE_SCALAR_FIELD(collation);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalCurrentOfExpr(const CurrentOfExpr *a, const CurrentOfExpr *b)
-{
- COMPARE_SCALAR_FIELD(cvarno);
- COMPARE_STRING_FIELD(cursor_name);
- COMPARE_SCALAR_FIELD(cursor_param);
-
- return true;
-}
-
-static bool
-_equalNextValueExpr(const NextValueExpr *a, const NextValueExpr *b)
-{
- COMPARE_SCALAR_FIELD(seqid);
- COMPARE_SCALAR_FIELD(typeId);
-
- return true;
-}
-
-static bool
-_equalInferenceElem(const InferenceElem *a, const InferenceElem *b)
-{
- COMPARE_NODE_FIELD(expr);
- COMPARE_SCALAR_FIELD(infercollid);
- COMPARE_SCALAR_FIELD(inferopclass);
-
- return true;
-}
-
-static bool
-_equalTargetEntry(const TargetEntry *a, const TargetEntry *b)
-{
- COMPARE_NODE_FIELD(expr);
- COMPARE_SCALAR_FIELD(resno);
- COMPARE_STRING_FIELD(resname);
- COMPARE_SCALAR_FIELD(ressortgroupref);
- COMPARE_SCALAR_FIELD(resorigtbl);
- COMPARE_SCALAR_FIELD(resorigcol);
- COMPARE_SCALAR_FIELD(resjunk);
-
- return true;
-}
-
-static bool
-_equalRangeTblRef(const RangeTblRef *a, const RangeTblRef *b)
-{
- COMPARE_SCALAR_FIELD(rtindex);
-
- return true;
-}
-
-static bool
-_equalJoinExpr(const JoinExpr *a, const JoinExpr *b)
-{
- COMPARE_SCALAR_FIELD(jointype);
- COMPARE_SCALAR_FIELD(isNatural);
- COMPARE_NODE_FIELD(larg);
- COMPARE_NODE_FIELD(rarg);
- COMPARE_NODE_FIELD(usingClause);
- COMPARE_NODE_FIELD(join_using_alias);
- COMPARE_NODE_FIELD(quals);
- COMPARE_NODE_FIELD(alias);
- COMPARE_SCALAR_FIELD(rtindex);
-
- return true;
-}
-
-static bool
-_equalFromExpr(const FromExpr *a, const FromExpr *b)
-{
- COMPARE_NODE_FIELD(fromlist);
- COMPARE_NODE_FIELD(quals);
-
- return true;
-}
-
-static bool
-_equalOnConflictExpr(const OnConflictExpr *a, const OnConflictExpr *b)
-{
- COMPARE_SCALAR_FIELD(action);
- COMPARE_NODE_FIELD(arbiterElems);
- COMPARE_NODE_FIELD(arbiterWhere);
- COMPARE_SCALAR_FIELD(constraint);
- COMPARE_NODE_FIELD(onConflictSet);
- COMPARE_NODE_FIELD(onConflictWhere);
- COMPARE_SCALAR_FIELD(exclRelIndex);
- COMPARE_NODE_FIELD(exclRelTlist);
-
- return true;
-}
-
-static bool
-_equalJsonFormat(const JsonFormat *a, const JsonFormat *b)
-{
- COMPARE_SCALAR_FIELD(format_type);
- COMPARE_SCALAR_FIELD(encoding);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonReturning(const JsonReturning *a, const JsonReturning *b)
-{
- COMPARE_NODE_FIELD(format);
- COMPARE_SCALAR_FIELD(typid);
- COMPARE_SCALAR_FIELD(typmod);
-
- return true;
-}
-
-static bool
-_equalJsonValueExpr(const JsonValueExpr *a, const JsonValueExpr *b)
-{
- COMPARE_NODE_FIELD(raw_expr);
- COMPARE_NODE_FIELD(formatted_expr);
- COMPARE_NODE_FIELD(format);
-
- return true;
-}
-
-static bool
-_equalJsonParseExpr(const JsonParseExpr *a, const JsonParseExpr *b)
-{
- COMPARE_NODE_FIELD(expr);
- COMPARE_NODE_FIELD(output);
- COMPARE_SCALAR_FIELD(unique_keys);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonScalarExpr(const JsonScalarExpr *a, const JsonScalarExpr *b)
-{
- COMPARE_NODE_FIELD(expr);
- COMPARE_NODE_FIELD(output);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonSerializeExpr(const JsonSerializeExpr *a, const JsonSerializeExpr *b)
-{
- COMPARE_NODE_FIELD(expr);
- COMPARE_NODE_FIELD(output);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonConstructorExpr(const JsonConstructorExpr *a, const JsonConstructorExpr *b)
-{
- COMPARE_SCALAR_FIELD(type);
- COMPARE_NODE_FIELD(args);
- COMPARE_NODE_FIELD(func);
- COMPARE_NODE_FIELD(coercion);
- COMPARE_NODE_FIELD(returning);
- COMPARE_SCALAR_FIELD(absent_on_null);
- COMPARE_SCALAR_FIELD(unique);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonKeyValue(const JsonKeyValue *a, const JsonKeyValue *b)
-{
- COMPARE_NODE_FIELD(key);
- COMPARE_NODE_FIELD(value);
-
- return true;
-}
-
-static bool
-_equalJsonObjectConstructor(const JsonObjectConstructor *a,
- const JsonObjectConstructor *b)
-{
- COMPARE_NODE_FIELD(exprs);
- COMPARE_NODE_FIELD(output);
- COMPARE_SCALAR_FIELD(absent_on_null);
- COMPARE_SCALAR_FIELD(unique);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonAggConstructor(const JsonAggConstructor *a,
- const JsonAggConstructor *b)
-{
- COMPARE_NODE_FIELD(output);
- COMPARE_NODE_FIELD(agg_filter);
- COMPARE_NODE_FIELD(agg_order);
- COMPARE_NODE_FIELD(over);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonObjectAgg(const JsonObjectAgg *a, const JsonObjectAgg *b)
-{
- COMPARE_NODE_FIELD(constructor);
- COMPARE_NODE_FIELD(arg);
- COMPARE_SCALAR_FIELD(absent_on_null);
- COMPARE_SCALAR_FIELD(unique);
-
- return true;
-}
-
-static bool
-_equalJsonOutput(const JsonOutput *a, const JsonOutput *b)
-{
- COMPARE_NODE_FIELD(typeName);
- COMPARE_NODE_FIELD(returning);
-
- return true;
-}
-
-static bool
-_equalJsonArrayConstructor(const JsonArrayConstructor *a,
- const JsonArrayConstructor *b)
-{
- COMPARE_NODE_FIELD(exprs);
- COMPARE_NODE_FIELD(output);
- COMPARE_SCALAR_FIELD(absent_on_null);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonArrayAgg(const JsonArrayAgg *a, const JsonArrayAgg *b)
-{
- COMPARE_NODE_FIELD(constructor);
- COMPARE_NODE_FIELD(arg);
- COMPARE_SCALAR_FIELD(absent_on_null);
-
- return true;
-}
-
-static bool
-_equalJsonArrayQueryConstructor(const JsonArrayQueryConstructor *a,
- const JsonArrayQueryConstructor *b)
-{
- COMPARE_NODE_FIELD(query);
- COMPARE_NODE_FIELD(output);
- COMPARE_NODE_FIELD(format);
- COMPARE_SCALAR_FIELD(absent_on_null);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonFuncExpr(const JsonFuncExpr *a, const JsonFuncExpr *b)
-{
- COMPARE_SCALAR_FIELD(op);
- COMPARE_NODE_FIELD(common);
- COMPARE_NODE_FIELD(output);
- COMPARE_NODE_FIELD(on_empty);
- COMPARE_NODE_FIELD(on_error);
- COMPARE_SCALAR_FIELD(wrapper);
- COMPARE_SCALAR_FIELD(omit_quotes);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonCommon(const JsonCommon *a, const JsonCommon *b)
-{
- COMPARE_NODE_FIELD(expr);
- COMPARE_NODE_FIELD(pathspec);
- COMPARE_STRING_FIELD(pathname);
- COMPARE_NODE_FIELD(passing);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalJsonArgument(const JsonArgument *a, const JsonArgument *b)
-{
- COMPARE_NODE_FIELD(val);
- COMPARE_STRING_FIELD(name);
-
- return true;
-}
-
-static bool
-_equalJsonIsPredicate(const JsonIsPredicate *a,
- const JsonIsPredicate *b)
-{
- COMPARE_NODE_FIELD(expr);
- COMPARE_NODE_FIELD(format);
- COMPARE_SCALAR_FIELD(item_type);
- COMPARE_SCALAR_FIELD(unique_keys);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-/*
- * _equalJsonBehavior
- */
-static bool
-_equalJsonBehavior(const JsonBehavior *a, const JsonBehavior *b)
-{
- COMPARE_SCALAR_FIELD(btype);
- COMPARE_NODE_FIELD(default_expr);
-
- return true;
-}
-
-/*
- * _equalJsonExpr
- */
-static bool
-_equalJsonExpr(const JsonExpr *a, const JsonExpr *b)
-{
- COMPARE_SCALAR_FIELD(op);
- COMPARE_NODE_FIELD(formatted_expr);
- COMPARE_NODE_FIELD(result_coercion);
- COMPARE_NODE_FIELD(format);
- COMPARE_NODE_FIELD(path_spec);
- COMPARE_NODE_FIELD(passing_names);
- COMPARE_NODE_FIELD(passing_values);
- COMPARE_NODE_FIELD(returning);
- COMPARE_NODE_FIELD(on_empty);
- COMPARE_NODE_FIELD(on_error);
- COMPARE_NODE_FIELD(coercions);
- COMPARE_SCALAR_FIELD(wrapper);
- COMPARE_SCALAR_FIELD(omit_quotes);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-/*
- * _equalJsonCoercion
- */
-static bool
-_equalJsonCoercion(const JsonCoercion *a, const JsonCoercion *b)
-{
- COMPARE_NODE_FIELD(expr);
- COMPARE_SCALAR_FIELD(via_populate);
- COMPARE_SCALAR_FIELD(via_io);
- COMPARE_SCALAR_FIELD(collation);
-
- return true;
-}
-
-/*
- * _equalJsonItemCoercions
- */
-static bool
-_equalJsonItemCoercions(const JsonItemCoercions *a, const JsonItemCoercions *b)
-{
- COMPARE_NODE_FIELD(null);
- COMPARE_NODE_FIELD(string);
- COMPARE_NODE_FIELD(numeric);
- COMPARE_NODE_FIELD(boolean);
- COMPARE_NODE_FIELD(date);
- COMPARE_NODE_FIELD(time);
- COMPARE_NODE_FIELD(timetz);
- COMPARE_NODE_FIELD(timestamp);
- COMPARE_NODE_FIELD(timestamptz);
- COMPARE_NODE_FIELD(composite);
-
- return true;
-}
-
-/*
- * Stuff from pathnodes.h
- */
-
-static bool
-_equalPathKey(const PathKey *a, const PathKey *b)
-{
- /* We assume pointer equality is sufficient to compare the eclasses */
- COMPARE_SCALAR_FIELD(pk_eclass);
- COMPARE_SCALAR_FIELD(pk_opfamily);
- COMPARE_SCALAR_FIELD(pk_strategy);
- COMPARE_SCALAR_FIELD(pk_nulls_first);
-
- return true;
-}
-
-static bool
-_equalRestrictInfo(const RestrictInfo *a, const RestrictInfo *b)
-{
- COMPARE_NODE_FIELD(clause);
- COMPARE_SCALAR_FIELD(is_pushed_down);
- COMPARE_SCALAR_FIELD(outerjoin_delayed);
- COMPARE_SCALAR_FIELD(security_level);
- COMPARE_BITMAPSET_FIELD(required_relids);
- COMPARE_BITMAPSET_FIELD(outer_relids);
- COMPARE_BITMAPSET_FIELD(nullable_relids);
-
- /*
- * We ignore all the remaining fields, since they may not be set yet, and
- * should be derivable from the clause anyway.
- */
-
- return true;
-}
-
-static bool
-_equalPlaceHolderVar(const PlaceHolderVar *a, const PlaceHolderVar *b)
-{
- /*
- * We intentionally do not compare phexpr. Two PlaceHolderVars with the
- * same ID and levelsup should be considered equal even if the contained
- * expressions have managed to mutate to different states. This will
- * happen during final plan construction when there are nested PHVs, since
- * the inner PHV will get replaced by a Param in some copies of the outer
- * PHV. Another way in which it can happen is that initplan sublinks
- * could get replaced by differently-numbered Params when sublink folding
- * is done. (The end result of such a situation would be some
- * unreferenced initplans, which is annoying but not really a problem.) On
- * the same reasoning, there is no need to examine phrels.
- *
- * COMPARE_NODE_FIELD(phexpr);
- *
- * COMPARE_BITMAPSET_FIELD(phrels);
- */
- COMPARE_SCALAR_FIELD(phid);
- COMPARE_SCALAR_FIELD(phlevelsup);
-
- return true;
-}
-
-static bool
-_equalSpecialJoinInfo(const SpecialJoinInfo *a, const SpecialJoinInfo *b)
-{
- COMPARE_BITMAPSET_FIELD(min_lefthand);
- COMPARE_BITMAPSET_FIELD(min_righthand);
- COMPARE_BITMAPSET_FIELD(syn_lefthand);
- COMPARE_BITMAPSET_FIELD(syn_righthand);
- COMPARE_SCALAR_FIELD(jointype);
- COMPARE_SCALAR_FIELD(lhs_strict);
- COMPARE_SCALAR_FIELD(delay_upper_joins);
- COMPARE_SCALAR_FIELD(semi_can_btree);
- COMPARE_SCALAR_FIELD(semi_can_hash);
- COMPARE_NODE_FIELD(semi_operators);
- COMPARE_NODE_FIELD(semi_rhs_exprs);
-
- return true;
-}
-
-static bool
-_equalAppendRelInfo(const AppendRelInfo *a, const AppendRelInfo *b)
-{
- COMPARE_SCALAR_FIELD(parent_relid);
- COMPARE_SCALAR_FIELD(child_relid);
- COMPARE_SCALAR_FIELD(parent_reltype);
- COMPARE_SCALAR_FIELD(child_reltype);
- COMPARE_NODE_FIELD(translated_vars);
- COMPARE_SCALAR_FIELD(num_child_cols);
- COMPARE_POINTER_FIELD(parent_colnos, a->num_child_cols * sizeof(AttrNumber));
- COMPARE_SCALAR_FIELD(parent_reloid);
-
- return true;
-}
-
-static bool
-_equalPlaceHolderInfo(const PlaceHolderInfo *a, const PlaceHolderInfo *b)
-{
- COMPARE_SCALAR_FIELD(phid);
- COMPARE_NODE_FIELD(ph_var); /* should be redundant */
- COMPARE_BITMAPSET_FIELD(ph_eval_at);
- COMPARE_BITMAPSET_FIELD(ph_lateral);
- COMPARE_BITMAPSET_FIELD(ph_needed);
- COMPARE_SCALAR_FIELD(ph_width);
-
- return true;
-}
-#endif /* OBSOLETE */
-
-/*
- * Stuff from extensible.h
- */
static bool
_equalExtensibleNode(const ExtensibleNode *a, const ExtensibleNode *b)
{
@@ -1326,1499 +130,6 @@ _equalExtensibleNode(const ExtensibleNode *a, const ExtensibleNode *b)
return true;
}
-#ifdef OBSOLETE
-/*
- * Stuff from parsenodes.h
- */
-
-static bool
-_equalQuery(const Query *a, const Query *b)
-{
- COMPARE_SCALAR_FIELD(commandType);
- COMPARE_SCALAR_FIELD(querySource);
- /* we intentionally ignore queryId, since it might not be set */
- COMPARE_SCALAR_FIELD(canSetTag);
- COMPARE_NODE_FIELD(utilityStmt);
- COMPARE_SCALAR_FIELD(resultRelation);
- COMPARE_SCALAR_FIELD(hasAggs);
- COMPARE_SCALAR_FIELD(hasWindowFuncs);
- COMPARE_SCALAR_FIELD(hasTargetSRFs);
- COMPARE_SCALAR_FIELD(hasSubLinks);
- COMPARE_SCALAR_FIELD(hasDistinctOn);
- COMPARE_SCALAR_FIELD(hasRecursive);
- COMPARE_SCALAR_FIELD(hasModifyingCTE);
- COMPARE_SCALAR_FIELD(hasForUpdate);
- COMPARE_SCALAR_FIELD(hasRowSecurity);
- COMPARE_SCALAR_FIELD(isReturn);
- COMPARE_NODE_FIELD(cteList);
- COMPARE_NODE_FIELD(rtable);
- COMPARE_NODE_FIELD(jointree);
- COMPARE_NODE_FIELD(targetList);
- COMPARE_SCALAR_FIELD(override);
- COMPARE_NODE_FIELD(onConflict);
- COMPARE_NODE_FIELD(returningList);
- COMPARE_NODE_FIELD(groupClause);
- COMPARE_SCALAR_FIELD(groupDistinct);
- COMPARE_NODE_FIELD(groupingSets);
- COMPARE_NODE_FIELD(havingQual);
- COMPARE_NODE_FIELD(windowClause);
- COMPARE_NODE_FIELD(distinctClause);
- COMPARE_NODE_FIELD(sortClause);
- COMPARE_NODE_FIELD(limitOffset);
- COMPARE_NODE_FIELD(limitCount);
- COMPARE_SCALAR_FIELD(limitOption);
- COMPARE_NODE_FIELD(rowMarks);
- COMPARE_NODE_FIELD(setOperations);
- COMPARE_NODE_FIELD(constraintDeps);
- COMPARE_NODE_FIELD(withCheckOptions);
- COMPARE_NODE_FIELD(mergeActionList);
- COMPARE_SCALAR_FIELD(mergeUseOuterJoin);
- COMPARE_LOCATION_FIELD(stmt_location);
- COMPARE_SCALAR_FIELD(stmt_len);
-
- return true;
-}
-
-static bool
-_equalRawStmt(const RawStmt *a, const RawStmt *b)
-{
- COMPARE_NODE_FIELD(stmt);
- COMPARE_LOCATION_FIELD(stmt_location);
- COMPARE_SCALAR_FIELD(stmt_len);
-
- return true;
-}
-
-static bool
-_equalInsertStmt(const InsertStmt *a, const InsertStmt *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(cols);
- COMPARE_NODE_FIELD(selectStmt);
- COMPARE_NODE_FIELD(onConflictClause);
- COMPARE_NODE_FIELD(returningList);
- COMPARE_NODE_FIELD(withClause);
- COMPARE_SCALAR_FIELD(override);
-
- return true;
-}
-
-static bool
-_equalDeleteStmt(const DeleteStmt *a, const DeleteStmt *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(usingClause);
- COMPARE_NODE_FIELD(whereClause);
- COMPARE_NODE_FIELD(returningList);
- COMPARE_NODE_FIELD(withClause);
-
- return true;
-}
-
-static bool
-_equalUpdateStmt(const UpdateStmt *a, const UpdateStmt *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(targetList);
- COMPARE_NODE_FIELD(whereClause);
- COMPARE_NODE_FIELD(fromClause);
- COMPARE_NODE_FIELD(returningList);
- COMPARE_NODE_FIELD(withClause);
-
- return true;
-}
-
-static bool
-_equalMergeStmt(const MergeStmt *a, const MergeStmt *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(sourceRelation);
- COMPARE_NODE_FIELD(joinCondition);
- COMPARE_NODE_FIELD(mergeWhenClauses);
- COMPARE_NODE_FIELD(withClause);
-
- return true;
-}
-
-static bool
-_equalSelectStmt(const SelectStmt *a, const SelectStmt *b)
-{
- COMPARE_NODE_FIELD(distinctClause);
- COMPARE_NODE_FIELD(intoClause);
- COMPARE_NODE_FIELD(targetList);
- COMPARE_NODE_FIELD(fromClause);
- COMPARE_NODE_FIELD(whereClause);
- COMPARE_NODE_FIELD(groupClause);
- COMPARE_SCALAR_FIELD(groupDistinct);
- COMPARE_NODE_FIELD(havingClause);
- COMPARE_NODE_FIELD(windowClause);
- COMPARE_NODE_FIELD(valuesLists);
- COMPARE_NODE_FIELD(sortClause);
- COMPARE_NODE_FIELD(limitOffset);
- COMPARE_NODE_FIELD(limitCount);
- COMPARE_SCALAR_FIELD(limitOption);
- COMPARE_NODE_FIELD(lockingClause);
- COMPARE_NODE_FIELD(withClause);
- COMPARE_SCALAR_FIELD(op);
- COMPARE_SCALAR_FIELD(all);
- COMPARE_NODE_FIELD(larg);
- COMPARE_NODE_FIELD(rarg);
-
- return true;
-}
-
-static bool
-_equalSetOperationStmt(const SetOperationStmt *a, const SetOperationStmt *b)
-{
- COMPARE_SCALAR_FIELD(op);
- COMPARE_SCALAR_FIELD(all);
- COMPARE_NODE_FIELD(larg);
- COMPARE_NODE_FIELD(rarg);
- COMPARE_NODE_FIELD(colTypes);
- COMPARE_NODE_FIELD(colTypmods);
- COMPARE_NODE_FIELD(colCollations);
- COMPARE_NODE_FIELD(groupClauses);
-
- return true;
-}
-
-static bool
-_equalReturnStmt(const ReturnStmt *a, const ReturnStmt *b)
-{
- COMPARE_NODE_FIELD(returnval);
-
- return true;
-}
-
-static bool
-_equalPLAssignStmt(const PLAssignStmt *a, const PLAssignStmt *b)
-{
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(indirection);
- COMPARE_SCALAR_FIELD(nnames);
- COMPARE_NODE_FIELD(val);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalAlterTableStmt(const AlterTableStmt *a, const AlterTableStmt *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(cmds);
- COMPARE_SCALAR_FIELD(objtype);
- COMPARE_SCALAR_FIELD(missing_ok);
-
- return true;
-}
-
-static bool
-_equalAlterTableCmd(const AlterTableCmd *a, const AlterTableCmd *b)
-{
- COMPARE_SCALAR_FIELD(subtype);
- COMPARE_STRING_FIELD(name);
- COMPARE_SCALAR_FIELD(num);
- COMPARE_NODE_FIELD(newowner);
- COMPARE_NODE_FIELD(def);
- COMPARE_SCALAR_FIELD(behavior);
- COMPARE_SCALAR_FIELD(missing_ok);
-
- return true;
-}
-
-static bool
-_equalAlterCollationStmt(const AlterCollationStmt *a, const AlterCollationStmt *b)
-{
- COMPARE_NODE_FIELD(collname);
-
- return true;
-}
-
-static bool
-_equalAlterDomainStmt(const AlterDomainStmt *a, const AlterDomainStmt *b)
-{
- COMPARE_SCALAR_FIELD(subtype);
- COMPARE_NODE_FIELD(typeName);
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(def);
- COMPARE_SCALAR_FIELD(behavior);
- COMPARE_SCALAR_FIELD(missing_ok);
-
- return true;
-}
-
-static bool
-_equalGrantStmt(const GrantStmt *a, const GrantStmt *b)
-{
- COMPARE_SCALAR_FIELD(is_grant);
- COMPARE_SCALAR_FIELD(targtype);
- COMPARE_SCALAR_FIELD(objtype);
- COMPARE_NODE_FIELD(objects);
- COMPARE_NODE_FIELD(privileges);
- COMPARE_NODE_FIELD(grantees);
- COMPARE_SCALAR_FIELD(grant_option);
- COMPARE_NODE_FIELD(grantor);
- COMPARE_SCALAR_FIELD(behavior);
-
- return true;
-}
-
-static bool
-_equalObjectWithArgs(const ObjectWithArgs *a, const ObjectWithArgs *b)
-{
- COMPARE_NODE_FIELD(objname);
- COMPARE_NODE_FIELD(objargs);
- COMPARE_NODE_FIELD(objfuncargs);
- COMPARE_SCALAR_FIELD(args_unspecified);
-
- return true;
-}
-
-static bool
-_equalAccessPriv(const AccessPriv *a, const AccessPriv *b)
-{
- COMPARE_STRING_FIELD(priv_name);
- COMPARE_NODE_FIELD(cols);
-
- return true;
-}
-
-static bool
-_equalGrantRoleStmt(const GrantRoleStmt *a, const GrantRoleStmt *b)
-{
- COMPARE_NODE_FIELD(granted_roles);
- COMPARE_NODE_FIELD(grantee_roles);
- COMPARE_SCALAR_FIELD(is_grant);
- COMPARE_SCALAR_FIELD(admin_opt);
- COMPARE_NODE_FIELD(grantor);
- COMPARE_SCALAR_FIELD(behavior);
-
- return true;
-}
-
-static bool
-_equalAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *a, const AlterDefaultPrivilegesStmt *b)
-{
- COMPARE_NODE_FIELD(options);
- COMPARE_NODE_FIELD(action);
-
- return true;
-}
-
-static bool
-_equalDeclareCursorStmt(const DeclareCursorStmt *a, const DeclareCursorStmt *b)
-{
- COMPARE_STRING_FIELD(portalname);
- COMPARE_SCALAR_FIELD(options);
- COMPARE_NODE_FIELD(query);
-
- return true;
-}
-
-static bool
-_equalClosePortalStmt(const ClosePortalStmt *a, const ClosePortalStmt *b)
-{
- COMPARE_STRING_FIELD(portalname);
-
- return true;
-}
-
-static bool
-_equalCallStmt(const CallStmt *a, const CallStmt *b)
-{
- COMPARE_NODE_FIELD(funccall);
- COMPARE_NODE_FIELD(funcexpr);
- COMPARE_NODE_FIELD(outargs);
-
- return true;
-}
-
-static bool
-_equalClusterStmt(const ClusterStmt *a, const ClusterStmt *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_STRING_FIELD(indexname);
- COMPARE_NODE_FIELD(params);
-
- return true;
-}
-
-static bool
-_equalCopyStmt(const CopyStmt *a, const CopyStmt *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(query);
- COMPARE_NODE_FIELD(attlist);
- COMPARE_SCALAR_FIELD(is_from);
- COMPARE_SCALAR_FIELD(is_program);
- COMPARE_STRING_FIELD(filename);
- COMPARE_NODE_FIELD(options);
- COMPARE_NODE_FIELD(whereClause);
-
- return true;
-}
-
-static bool
-_equalCreateStmt(const CreateStmt *a, const CreateStmt *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(tableElts);
- COMPARE_NODE_FIELD(inhRelations);
- COMPARE_NODE_FIELD(partbound);
- COMPARE_NODE_FIELD(partspec);
- COMPARE_NODE_FIELD(ofTypename);
- COMPARE_NODE_FIELD(constraints);
- COMPARE_NODE_FIELD(options);
- COMPARE_SCALAR_FIELD(oncommit);
- COMPARE_STRING_FIELD(tablespacename);
- COMPARE_STRING_FIELD(accessMethod);
- COMPARE_SCALAR_FIELD(if_not_exists);
-
- return true;
-}
-
-static bool
-_equalTableLikeClause(const TableLikeClause *a, const TableLikeClause *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_SCALAR_FIELD(options);
- COMPARE_SCALAR_FIELD(relationOid);
-
- return true;
-}
-
-static bool
-_equalDefineStmt(const DefineStmt *a, const DefineStmt *b)
-{
- COMPARE_SCALAR_FIELD(kind);
- COMPARE_SCALAR_FIELD(oldstyle);
- COMPARE_NODE_FIELD(defnames);
- COMPARE_NODE_FIELD(args);
- COMPARE_NODE_FIELD(definition);
- COMPARE_SCALAR_FIELD(if_not_exists);
- COMPARE_SCALAR_FIELD(replace);
-
- return true;
-}
-
-static bool
-_equalDropStmt(const DropStmt *a, const DropStmt *b)
-{
- COMPARE_NODE_FIELD(objects);
- COMPARE_SCALAR_FIELD(removeType);
- COMPARE_SCALAR_FIELD(behavior);
- COMPARE_SCALAR_FIELD(missing_ok);
- COMPARE_SCALAR_FIELD(concurrent);
-
- return true;
-}
-
-static bool
-_equalTruncateStmt(const TruncateStmt *a, const TruncateStmt *b)
-{
- COMPARE_NODE_FIELD(relations);
- COMPARE_SCALAR_FIELD(restart_seqs);
- COMPARE_SCALAR_FIELD(behavior);
-
- return true;
-}
-
-static bool
-_equalCommentStmt(const CommentStmt *a, const CommentStmt *b)
-{
- COMPARE_SCALAR_FIELD(objtype);
- COMPARE_NODE_FIELD(object);
- COMPARE_STRING_FIELD(comment);
-
- return true;
-}
-
-static bool
-_equalSecLabelStmt(const SecLabelStmt *a, const SecLabelStmt *b)
-{
- COMPARE_SCALAR_FIELD(objtype);
- COMPARE_NODE_FIELD(object);
- COMPARE_STRING_FIELD(provider);
- COMPARE_STRING_FIELD(label);
-
- return true;
-}
-
-static bool
-_equalFetchStmt(const FetchStmt *a, const FetchStmt *b)
-{
- COMPARE_SCALAR_FIELD(direction);
- COMPARE_SCALAR_FIELD(howMany);
- COMPARE_STRING_FIELD(portalname);
- COMPARE_SCALAR_FIELD(ismove);
-
- return true;
-}
-
-static bool
-_equalIndexStmt(const IndexStmt *a, const IndexStmt *b)
-{
- COMPARE_STRING_FIELD(idxname);
- COMPARE_NODE_FIELD(relation);
- COMPARE_STRING_FIELD(accessMethod);
- COMPARE_STRING_FIELD(tableSpace);
- COMPARE_NODE_FIELD(indexParams);
- COMPARE_NODE_FIELD(indexIncludingParams);
- COMPARE_NODE_FIELD(options);
- COMPARE_NODE_FIELD(whereClause);
- COMPARE_NODE_FIELD(excludeOpNames);
- COMPARE_STRING_FIELD(idxcomment);
- COMPARE_SCALAR_FIELD(indexOid);
- COMPARE_SCALAR_FIELD(oldNumber);
- COMPARE_SCALAR_FIELD(oldCreateSubid);
- COMPARE_SCALAR_FIELD(oldFirstRelfilelocatorSubid);
- COMPARE_SCALAR_FIELD(unique);
- COMPARE_SCALAR_FIELD(nulls_not_distinct);
- COMPARE_SCALAR_FIELD(primary);
- COMPARE_SCALAR_FIELD(isconstraint);
- COMPARE_SCALAR_FIELD(deferrable);
- COMPARE_SCALAR_FIELD(initdeferred);
- COMPARE_SCALAR_FIELD(transformed);
- COMPARE_SCALAR_FIELD(concurrent);
- COMPARE_SCALAR_FIELD(if_not_exists);
- COMPARE_SCALAR_FIELD(reset_default_tblspc);
-
- return true;
-}
-
-static bool
-_equalCreateStatsStmt(const CreateStatsStmt *a, const CreateStatsStmt *b)
-{
- COMPARE_NODE_FIELD(defnames);
- COMPARE_NODE_FIELD(stat_types);
- COMPARE_NODE_FIELD(exprs);
- COMPARE_NODE_FIELD(relations);
- COMPARE_STRING_FIELD(stxcomment);
- COMPARE_SCALAR_FIELD(transformed);
- COMPARE_SCALAR_FIELD(if_not_exists);
-
- return true;
-}
-
-static bool
-_equalAlterStatsStmt(const AlterStatsStmt *a, const AlterStatsStmt *b)
-{
- COMPARE_NODE_FIELD(defnames);
- COMPARE_SCALAR_FIELD(stxstattarget);
- COMPARE_SCALAR_FIELD(missing_ok);
-
- return true;
-}
-
-static bool
-_equalCreateFunctionStmt(const CreateFunctionStmt *a, const CreateFunctionStmt *b)
-{
- COMPARE_SCALAR_FIELD(is_procedure);
- COMPARE_SCALAR_FIELD(replace);
- COMPARE_NODE_FIELD(funcname);
- COMPARE_NODE_FIELD(parameters);
- COMPARE_NODE_FIELD(returnType);
- COMPARE_NODE_FIELD(options);
- COMPARE_NODE_FIELD(sql_body);
-
- return true;
-}
-
-static bool
-_equalFunctionParameter(const FunctionParameter *a, const FunctionParameter *b)
-{
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(argType);
- COMPARE_SCALAR_FIELD(mode);
- COMPARE_NODE_FIELD(defexpr);
-
- return true;
-}
-
-static bool
-_equalAlterFunctionStmt(const AlterFunctionStmt *a, const AlterFunctionStmt *b)
-{
- COMPARE_SCALAR_FIELD(objtype);
- COMPARE_NODE_FIELD(func);
- COMPARE_NODE_FIELD(actions);
-
- return true;
-}
-
-static bool
-_equalDoStmt(const DoStmt *a, const DoStmt *b)
-{
- COMPARE_NODE_FIELD(args);
-
- return true;
-}
-
-static bool
-_equalRenameStmt(const RenameStmt *a, const RenameStmt *b)
-{
- COMPARE_SCALAR_FIELD(renameType);
- COMPARE_SCALAR_FIELD(relationType);
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(object);
- COMPARE_STRING_FIELD(subname);
- COMPARE_STRING_FIELD(newname);
- COMPARE_SCALAR_FIELD(behavior);
- COMPARE_SCALAR_FIELD(missing_ok);
-
- return true;
-}
-
-static bool
-_equalAlterObjectDependsStmt(const AlterObjectDependsStmt *a, const AlterObjectDependsStmt *b)
-{
- COMPARE_SCALAR_FIELD(objectType);
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(object);
- COMPARE_NODE_FIELD(extname);
- COMPARE_SCALAR_FIELD(remove);
-
- return true;
-}
-
-static bool
-_equalAlterObjectSchemaStmt(const AlterObjectSchemaStmt *a, const AlterObjectSchemaStmt *b)
-{
- COMPARE_SCALAR_FIELD(objectType);
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(object);
- COMPARE_STRING_FIELD(newschema);
- COMPARE_SCALAR_FIELD(missing_ok);
-
- return true;
-}
-
-static bool
-_equalAlterOwnerStmt(const AlterOwnerStmt *a, const AlterOwnerStmt *b)
-{
- COMPARE_SCALAR_FIELD(objectType);
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(object);
- COMPARE_NODE_FIELD(newowner);
-
- return true;
-}
-
-static bool
-_equalAlterOperatorStmt(const AlterOperatorStmt *a, const AlterOperatorStmt *b)
-{
- COMPARE_NODE_FIELD(opername);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalAlterTypeStmt(const AlterTypeStmt *a, const AlterTypeStmt *b)
-{
- COMPARE_NODE_FIELD(typeName);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_STRING_FIELD(rulename);
- COMPARE_NODE_FIELD(whereClause);
- COMPARE_SCALAR_FIELD(event);
- COMPARE_SCALAR_FIELD(instead);
- COMPARE_NODE_FIELD(actions);
- COMPARE_SCALAR_FIELD(replace);
-
- return true;
-}
-
-static bool
-_equalNotifyStmt(const NotifyStmt *a, const NotifyStmt *b)
-{
- COMPARE_STRING_FIELD(conditionname);
- COMPARE_STRING_FIELD(payload);
-
- return true;
-}
-
-static bool
-_equalListenStmt(const ListenStmt *a, const ListenStmt *b)
-{
- COMPARE_STRING_FIELD(conditionname);
-
- return true;
-}
-
-static bool
-_equalUnlistenStmt(const UnlistenStmt *a, const UnlistenStmt *b)
-{
- COMPARE_STRING_FIELD(conditionname);
-
- return true;
-}
-
-static bool
-_equalTransactionStmt(const TransactionStmt *a, const TransactionStmt *b)
-{
- COMPARE_SCALAR_FIELD(kind);
- COMPARE_NODE_FIELD(options);
- COMPARE_STRING_FIELD(savepoint_name);
- COMPARE_STRING_FIELD(gid);
- COMPARE_SCALAR_FIELD(chain);
-
- return true;
-}
-
-static bool
-_equalCompositeTypeStmt(const CompositeTypeStmt *a, const CompositeTypeStmt *b)
-{
- COMPARE_NODE_FIELD(typevar);
- COMPARE_NODE_FIELD(coldeflist);
-
- return true;
-}
-
-static bool
-_equalCreateEnumStmt(const CreateEnumStmt *a, const CreateEnumStmt *b)
-{
- COMPARE_NODE_FIELD(typeName);
- COMPARE_NODE_FIELD(vals);
-
- return true;
-}
-
-static bool
-_equalCreateRangeStmt(const CreateRangeStmt *a, const CreateRangeStmt *b)
-{
- COMPARE_NODE_FIELD(typeName);
- COMPARE_NODE_FIELD(params);
-
- return true;
-}
-
-static bool
-_equalAlterEnumStmt(const AlterEnumStmt *a, const AlterEnumStmt *b)
-{
- COMPARE_NODE_FIELD(typeName);
- COMPARE_STRING_FIELD(oldVal);
- COMPARE_STRING_FIELD(newVal);
- COMPARE_STRING_FIELD(newValNeighbor);
- COMPARE_SCALAR_FIELD(newValIsAfter);
- COMPARE_SCALAR_FIELD(skipIfNewValExists);
-
- return true;
-}
-
-static bool
-_equalViewStmt(const ViewStmt *a, const ViewStmt *b)
-{
- COMPARE_NODE_FIELD(view);
- COMPARE_NODE_FIELD(aliases);
- COMPARE_NODE_FIELD(query);
- COMPARE_SCALAR_FIELD(replace);
- COMPARE_NODE_FIELD(options);
- COMPARE_SCALAR_FIELD(withCheckOption);
-
- return true;
-}
-
-static bool
-_equalLoadStmt(const LoadStmt *a, const LoadStmt *b)
-{
- COMPARE_STRING_FIELD(filename);
-
- return true;
-}
-
-static bool
-_equalCreateDomainStmt(const CreateDomainStmt *a, const CreateDomainStmt *b)
-{
- COMPARE_NODE_FIELD(domainname);
- COMPARE_NODE_FIELD(typeName);
- COMPARE_NODE_FIELD(collClause);
- COMPARE_NODE_FIELD(constraints);
-
- return true;
-}
-
-static bool
-_equalCreateOpClassStmt(const CreateOpClassStmt *a, const CreateOpClassStmt *b)
-{
- COMPARE_NODE_FIELD(opclassname);
- COMPARE_NODE_FIELD(opfamilyname);
- COMPARE_STRING_FIELD(amname);
- COMPARE_NODE_FIELD(datatype);
- COMPARE_NODE_FIELD(items);
- COMPARE_SCALAR_FIELD(isDefault);
-
- return true;
-}
-
-static bool
-_equalCreateOpClassItem(const CreateOpClassItem *a, const CreateOpClassItem *b)
-{
- COMPARE_SCALAR_FIELD(itemtype);
- COMPARE_NODE_FIELD(name);
- COMPARE_SCALAR_FIELD(number);
- COMPARE_NODE_FIELD(order_family);
- COMPARE_NODE_FIELD(class_args);
- COMPARE_NODE_FIELD(storedtype);
-
- return true;
-}
-
-static bool
-_equalCreateOpFamilyStmt(const CreateOpFamilyStmt *a, const CreateOpFamilyStmt *b)
-{
- COMPARE_NODE_FIELD(opfamilyname);
- COMPARE_STRING_FIELD(amname);
-
- return true;
-}
-
-static bool
-_equalAlterOpFamilyStmt(const AlterOpFamilyStmt *a, const AlterOpFamilyStmt *b)
-{
- COMPARE_NODE_FIELD(opfamilyname);
- COMPARE_STRING_FIELD(amname);
- COMPARE_SCALAR_FIELD(isDrop);
- COMPARE_NODE_FIELD(items);
-
- return true;
-}
-
-static bool
-_equalCreatedbStmt(const CreatedbStmt *a, const CreatedbStmt *b)
-{
- COMPARE_STRING_FIELD(dbname);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalAlterDatabaseStmt(const AlterDatabaseStmt *a, const AlterDatabaseStmt *b)
-{
- COMPARE_STRING_FIELD(dbname);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *a, const AlterDatabaseRefreshCollStmt *b)
-{
- COMPARE_STRING_FIELD(dbname);
-
- return true;
-}
-
-static bool
-_equalAlterDatabaseSetStmt(const AlterDatabaseSetStmt *a, const AlterDatabaseSetStmt *b)
-{
- COMPARE_STRING_FIELD(dbname);
- COMPARE_NODE_FIELD(setstmt);
-
- return true;
-}
-
-static bool
-_equalDropdbStmt(const DropdbStmt *a, const DropdbStmt *b)
-{
- COMPARE_STRING_FIELD(dbname);
- COMPARE_SCALAR_FIELD(missing_ok);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalVacuumStmt(const VacuumStmt *a, const VacuumStmt *b)
-{
- COMPARE_NODE_FIELD(options);
- COMPARE_NODE_FIELD(rels);
- COMPARE_SCALAR_FIELD(is_vacuumcmd);
-
- return true;
-}
-
-static bool
-_equalVacuumRelation(const VacuumRelation *a, const VacuumRelation *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_SCALAR_FIELD(oid);
- COMPARE_NODE_FIELD(va_cols);
-
- return true;
-}
-
-static bool
-_equalExplainStmt(const ExplainStmt *a, const ExplainStmt *b)
-{
- COMPARE_NODE_FIELD(query);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalCreateTableAsStmt(const CreateTableAsStmt *a, const CreateTableAsStmt *b)
-{
- COMPARE_NODE_FIELD(query);
- COMPARE_NODE_FIELD(into);
- COMPARE_SCALAR_FIELD(objtype);
- COMPARE_SCALAR_FIELD(is_select_into);
- COMPARE_SCALAR_FIELD(if_not_exists);
-
- return true;
-}
-
-static bool
-_equalRefreshMatViewStmt(const RefreshMatViewStmt *a, const RefreshMatViewStmt *b)
-{
- COMPARE_SCALAR_FIELD(concurrent);
- COMPARE_SCALAR_FIELD(skipData);
- COMPARE_NODE_FIELD(relation);
-
- return true;
-}
-
-static bool
-_equalReplicaIdentityStmt(const ReplicaIdentityStmt *a, const ReplicaIdentityStmt *b)
-{
- COMPARE_SCALAR_FIELD(identity_type);
- COMPARE_STRING_FIELD(name);
-
- return true;
-}
-
-static bool
-_equalAlterSystemStmt(const AlterSystemStmt *a, const AlterSystemStmt *b)
-{
- COMPARE_NODE_FIELD(setstmt);
-
- return true;
-}
-
-
-static bool
-_equalCreateSeqStmt(const CreateSeqStmt *a, const CreateSeqStmt *b)
-{
- COMPARE_NODE_FIELD(sequence);
- COMPARE_NODE_FIELD(options);
- COMPARE_SCALAR_FIELD(ownerId);
- COMPARE_SCALAR_FIELD(for_identity);
- COMPARE_SCALAR_FIELD(if_not_exists);
-
- return true;
-}
-
-static bool
-_equalAlterSeqStmt(const AlterSeqStmt *a, const AlterSeqStmt *b)
-{
- COMPARE_NODE_FIELD(sequence);
- COMPARE_NODE_FIELD(options);
- COMPARE_SCALAR_FIELD(for_identity);
- COMPARE_SCALAR_FIELD(missing_ok);
-
- return true;
-}
-
-static bool
-_equalVariableSetStmt(const VariableSetStmt *a, const VariableSetStmt *b)
-{
- COMPARE_SCALAR_FIELD(kind);
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(args);
- COMPARE_SCALAR_FIELD(is_local);
-
- return true;
-}
-
-static bool
-_equalVariableShowStmt(const VariableShowStmt *a, const VariableShowStmt *b)
-{
- COMPARE_STRING_FIELD(name);
-
- return true;
-}
-
-static bool
-_equalDiscardStmt(const DiscardStmt *a, const DiscardStmt *b)
-{
- COMPARE_SCALAR_FIELD(target);
-
- return true;
-}
-
-static bool
-_equalCreateTableSpaceStmt(const CreateTableSpaceStmt *a, const CreateTableSpaceStmt *b)
-{
- COMPARE_STRING_FIELD(tablespacename);
- COMPARE_NODE_FIELD(owner);
- COMPARE_STRING_FIELD(location);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalDropTableSpaceStmt(const DropTableSpaceStmt *a, const DropTableSpaceStmt *b)
-{
- COMPARE_STRING_FIELD(tablespacename);
- COMPARE_SCALAR_FIELD(missing_ok);
-
- return true;
-}
-
-static bool
-_equalAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *a,
- const AlterTableSpaceOptionsStmt *b)
-{
- COMPARE_STRING_FIELD(tablespacename);
- COMPARE_NODE_FIELD(options);
- COMPARE_SCALAR_FIELD(isReset);
-
- return true;
-}
-
-static bool
-_equalAlterTableMoveAllStmt(const AlterTableMoveAllStmt *a,
- const AlterTableMoveAllStmt *b)
-{
- COMPARE_STRING_FIELD(orig_tablespacename);
- COMPARE_SCALAR_FIELD(objtype);
- COMPARE_NODE_FIELD(roles);
- COMPARE_STRING_FIELD(new_tablespacename);
- COMPARE_SCALAR_FIELD(nowait);
-
- return true;
-}
-
-static bool
-_equalCreateExtensionStmt(const CreateExtensionStmt *a, const CreateExtensionStmt *b)
-{
- COMPARE_STRING_FIELD(extname);
- COMPARE_SCALAR_FIELD(if_not_exists);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalAlterExtensionStmt(const AlterExtensionStmt *a, const AlterExtensionStmt *b)
-{
- COMPARE_STRING_FIELD(extname);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalAlterExtensionContentsStmt(const AlterExtensionContentsStmt *a, const AlterExtensionContentsStmt *b)
-{
- COMPARE_STRING_FIELD(extname);
- COMPARE_SCALAR_FIELD(action);
- COMPARE_SCALAR_FIELD(objtype);
- COMPARE_NODE_FIELD(object);
-
- return true;
-}
-
-static bool
-_equalCreateFdwStmt(const CreateFdwStmt *a, const CreateFdwStmt *b)
-{
- COMPARE_STRING_FIELD(fdwname);
- COMPARE_NODE_FIELD(func_options);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalAlterFdwStmt(const AlterFdwStmt *a, const AlterFdwStmt *b)
-{
- COMPARE_STRING_FIELD(fdwname);
- COMPARE_NODE_FIELD(func_options);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalCreateForeignServerStmt(const CreateForeignServerStmt *a, const CreateForeignServerStmt *b)
-{
- COMPARE_STRING_FIELD(servername);
- COMPARE_STRING_FIELD(servertype);
- COMPARE_STRING_FIELD(version);
- COMPARE_STRING_FIELD(fdwname);
- COMPARE_SCALAR_FIELD(if_not_exists);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalAlterForeignServerStmt(const AlterForeignServerStmt *a, const AlterForeignServerStmt *b)
-{
- COMPARE_STRING_FIELD(servername);
- COMPARE_STRING_FIELD(version);
- COMPARE_NODE_FIELD(options);
- COMPARE_SCALAR_FIELD(has_version);
-
- return true;
-}
-
-static bool
-_equalCreateUserMappingStmt(const CreateUserMappingStmt *a, const CreateUserMappingStmt *b)
-{
- COMPARE_NODE_FIELD(user);
- COMPARE_STRING_FIELD(servername);
- COMPARE_SCALAR_FIELD(if_not_exists);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalAlterUserMappingStmt(const AlterUserMappingStmt *a, const AlterUserMappingStmt *b)
-{
- COMPARE_NODE_FIELD(user);
- COMPARE_STRING_FIELD(servername);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalDropUserMappingStmt(const DropUserMappingStmt *a, const DropUserMappingStmt *b)
-{
- COMPARE_NODE_FIELD(user);
- COMPARE_STRING_FIELD(servername);
- COMPARE_SCALAR_FIELD(missing_ok);
-
- return true;
-}
-
-static bool
-_equalCreateForeignTableStmt(const CreateForeignTableStmt *a, const CreateForeignTableStmt *b)
-{
- if (!_equalCreateStmt(&a->base, &b->base))
- return false;
-
- COMPARE_STRING_FIELD(servername);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalImportForeignSchemaStmt(const ImportForeignSchemaStmt *a, const ImportForeignSchemaStmt *b)
-{
- COMPARE_STRING_FIELD(server_name);
- COMPARE_STRING_FIELD(remote_schema);
- COMPARE_STRING_FIELD(local_schema);
- COMPARE_SCALAR_FIELD(list_type);
- COMPARE_NODE_FIELD(table_list);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalCreateTransformStmt(const CreateTransformStmt *a, const CreateTransformStmt *b)
-{
- COMPARE_SCALAR_FIELD(replace);
- COMPARE_NODE_FIELD(type_name);
- COMPARE_STRING_FIELD(lang);
- COMPARE_NODE_FIELD(fromsql);
- COMPARE_NODE_FIELD(tosql);
-
- return true;
-}
-
-static bool
-_equalCreateAmStmt(const CreateAmStmt *a, const CreateAmStmt *b)
-{
- COMPARE_STRING_FIELD(amname);
- COMPARE_NODE_FIELD(handler_name);
- COMPARE_SCALAR_FIELD(amtype);
-
- return true;
-}
-
-static bool
-_equalCreateTrigStmt(const CreateTrigStmt *a, const CreateTrigStmt *b)
-{
- COMPARE_SCALAR_FIELD(replace);
- COMPARE_SCALAR_FIELD(isconstraint);
- COMPARE_STRING_FIELD(trigname);
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(funcname);
- COMPARE_NODE_FIELD(args);
- COMPARE_SCALAR_FIELD(row);
- COMPARE_SCALAR_FIELD(timing);
- COMPARE_SCALAR_FIELD(events);
- COMPARE_NODE_FIELD(columns);
- COMPARE_NODE_FIELD(whenClause);
- COMPARE_NODE_FIELD(transitionRels);
- COMPARE_SCALAR_FIELD(deferrable);
- COMPARE_SCALAR_FIELD(initdeferred);
- COMPARE_NODE_FIELD(constrrel);
-
- return true;
-}
-
-static bool
-_equalCreateEventTrigStmt(const CreateEventTrigStmt *a, const CreateEventTrigStmt *b)
-{
- COMPARE_STRING_FIELD(trigname);
- COMPARE_STRING_FIELD(eventname);
- COMPARE_NODE_FIELD(whenclause);
- COMPARE_NODE_FIELD(funcname);
-
- return true;
-}
-
-static bool
-_equalAlterEventTrigStmt(const AlterEventTrigStmt *a, const AlterEventTrigStmt *b)
-{
- COMPARE_STRING_FIELD(trigname);
- COMPARE_SCALAR_FIELD(tgenabled);
-
- return true;
-}
-
-static bool
-_equalCreatePLangStmt(const CreatePLangStmt *a, const CreatePLangStmt *b)
-{
- COMPARE_SCALAR_FIELD(replace);
- COMPARE_STRING_FIELD(plname);
- COMPARE_NODE_FIELD(plhandler);
- COMPARE_NODE_FIELD(plinline);
- COMPARE_NODE_FIELD(plvalidator);
- COMPARE_SCALAR_FIELD(pltrusted);
-
- return true;
-}
-
-static bool
-_equalCreateRoleStmt(const CreateRoleStmt *a, const CreateRoleStmt *b)
-{
- COMPARE_SCALAR_FIELD(stmt_type);
- COMPARE_STRING_FIELD(role);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalAlterRoleStmt(const AlterRoleStmt *a, const AlterRoleStmt *b)
-{
- COMPARE_NODE_FIELD(role);
- COMPARE_NODE_FIELD(options);
- COMPARE_SCALAR_FIELD(action);
-
- return true;
-}
-
-static bool
-_equalAlterRoleSetStmt(const AlterRoleSetStmt *a, const AlterRoleSetStmt *b)
-{
- COMPARE_NODE_FIELD(role);
- COMPARE_STRING_FIELD(database);
- COMPARE_NODE_FIELD(setstmt);
-
- return true;
-}
-
-static bool
-_equalDropRoleStmt(const DropRoleStmt *a, const DropRoleStmt *b)
-{
- COMPARE_NODE_FIELD(roles);
- COMPARE_SCALAR_FIELD(missing_ok);
-
- return true;
-}
-
-static bool
-_equalLockStmt(const LockStmt *a, const LockStmt *b)
-{
- COMPARE_NODE_FIELD(relations);
- COMPARE_SCALAR_FIELD(mode);
- COMPARE_SCALAR_FIELD(nowait);
-
- return true;
-}
-
-static bool
-_equalConstraintsSetStmt(const ConstraintsSetStmt *a, const ConstraintsSetStmt *b)
-{
- COMPARE_NODE_FIELD(constraints);
- COMPARE_SCALAR_FIELD(deferred);
-
- return true;
-}
-
-static bool
-_equalReindexStmt(const ReindexStmt *a, const ReindexStmt *b)
-{
- COMPARE_SCALAR_FIELD(kind);
- COMPARE_NODE_FIELD(relation);
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(params);
-
- return true;
-}
-
-static bool
-_equalCreateSchemaStmt(const CreateSchemaStmt *a, const CreateSchemaStmt *b)
-{
- COMPARE_STRING_FIELD(schemaname);
- COMPARE_NODE_FIELD(authrole);
- COMPARE_NODE_FIELD(schemaElts);
- COMPARE_SCALAR_FIELD(if_not_exists);
-
- return true;
-}
-
-static bool
-_equalCreateConversionStmt(const CreateConversionStmt *a, const CreateConversionStmt *b)
-{
- COMPARE_NODE_FIELD(conversion_name);
- COMPARE_STRING_FIELD(for_encoding_name);
- COMPARE_STRING_FIELD(to_encoding_name);
- COMPARE_NODE_FIELD(func_name);
- COMPARE_SCALAR_FIELD(def);
-
- return true;
-}
-
-static bool
-_equalCreateCastStmt(const CreateCastStmt *a, const CreateCastStmt *b)
-{
- COMPARE_NODE_FIELD(sourcetype);
- COMPARE_NODE_FIELD(targettype);
- COMPARE_NODE_FIELD(func);
- COMPARE_SCALAR_FIELD(context);
- COMPARE_SCALAR_FIELD(inout);
-
- return true;
-}
-
-static bool
-_equalPrepareStmt(const PrepareStmt *a, const PrepareStmt *b)
-{
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(argtypes);
- COMPARE_NODE_FIELD(query);
-
- return true;
-}
-
-static bool
-_equalExecuteStmt(const ExecuteStmt *a, const ExecuteStmt *b)
-{
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(params);
-
- return true;
-}
-
-static bool
-_equalDeallocateStmt(const DeallocateStmt *a, const DeallocateStmt *b)
-{
- COMPARE_STRING_FIELD(name);
-
- return true;
-}
-
-static bool
-_equalDropOwnedStmt(const DropOwnedStmt *a, const DropOwnedStmt *b)
-{
- COMPARE_NODE_FIELD(roles);
- COMPARE_SCALAR_FIELD(behavior);
-
- return true;
-}
-
-static bool
-_equalReassignOwnedStmt(const ReassignOwnedStmt *a, const ReassignOwnedStmt *b)
-{
- COMPARE_NODE_FIELD(roles);
- COMPARE_NODE_FIELD(newrole);
-
- return true;
-}
-
-static bool
-_equalAlterTSDictionaryStmt(const AlterTSDictionaryStmt *a, const AlterTSDictionaryStmt *b)
-{
- COMPARE_NODE_FIELD(dictname);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalAlterTSConfigurationStmt(const AlterTSConfigurationStmt *a,
- const AlterTSConfigurationStmt *b)
-{
- COMPARE_SCALAR_FIELD(kind);
- COMPARE_NODE_FIELD(cfgname);
- COMPARE_NODE_FIELD(tokentype);
- COMPARE_NODE_FIELD(dicts);
- COMPARE_SCALAR_FIELD(override);
- COMPARE_SCALAR_FIELD(replace);
- COMPARE_SCALAR_FIELD(missing_ok);
-
- return true;
-}
-
-static bool
-_equalPublicationObject(const PublicationObjSpec *a,
- const PublicationObjSpec *b)
-{
- COMPARE_SCALAR_FIELD(pubobjtype);
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(pubtable);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalPublicationTable(const PublicationTable *a, const PublicationTable *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(whereClause);
- COMPARE_NODE_FIELD(columns);
-
- return true;
-}
-
-static bool
-_equalCreatePublicationStmt(const CreatePublicationStmt *a,
- const CreatePublicationStmt *b)
-{
- COMPARE_STRING_FIELD(pubname);
- COMPARE_NODE_FIELD(options);
- COMPARE_NODE_FIELD(pubobjects);
- COMPARE_SCALAR_FIELD(for_all_tables);
-
- return true;
-}
-
-static bool
-_equalAlterPublicationStmt(const AlterPublicationStmt *a,
- const AlterPublicationStmt *b)
-{
- COMPARE_STRING_FIELD(pubname);
- COMPARE_NODE_FIELD(options);
- COMPARE_NODE_FIELD(pubobjects);
- COMPARE_SCALAR_FIELD(for_all_tables);
- COMPARE_SCALAR_FIELD(action);
-
- return true;
-}
-
-static bool
-_equalCreateSubscriptionStmt(const CreateSubscriptionStmt *a,
- const CreateSubscriptionStmt *b)
-{
- COMPARE_STRING_FIELD(subname);
- COMPARE_STRING_FIELD(conninfo);
- COMPARE_NODE_FIELD(publication);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalAlterSubscriptionStmt(const AlterSubscriptionStmt *a,
- const AlterSubscriptionStmt *b)
-{
- COMPARE_SCALAR_FIELD(kind);
- COMPARE_STRING_FIELD(subname);
- COMPARE_STRING_FIELD(conninfo);
- COMPARE_NODE_FIELD(publication);
- COMPARE_NODE_FIELD(options);
-
- return true;
-}
-
-static bool
-_equalDropSubscriptionStmt(const DropSubscriptionStmt *a,
- const DropSubscriptionStmt *b)
-{
- COMPARE_STRING_FIELD(subname);
- COMPARE_SCALAR_FIELD(missing_ok);
- COMPARE_SCALAR_FIELD(behavior);
-
- return true;
-}
-
-static bool
-_equalCreatePolicyStmt(const CreatePolicyStmt *a, const CreatePolicyStmt *b)
-{
- COMPARE_STRING_FIELD(policy_name);
- COMPARE_NODE_FIELD(table);
- COMPARE_STRING_FIELD(cmd_name);
- COMPARE_SCALAR_FIELD(permissive);
- COMPARE_NODE_FIELD(roles);
- COMPARE_NODE_FIELD(qual);
- COMPARE_NODE_FIELD(with_check);
-
- return true;
-}
-
-static bool
-_equalAlterPolicyStmt(const AlterPolicyStmt *a, const AlterPolicyStmt *b)
-{
- COMPARE_STRING_FIELD(policy_name);
- COMPARE_NODE_FIELD(table);
- COMPARE_NODE_FIELD(roles);
- COMPARE_NODE_FIELD(qual);
- COMPARE_NODE_FIELD(with_check);
-
- return true;
-}
-
-static bool
-_equalA_Expr(const A_Expr *a, const A_Expr *b)
-{
- COMPARE_SCALAR_FIELD(kind);
- COMPARE_NODE_FIELD(name);
- COMPARE_NODE_FIELD(lexpr);
- COMPARE_NODE_FIELD(rexpr);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalColumnRef(const ColumnRef *a, const ColumnRef *b)
-{
- COMPARE_NODE_FIELD(fields);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalParamRef(const ParamRef *a, const ParamRef *b)
-{
- COMPARE_SCALAR_FIELD(number);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-#endif /* OBSOLETE */
-
static bool
_equalA_Const(const A_Const *a, const A_Const *b)
{
@@ -2834,650 +145,9 @@ _equalA_Const(const A_Const *a, const A_Const *b)
return true;
}
-#ifdef OBSOLETE
-static bool
-_equalFuncCall(const FuncCall *a, const FuncCall *b)
-{
- COMPARE_NODE_FIELD(funcname);
- COMPARE_NODE_FIELD(args);
- COMPARE_NODE_FIELD(agg_order);
- COMPARE_NODE_FIELD(agg_filter);
- COMPARE_NODE_FIELD(over);
- COMPARE_SCALAR_FIELD(agg_within_group);
- COMPARE_SCALAR_FIELD(agg_star);
- COMPARE_SCALAR_FIELD(agg_distinct);
- COMPARE_SCALAR_FIELD(func_variadic);
- COMPARE_COERCIONFORM_FIELD(funcformat);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalA_Star(const A_Star *a, const A_Star *b)
-{
- return true;
-}
-
-static bool
-_equalA_Indices(const A_Indices *a, const A_Indices *b)
-{
- COMPARE_SCALAR_FIELD(is_slice);
- COMPARE_NODE_FIELD(lidx);
- COMPARE_NODE_FIELD(uidx);
-
- return true;
-}
-
-static bool
-_equalA_Indirection(const A_Indirection *a, const A_Indirection *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_NODE_FIELD(indirection);
-
- return true;
-}
-
-static bool
-_equalA_ArrayExpr(const A_ArrayExpr *a, const A_ArrayExpr *b)
-{
- COMPARE_NODE_FIELD(elements);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalResTarget(const ResTarget *a, const ResTarget *b)
-{
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(indirection);
- COMPARE_NODE_FIELD(val);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalMultiAssignRef(const MultiAssignRef *a, const MultiAssignRef *b)
-{
- COMPARE_NODE_FIELD(source);
- COMPARE_SCALAR_FIELD(colno);
- COMPARE_SCALAR_FIELD(ncolumns);
-
- return true;
-}
-
-static bool
-_equalTypeName(const TypeName *a, const TypeName *b)
-{
- COMPARE_NODE_FIELD(names);
- COMPARE_SCALAR_FIELD(typeOid);
- COMPARE_SCALAR_FIELD(setof);
- COMPARE_SCALAR_FIELD(pct_type);
- COMPARE_NODE_FIELD(typmods);
- COMPARE_SCALAR_FIELD(typemod);
- COMPARE_NODE_FIELD(arrayBounds);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalTypeCast(const TypeCast *a, const TypeCast *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_NODE_FIELD(typeName);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalCollateClause(const CollateClause *a, const CollateClause *b)
-{
- COMPARE_NODE_FIELD(arg);
- COMPARE_NODE_FIELD(collname);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalSortBy(const SortBy *a, const SortBy *b)
-{
- COMPARE_NODE_FIELD(node);
- COMPARE_SCALAR_FIELD(sortby_dir);
- COMPARE_SCALAR_FIELD(sortby_nulls);
- COMPARE_NODE_FIELD(useOp);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalWindowDef(const WindowDef *a, const WindowDef *b)
-{
- COMPARE_STRING_FIELD(name);
- COMPARE_STRING_FIELD(refname);
- COMPARE_NODE_FIELD(partitionClause);
- COMPARE_NODE_FIELD(orderClause);
- COMPARE_SCALAR_FIELD(frameOptions);
- COMPARE_NODE_FIELD(startOffset);
- COMPARE_NODE_FIELD(endOffset);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalRangeSubselect(const RangeSubselect *a, const RangeSubselect *b)
-{
- COMPARE_SCALAR_FIELD(lateral);
- COMPARE_NODE_FIELD(subquery);
- COMPARE_NODE_FIELD(alias);
-
- return true;
-}
-
-static bool
-_equalRangeFunction(const RangeFunction *a, const RangeFunction *b)
-{
- COMPARE_SCALAR_FIELD(lateral);
- COMPARE_SCALAR_FIELD(ordinality);
- COMPARE_SCALAR_FIELD(is_rowsfrom);
- COMPARE_NODE_FIELD(functions);
- COMPARE_NODE_FIELD(alias);
- COMPARE_NODE_FIELD(coldeflist);
-
- return true;
-}
-
-static bool
-_equalRangeTableSample(const RangeTableSample *a, const RangeTableSample *b)
-{
- COMPARE_NODE_FIELD(relation);
- COMPARE_NODE_FIELD(method);
- COMPARE_NODE_FIELD(args);
- COMPARE_NODE_FIELD(repeatable);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalRangeTableFunc(const RangeTableFunc *a, const RangeTableFunc *b)
-{
- COMPARE_SCALAR_FIELD(lateral);
- COMPARE_NODE_FIELD(docexpr);
- COMPARE_NODE_FIELD(rowexpr);
- COMPARE_NODE_FIELD(namespaces);
- COMPARE_NODE_FIELD(columns);
- COMPARE_NODE_FIELD(alias);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalRangeTableFuncCol(const RangeTableFuncCol *a, const RangeTableFuncCol *b)
-{
- COMPARE_STRING_FIELD(colname);
- COMPARE_NODE_FIELD(typeName);
- COMPARE_SCALAR_FIELD(for_ordinality);
- COMPARE_SCALAR_FIELD(is_not_null);
- COMPARE_NODE_FIELD(colexpr);
- COMPARE_NODE_FIELD(coldefexpr);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-
-static bool
-_equalIndexElem(const IndexElem *a, const IndexElem *b)
-{
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(expr);
- COMPARE_STRING_FIELD(indexcolname);
- COMPARE_NODE_FIELD(collation);
- COMPARE_NODE_FIELD(opclass);
- COMPARE_NODE_FIELD(opclassopts);
- COMPARE_SCALAR_FIELD(ordering);
- COMPARE_SCALAR_FIELD(nulls_ordering);
-
- return true;
-}
-
-
-static bool
-_equalStatsElem(const StatsElem *a, const StatsElem *b)
-{
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(expr);
-
- return true;
-}
-
-static bool
-_equalColumnDef(const ColumnDef *a, const ColumnDef *b)
-{
- COMPARE_STRING_FIELD(colname);
- COMPARE_NODE_FIELD(typeName);
- COMPARE_STRING_FIELD(compression);
- COMPARE_SCALAR_FIELD(inhcount);
- COMPARE_SCALAR_FIELD(is_local);
- COMPARE_SCALAR_FIELD(is_not_null);
- COMPARE_SCALAR_FIELD(is_from_type);
- COMPARE_SCALAR_FIELD(storage);
- COMPARE_NODE_FIELD(raw_default);
- COMPARE_NODE_FIELD(cooked_default);
- COMPARE_SCALAR_FIELD(identity);
- COMPARE_NODE_FIELD(identitySequence);
- COMPARE_SCALAR_FIELD(generated);
- COMPARE_NODE_FIELD(collClause);
- COMPARE_SCALAR_FIELD(collOid);
- COMPARE_NODE_FIELD(constraints);
- COMPARE_NODE_FIELD(fdwoptions);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalConstraint(const Constraint *a, const Constraint *b)
-{
- COMPARE_SCALAR_FIELD(contype);
- COMPARE_STRING_FIELD(conname);
- COMPARE_SCALAR_FIELD(deferrable);
- COMPARE_SCALAR_FIELD(initdeferred);
- COMPARE_LOCATION_FIELD(location);
- COMPARE_SCALAR_FIELD(is_no_inherit);
- COMPARE_NODE_FIELD(raw_expr);
- COMPARE_STRING_FIELD(cooked_expr);
- COMPARE_SCALAR_FIELD(generated_when);
- COMPARE_SCALAR_FIELD(nulls_not_distinct);
- COMPARE_NODE_FIELD(keys);
- COMPARE_NODE_FIELD(including);
- COMPARE_NODE_FIELD(exclusions);
- COMPARE_NODE_FIELD(options);
- COMPARE_STRING_FIELD(indexname);
- COMPARE_STRING_FIELD(indexspace);
- COMPARE_SCALAR_FIELD(reset_default_tblspc);
- COMPARE_STRING_FIELD(access_method);
- COMPARE_NODE_FIELD(where_clause);
- COMPARE_NODE_FIELD(pktable);
- COMPARE_NODE_FIELD(fk_attrs);
- COMPARE_NODE_FIELD(pk_attrs);
- COMPARE_SCALAR_FIELD(fk_matchtype);
- COMPARE_SCALAR_FIELD(fk_upd_action);
- COMPARE_SCALAR_FIELD(fk_del_action);
- COMPARE_NODE_FIELD(fk_del_set_cols);
- COMPARE_NODE_FIELD(old_conpfeqop);
- COMPARE_SCALAR_FIELD(old_pktable_oid);
- COMPARE_SCALAR_FIELD(skip_validation);
- COMPARE_SCALAR_FIELD(initially_valid);
-
- return true;
-}
-
-static bool
-_equalDefElem(const DefElem *a, const DefElem *b)
-{
- COMPARE_STRING_FIELD(defnamespace);
- COMPARE_STRING_FIELD(defname);
- COMPARE_NODE_FIELD(arg);
- COMPARE_SCALAR_FIELD(defaction);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalLockingClause(const LockingClause *a, const LockingClause *b)
-{
- COMPARE_NODE_FIELD(lockedRels);
- COMPARE_SCALAR_FIELD(strength);
- COMPARE_SCALAR_FIELD(waitPolicy);
-
- return true;
-}
-
-static bool
-_equalRangeTblEntry(const RangeTblEntry *a, const RangeTblEntry *b)
-{
- COMPARE_SCALAR_FIELD(rtekind);
- COMPARE_SCALAR_FIELD(relid);
- COMPARE_SCALAR_FIELD(relkind);
- COMPARE_SCALAR_FIELD(rellockmode);
- COMPARE_NODE_FIELD(tablesample);
- COMPARE_NODE_FIELD(subquery);
- COMPARE_SCALAR_FIELD(security_barrier);
- COMPARE_SCALAR_FIELD(jointype);
- COMPARE_SCALAR_FIELD(joinmergedcols);
- COMPARE_NODE_FIELD(joinaliasvars);
- COMPARE_NODE_FIELD(joinleftcols);
- COMPARE_NODE_FIELD(joinrightcols);
- COMPARE_NODE_FIELD(join_using_alias);
- COMPARE_NODE_FIELD(functions);
- COMPARE_SCALAR_FIELD(funcordinality);
- COMPARE_NODE_FIELD(tablefunc);
- COMPARE_NODE_FIELD(values_lists);
- COMPARE_STRING_FIELD(ctename);
- COMPARE_SCALAR_FIELD(ctelevelsup);
- COMPARE_SCALAR_FIELD(self_reference);
- COMPARE_NODE_FIELD(coltypes);
- COMPARE_NODE_FIELD(coltypmods);
- COMPARE_NODE_FIELD(colcollations);
- COMPARE_STRING_FIELD(enrname);
- COMPARE_SCALAR_FIELD(enrtuples);
- COMPARE_NODE_FIELD(alias);
- COMPARE_NODE_FIELD(eref);
- COMPARE_SCALAR_FIELD(lateral);
- COMPARE_SCALAR_FIELD(inh);
- COMPARE_SCALAR_FIELD(inFromCl);
- COMPARE_SCALAR_FIELD(requiredPerms);
- COMPARE_SCALAR_FIELD(checkAsUser);
- COMPARE_BITMAPSET_FIELD(selectedCols);
- COMPARE_BITMAPSET_FIELD(insertedCols);
- COMPARE_BITMAPSET_FIELD(updatedCols);
- COMPARE_BITMAPSET_FIELD(extraUpdatedCols);
- COMPARE_NODE_FIELD(securityQuals);
-
- return true;
-}
-
-static bool
-_equalRangeTblFunction(const RangeTblFunction *a, const RangeTblFunction *b)
-{
- COMPARE_NODE_FIELD(funcexpr);
- COMPARE_SCALAR_FIELD(funccolcount);
- COMPARE_NODE_FIELD(funccolnames);
- COMPARE_NODE_FIELD(funccoltypes);
- COMPARE_NODE_FIELD(funccoltypmods);
- COMPARE_NODE_FIELD(funccolcollations);
- COMPARE_BITMAPSET_FIELD(funcparams);
-
- return true;
-}
-
-static bool
-_equalTableSampleClause(const TableSampleClause *a, const TableSampleClause *b)
-{
- COMPARE_SCALAR_FIELD(tsmhandler);
- COMPARE_NODE_FIELD(args);
- COMPARE_NODE_FIELD(repeatable);
-
- return true;
-}
-
-static bool
-_equalWithCheckOption(const WithCheckOption *a, const WithCheckOption *b)
-{
- COMPARE_SCALAR_FIELD(kind);
- COMPARE_STRING_FIELD(relname);
- COMPARE_STRING_FIELD(polname);
- COMPARE_NODE_FIELD(qual);
- COMPARE_SCALAR_FIELD(cascaded);
-
- return true;
-}
-
-static bool
-_equalSortGroupClause(const SortGroupClause *a, const SortGroupClause *b)
-{
- COMPARE_SCALAR_FIELD(tleSortGroupRef);
- COMPARE_SCALAR_FIELD(eqop);
- COMPARE_SCALAR_FIELD(sortop);
- COMPARE_SCALAR_FIELD(nulls_first);
- COMPARE_SCALAR_FIELD(hashable);
-
- return true;
-}
-
-static bool
-_equalGroupingSet(const GroupingSet *a, const GroupingSet *b)
-{
- COMPARE_SCALAR_FIELD(kind);
- COMPARE_NODE_FIELD(content);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalWindowClause(const WindowClause *a, const WindowClause *b)
-{
- COMPARE_STRING_FIELD(name);
- COMPARE_STRING_FIELD(refname);
- COMPARE_NODE_FIELD(partitionClause);
- COMPARE_NODE_FIELD(orderClause);
- COMPARE_SCALAR_FIELD(frameOptions);
- COMPARE_NODE_FIELD(startOffset);
- COMPARE_NODE_FIELD(endOffset);
- COMPARE_NODE_FIELD(runCondition);
- COMPARE_SCALAR_FIELD(startInRangeFunc);
- COMPARE_SCALAR_FIELD(endInRangeFunc);
- COMPARE_SCALAR_FIELD(inRangeColl);
- COMPARE_SCALAR_FIELD(inRangeAsc);
- COMPARE_SCALAR_FIELD(inRangeNullsFirst);
- COMPARE_SCALAR_FIELD(winref);
- COMPARE_SCALAR_FIELD(copiedOrder);
-
- return true;
-}
-
-static bool
-_equalRowMarkClause(const RowMarkClause *a, const RowMarkClause *b)
-{
- COMPARE_SCALAR_FIELD(rti);
- COMPARE_SCALAR_FIELD(strength);
- COMPARE_SCALAR_FIELD(waitPolicy);
- COMPARE_SCALAR_FIELD(pushedDown);
-
- return true;
-}
-
-static bool
-_equalWithClause(const WithClause *a, const WithClause *b)
-{
- COMPARE_NODE_FIELD(ctes);
- COMPARE_SCALAR_FIELD(recursive);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalInferClause(const InferClause *a, const InferClause *b)
-{
- COMPARE_NODE_FIELD(indexElems);
- COMPARE_NODE_FIELD(whereClause);
- COMPARE_STRING_FIELD(conname);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalOnConflictClause(const OnConflictClause *a, const OnConflictClause *b)
-{
- COMPARE_SCALAR_FIELD(action);
- COMPARE_NODE_FIELD(infer);
- COMPARE_NODE_FIELD(targetList);
- COMPARE_NODE_FIELD(whereClause);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalCTESearchClause(const CTESearchClause *a, const CTESearchClause *b)
-{
- COMPARE_NODE_FIELD(search_col_list);
- COMPARE_SCALAR_FIELD(search_breadth_first);
- COMPARE_STRING_FIELD(search_seq_column);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalCTECycleClause(const CTECycleClause *a, const CTECycleClause *b)
-{
- COMPARE_NODE_FIELD(cycle_col_list);
- COMPARE_STRING_FIELD(cycle_mark_column);
- COMPARE_NODE_FIELD(cycle_mark_value);
- COMPARE_NODE_FIELD(cycle_mark_default);
- COMPARE_STRING_FIELD(cycle_path_column);
- COMPARE_LOCATION_FIELD(location);
- COMPARE_SCALAR_FIELD(cycle_mark_type);
- COMPARE_SCALAR_FIELD(cycle_mark_typmod);
- COMPARE_SCALAR_FIELD(cycle_mark_collation);
- COMPARE_SCALAR_FIELD(cycle_mark_neop);
-
- return true;
-}
-
-static bool
-_equalCommonTableExpr(const CommonTableExpr *a, const CommonTableExpr *b)
-{
- COMPARE_STRING_FIELD(ctename);
- COMPARE_NODE_FIELD(aliascolnames);
- COMPARE_SCALAR_FIELD(ctematerialized);
- COMPARE_NODE_FIELD(ctequery);
- COMPARE_NODE_FIELD(search_clause);
- COMPARE_NODE_FIELD(cycle_clause);
- COMPARE_LOCATION_FIELD(location);
- COMPARE_SCALAR_FIELD(cterecursive);
- COMPARE_SCALAR_FIELD(cterefcount);
- COMPARE_NODE_FIELD(ctecolnames);
- COMPARE_NODE_FIELD(ctecoltypes);
- COMPARE_NODE_FIELD(ctecoltypmods);
- COMPARE_NODE_FIELD(ctecolcollations);
-
- return true;
-}
-
-static bool
-_equalMergeWhenClause(const MergeWhenClause *a, const MergeWhenClause *b)
-{
- COMPARE_SCALAR_FIELD(matched);
- COMPARE_SCALAR_FIELD(commandType);
- COMPARE_SCALAR_FIELD(override);
- COMPARE_NODE_FIELD(condition);
- COMPARE_NODE_FIELD(targetList);
- COMPARE_NODE_FIELD(values);
-
- return true;
-}
-
-static bool
-_equalMergeAction(const MergeAction *a, const MergeAction *b)
-{
- COMPARE_SCALAR_FIELD(matched);
- COMPARE_SCALAR_FIELD(commandType);
- COMPARE_SCALAR_FIELD(override);
- COMPARE_NODE_FIELD(qual);
- COMPARE_NODE_FIELD(targetList);
- COMPARE_NODE_FIELD(updateColnos);
-
- return true;
-}
-
-static bool
-_equalXmlSerialize(const XmlSerialize *a, const XmlSerialize *b)
-{
- COMPARE_SCALAR_FIELD(xmloption);
- COMPARE_NODE_FIELD(expr);
- COMPARE_NODE_FIELD(typeName);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalRoleSpec(const RoleSpec *a, const RoleSpec *b)
-{
- COMPARE_SCALAR_FIELD(roletype);
- COMPARE_STRING_FIELD(rolename);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalTriggerTransition(const TriggerTransition *a, const TriggerTransition *b)
-{
- COMPARE_STRING_FIELD(name);
- COMPARE_SCALAR_FIELD(isNew);
- COMPARE_SCALAR_FIELD(isTable);
-
- return true;
-}
-
-static bool
-_equalPartitionElem(const PartitionElem *a, const PartitionElem *b)
-{
- COMPARE_STRING_FIELD(name);
- COMPARE_NODE_FIELD(expr);
- COMPARE_NODE_FIELD(collation);
- COMPARE_NODE_FIELD(opclass);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalPartitionSpec(const PartitionSpec *a, const PartitionSpec *b)
-{
- COMPARE_STRING_FIELD(strategy);
- COMPARE_NODE_FIELD(partParams);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalPartitionBoundSpec(const PartitionBoundSpec *a, const PartitionBoundSpec *b)
-{
- COMPARE_SCALAR_FIELD(strategy);
- COMPARE_SCALAR_FIELD(is_default);
- COMPARE_SCALAR_FIELD(modulus);
- COMPARE_SCALAR_FIELD(remainder);
- COMPARE_NODE_FIELD(listdatums);
- COMPARE_NODE_FIELD(lowerdatums);
- COMPARE_NODE_FIELD(upperdatums);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalPartitionRangeDatum(const PartitionRangeDatum *a, const PartitionRangeDatum *b)
-{
- COMPARE_SCALAR_FIELD(kind);
- COMPARE_NODE_FIELD(value);
- COMPARE_LOCATION_FIELD(location);
-
- return true;
-}
-
-static bool
-_equalPartitionCmd(const PartitionCmd *a, const PartitionCmd *b)
-{
- COMPARE_NODE_FIELD(name);
- COMPARE_NODE_FIELD(bound);
- COMPARE_SCALAR_FIELD(concurrent);
-
- return true;
-}
-#endif /* OBSOLETE */
-
/*
- * Stuff from pg_list.h
+ * Lists are handled specially
*/
-
static bool
_equalList(const List *a, const List *b)
{
@@ -3533,51 +203,6 @@ _equalList(const List *a, const List *b)
return true;
}
-#ifdef OBSOLETE
-/*
- * Stuff from value.h
- */
-
-static bool
-_equalInteger(const Integer *a, const Integer *b)
-{
- COMPARE_SCALAR_FIELD(ival);
-
- return true;
-}
-
-static bool
-_equalFloat(const Float *a, const Float *b)
-{
- COMPARE_STRING_FIELD(fval);
-
- return true;
-}
-
-static bool
-_equalBoolean(const Boolean *a, const Boolean *b)
-{
- COMPARE_SCALAR_FIELD(boolval);
-
- return true;
-}
-
-static bool
-_equalString(const String *a, const String *b)
-{
- COMPARE_STRING_FIELD(sval);
-
- return true;
-}
-
-static bool
-_equalBitString(const BitString *a, const BitString *b)
-{
- COMPARE_STRING_FIELD(bsval);
-
- return true;
-}
-#endif /* OBSOLETE */
/*
* equal
@@ -3609,228 +234,6 @@ equal(const void *a, const void *b)
switch (nodeTag(a))
{
#include "equalfuncs.switch.c"
-#ifdef OBSOLETE
- /*
- * PRIMITIVE NODES
- */
- case T_Alias:
- retval = _equalAlias(a, b);
- break;
- case T_RangeVar:
- retval = _equalRangeVar(a, b);
- break;
- case T_TableFunc:
- retval = _equalTableFunc(a, b);
- break;
- case T_IntoClause:
- retval = _equalIntoClause(a, b);
- break;
- case T_Var:
- retval = _equalVar(a, b);
- break;
- case T_Const:
- retval = _equalConst(a, b);
- break;
- case T_Param:
- retval = _equalParam(a, b);
- break;
- case T_Aggref:
- retval = _equalAggref(a, b);
- break;
- case T_GroupingFunc:
- retval = _equalGroupingFunc(a, b);
- break;
- case T_WindowFunc:
- retval = _equalWindowFunc(a, b);
- break;
- case T_SubscriptingRef:
- retval = _equalSubscriptingRef(a, b);
- break;
- case T_FuncExpr:
- retval = _equalFuncExpr(a, b);
- break;
- case T_NamedArgExpr:
- retval = _equalNamedArgExpr(a, b);
- break;
- case T_OpExpr:
- retval = _equalOpExpr(a, b);
- break;
- case T_DistinctExpr:
- retval = _equalDistinctExpr(a, b);
- break;
- case T_NullIfExpr:
- retval = _equalNullIfExpr(a, b);
- break;
- case T_ScalarArrayOpExpr:
- retval = _equalScalarArrayOpExpr(a, b);
- break;
- case T_BoolExpr:
- retval = _equalBoolExpr(a, b);
- break;
- case T_SubLink:
- retval = _equalSubLink(a, b);
- break;
- case T_SubPlan:
- retval = _equalSubPlan(a, b);
- break;
- case T_AlternativeSubPlan:
- retval = _equalAlternativeSubPlan(a, b);
- break;
- case T_FieldSelect:
- retval = _equalFieldSelect(a, b);
- break;
- case T_FieldStore:
- retval = _equalFieldStore(a, b);
- break;
- case T_RelabelType:
- retval = _equalRelabelType(a, b);
- break;
- case T_CoerceViaIO:
- retval = _equalCoerceViaIO(a, b);
- break;
- case T_ArrayCoerceExpr:
- retval = _equalArrayCoerceExpr(a, b);
- break;
- case T_ConvertRowtypeExpr:
- retval = _equalConvertRowtypeExpr(a, b);
- break;
- case T_CollateExpr:
- retval = _equalCollateExpr(a, b);
- break;
- case T_CaseExpr:
- retval = _equalCaseExpr(a, b);
- break;
- case T_CaseWhen:
- retval = _equalCaseWhen(a, b);
- break;
- case T_CaseTestExpr:
- retval = _equalCaseTestExpr(a, b);
- break;
- case T_ArrayExpr:
- retval = _equalArrayExpr(a, b);
- break;
- case T_RowExpr:
- retval = _equalRowExpr(a, b);
- break;
- case T_RowCompareExpr:
- retval = _equalRowCompareExpr(a, b);
- break;
- case T_CoalesceExpr:
- retval = _equalCoalesceExpr(a, b);
- break;
- case T_MinMaxExpr:
- retval = _equalMinMaxExpr(a, b);
- break;
- case T_SQLValueFunction:
- retval = _equalSQLValueFunction(a, b);
- break;
- case T_XmlExpr:
- retval = _equalXmlExpr(a, b);
- break;
- case T_NullTest:
- retval = _equalNullTest(a, b);
- break;
- case T_BooleanTest:
- retval = _equalBooleanTest(a, b);
- break;
- case T_CoerceToDomain:
- retval = _equalCoerceToDomain(a, b);
- break;
- case T_CoerceToDomainValue:
- retval = _equalCoerceToDomainValue(a, b);
- break;
- case T_SetToDefault:
- retval = _equalSetToDefault(a, b);
- break;
- case T_CurrentOfExpr:
- retval = _equalCurrentOfExpr(a, b);
- break;
- case T_NextValueExpr:
- retval = _equalNextValueExpr(a, b);
- break;
- case T_InferenceElem:
- retval = _equalInferenceElem(a, b);
- break;
- case T_TargetEntry:
- retval = _equalTargetEntry(a, b);
- break;
- case T_RangeTblRef:
- retval = _equalRangeTblRef(a, b);
- break;
- case T_FromExpr:
- retval = _equalFromExpr(a, b);
- break;
- case T_OnConflictExpr:
- retval = _equalOnConflictExpr(a, b);
- break;
- case T_JoinExpr:
- retval = _equalJoinExpr(a, b);
- break;
- case T_JsonFormat:
- retval = _equalJsonFormat(a, b);
- break;
- case T_JsonReturning:
- retval = _equalJsonReturning(a, b);
- break;
- case T_JsonValueExpr:
- retval = _equalJsonValueExpr(a, b);
- break;
- case T_JsonParseExpr:
- retval = _equalJsonParseExpr(a, b);
- break;
- case T_JsonScalarExpr:
- retval = _equalJsonScalarExpr(a, b);
- break;
- case T_JsonSerializeExpr:
- retval = _equalJsonSerializeExpr(a, b);
- break;
- case T_JsonConstructorExpr:
- retval = _equalJsonConstructorExpr(a, b);
- break;
- case T_JsonIsPredicate:
- retval = _equalJsonIsPredicate(a, b);
- break;
- case T_JsonBehavior:
- retval = _equalJsonBehavior(a, b);
- break;
- case T_JsonExpr:
- retval = _equalJsonExpr(a, b);
- break;
- case T_JsonCoercion:
- retval = _equalJsonCoercion(a, b);
- break;
- case T_JsonItemCoercions:
- retval = _equalJsonItemCoercions(a, b);
- break;
- case T_JsonTableParent:
- retval = _equalJsonTableParent(a, b);
- break;
- case T_JsonTableSibling:
- retval = _equalJsonTableSibling(a, b);
- break;
-
- /*
- * RELATION NODES
- */
- case T_PathKey:
- retval = _equalPathKey(a, b);
- break;
- case T_RestrictInfo:
- retval = _equalRestrictInfo(a, b);
- break;
- case T_PlaceHolderVar:
- retval = _equalPlaceHolderVar(a, b);
- break;
- case T_SpecialJoinInfo:
- retval = _equalSpecialJoinInfo(a, b);
- break;
- case T_AppendRelInfo:
- retval = _equalAppendRelInfo(a, b);
- break;
- case T_PlaceHolderInfo:
- retval = _equalPlaceHolderInfo(a, b);
- break;
-#endif /* OBSOLETE */
case T_List:
case T_IntList:
@@ -3838,611 +241,6 @@ equal(const void *a, const void *b)
retval = _equalList(a, b);
break;
-#ifdef OBSOLETE
- case T_Integer:
- retval = _equalInteger(a, b);
- break;
- case T_Float:
- retval = _equalFloat(a, b);
- break;
- case T_Boolean:
- retval = _equalBoolean(a, b);
- break;
- case T_String:
- retval = _equalString(a, b);
- break;
- case T_BitString:
- retval = _equalBitString(a, b);
- break;
-
- /*
- * EXTENSIBLE NODES
- */
- case T_ExtensibleNode:
- retval = _equalExtensibleNode(a, b);
- break;
-
- /*
- * PARSE NODES
- */
- case T_Query:
- retval = _equalQuery(a, b);
- break;
- case T_RawStmt:
- retval = _equalRawStmt(a, b);
- break;
- case T_InsertStmt:
- retval = _equalInsertStmt(a, b);
- break;
- case T_DeleteStmt:
- retval = _equalDeleteStmt(a, b);
- break;
- case T_UpdateStmt:
- retval = _equalUpdateStmt(a, b);
- break;
- case T_MergeStmt:
- retval = _equalMergeStmt(a, b);
- break;
- case T_SelectStmt:
- retval = _equalSelectStmt(a, b);
- break;
- case T_SetOperationStmt:
- retval = _equalSetOperationStmt(a, b);
- break;
- case T_ReturnStmt:
- retval = _equalReturnStmt(a, b);
- break;
- case T_PLAssignStmt:
- retval = _equalPLAssignStmt(a, b);
- break;
- case T_AlterTableStmt:
- retval = _equalAlterTableStmt(a, b);
- break;
- case T_AlterTableCmd:
- retval = _equalAlterTableCmd(a, b);
- break;
- case T_AlterCollationStmt:
- retval = _equalAlterCollationStmt(a, b);
- break;
- case T_AlterDomainStmt:
- retval = _equalAlterDomainStmt(a, b);
- break;
- case T_GrantStmt:
- retval = _equalGrantStmt(a, b);
- break;
- case T_GrantRoleStmt:
- retval = _equalGrantRoleStmt(a, b);
- break;
- case T_AlterDefaultPrivilegesStmt:
- retval = _equalAlterDefaultPrivilegesStmt(a, b);
- break;
- case T_DeclareCursorStmt:
- retval = _equalDeclareCursorStmt(a, b);
- break;
- case T_ClosePortalStmt:
- retval = _equalClosePortalStmt(a, b);
- break;
- case T_CallStmt:
- retval = _equalCallStmt(a, b);
- break;
- case T_ClusterStmt:
- retval = _equalClusterStmt(a, b);
- break;
- case T_CopyStmt:
- retval = _equalCopyStmt(a, b);
- break;
- case T_CreateStmt:
- retval = _equalCreateStmt(a, b);
- break;
- case T_TableLikeClause:
- retval = _equalTableLikeClause(a, b);
- break;
- case T_DefineStmt:
- retval = _equalDefineStmt(a, b);
- break;
- case T_DropStmt:
- retval = _equalDropStmt(a, b);
- break;
- case T_TruncateStmt:
- retval = _equalTruncateStmt(a, b);
- break;
- case T_CommentStmt:
- retval = _equalCommentStmt(a, b);
- break;
- case T_SecLabelStmt:
- retval = _equalSecLabelStmt(a, b);
- break;
- case T_FetchStmt:
- retval = _equalFetchStmt(a, b);
- break;
- case T_IndexStmt:
- retval = _equalIndexStmt(a, b);
- break;
- case T_CreateStatsStmt:
- retval = _equalCreateStatsStmt(a, b);
- break;
- case T_AlterStatsStmt:
- retval = _equalAlterStatsStmt(a, b);
- break;
- case T_CreateFunctionStmt:
- retval = _equalCreateFunctionStmt(a, b);
- break;
- case T_FunctionParameter:
- retval = _equalFunctionParameter(a, b);
- break;
- case T_AlterFunctionStmt:
- retval = _equalAlterFunctionStmt(a, b);
- break;
- case T_DoStmt:
- retval = _equalDoStmt(a, b);
- break;
- case T_RenameStmt:
- retval = _equalRenameStmt(a, b);
- break;
- case T_AlterObjectDependsStmt:
- retval = _equalAlterObjectDependsStmt(a, b);
- break;
- case T_AlterObjectSchemaStmt:
- retval = _equalAlterObjectSchemaStmt(a, b);
- break;
- case T_AlterOwnerStmt:
- retval = _equalAlterOwnerStmt(a, b);
- break;
- case T_AlterOperatorStmt:
- retval = _equalAlterOperatorStmt(a, b);
- break;
- case T_AlterTypeStmt:
- retval = _equalAlterTypeStmt(a, b);
- break;
- case T_RuleStmt:
- retval = _equalRuleStmt(a, b);
- break;
- case T_NotifyStmt:
- retval = _equalNotifyStmt(a, b);
- break;
- case T_ListenStmt:
- retval = _equalListenStmt(a, b);
- break;
- case T_UnlistenStmt:
- retval = _equalUnlistenStmt(a, b);
- break;
- case T_TransactionStmt:
- retval = _equalTransactionStmt(a, b);
- break;
- case T_CompositeTypeStmt:
- retval = _equalCompositeTypeStmt(a, b);
- break;
- case T_CreateEnumStmt:
- retval = _equalCreateEnumStmt(a, b);
- break;
- case T_CreateRangeStmt:
- retval = _equalCreateRangeStmt(a, b);
- break;
- case T_AlterEnumStmt:
- retval = _equalAlterEnumStmt(a, b);
- break;
- case T_ViewStmt:
- retval = _equalViewStmt(a, b);
- break;
- case T_LoadStmt:
- retval = _equalLoadStmt(a, b);
- break;
- case T_CreateDomainStmt:
- retval = _equalCreateDomainStmt(a, b);
- break;
- case T_CreateOpClassStmt:
- retval = _equalCreateOpClassStmt(a, b);
- break;
- case T_CreateOpClassItem:
- retval = _equalCreateOpClassItem(a, b);
- break;
- case T_CreateOpFamilyStmt:
- retval = _equalCreateOpFamilyStmt(a, b);
- break;
- case T_AlterOpFamilyStmt:
- retval = _equalAlterOpFamilyStmt(a, b);
- break;
- case T_CreatedbStmt:
- retval = _equalCreatedbStmt(a, b);
- break;
- case T_AlterDatabaseStmt:
- retval = _equalAlterDatabaseStmt(a, b);
- break;
- case T_AlterDatabaseRefreshCollStmt:
- retval = _equalAlterDatabaseRefreshCollStmt(a, b);
- break;
- case T_AlterDatabaseSetStmt:
- retval = _equalAlterDatabaseSetStmt(a, b);
- break;
- case T_DropdbStmt:
- retval = _equalDropdbStmt(a, b);
- break;
- case T_VacuumStmt:
- retval = _equalVacuumStmt(a, b);
- break;
- case T_VacuumRelation:
- retval = _equalVacuumRelation(a, b);
- break;
- case T_ExplainStmt:
- retval = _equalExplainStmt(a, b);
- break;
- case T_CreateTableAsStmt:
- retval = _equalCreateTableAsStmt(a, b);
- break;
- case T_RefreshMatViewStmt:
- retval = _equalRefreshMatViewStmt(a, b);
- break;
- case T_ReplicaIdentityStmt:
- retval = _equalReplicaIdentityStmt(a, b);
- break;
- case T_AlterSystemStmt:
- retval = _equalAlterSystemStmt(a, b);
- break;
- case T_CreateSeqStmt:
- retval = _equalCreateSeqStmt(a, b);
- break;
- case T_AlterSeqStmt:
- retval = _equalAlterSeqStmt(a, b);
- break;
- case T_VariableSetStmt:
- retval = _equalVariableSetStmt(a, b);
- break;
- case T_VariableShowStmt:
- retval = _equalVariableShowStmt(a, b);
- break;
- case T_DiscardStmt:
- retval = _equalDiscardStmt(a, b);
- break;
- case T_CreateTableSpaceStmt:
- retval = _equalCreateTableSpaceStmt(a, b);
- break;
- case T_DropTableSpaceStmt:
- retval = _equalDropTableSpaceStmt(a, b);
- break;
- case T_AlterTableSpaceOptionsStmt:
- retval = _equalAlterTableSpaceOptionsStmt(a, b);
- break;
- case T_AlterTableMoveAllStmt:
- retval = _equalAlterTableMoveAllStmt(a, b);
- break;
- case T_CreateExtensionStmt:
- retval = _equalCreateExtensionStmt(a, b);
- break;
- case T_AlterExtensionStmt:
- retval = _equalAlterExtensionStmt(a, b);
- break;
- case T_AlterExtensionContentsStmt:
- retval = _equalAlterExtensionContentsStmt(a, b);
- break;
- case T_CreateFdwStmt:
- retval = _equalCreateFdwStmt(a, b);
- break;
- case T_AlterFdwStmt:
- retval = _equalAlterFdwStmt(a, b);
- break;
- case T_CreateForeignServerStmt:
- retval = _equalCreateForeignServerStmt(a, b);
- break;
- case T_AlterForeignServerStmt:
- retval = _equalAlterForeignServerStmt(a, b);
- break;
- case T_CreateUserMappingStmt:
- retval = _equalCreateUserMappingStmt(a, b);
- break;
- case T_AlterUserMappingStmt:
- retval = _equalAlterUserMappingStmt(a, b);
- break;
- case T_DropUserMappingStmt:
- retval = _equalDropUserMappingStmt(a, b);
- break;
- case T_CreateForeignTableStmt:
- retval = _equalCreateForeignTableStmt(a, b);
- break;
- case T_ImportForeignSchemaStmt:
- retval = _equalImportForeignSchemaStmt(a, b);
- break;
- case T_CreateTransformStmt:
- retval = _equalCreateTransformStmt(a, b);
- break;
- case T_CreateAmStmt:
- retval = _equalCreateAmStmt(a, b);
- break;
- case T_CreateTrigStmt:
- retval = _equalCreateTrigStmt(a, b);
- break;
- case T_CreateEventTrigStmt:
- retval = _equalCreateEventTrigStmt(a, b);
- break;
- case T_AlterEventTrigStmt:
- retval = _equalAlterEventTrigStmt(a, b);
- break;
- case T_CreatePLangStmt:
- retval = _equalCreatePLangStmt(a, b);
- break;
- case T_CreateRoleStmt:
- retval = _equalCreateRoleStmt(a, b);
- break;
- case T_AlterRoleStmt:
- retval = _equalAlterRoleStmt(a, b);
- break;
- case T_AlterRoleSetStmt:
- retval = _equalAlterRoleSetStmt(a, b);
- break;
- case T_DropRoleStmt:
- retval = _equalDropRoleStmt(a, b);
- break;
- case T_LockStmt:
- retval = _equalLockStmt(a, b);
- break;
- case T_ConstraintsSetStmt:
- retval = _equalConstraintsSetStmt(a, b);
- break;
- case T_ReindexStmt:
- retval = _equalReindexStmt(a, b);
- break;
- case T_CheckPointStmt:
- retval = true;
- break;
- case T_CreateSchemaStmt:
- retval = _equalCreateSchemaStmt(a, b);
- break;
- case T_CreateConversionStmt:
- retval = _equalCreateConversionStmt(a, b);
- break;
- case T_CreateCastStmt:
- retval = _equalCreateCastStmt(a, b);
- break;
- case T_PrepareStmt:
- retval = _equalPrepareStmt(a, b);
- break;
- case T_ExecuteStmt:
- retval = _equalExecuteStmt(a, b);
- break;
- case T_DeallocateStmt:
- retval = _equalDeallocateStmt(a, b);
- break;
- case T_DropOwnedStmt:
- retval = _equalDropOwnedStmt(a, b);
- break;
- case T_ReassignOwnedStmt:
- retval = _equalReassignOwnedStmt(a, b);
- break;
- case T_AlterTSDictionaryStmt:
- retval = _equalAlterTSDictionaryStmt(a, b);
- break;
- case T_AlterTSConfigurationStmt:
- retval = _equalAlterTSConfigurationStmt(a, b);
- break;
- case T_CreatePolicyStmt:
- retval = _equalCreatePolicyStmt(a, b);
- break;
- case T_AlterPolicyStmt:
- retval = _equalAlterPolicyStmt(a, b);
- break;
- case T_CreatePublicationStmt:
- retval = _equalCreatePublicationStmt(a, b);
- break;
- case T_AlterPublicationStmt:
- retval = _equalAlterPublicationStmt(a, b);
- break;
- case T_CreateSubscriptionStmt:
- retval = _equalCreateSubscriptionStmt(a, b);
- break;
- case T_AlterSubscriptionStmt:
- retval = _equalAlterSubscriptionStmt(a, b);
- break;
- case T_DropSubscriptionStmt:
- retval = _equalDropSubscriptionStmt(a, b);
- break;
- case T_A_Expr:
- retval = _equalA_Expr(a, b);
- break;
- case T_ColumnRef:
- retval = _equalColumnRef(a, b);
- break;
- case T_ParamRef:
- retval = _equalParamRef(a, b);
- break;
- case T_A_Const:
- retval = _equalA_Const(a, b);
- break;
- case T_FuncCall:
- retval = _equalFuncCall(a, b);
- break;
- case T_A_Star:
- retval = _equalA_Star(a, b);
- break;
- case T_A_Indices:
- retval = _equalA_Indices(a, b);
- break;
- case T_A_Indirection:
- retval = _equalA_Indirection(a, b);
- break;
- case T_A_ArrayExpr:
- retval = _equalA_ArrayExpr(a, b);
- break;
- case T_ResTarget:
- retval = _equalResTarget(a, b);
- break;
- case T_MultiAssignRef:
- retval = _equalMultiAssignRef(a, b);
- break;
- case T_TypeCast:
- retval = _equalTypeCast(a, b);
- break;
- case T_CollateClause:
- retval = _equalCollateClause(a, b);
- break;
- case T_SortBy:
- retval = _equalSortBy(a, b);
- break;
- case T_WindowDef:
- retval = _equalWindowDef(a, b);
- break;
- case T_RangeSubselect:
- retval = _equalRangeSubselect(a, b);
- break;
- case T_RangeFunction:
- retval = _equalRangeFunction(a, b);
- break;
- case T_RangeTableSample:
- retval = _equalRangeTableSample(a, b);
- break;
- case T_RangeTableFunc:
- retval = _equalRangeTableFunc(a, b);
- break;
- case T_RangeTableFuncCol:
- retval = _equalRangeTableFuncCol(a, b);
- break;
- case T_TypeName:
- retval = _equalTypeName(a, b);
- break;
- case T_IndexElem:
- retval = _equalIndexElem(a, b);
- break;
- case T_StatsElem:
- retval = _equalStatsElem(a, b);
- break;
- case T_ColumnDef:
- retval = _equalColumnDef(a, b);
- break;
- case T_Constraint:
- retval = _equalConstraint(a, b);
- break;
- case T_DefElem:
- retval = _equalDefElem(a, b);
- break;
- case T_LockingClause:
- retval = _equalLockingClause(a, b);
- break;
- case T_RangeTblEntry:
- retval = _equalRangeTblEntry(a, b);
- break;
- case T_RangeTblFunction:
- retval = _equalRangeTblFunction(a, b);
- break;
- case T_TableSampleClause:
- retval = _equalTableSampleClause(a, b);
- break;
- case T_WithCheckOption:
- retval = _equalWithCheckOption(a, b);
- break;
- case T_SortGroupClause:
- retval = _equalSortGroupClause(a, b);
- break;
- case T_GroupingSet:
- retval = _equalGroupingSet(a, b);
- break;
- case T_WindowClause:
- retval = _equalWindowClause(a, b);
- break;
- case T_RowMarkClause:
- retval = _equalRowMarkClause(a, b);
- break;
- case T_WithClause:
- retval = _equalWithClause(a, b);
- break;
- case T_InferClause:
- retval = _equalInferClause(a, b);
- break;
- case T_OnConflictClause:
- retval = _equalOnConflictClause(a, b);
- break;
- case T_CTESearchClause:
- retval = _equalCTESearchClause(a, b);
- break;
- case T_CTECycleClause:
- retval = _equalCTECycleClause(a, b);
- break;
- case T_CommonTableExpr:
- retval = _equalCommonTableExpr(a, b);
- break;
- case T_MergeWhenClause:
- retval = _equalMergeWhenClause(a, b);
- break;
- case T_MergeAction:
- retval = _equalMergeAction(a, b);
- break;
- case T_ObjectWithArgs:
- retval = _equalObjectWithArgs(a, b);
- break;
- case T_AccessPriv:
- retval = _equalAccessPriv(a, b);
- break;
- case T_XmlSerialize:
- retval = _equalXmlSerialize(a, b);
- break;
- case T_RoleSpec:
- retval = _equalRoleSpec(a, b);
- break;
- case T_TriggerTransition:
- retval = _equalTriggerTransition(a, b);
- break;
- case T_PartitionElem:
- retval = _equalPartitionElem(a, b);
- break;
- case T_PartitionSpec:
- retval = _equalPartitionSpec(a, b);
- break;
- case T_PartitionBoundSpec:
- retval = _equalPartitionBoundSpec(a, b);
- break;
- case T_PartitionRangeDatum:
- retval = _equalPartitionRangeDatum(a, b);
- break;
- case T_PartitionCmd:
- retval = _equalPartitionCmd(a, b);
- break;
- case T_PublicationObjSpec:
- retval = _equalPublicationObject(a, b);
- break;
- case T_PublicationTable:
- retval = _equalPublicationTable(a, b);
- break;
- case T_JsonKeyValue:
- retval = _equalJsonKeyValue(a, b);
- break;
- case T_JsonObjectConstructor:
- retval = _equalJsonObjectConstructor(a, b);
- break;
- case T_JsonAggConstructor:
- retval = _equalJsonAggConstructor(a, b);
- break;
- case T_JsonObjectAgg:
- retval = _equalJsonObjectAgg(a, b);
- break;
- case T_JsonOutput:
- retval = _equalJsonOutput(a, b);
- break;
- case T_JsonArrayConstructor:
- retval = _equalJsonArrayConstructor(a, b);
- break;
- case T_JsonArrayQueryConstructor:
- retval = _equalJsonArrayQueryConstructor(a, b);
- break;
- case T_JsonArrayAgg:
- retval = _equalJsonArrayAgg(a, b);
- break;
- case T_JsonFuncExpr:
- retval = _equalJsonFuncExpr(a, b);
- break;
- case T_JsonCommon:
- retval = _equalJsonCommon(a, b);
- break;
- case T_JsonArgument:
- retval = _equalJsonArgument(a, b);
- break;
- case T_JsonTablePlan:
- retval = _equalJsonTablePlan(a, b);
- break;
- case T_JsonTable:
- retval = _equalJsonTable(a, b);
- break;
- case T_JsonTableColumn:
- retval = _equalJsonTableColumn(a, b);
- break;
-#endif /* OBSOLETE */
-
default:
elog(ERROR, "unrecognized node type: %d",
(int) nodeTag(a));
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index f26c129d59..9e70bbb4d6 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -307,840 +307,11 @@ outDatum(StringInfo str, Datum value, int typlen, bool typbyval)
#include "outfuncs.funcs.c"
-#ifdef OBSOLETE
-/*
- * Stuff from plannodes.h
- */
-
-static void
-_outPlannedStmt(StringInfo str, const PlannedStmt *node)
-{
- WRITE_NODE_TYPE("PLANNEDSTMT");
-
- WRITE_ENUM_FIELD(commandType, CmdType);
- WRITE_UINT64_FIELD(queryId);
- WRITE_BOOL_FIELD(hasReturning);
- WRITE_BOOL_FIELD(hasModifyingCTE);
- WRITE_BOOL_FIELD(canSetTag);
- WRITE_BOOL_FIELD(transientPlan);
- WRITE_BOOL_FIELD(dependsOnRole);
- WRITE_BOOL_FIELD(parallelModeNeeded);
- WRITE_INT_FIELD(jitFlags);
- WRITE_NODE_FIELD(planTree);
- WRITE_NODE_FIELD(rtable);
- WRITE_NODE_FIELD(resultRelations);
- WRITE_NODE_FIELD(appendRelations);
- WRITE_NODE_FIELD(subplans);
- WRITE_BITMAPSET_FIELD(rewindPlanIDs);
- WRITE_NODE_FIELD(rowMarks);
- WRITE_NODE_FIELD(relationOids);
- WRITE_NODE_FIELD(invalItems);
- WRITE_NODE_FIELD(paramExecTypes);
- WRITE_NODE_FIELD(utilityStmt);
- WRITE_LOCATION_FIELD(stmt_location);
- WRITE_INT_FIELD(stmt_len);
-}
-
-/*
- * print the basic stuff of all nodes that inherit from Plan
- */
-static void
-_outPlanInfo(StringInfo str, const Plan *node)
-{
- WRITE_FLOAT_FIELD(startup_cost, "%.2f");
- WRITE_FLOAT_FIELD(total_cost, "%.2f");
- WRITE_FLOAT_FIELD(plan_rows, "%.0f");
- WRITE_INT_FIELD(plan_width);
- WRITE_BOOL_FIELD(parallel_aware);
- WRITE_BOOL_FIELD(parallel_safe);
- WRITE_BOOL_FIELD(async_capable);
- WRITE_INT_FIELD(plan_node_id);
- WRITE_NODE_FIELD(targetlist);
- WRITE_NODE_FIELD(qual);
- WRITE_NODE_FIELD(lefttree);
- WRITE_NODE_FIELD(righttree);
- WRITE_NODE_FIELD(initPlan);
- WRITE_BITMAPSET_FIELD(extParam);
- WRITE_BITMAPSET_FIELD(allParam);
-}
-
-/*
- * print the basic stuff of all nodes that inherit from Scan
- */
-static void
-_outScanInfo(StringInfo str, const Scan *node)
-{
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_UINT_FIELD(scanrelid);
-}
/*
- * print the basic stuff of all nodes that inherit from Join
+ * Support functions for nodes with custom_read_write attribute or
+ * special_read_write attribute
*/
-static void
-_outJoinPlanInfo(StringInfo str, const Join *node)
-{
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_ENUM_FIELD(jointype, JoinType);
- WRITE_BOOL_FIELD(inner_unique);
- WRITE_NODE_FIELD(joinqual);
-}
-
-static void
-_outResult(StringInfo str, const Result *node)
-{
- WRITE_NODE_TYPE("RESULT");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_NODE_FIELD(resconstantqual);
-}
-
-static void
-_outProjectSet(StringInfo str, const ProjectSet *node)
-{
- WRITE_NODE_TYPE("PROJECTSET");
-
- _outPlanInfo(str, (const Plan *) node);
-}
-
-static void
-_outModifyTable(StringInfo str, const ModifyTable *node)
-{
- WRITE_NODE_TYPE("MODIFYTABLE");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_ENUM_FIELD(operation, CmdType);
- WRITE_BOOL_FIELD(canSetTag);
- WRITE_UINT_FIELD(nominalRelation);
- WRITE_UINT_FIELD(rootRelation);
- WRITE_BOOL_FIELD(partColsUpdated);
- WRITE_NODE_FIELD(resultRelations);
- WRITE_NODE_FIELD(updateColnosLists);
- WRITE_NODE_FIELD(withCheckOptionLists);
- WRITE_NODE_FIELD(returningLists);
- WRITE_NODE_FIELD(fdwPrivLists);
- WRITE_BITMAPSET_FIELD(fdwDirectModifyPlans);
- WRITE_NODE_FIELD(rowMarks);
- WRITE_INT_FIELD(epqParam);
- WRITE_ENUM_FIELD(onConflictAction, OnConflictAction);
- WRITE_NODE_FIELD(arbiterIndexes);
- WRITE_NODE_FIELD(onConflictSet);
- WRITE_NODE_FIELD(onConflictCols);
- WRITE_NODE_FIELD(onConflictWhere);
- WRITE_UINT_FIELD(exclRelRTI);
- WRITE_NODE_FIELD(exclRelTlist);
- WRITE_NODE_FIELD(mergeActionLists);
-}
-
-static void
-_outAppend(StringInfo str, const Append *node)
-{
- WRITE_NODE_TYPE("APPEND");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_BITMAPSET_FIELD(apprelids);
- WRITE_NODE_FIELD(appendplans);
- WRITE_INT_FIELD(nasyncplans);
- WRITE_INT_FIELD(first_partial_plan);
- WRITE_NODE_FIELD(part_prune_info);
-}
-
-static void
-_outMergeAppend(StringInfo str, const MergeAppend *node)
-{
- WRITE_NODE_TYPE("MERGEAPPEND");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_BITMAPSET_FIELD(apprelids);
- WRITE_NODE_FIELD(mergeplans);
- WRITE_INT_FIELD(numCols);
- WRITE_ATTRNUMBER_ARRAY(sortColIdx, node->numCols);
- WRITE_OID_ARRAY(sortOperators, node->numCols);
- WRITE_OID_ARRAY(collations, node->numCols);
- WRITE_BOOL_ARRAY(nullsFirst, node->numCols);
- WRITE_NODE_FIELD(part_prune_info);
-}
-
-static void
-_outRecursiveUnion(StringInfo str, const RecursiveUnion *node)
-{
- WRITE_NODE_TYPE("RECURSIVEUNION");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_INT_FIELD(wtParam);
- WRITE_INT_FIELD(numCols);
- WRITE_ATTRNUMBER_ARRAY(dupColIdx, node->numCols);
- WRITE_OID_ARRAY(dupOperators, node->numCols);
- WRITE_OID_ARRAY(dupCollations, node->numCols);
- WRITE_LONG_FIELD(numGroups);
-}
-
-static void
-_outBitmapAnd(StringInfo str, const BitmapAnd *node)
-{
- WRITE_NODE_TYPE("BITMAPAND");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_NODE_FIELD(bitmapplans);
-}
-
-static void
-_outBitmapOr(StringInfo str, const BitmapOr *node)
-{
- WRITE_NODE_TYPE("BITMAPOR");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_BOOL_FIELD(isshared);
- WRITE_NODE_FIELD(bitmapplans);
-}
-
-static void
-_outGather(StringInfo str, const Gather *node)
-{
- WRITE_NODE_TYPE("GATHER");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_INT_FIELD(num_workers);
- WRITE_INT_FIELD(rescan_param);
- WRITE_BOOL_FIELD(single_copy);
- WRITE_BOOL_FIELD(invisible);
- WRITE_BITMAPSET_FIELD(initParam);
-}
-
-static void
-_outGatherMerge(StringInfo str, const GatherMerge *node)
-{
- WRITE_NODE_TYPE("GATHERMERGE");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_INT_FIELD(num_workers);
- WRITE_INT_FIELD(rescan_param);
- WRITE_INT_FIELD(numCols);
- WRITE_ATTRNUMBER_ARRAY(sortColIdx, node->numCols);
- WRITE_OID_ARRAY(sortOperators, node->numCols);
- WRITE_OID_ARRAY(collations, node->numCols);
- WRITE_BOOL_ARRAY(nullsFirst, node->numCols);
- WRITE_BITMAPSET_FIELD(initParam);
-}
-
-static void
-_outScan(StringInfo str, const Scan *node)
-{
- WRITE_NODE_TYPE("SCAN");
-
- _outScanInfo(str, node);
-}
-
-static void
-_outSeqScan(StringInfo str, const SeqScan *node)
-{
- WRITE_NODE_TYPE("SEQSCAN");
-
- _outScanInfo(str, (const Scan *) node);
-}
-
-static void
-_outSampleScan(StringInfo str, const SampleScan *node)
-{
- WRITE_NODE_TYPE("SAMPLESCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_NODE_FIELD(tablesample);
-}
-
-static void
-_outIndexScan(StringInfo str, const IndexScan *node)
-{
- WRITE_NODE_TYPE("INDEXSCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_OID_FIELD(indexid);
- WRITE_NODE_FIELD(indexqual);
- WRITE_NODE_FIELD(indexqualorig);
- WRITE_NODE_FIELD(indexorderby);
- WRITE_NODE_FIELD(indexorderbyorig);
- WRITE_NODE_FIELD(indexorderbyops);
- WRITE_ENUM_FIELD(indexorderdir, ScanDirection);
-}
-
-static void
-_outIndexOnlyScan(StringInfo str, const IndexOnlyScan *node)
-{
- WRITE_NODE_TYPE("INDEXONLYSCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_OID_FIELD(indexid);
- WRITE_NODE_FIELD(indexqual);
- WRITE_NODE_FIELD(recheckqual);
- WRITE_NODE_FIELD(indexorderby);
- WRITE_NODE_FIELD(indextlist);
- WRITE_ENUM_FIELD(indexorderdir, ScanDirection);
-}
-
-static void
-_outBitmapIndexScan(StringInfo str, const BitmapIndexScan *node)
-{
- WRITE_NODE_TYPE("BITMAPINDEXSCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_OID_FIELD(indexid);
- WRITE_BOOL_FIELD(isshared);
- WRITE_NODE_FIELD(indexqual);
- WRITE_NODE_FIELD(indexqualorig);
-}
-
-static void
-_outBitmapHeapScan(StringInfo str, const BitmapHeapScan *node)
-{
- WRITE_NODE_TYPE("BITMAPHEAPSCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_NODE_FIELD(bitmapqualorig);
-}
-
-static void
-_outTidScan(StringInfo str, const TidScan *node)
-{
- WRITE_NODE_TYPE("TIDSCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_NODE_FIELD(tidquals);
-}
-
-static void
-_outTidRangeScan(StringInfo str, const TidRangeScan *node)
-{
- WRITE_NODE_TYPE("TIDRANGESCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_NODE_FIELD(tidrangequals);
-}
-
-static void
-_outSubqueryScan(StringInfo str, const SubqueryScan *node)
-{
- WRITE_NODE_TYPE("SUBQUERYSCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_NODE_FIELD(subplan);
- WRITE_ENUM_FIELD(scanstatus, SubqueryScanStatus);
-}
-
-static void
-_outFunctionScan(StringInfo str, const FunctionScan *node)
-{
- WRITE_NODE_TYPE("FUNCTIONSCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_NODE_FIELD(functions);
- WRITE_BOOL_FIELD(funcordinality);
-}
-
-static void
-_outTableFuncScan(StringInfo str, const TableFuncScan *node)
-{
- WRITE_NODE_TYPE("TABLEFUNCSCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_NODE_FIELD(tablefunc);
-}
-
-static void
-_outValuesScan(StringInfo str, const ValuesScan *node)
-{
- WRITE_NODE_TYPE("VALUESSCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_NODE_FIELD(values_lists);
-}
-
-static void
-_outCteScan(StringInfo str, const CteScan *node)
-{
- WRITE_NODE_TYPE("CTESCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_INT_FIELD(ctePlanId);
- WRITE_INT_FIELD(cteParam);
-}
-
-static void
-_outNamedTuplestoreScan(StringInfo str, const NamedTuplestoreScan *node)
-{
- WRITE_NODE_TYPE("NAMEDTUPLESTORESCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_STRING_FIELD(enrname);
-}
-
-static void
-_outWorkTableScan(StringInfo str, const WorkTableScan *node)
-{
- WRITE_NODE_TYPE("WORKTABLESCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_INT_FIELD(wtParam);
-}
-
-static void
-_outForeignScan(StringInfo str, const ForeignScan *node)
-{
- WRITE_NODE_TYPE("FOREIGNSCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_ENUM_FIELD(operation, CmdType);
- WRITE_UINT_FIELD(resultRelation);
- WRITE_OID_FIELD(fs_server);
- WRITE_NODE_FIELD(fdw_exprs);
- WRITE_NODE_FIELD(fdw_private);
- WRITE_NODE_FIELD(fdw_scan_tlist);
- WRITE_NODE_FIELD(fdw_recheck_quals);
- WRITE_BITMAPSET_FIELD(fs_relids);
- WRITE_BOOL_FIELD(fsSystemCol);
-}
-
-static void
-_outCustomScan(StringInfo str, const CustomScan *node)
-{
- WRITE_NODE_TYPE("CUSTOMSCAN");
-
- _outScanInfo(str, (const Scan *) node);
-
- WRITE_UINT_FIELD(flags);
- WRITE_NODE_FIELD(custom_plans);
- WRITE_NODE_FIELD(custom_exprs);
- WRITE_NODE_FIELD(custom_private);
- WRITE_NODE_FIELD(custom_scan_tlist);
- WRITE_BITMAPSET_FIELD(custom_relids);
- /* CustomName is a key to lookup CustomScanMethods */
- appendStringInfoString(str, " :methods ");
- outToken(str, node->methods->CustomName);
-}
-
-static void
-_outNestLoop(StringInfo str, const NestLoop *node)
-{
- WRITE_NODE_TYPE("NESTLOOP");
-
- _outJoinPlanInfo(str, (const Join *) node);
-
- WRITE_NODE_FIELD(nestParams);
-}
-
-static void
-_outMergeJoin(StringInfo str, const MergeJoin *node)
-{
- int numCols;
-
- WRITE_NODE_TYPE("MERGEJOIN");
-
- _outJoinPlanInfo(str, (const Join *) node);
-
- WRITE_BOOL_FIELD(skip_mark_restore);
- WRITE_NODE_FIELD(mergeclauses);
-
- numCols = list_length(node->mergeclauses);
-
- WRITE_OID_ARRAY(mergeFamilies, numCols);
- WRITE_OID_ARRAY(mergeCollations, numCols);
- WRITE_INT_ARRAY(mergeStrategies, numCols);
- WRITE_BOOL_ARRAY(mergeNullsFirst, numCols);
-}
-
-static void
-_outHashJoin(StringInfo str, const HashJoin *node)
-{
- WRITE_NODE_TYPE("HASHJOIN");
-
- _outJoinPlanInfo(str, (const Join *) node);
-
- WRITE_NODE_FIELD(hashclauses);
- WRITE_NODE_FIELD(hashoperators);
- WRITE_NODE_FIELD(hashcollations);
- WRITE_NODE_FIELD(hashkeys);
-}
-
-static void
-_outAgg(StringInfo str, const Agg *node)
-{
- WRITE_NODE_TYPE("AGG");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
- WRITE_ENUM_FIELD(aggsplit, AggSplit);
- WRITE_INT_FIELD(numCols);
- WRITE_ATTRNUMBER_ARRAY(grpColIdx, node->numCols);
- WRITE_OID_ARRAY(grpOperators, node->numCols);
- WRITE_OID_ARRAY(grpCollations, node->numCols);
- WRITE_LONG_FIELD(numGroups);
- WRITE_UINT64_FIELD(transitionSpace);
- WRITE_BITMAPSET_FIELD(aggParams);
- WRITE_NODE_FIELD(groupingSets);
- WRITE_NODE_FIELD(chain);
-}
-
-static void
-_outWindowAgg(StringInfo str, const WindowAgg *node)
-{
- WRITE_NODE_TYPE("WINDOWAGG");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_UINT_FIELD(winref);
- WRITE_INT_FIELD(partNumCols);
- WRITE_ATTRNUMBER_ARRAY(partColIdx, node->partNumCols);
- WRITE_OID_ARRAY(partOperators, node->partNumCols);
- WRITE_OID_ARRAY(partCollations, node->partNumCols);
- WRITE_INT_FIELD(ordNumCols);
- WRITE_ATTRNUMBER_ARRAY(ordColIdx, node->ordNumCols);
- WRITE_OID_ARRAY(ordOperators, node->ordNumCols);
- WRITE_OID_ARRAY(ordCollations, node->ordNumCols);
- WRITE_INT_FIELD(frameOptions);
- WRITE_NODE_FIELD(startOffset);
- WRITE_NODE_FIELD(endOffset);
- WRITE_NODE_FIELD(runCondition);
- WRITE_NODE_FIELD(runConditionOrig);
- WRITE_OID_FIELD(startInRangeFunc);
- WRITE_OID_FIELD(endInRangeFunc);
- WRITE_OID_FIELD(inRangeColl);
- WRITE_BOOL_FIELD(inRangeAsc);
- WRITE_BOOL_FIELD(inRangeNullsFirst);
- WRITE_BOOL_FIELD(topWindow);
-}
-
-static void
-_outGroup(StringInfo str, const Group *node)
-{
- WRITE_NODE_TYPE("GROUP");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_INT_FIELD(numCols);
- WRITE_ATTRNUMBER_ARRAY(grpColIdx, node->numCols);
- WRITE_OID_ARRAY(grpOperators, node->numCols);
- WRITE_OID_ARRAY(grpCollations, node->numCols);
-}
-
-static void
-_outMaterial(StringInfo str, const Material *node)
-{
- WRITE_NODE_TYPE("MATERIAL");
-
- _outPlanInfo(str, (const Plan *) node);
-}
-
-static void
-_outMemoize(StringInfo str, const Memoize *node)
-{
- WRITE_NODE_TYPE("MEMOIZE");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_INT_FIELD(numKeys);
- WRITE_OID_ARRAY(hashOperators, node->numKeys);
- WRITE_OID_ARRAY(collations, node->numKeys);
- WRITE_NODE_FIELD(param_exprs);
- WRITE_BOOL_FIELD(singlerow);
- WRITE_BOOL_FIELD(binary_mode);
- WRITE_UINT_FIELD(est_entries);
- WRITE_BITMAPSET_FIELD(keyparamids);
-}
-
-static void
-_outSortInfo(StringInfo str, const Sort *node)
-{
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_INT_FIELD(numCols);
- WRITE_ATTRNUMBER_ARRAY(sortColIdx, node->numCols);
- WRITE_OID_ARRAY(sortOperators, node->numCols);
- WRITE_OID_ARRAY(collations, node->numCols);
- WRITE_BOOL_ARRAY(nullsFirst, node->numCols);
-}
-
-static void
-_outSort(StringInfo str, const Sort *node)
-{
- WRITE_NODE_TYPE("SORT");
-
- _outSortInfo(str, node);
-}
-
-static void
-_outIncrementalSort(StringInfo str, const IncrementalSort *node)
-{
- WRITE_NODE_TYPE("INCREMENTALSORT");
-
- _outSortInfo(str, (const Sort *) node);
-
- WRITE_INT_FIELD(nPresortedCols);
-}
-
-static void
-_outUnique(StringInfo str, const Unique *node)
-{
- WRITE_NODE_TYPE("UNIQUE");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_INT_FIELD(numCols);
- WRITE_ATTRNUMBER_ARRAY(uniqColIdx, node->numCols);
- WRITE_OID_ARRAY(uniqOperators, node->numCols);
- WRITE_OID_ARRAY(uniqCollations, node->numCols);
-}
-
-static void
-_outHash(StringInfo str, const Hash *node)
-{
- WRITE_NODE_TYPE("HASH");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_NODE_FIELD(hashkeys);
- WRITE_OID_FIELD(skewTable);
- WRITE_INT_FIELD(skewColumn);
- WRITE_BOOL_FIELD(skewInherit);
- WRITE_FLOAT_FIELD(rows_total, "%.0f");
-}
-
-static void
-_outSetOp(StringInfo str, const SetOp *node)
-{
- WRITE_NODE_TYPE("SETOP");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_ENUM_FIELD(cmd, SetOpCmd);
- WRITE_ENUM_FIELD(strategy, SetOpStrategy);
- WRITE_INT_FIELD(numCols);
- WRITE_ATTRNUMBER_ARRAY(dupColIdx, node->numCols);
- WRITE_OID_ARRAY(dupOperators, node->numCols);
- WRITE_OID_ARRAY(dupCollations, node->numCols);
- WRITE_INT_FIELD(flagColIdx);
- WRITE_INT_FIELD(firstFlag);
- WRITE_LONG_FIELD(numGroups);
-}
-
-static void
-_outLockRows(StringInfo str, const LockRows *node)
-{
- WRITE_NODE_TYPE("LOCKROWS");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_NODE_FIELD(rowMarks);
- WRITE_INT_FIELD(epqParam);
-}
-
-static void
-_outLimit(StringInfo str, const Limit *node)
-{
- WRITE_NODE_TYPE("LIMIT");
-
- _outPlanInfo(str, (const Plan *) node);
-
- WRITE_NODE_FIELD(limitOffset);
- WRITE_NODE_FIELD(limitCount);
- WRITE_ENUM_FIELD(limitOption, LimitOption);
- WRITE_INT_FIELD(uniqNumCols);
- WRITE_ATTRNUMBER_ARRAY(uniqColIdx, node->uniqNumCols);
- WRITE_OID_ARRAY(uniqOperators, node->uniqNumCols);
- WRITE_OID_ARRAY(uniqCollations, node->uniqNumCols);
-}
-
-static void
-_outNestLoopParam(StringInfo str, const NestLoopParam *node)
-{
- WRITE_NODE_TYPE("NESTLOOPPARAM");
-
- WRITE_INT_FIELD(paramno);
- WRITE_NODE_FIELD(paramval);
-}
-
-static void
-_outPlanRowMark(StringInfo str, const PlanRowMark *node)
-{
- WRITE_NODE_TYPE("PLANROWMARK");
-
- WRITE_UINT_FIELD(rti);
- WRITE_UINT_FIELD(prti);
- WRITE_UINT_FIELD(rowmarkId);
- WRITE_ENUM_FIELD(markType, RowMarkType);
- WRITE_INT_FIELD(allMarkTypes);
- WRITE_ENUM_FIELD(strength, LockClauseStrength);
- WRITE_ENUM_FIELD(waitPolicy, LockWaitPolicy);
- WRITE_BOOL_FIELD(isParent);
-}
-
-static void
-_outPartitionPruneInfo(StringInfo str, const PartitionPruneInfo *node)
-{
- WRITE_NODE_TYPE("PARTITIONPRUNEINFO");
-
- WRITE_NODE_FIELD(prune_infos);
- WRITE_BITMAPSET_FIELD(other_subplans);
-}
-
-static void
-_outPartitionedRelPruneInfo(StringInfo str, const PartitionedRelPruneInfo *node)
-{
- WRITE_NODE_TYPE("PARTITIONEDRELPRUNEINFO");
-
- WRITE_UINT_FIELD(rtindex);
- WRITE_BITMAPSET_FIELD(present_parts);
- WRITE_INT_FIELD(nparts);
- WRITE_INT_ARRAY(subplan_map, node->nparts);
- WRITE_INT_ARRAY(subpart_map, node->nparts);
- WRITE_OID_ARRAY(relid_map, node->nparts);
- WRITE_NODE_FIELD(initial_pruning_steps);
- WRITE_NODE_FIELD(exec_pruning_steps);
- WRITE_BITMAPSET_FIELD(execparamids);
-}
-
-static void
-_outPartitionPruneStepOp(StringInfo str, const PartitionPruneStepOp *node)
-{
- WRITE_NODE_TYPE("PARTITIONPRUNESTEPOP");
-
- WRITE_INT_FIELD(step.step_id);
- WRITE_INT_FIELD(opstrategy);
- WRITE_NODE_FIELD(exprs);
- WRITE_NODE_FIELD(cmpfns);
- WRITE_BITMAPSET_FIELD(nullkeys);
-}
-
-static void
-_outPartitionPruneStepCombine(StringInfo str, const PartitionPruneStepCombine *node)
-{
- WRITE_NODE_TYPE("PARTITIONPRUNESTEPCOMBINE");
-
- WRITE_INT_FIELD(step.step_id);
- WRITE_ENUM_FIELD(combineOp, PartitionPruneCombineOp);
- WRITE_NODE_FIELD(source_stepids);
-}
-
-static void
-_outPlanInvalItem(StringInfo str, const PlanInvalItem *node)
-{
- WRITE_NODE_TYPE("PLANINVALITEM");
-
- WRITE_INT_FIELD(cacheId);
- WRITE_UINT_FIELD(hashValue);
-}
-
-/*****************************************************************************
- *
- * Stuff from primnodes.h.
- *
- *************************