]> granicus.if.org Git - postgresql/blobdiff - src/backend/nodes/copyfuncs.c
Fix the plan-invalidation mechanism to treat regclass constants that refer to
[postgresql] / src / backend / nodes / copyfuncs.c
index 2b8f3af09b96a229a0b20b5ea062b17358bd2b04..c6393effcd649006f5c3519b58059b08a6767736 100644 (file)
  * be handled easily in a simple depth-first traversal.
  *
  *
- * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.347 2006/08/12 02:52:04 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.383 2007/10/11 18:05:26 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
  * ****************************************************************
  */
 
+/*
+ * _copyPlannedStmt
+ */
+static PlannedStmt *
+_copyPlannedStmt(PlannedStmt *from)
+{
+       PlannedStmt        *newnode = makeNode(PlannedStmt);
+
+       COPY_SCALAR_FIELD(commandType);
+       COPY_SCALAR_FIELD(canSetTag);
+       COPY_NODE_FIELD(planTree);
+       COPY_NODE_FIELD(rtable);
+       COPY_NODE_FIELD(resultRelations);
+       COPY_NODE_FIELD(utilityStmt);
+       COPY_NODE_FIELD(intoClause);
+       COPY_NODE_FIELD(subplans);
+       COPY_BITMAPSET_FIELD(rewindPlanIDs);
+       COPY_NODE_FIELD(returningLists);
+       COPY_NODE_FIELD(rowMarks);
+       COPY_NODE_FIELD(relationOids);
+       COPY_SCALAR_FIELD(nParamExec);
+
+       return newnode;
+}
+
 /*
  * CopyPlanFields
  *
@@ -84,7 +109,6 @@ CopyPlanFields(Plan *from, Plan *newnode)
        COPY_NODE_FIELD(initPlan);
        COPY_BITMAPSET_FIELD(extParam);
        COPY_BITMAPSET_FIELD(allParam);
-       COPY_SCALAR_FIELD(nParamExec);
 }
 
 /*
@@ -346,6 +370,7 @@ _copySubqueryScan(SubqueryScan *from)
         * copy remainder of node
         */
        COPY_NODE_FIELD(subplan);
+       COPY_NODE_FIELD(subrtable);
 
        return newnode;
 }
@@ -363,6 +388,14 @@ _copyFunctionScan(FunctionScan *from)
         */
        CopyScanFields((Scan *) from, (Scan *) newnode);
 
+       /*
+        * copy remainder of node
+        */
+       COPY_NODE_FIELD(funcexpr);
+       COPY_NODE_FIELD(funccolnames);
+       COPY_NODE_FIELD(funccoltypes);
+       COPY_NODE_FIELD(funccoltypmods);
+
        return newnode;
 }
 
@@ -379,6 +412,11 @@ _copyValuesScan(ValuesScan *from)
         */
        CopyScanFields((Scan *) from, (Scan *) newnode);
 
+       /*
+        * copy remainder of node
+        */
+       COPY_NODE_FIELD(values_lists);
+
        return newnode;
 }
 
@@ -439,6 +477,7 @@ static MergeJoin *
 _copyMergeJoin(MergeJoin *from)
 {
        MergeJoin  *newnode = makeNode(MergeJoin);
+       int                     numCols;
 
        /*
         * copy node superclass fields
@@ -449,6 +488,10 @@ _copyMergeJoin(MergeJoin *from)
         * copy remainder of node
         */
        COPY_NODE_FIELD(mergeclauses);
+       numCols = list_length(from->mergeclauses);
+       COPY_POINTER_FIELD(mergeFamilies, numCols * sizeof(Oid));
+       COPY_POINTER_FIELD(mergeStrategies, numCols * sizeof(int));
+       COPY_POINTER_FIELD(mergeNullsFirst, numCols * sizeof(bool));
 
        return newnode;
 }
@@ -508,6 +551,7 @@ _copySort(Sort *from)
        COPY_SCALAR_FIELD(numCols);
        COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber));
        COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid));
+       COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool));
 
        return newnode;
 }
@@ -525,6 +569,7 @@ _copyGroup(Group *from)
 
        COPY_SCALAR_FIELD(numCols);
        COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+       COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
 
        return newnode;
 }
@@ -542,7 +587,10 @@ _copyAgg(Agg *from)
        COPY_SCALAR_FIELD(aggstrategy);
        COPY_SCALAR_FIELD(numCols);
        if (from->numCols > 0)
+       {
                COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber));
+               COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid));
+       }
        COPY_SCALAR_FIELD(numGroups);
 
        return newnode;
@@ -566,6 +614,7 @@ _copyUnique(Unique *from)
         */
        COPY_SCALAR_FIELD(numCols);
        COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber));
+       COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid));
 
        return newnode;
 }
@@ -609,6 +658,7 @@ _copySetOp(SetOp *from)
        COPY_SCALAR_FIELD(cmd);
        COPY_SCALAR_FIELD(numCols);
        COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber));
+       COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid));
        COPY_SCALAR_FIELD(flagColIdx);
 
        return newnode;
@@ -673,6 +723,23 @@ _copyRangeVar(RangeVar *from)
        return newnode;
 }
 
+/*
+ * _copyIntoClause
+ */
+static IntoClause *
+_copyIntoClause(IntoClause *from)
+{
+       IntoClause   *newnode = makeNode(IntoClause);
+
+       COPY_NODE_FIELD(rel);
+       COPY_NODE_FIELD(colNames);
+       COPY_NODE_FIELD(options);
+       COPY_SCALAR_FIELD(onCommit);
+       COPY_STRING_FIELD(tableSpaceName);
+
+       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
@@ -708,6 +775,7 @@ _copyConst(Const *from)
        Const      *newnode = makeNode(Const);
 
        COPY_SCALAR_FIELD(consttype);
+       COPY_SCALAR_FIELD(consttypmod);
        COPY_SCALAR_FIELD(constlen);
 
        if (from->constbyval || from->constisnull)
@@ -745,6 +813,7 @@ _copyParam(Param *from)
        COPY_SCALAR_FIELD(paramkind);
        COPY_SCALAR_FIELD(paramid);
        COPY_SCALAR_FIELD(paramtype);
+       COPY_SCALAR_FIELD(paramtypmod);
 
        return newnode;
 }
@@ -775,9 +844,9 @@ _copyArrayRef(ArrayRef *from)
 {
        ArrayRef   *newnode = makeNode(ArrayRef);
 
-       COPY_SCALAR_FIELD(refrestype);
        COPY_SCALAR_FIELD(refarraytype);
        COPY_SCALAR_FIELD(refelemtype);
+       COPY_SCALAR_FIELD(reftypmod);
        COPY_NODE_FIELD(refupperindexpr);
        COPY_NODE_FIELD(reflowerindexpr);
        COPY_NODE_FIELD(refexpr);
@@ -894,9 +963,8 @@ _copySubPlan(SubPlan *from)
        COPY_SCALAR_FIELD(subLinkType);
        COPY_NODE_FIELD(testexpr);
        COPY_NODE_FIELD(paramIds);
-       COPY_NODE_FIELD(plan);
        COPY_SCALAR_FIELD(plan_id);
-       COPY_NODE_FIELD(rtable);
+       COPY_SCALAR_FIELD(firstColType);
        COPY_SCALAR_FIELD(useHashTable);
        COPY_SCALAR_FIELD(unknownEqFalse);
        COPY_NODE_FIELD(setParam);
@@ -954,6 +1022,39 @@ _copyRelabelType(RelabelType *from)
        return newnode;
 }
 
+/*
+ * _copyCoerceViaIO
+ */
+static CoerceViaIO *
+_copyCoerceViaIO(CoerceViaIO *from)
+{
+       CoerceViaIO   *newnode = makeNode(CoerceViaIO);
+
+       COPY_NODE_FIELD(arg);
+       COPY_SCALAR_FIELD(resulttype);
+       COPY_SCALAR_FIELD(coerceformat);
+
+       return newnode;
+}
+
+/*
+ * _copyArrayCoerceExpr
+ */
+static ArrayCoerceExpr *
+_copyArrayCoerceExpr(ArrayCoerceExpr *from)
+{
+       ArrayCoerceExpr   *newnode = makeNode(ArrayCoerceExpr);
+
+       COPY_NODE_FIELD(arg);
+       COPY_SCALAR_FIELD(elemfuncid);
+       COPY_SCALAR_FIELD(resulttype);
+       COPY_SCALAR_FIELD(resulttypmod);
+       COPY_SCALAR_FIELD(isExplicit);
+       COPY_SCALAR_FIELD(coerceformat);
+
+       return newnode;
+}
+
 /*
  * _copyConvertRowtypeExpr
  */
@@ -1050,11 +1151,11 @@ _copyRowExpr(RowExpr *from)
 static RowCompareExpr *
 _copyRowCompareExpr(RowCompareExpr *from)
 {
-       RowCompareExpr    *newnode = makeNode(RowCompareExpr);
+       RowCompareExpr *newnode = makeNode(RowCompareExpr);
 
        COPY_SCALAR_FIELD(rctype);
        COPY_NODE_FIELD(opnos);
-       COPY_NODE_FIELD(opclasses);
+       COPY_NODE_FIELD(opfamilies);
        COPY_NODE_FIELD(largs);
        COPY_NODE_FIELD(rargs);
 
@@ -1090,6 +1191,26 @@ _copyMinMaxExpr(MinMaxExpr *from)
        return newnode;
 }
 
+/*
+ * _copyXmlExpr
+ */
+static XmlExpr *
+_copyXmlExpr(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);
+
+       return newnode;
+}
+
 /*
  * _copyNullIfExpr (same as OpExpr)
  */
@@ -1179,6 +1300,21 @@ _copySetToDefault(SetToDefault *from)
        return newnode;
 }
 
+/*
+ * _copyCurrentOfExpr
+ */
+static CurrentOfExpr *
+_copyCurrentOfExpr(CurrentOfExpr *from)
+{
+       CurrentOfExpr *newnode = makeNode(CurrentOfExpr);
+
+       COPY_SCALAR_FIELD(cvarno);
+       COPY_STRING_FIELD(cursor_name);
+       COPY_SCALAR_FIELD(cursor_param);
+
+       return newnode;
+}
+
 /*
  * _copyTargetEntry
  */
@@ -1254,15 +1390,18 @@ _copyFromExpr(FromExpr *from)
  */
 
 /*
- * _copyPathKeyItem
+ * _copyPathKey
  */
-static PathKeyItem *
-_copyPathKeyItem(PathKeyItem *from)
+static PathKey *
+_copyPathKey(PathKey *from)
 {
-       PathKeyItem *newnode = makeNode(PathKeyItem);
+       PathKey *newnode = makeNode(PathKey);
 
-       COPY_NODE_FIELD(key);
-       COPY_SCALAR_FIELD(sortop);
+       /* 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;
 }
@@ -1285,20 +1424,19 @@ _copyRestrictInfo(RestrictInfo *from)
        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(this_selec);
-       COPY_SCALAR_FIELD(mergejoinoperator);
-       COPY_SCALAR_FIELD(left_sortop);
-       COPY_SCALAR_FIELD(right_sortop);
-
-       /*
-        * Do not copy pathkeys, since they'd not be canonical in a copied query
-        */
-       newnode->left_pathkey = NIL;
-       newnode->right_pathkey = NIL;
-
-       COPY_SCALAR_FIELD(left_mergescansel);
-       COPY_SCALAR_FIELD(right_mergescansel);
+       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);
@@ -1316,8 +1454,11 @@ _copyOuterJoinInfo(OuterJoinInfo *from)
 
        COPY_BITMAPSET_FIELD(min_lefthand);
        COPY_BITMAPSET_FIELD(min_righthand);
+       COPY_BITMAPSET_FIELD(syn_lefthand);
+       COPY_BITMAPSET_FIELD(syn_righthand);
        COPY_SCALAR_FIELD(is_full_join);
        COPY_SCALAR_FIELD(lhs_strict);
+       COPY_SCALAR_FIELD(delay_upper_joins);
 
        return newnode;
 }
@@ -1333,6 +1474,7 @@ _copyInClauseInfo(InClauseInfo *from)
        COPY_BITMAPSET_FIELD(lefthand);
        COPY_BITMAPSET_FIELD(righthand);
        COPY_NODE_FIELD(sub_targetlist);
+       COPY_NODE_FIELD(in_operators);
 
        return newnode;
 }
@@ -1411,6 +1553,7 @@ _copySortClause(SortClause *from)
 
        COPY_SCALAR_FIELD(tleSortGroupRef);
        COPY_SCALAR_FIELD(sortop);
+       COPY_SCALAR_FIELD(nulls_first);
 
        return newnode;
 }
@@ -1422,6 +1565,7 @@ _copyGroupClause(GroupClause *from)
 
        COPY_SCALAR_FIELD(tleSortGroupRef);
        COPY_SCALAR_FIELD(sortop);
+       COPY_SCALAR_FIELD(nulls_first);
 
        return newnode;
 }
@@ -1563,7 +1707,8 @@ _copyTypeName(TypeName *from)
        COPY_SCALAR_FIELD(timezone);
        COPY_SCALAR_FIELD(setof);
        COPY_SCALAR_FIELD(pct_type);
-       COPY_SCALAR_FIELD(typmod);
+       COPY_NODE_FIELD(typmods);
+       COPY_SCALAR_FIELD(typemod);
        COPY_NODE_FIELD(arrayBounds);
        COPY_SCALAR_FIELD(location);
 
@@ -1575,7 +1720,8 @@ _copySortBy(SortBy *from)
 {
        SortBy     *newnode = makeNode(SortBy);
 
-       COPY_SCALAR_FIELD(sortby_kind);
+       COPY_SCALAR_FIELD(sortby_dir);
+       COPY_SCALAR_FIELD(sortby_nulls);
        COPY_NODE_FIELD(useOp);
        COPY_NODE_FIELD(node);
 
@@ -1624,6 +1770,8 @@ _copyIndexElem(IndexElem *from)
        COPY_STRING_FIELD(name);
        COPY_NODE_FIELD(expr);
        COPY_NODE_FIELD(opclass);
+       COPY_SCALAR_FIELD(ordering);
+       COPY_SCALAR_FIELD(nulls_ordering);
 
        return newnode;
 }
@@ -1641,7 +1789,6 @@ _copyColumnDef(ColumnDef *from)
        COPY_NODE_FIELD(raw_default);
        COPY_STRING_FIELD(cooked_default);
        COPY_NODE_FIELD(constraints);
-       COPY_NODE_FIELD(support);
 
        return newnode;
 }
@@ -1685,6 +1832,18 @@ _copyLockingClause(LockingClause *from)
        return newnode;
 }
 
+static XmlSerialize *
+_copyXmlSerialize(XmlSerialize *from)
+{
+       XmlSerialize *newnode = makeNode(XmlSerialize);
+
+       COPY_SCALAR_FIELD(xmloption);
+       COPY_NODE_FIELD(expr);
+       COPY_NODE_FIELD(typename);
+
+       return newnode;
+}
+
 static Query *
 _copyQuery(Query *from)
 {
@@ -1695,10 +1854,7 @@ _copyQuery(Query *from)
        COPY_SCALAR_FIELD(canSetTag);
        COPY_NODE_FIELD(utilityStmt);
        COPY_SCALAR_FIELD(resultRelation);
-       COPY_NODE_FIELD(into);
-       COPY_NODE_FIELD(intoOptions);
-       COPY_SCALAR_FIELD(intoOnCommit);
-       COPY_STRING_FIELD(intoTableSpaceName);
+       COPY_NODE_FIELD(intoClause);
        COPY_SCALAR_FIELD(hasAggs);
        COPY_SCALAR_FIELD(hasSubLinks);
        COPY_NODE_FIELD(rtable);
@@ -1713,8 +1869,6 @@ _copyQuery(Query *from)
        COPY_NODE_FIELD(limitCount);
        COPY_NODE_FIELD(rowMarks);
        COPY_NODE_FIELD(setOperations);
-       COPY_NODE_FIELD(resultRelations);
-       COPY_NODE_FIELD(returningLists);
 
        return newnode;
 }
@@ -1765,11 +1919,7 @@ _copySelectStmt(SelectStmt *from)
        SelectStmt *newnode = makeNode(SelectStmt);
 
        COPY_NODE_FIELD(distinctClause);
-       COPY_NODE_FIELD(into);
-       COPY_NODE_FIELD(intoColNames);
-       COPY_NODE_FIELD(intoOptions);
-       COPY_SCALAR_FIELD(intoOnCommit);
-       COPY_STRING_FIELD(intoTableSpaceName);
+       COPY_NODE_FIELD(intoClause);
        COPY_NODE_FIELD(targetList);
        COPY_NODE_FIELD(fromClause);
        COPY_NODE_FIELD(whereClause);
@@ -1822,7 +1972,6 @@ _copyAlterTableCmd(AlterTableCmd *from)
 
        COPY_SCALAR_FIELD(subtype);
        COPY_STRING_FIELD(name);
-       COPY_NODE_FIELD(parent);
        COPY_NODE_FIELD(def);
        COPY_NODE_FIELD(transform);
        COPY_SCALAR_FIELD(behavior);
@@ -1935,6 +2084,7 @@ _copyCopyStmt(CopyStmt *from)
        CopyStmt   *newnode = makeNode(CopyStmt);
 
        COPY_NODE_FIELD(relation);
+       COPY_NODE_FIELD(query);
        COPY_NODE_FIELD(attlist);
        COPY_SCALAR_FIELD(is_from);
        COPY_STRING_FIELD(filename);
@@ -2045,11 +2195,12 @@ _copyIndexStmt(IndexStmt *from)
        COPY_STRING_FIELD(tableSpace);
        COPY_NODE_FIELD(indexParams);
        COPY_NODE_FIELD(options);
+       COPY_STRING_FIELD(src_options);
        COPY_NODE_FIELD(whereClause);
-       COPY_NODE_FIELD(rangetable);
        COPY_SCALAR_FIELD(unique);
        COPY_SCALAR_FIELD(primary);
        COPY_SCALAR_FIELD(isconstraint);
+       COPY_SCALAR_FIELD(concurrent);
 
        return newnode;
 }
@@ -2119,6 +2270,19 @@ _copyRemoveOpClassStmt(RemoveOpClassStmt *from)
        return newnode;
 }
 
+static RemoveOpFamilyStmt *
+_copyRemoveOpFamilyStmt(RemoveOpFamilyStmt *from)
+{
+       RemoveOpFamilyStmt *newnode = makeNode(RemoveOpFamilyStmt);
+
+       COPY_NODE_FIELD(opfamilyname);
+       COPY_STRING_FIELD(amname);
+       COPY_SCALAR_FIELD(behavior);
+       COPY_SCALAR_FIELD(missing_ok);
+
+       return newnode;
+}
+
 static RenameStmt *
 _copyRenameStmt(RenameStmt *from)
 {
@@ -2233,6 +2397,17 @@ _copyCompositeTypeStmt(CompositeTypeStmt *from)
        return newnode;
 }
 
+static CreateEnumStmt *
+_copyCreateEnumStmt(CreateEnumStmt *from)
+{
+       CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
+
+       COPY_NODE_FIELD(typename);
+       COPY_NODE_FIELD(vals);
+
+       return newnode;
+}
+
 static ViewStmt *
 _copyViewStmt(ViewStmt *from)
 {
@@ -2274,6 +2449,7 @@ _copyCreateOpClassStmt(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);
@@ -2292,11 +2468,36 @@ _copyCreateOpClassItem(CreateOpClassItem *from)
        COPY_NODE_FIELD(args);
        COPY_SCALAR_FIELD(number);
        COPY_SCALAR_FIELD(recheck);
+       COPY_NODE_FIELD(class_args);
        COPY_NODE_FIELD(storedtype);
 
        return newnode;
 }
 
+static CreateOpFamilyStmt *
+_copyCreateOpFamilyStmt(CreateOpFamilyStmt *from)
+{
+       CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
+
+       COPY_NODE_FIELD(opfamilyname);
+       COPY_STRING_FIELD(amname);
+
+       return newnode;
+}
+
+static AlterOpFamilyStmt *
+_copyAlterOpFamilyStmt(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(CreatedbStmt *from)
 {
@@ -2325,8 +2526,7 @@ _copyAlterDatabaseSetStmt(AlterDatabaseSetStmt *from)
        AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt);
 
        COPY_STRING_FIELD(dbname);
-       COPY_STRING_FIELD(variable);
-       COPY_NODE_FIELD(value);
+       COPY_NODE_FIELD(setstmt);
 
        return newnode;
 }
@@ -2350,8 +2550,8 @@ _copyVacuumStmt(VacuumStmt *from)
        COPY_SCALAR_FIELD(vacuum);
        COPY_SCALAR_FIELD(full);
        COPY_SCALAR_FIELD(analyze);
-       COPY_SCALAR_FIELD(freeze);
        COPY_SCALAR_FIELD(verbose);
+       COPY_SCALAR_FIELD(freeze_min_age);
        COPY_NODE_FIELD(relation);
        COPY_NODE_FIELD(va_cols);
 
@@ -2397,6 +2597,7 @@ _copyVariableSetStmt(VariableSetStmt *from)
 {
        VariableSetStmt *newnode = makeNode(VariableSetStmt);
 
+       COPY_SCALAR_FIELD(kind);
        COPY_STRING_FIELD(name);
        COPY_NODE_FIELD(args);
        COPY_SCALAR_FIELD(is_local);
@@ -2414,12 +2615,12 @@ _copyVariableShowStmt(VariableShowStmt *from)
        return newnode;
 }
 
-static VariableResetStmt *
-_copyVariableResetStmt(VariableResetStmt *from)
+static DiscardStmt *
+_copyDiscardStmt(DiscardStmt *from)
 {
-       VariableResetStmt *newnode = makeNode(VariableResetStmt);
+       DiscardStmt *newnode = makeNode(DiscardStmt);
 
-       COPY_STRING_FIELD(name);
+       COPY_SCALAR_FIELD(target);
 
        return newnode;
 }
@@ -2536,8 +2737,7 @@ _copyAlterRoleSetStmt(AlterRoleSetStmt *from)
        AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt);
 
        COPY_STRING_FIELD(role);
-       COPY_STRING_FIELD(variable);
-       COPY_NODE_FIELD(value);
+       COPY_NODE_FIELD(setstmt);
 
        return newnode;
 }
@@ -2649,7 +2849,6 @@ _copyPrepareStmt(PrepareStmt *from)
 
        COPY_STRING_FIELD(name);
        COPY_NODE_FIELD(argtypes);
-       COPY_NODE_FIELD(argtype_oids);
        COPY_NODE_FIELD(query);
 
        return newnode;
@@ -2662,9 +2861,6 @@ _copyExecuteStmt(ExecuteStmt *from)
 
        COPY_STRING_FIELD(name);
        COPY_NODE_FIELD(into);
-       COPY_NODE_FIELD(intoOptions);
-       COPY_SCALAR_FIELD(into_on_commit);
-       COPY_STRING_FIELD(into_tbl_space);
        COPY_NODE_FIELD(params);
 
        return newnode;
@@ -2681,7 +2877,7 @@ _copyDeallocateStmt(DeallocateStmt *from)
 }
 
 static DropOwnedStmt *
-_copyDropOwnedStmt(DropOwnedStmt * from)
+_copyDropOwnedStmt(DropOwnedStmt *from)
 {
        DropOwnedStmt *newnode = makeNode(DropOwnedStmt);
 
@@ -2692,7 +2888,7 @@ _copyDropOwnedStmt(DropOwnedStmt * from)
 }
 
 static ReassignOwnedStmt *
-_copyReassignOwnedStmt(ReassignOwnedStmt * from)
+_copyReassignOwnedStmt(ReassignOwnedStmt *from)
 {
        ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt);
 
@@ -2796,6 +2992,9 @@ copyObject(void *from)
                        /*
                         * PLAN NODES
                         */
+               case T_PlannedStmt:
+                       retval = _copyPlannedStmt(from);
+                       break;
                case T_Plan:
                        retval = _copyPlan(from);
                        break;
@@ -2884,6 +3083,9 @@ copyObject(void *from)
                case T_RangeVar:
                        retval = _copyRangeVar(from);
                        break;
+               case T_IntoClause:
+                       retval = _copyIntoClause(from);
+                       break;
                case T_Var:
                        retval = _copyVar(from);
                        break;
@@ -2929,6 +3131,12 @@ copyObject(void *from)
                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;
@@ -2956,6 +3164,9 @@ copyObject(void *from)
                case T_MinMaxExpr:
                        retval = _copyMinMaxExpr(from);
                        break;
+               case T_XmlExpr:
+                       retval = _copyXmlExpr(from);
+                       break;
                case T_NullIfExpr:
                        retval = _copyNullIfExpr(from);
                        break;
@@ -2974,6 +3185,9 @@ copyObject(void *from)
                case T_SetToDefault:
                        retval = _copySetToDefault(from);
                        break;
+               case T_CurrentOfExpr:
+                       retval = _copyCurrentOfExpr(from);
+                       break;
                case T_TargetEntry:
                        retval = _copyTargetEntry(from);
                        break;
@@ -2990,8 +3204,8 @@ copyObject(void *from)
                        /*
                         * RELATION NODES
                         */
-               case T_PathKeyItem:
-                       retval = _copyPathKeyItem(from);
+               case T_PathKey:
+                       retval = _copyPathKey(from);
                        break;
                case T_RestrictInfo:
                        retval = _copyRestrictInfo(from);
@@ -3120,6 +3334,9 @@ copyObject(void *from)
                case T_RemoveOpClassStmt:
                        retval = _copyRemoveOpClassStmt(from);
                        break;
+               case T_RemoveOpFamilyStmt:
+                       retval = _copyRemoveOpFamilyStmt(from);
+                       break;
                case T_RenameStmt:
                        retval = _copyRenameStmt(from);
                        break;
@@ -3147,6 +3364,9 @@ copyObject(void *from)
                case T_CompositeTypeStmt:
                        retval = _copyCompositeTypeStmt(from);
                        break;
+               case T_CreateEnumStmt:
+                       retval = _copyCreateEnumStmt(from);
+                       break;
                case T_ViewStmt:
                        retval = _copyViewStmt(from);
                        break;
@@ -3162,6 +3382,12 @@ copyObject(void *from)
                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;
@@ -3192,8 +3418,8 @@ copyObject(void *from)
                case T_VariableShowStmt:
                        retval = _copyVariableShowStmt(from);
                        break;
-               case T_VariableResetStmt:
-                       retval = _copyVariableResetStmt(from);
+               case T_DiscardStmt:
+                       retval = _copyDiscardStmt(from);
                        break;
                case T_CreateTableSpaceStmt:
                        retval = _copyCreateTableSpaceStmt(from);
@@ -3340,6 +3566,9 @@ copyObject(void *from)
                case T_FuncWithArgs:
                        retval = _copyFuncWithArgs(from);
                        break;
+               case T_XmlSerialize:
+                       retval = _copyXmlSerialize(from);
+                       break;
 
                default:
                        elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from));