1 /*-------------------------------------------------------------------------
4 * Equality functions to compare node trees.
6 * NOTE: we currently support comparing all node types found in parse
7 * trees. We do not support comparing executor state trees; there
8 * is no need for that, and no point in maintaining all the code that
9 * would be needed. We also do not support comparing Path trees, mainly
10 * because the circular linkages between RelOptInfo and Path nodes can't
11 * be handled easily in a simple depth-first traversal.
13 * Currently, in fact, equal() doesn't know how to compare Plan trees
14 * either. This might need to be fixed someday.
17 * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
18 * Portions Copyright (c) 1994, Regents of the University of California
21 * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.203 2003/07/22 23:30:37 tgl Exp $
23 *-------------------------------------------------------------------------
28 #include "nodes/params.h"
29 #include "nodes/parsenodes.h"
30 #include "nodes/relation.h"
31 #include "utils/datum.h"
35 * Macros to simplify comparison of different kinds of fields. Use these
36 * wherever possible to reduce the chance for silly typos. Note that these
37 * hard-wire the convention that the local variables in an Equal routine are
41 /* Compare a simple scalar field (int, float, bool, enum, etc) */
42 #define COMPARE_SCALAR_FIELD(fldname) \
44 if (a->fldname != b->fldname) \
48 /* Compare a field that is a pointer to some kind of Node or Node tree */
49 #define COMPARE_NODE_FIELD(fldname) \
51 if (!equal(a->fldname, b->fldname)) \
55 /* Compare a field that is a pointer to a list of integers */
56 #define COMPARE_INTLIST_FIELD(fldname) \
58 if (!equali(a->fldname, b->fldname)) \
62 /* Compare a field that is a pointer to a list of Oids */
63 #define COMPARE_OIDLIST_FIELD(fldname) \
65 if (!equalo(a->fldname, b->fldname)) \
69 /* Compare a field that is a pointer to a Bitmapset */
70 #define COMPARE_BITMAPSET_FIELD(fldname) \
72 if (!bms_equal(a->fldname, b->fldname)) \
76 /* Compare a field that is a pointer to a C string, or perhaps NULL */
77 #define COMPARE_STRING_FIELD(fldname) \
79 if (!equalstr(a->fldname, b->fldname)) \
83 /* Macro for comparing string fields that might be NULL */
84 #define equalstr(a, b) \
85 (((a) != NULL && (b) != NULL) ? (strcmp(a, b) == 0) : (a) == (b))
87 /* Compare a field that is a pointer to a simple palloc'd object of size sz */
88 #define COMPARE_POINTER_FIELD(fldname, sz) \
90 if (memcmp(a->fldname, b->fldname, (sz)) != 0) \
96 * Stuff from primnodes.h
100 _equalResdom(Resdom *a, Resdom *b)
102 COMPARE_SCALAR_FIELD(resno);
103 COMPARE_SCALAR_FIELD(restype);
104 COMPARE_SCALAR_FIELD(restypmod);
105 COMPARE_STRING_FIELD(resname);
106 COMPARE_SCALAR_FIELD(ressortgroupref);
107 COMPARE_SCALAR_FIELD(resorigtbl);
108 COMPARE_SCALAR_FIELD(resorigcol);
109 COMPARE_SCALAR_FIELD(resjunk);
115 _equalAlias(Alias *a, Alias *b)
117 COMPARE_STRING_FIELD(aliasname);
118 COMPARE_NODE_FIELD(colnames);
124 _equalRangeVar(RangeVar *a, RangeVar *b)
126 COMPARE_STRING_FIELD(catalogname);
127 COMPARE_STRING_FIELD(schemaname);
128 COMPARE_STRING_FIELD(relname);
129 COMPARE_SCALAR_FIELD(inhOpt);
130 COMPARE_SCALAR_FIELD(istemp);
131 COMPARE_NODE_FIELD(alias);
137 * We don't need an _equalExpr because Expr is an abstract supertype which
138 * should never actually get instantiated. Also, since it has no common
139 * fields except NodeTag, there's no need for a helper routine to factor
140 * out comparing the common fields...
144 _equalVar(Var *a, Var *b)
146 COMPARE_SCALAR_FIELD(varno);
147 COMPARE_SCALAR_FIELD(varattno);
148 COMPARE_SCALAR_FIELD(vartype);
149 COMPARE_SCALAR_FIELD(vartypmod);
150 COMPARE_SCALAR_FIELD(varlevelsup);
151 COMPARE_SCALAR_FIELD(varnoold);
152 COMPARE_SCALAR_FIELD(varoattno);
158 _equalConst(Const *a, Const *b)
160 COMPARE_SCALAR_FIELD(consttype);
161 COMPARE_SCALAR_FIELD(constlen);
162 COMPARE_SCALAR_FIELD(constisnull);
163 COMPARE_SCALAR_FIELD(constbyval);
166 * We treat all NULL constants of the same type as equal. Someday this
167 * might need to change? But datumIsEqual doesn't work on nulls,
172 return datumIsEqual(a->constvalue, b->constvalue,
173 a->constbyval, a->constlen);
177 _equalParam(Param *a, Param *b)
179 COMPARE_SCALAR_FIELD(paramkind);
180 COMPARE_SCALAR_FIELD(paramtype);
182 switch (a->paramkind)
185 COMPARE_STRING_FIELD(paramname);
189 COMPARE_SCALAR_FIELD(paramid);
192 elog(ERROR, "unrecognized paramkind value: %d",
200 _equalAggref(Aggref *a, Aggref *b)
202 COMPARE_SCALAR_FIELD(aggfnoid);
203 COMPARE_SCALAR_FIELD(aggtype);
204 COMPARE_NODE_FIELD(target);
205 COMPARE_SCALAR_FIELD(agglevelsup);
206 COMPARE_SCALAR_FIELD(aggstar);
207 COMPARE_SCALAR_FIELD(aggdistinct);
213 _equalArrayRef(ArrayRef *a, ArrayRef *b)
215 COMPARE_SCALAR_FIELD(refrestype);
216 COMPARE_SCALAR_FIELD(refarraytype);
217 COMPARE_SCALAR_FIELD(refelemtype);
218 COMPARE_NODE_FIELD(refupperindexpr);
219 COMPARE_NODE_FIELD(reflowerindexpr);
220 COMPARE_NODE_FIELD(refexpr);
221 COMPARE_NODE_FIELD(refassgnexpr);
227 _equalFuncExpr(FuncExpr *a, FuncExpr *b)
229 COMPARE_SCALAR_FIELD(funcid);
230 COMPARE_SCALAR_FIELD(funcresulttype);
231 COMPARE_SCALAR_FIELD(funcretset);
233 * Special-case COERCE_DONTCARE, so that pathkeys can build coercion
234 * nodes that are equal() to both explicit and implicit coercions.
236 if (a->funcformat != b->funcformat &&
237 a->funcformat != COERCE_DONTCARE &&
238 b->funcformat != COERCE_DONTCARE)
241 COMPARE_NODE_FIELD(args);
247 _equalOpExpr(OpExpr *a, OpExpr *b)
249 COMPARE_SCALAR_FIELD(opno);
251 * Special-case opfuncid: it is allowable for it to differ if one
252 * node contains zero and the other doesn't. This just means that the
253 * one node isn't as far along in the parse/plan pipeline and hasn't
254 * had the opfuncid cache filled yet.
256 if (a->opfuncid != b->opfuncid &&
261 COMPARE_SCALAR_FIELD(opresulttype);
262 COMPARE_SCALAR_FIELD(opretset);
263 COMPARE_NODE_FIELD(args);
269 _equalDistinctExpr(DistinctExpr *a, DistinctExpr *b)
271 COMPARE_SCALAR_FIELD(opno);
273 * Special-case opfuncid: it is allowable for it to differ if one
274 * node contains zero and the other doesn't. This just means that the
275 * one node isn't as far along in the parse/plan pipeline and hasn't
276 * had the opfuncid cache filled yet.
278 if (a->opfuncid != b->opfuncid &&
283 COMPARE_SCALAR_FIELD(opresulttype);
284 COMPARE_SCALAR_FIELD(opretset);
285 COMPARE_NODE_FIELD(args);
291 _equalScalarArrayOpExpr(ScalarArrayOpExpr *a, ScalarArrayOpExpr *b)
293 COMPARE_SCALAR_FIELD(opno);
295 * Special-case opfuncid: it is allowable for it to differ if one
296 * node contains zero and the other doesn't. This just means that the
297 * one node isn't as far along in the parse/plan pipeline and hasn't
298 * had the opfuncid cache filled yet.
300 if (a->opfuncid != b->opfuncid &&
305 COMPARE_SCALAR_FIELD(useOr);
306 COMPARE_NODE_FIELD(args);
312 _equalBoolExpr(BoolExpr *a, BoolExpr *b)
314 COMPARE_SCALAR_FIELD(boolop);
315 COMPARE_NODE_FIELD(args);
321 _equalSubLink(SubLink *a, SubLink *b)
323 COMPARE_SCALAR_FIELD(subLinkType);
324 COMPARE_SCALAR_FIELD(useOr);
325 COMPARE_NODE_FIELD(lefthand);
326 COMPARE_NODE_FIELD(operName);
327 COMPARE_OIDLIST_FIELD(operOids);
328 COMPARE_NODE_FIELD(subselect);
334 _equalSubPlan(SubPlan *a, SubPlan *b)
336 COMPARE_SCALAR_FIELD(subLinkType);
337 COMPARE_SCALAR_FIELD(useOr);
338 COMPARE_NODE_FIELD(exprs);
339 COMPARE_INTLIST_FIELD(paramIds);
340 /* should compare plans, but have to settle for comparing plan IDs */
341 COMPARE_SCALAR_FIELD(plan_id);
342 COMPARE_NODE_FIELD(rtable);
343 COMPARE_SCALAR_FIELD(useHashTable);
344 COMPARE_SCALAR_FIELD(unknownEqFalse);
345 COMPARE_INTLIST_FIELD(setParam);
346 COMPARE_INTLIST_FIELD(parParam);
347 COMPARE_NODE_FIELD(args);
353 _equalFieldSelect(FieldSelect *a, FieldSelect *b)
355 COMPARE_NODE_FIELD(arg);
356 COMPARE_SCALAR_FIELD(fieldnum);
357 COMPARE_SCALAR_FIELD(resulttype);
358 COMPARE_SCALAR_FIELD(resulttypmod);
364 _equalRelabelType(RelabelType *a, RelabelType *b)
366 COMPARE_NODE_FIELD(arg);
367 COMPARE_SCALAR_FIELD(resulttype);
368 COMPARE_SCALAR_FIELD(resulttypmod);
370 * Special-case COERCE_DONTCARE, so that pathkeys can build coercion
371 * nodes that are equal() to both explicit and implicit coercions.
373 if (a->relabelformat != b->relabelformat &&
374 a->relabelformat != COERCE_DONTCARE &&
375 b->relabelformat != COERCE_DONTCARE)
382 _equalCaseExpr(CaseExpr *a, CaseExpr *b)
384 COMPARE_SCALAR_FIELD(casetype);
385 COMPARE_NODE_FIELD(arg);
386 COMPARE_NODE_FIELD(args);
387 COMPARE_NODE_FIELD(defresult);
393 _equalCaseWhen(CaseWhen *a, CaseWhen *b)
395 COMPARE_NODE_FIELD(expr);
396 COMPARE_NODE_FIELD(result);
402 _equalArrayExpr(ArrayExpr *a, ArrayExpr *b)
404 COMPARE_SCALAR_FIELD(array_typeid);
405 COMPARE_SCALAR_FIELD(element_typeid);
406 COMPARE_NODE_FIELD(elements);
407 COMPARE_SCALAR_FIELD(ndims);
413 _equalCoalesceExpr(CoalesceExpr *a, CoalesceExpr *b)
415 COMPARE_SCALAR_FIELD(coalescetype);
416 COMPARE_NODE_FIELD(args);
422 _equalNullIfExpr(NullIfExpr *a, NullIfExpr *b)
424 COMPARE_SCALAR_FIELD(opno);
426 * Special-case opfuncid: it is allowable for it to differ if one
427 * node contains zero and the other doesn't. This just means that the
428 * one node isn't as far along in the parse/plan pipeline and hasn't
429 * had the opfuncid cache filled yet.
431 if (a->opfuncid != b->opfuncid &&
436 COMPARE_SCALAR_FIELD(opresulttype);
437 COMPARE_SCALAR_FIELD(opretset);
438 COMPARE_NODE_FIELD(args);
444 _equalNullTest(NullTest *a, NullTest *b)
446 COMPARE_NODE_FIELD(arg);
447 COMPARE_SCALAR_FIELD(nulltesttype);
453 _equalBooleanTest(BooleanTest *a, BooleanTest *b)
455 COMPARE_NODE_FIELD(arg);
456 COMPARE_SCALAR_FIELD(booltesttype);
462 _equalCoerceToDomain(CoerceToDomain *a, CoerceToDomain *b)
464 COMPARE_NODE_FIELD(arg);
465 COMPARE_SCALAR_FIELD(resulttype);
466 COMPARE_SCALAR_FIELD(resulttypmod);
468 * Special-case COERCE_DONTCARE, so that pathkeys can build coercion
469 * nodes that are equal() to both explicit and implicit coercions.
471 if (a->coercionformat != b->coercionformat &&
472 a->coercionformat != COERCE_DONTCARE &&
473 b->coercionformat != COERCE_DONTCARE)
480 _equalCoerceToDomainValue(CoerceToDomainValue *a, CoerceToDomainValue *b)
482 COMPARE_SCALAR_FIELD(typeId);
483 COMPARE_SCALAR_FIELD(typeMod);
489 _equalSetToDefault(SetToDefault *a, SetToDefault *b)
491 COMPARE_SCALAR_FIELD(typeId);
492 COMPARE_SCALAR_FIELD(typeMod);
498 _equalTargetEntry(TargetEntry *a, TargetEntry *b)
500 COMPARE_NODE_FIELD(resdom);
501 COMPARE_NODE_FIELD(expr);
507 _equalRangeTblRef(RangeTblRef *a, RangeTblRef *b)
509 COMPARE_SCALAR_FIELD(rtindex);
515 _equalJoinExpr(JoinExpr *a, JoinExpr *b)
517 COMPARE_SCALAR_FIELD(jointype);
518 COMPARE_SCALAR_FIELD(isNatural);
519 COMPARE_NODE_FIELD(larg);
520 COMPARE_NODE_FIELD(rarg);
521 COMPARE_NODE_FIELD(using);
522 COMPARE_NODE_FIELD(quals);
523 COMPARE_NODE_FIELD(alias);
524 COMPARE_SCALAR_FIELD(rtindex);
530 _equalFromExpr(FromExpr *a, FromExpr *b)
532 COMPARE_NODE_FIELD(fromlist);
533 COMPARE_NODE_FIELD(quals);
540 * Stuff from relation.h
544 _equalPathKeyItem(PathKeyItem *a, PathKeyItem *b)
546 COMPARE_NODE_FIELD(key);
547 COMPARE_SCALAR_FIELD(sortop);
553 _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
555 COMPARE_NODE_FIELD(clause);
556 COMPARE_SCALAR_FIELD(ispusheddown);
558 * We ignore subclauseindices, eval_cost, this_selec, left/right_relids,
559 * left/right_pathkey, and left/right_bucketsize, since they may not be
560 * set yet, and should be derivable from the clause anyway. Probably it's
561 * not really necessary to compare any of these remaining fields ...
563 COMPARE_SCALAR_FIELD(mergejoinoperator);
564 COMPARE_SCALAR_FIELD(left_sortop);
565 COMPARE_SCALAR_FIELD(right_sortop);
566 COMPARE_SCALAR_FIELD(hashjoinoperator);
572 _equalJoinInfo(JoinInfo *a, JoinInfo *b)
574 COMPARE_BITMAPSET_FIELD(unjoined_relids);
575 COMPARE_NODE_FIELD(jinfo_restrictinfo);
581 _equalInClauseInfo(InClauseInfo *a, InClauseInfo *b)
583 COMPARE_BITMAPSET_FIELD(lefthand);
584 COMPARE_BITMAPSET_FIELD(righthand);
585 COMPARE_NODE_FIELD(sub_targetlist);
592 * Stuff from parsenodes.h
596 _equalQuery(Query *a, Query *b)
598 COMPARE_SCALAR_FIELD(commandType);
599 COMPARE_SCALAR_FIELD(querySource);
600 COMPARE_SCALAR_FIELD(canSetTag);
601 COMPARE_NODE_FIELD(utilityStmt);
602 COMPARE_SCALAR_FIELD(resultRelation);
603 COMPARE_NODE_FIELD(into);
604 COMPARE_SCALAR_FIELD(hasAggs);
605 COMPARE_SCALAR_FIELD(hasSubLinks);
606 COMPARE_NODE_FIELD(rtable);
607 COMPARE_NODE_FIELD(jointree);
608 COMPARE_INTLIST_FIELD(rowMarks);
609 COMPARE_NODE_FIELD(targetList);
610 COMPARE_NODE_FIELD(groupClause);
611 COMPARE_NODE_FIELD(havingQual);
612 COMPARE_NODE_FIELD(distinctClause);
613 COMPARE_NODE_FIELD(sortClause);
614 COMPARE_NODE_FIELD(limitOffset);
615 COMPARE_NODE_FIELD(limitCount);
616 COMPARE_NODE_FIELD(setOperations);
617 COMPARE_INTLIST_FIELD(resultRelations);
618 COMPARE_NODE_FIELD(in_info_list);
619 COMPARE_SCALAR_FIELD(hasJoinRTEs);
622 * We do not check the other planner internal fields: base_rel_list,
623 * other_rel_list, join_rel_list, equi_key_list, query_pathkeys.
624 * They might not be set yet, and in any case they should be derivable
625 * from the other fields.
631 _equalInsertStmt(InsertStmt *a, InsertStmt *b)
633 COMPARE_NODE_FIELD(relation);
634 COMPARE_NODE_FIELD(cols);
635 COMPARE_NODE_FIELD(targetList);
636 COMPARE_NODE_FIELD(selectStmt);
642 _equalDeleteStmt(DeleteStmt *a, DeleteStmt *b)
644 COMPARE_NODE_FIELD(relation);
645 COMPARE_NODE_FIELD(whereClause);
651 _equalUpdateStmt(UpdateStmt *a, UpdateStmt *b)
653 COMPARE_NODE_FIELD(relation);
654 COMPARE_NODE_FIELD(targetList);
655 COMPARE_NODE_FIELD(whereClause);
656 COMPARE_NODE_FIELD(fromClause);
662 _equalSelectStmt(SelectStmt *a, SelectStmt *b)
664 COMPARE_NODE_FIELD(distinctClause);
665 COMPARE_NODE_FIELD(into);
666 COMPARE_NODE_FIELD(intoColNames);
667 COMPARE_NODE_FIELD(targetList);
668 COMPARE_NODE_FIELD(fromClause);
669 COMPARE_NODE_FIELD(whereClause);
670 COMPARE_NODE_FIELD(groupClause);
671 COMPARE_NODE_FIELD(havingClause);
672 COMPARE_NODE_FIELD(sortClause);
673 COMPARE_NODE_FIELD(limitOffset);
674 COMPARE_NODE_FIELD(limitCount);
675 COMPARE_NODE_FIELD(forUpdate);
676 COMPARE_SCALAR_FIELD(op);
677 COMPARE_SCALAR_FIELD(all);
678 COMPARE_NODE_FIELD(larg);
679 COMPARE_NODE_FIELD(rarg);
685 _equalSetOperationStmt(SetOperationStmt *a, SetOperationStmt *b)
687 COMPARE_SCALAR_FIELD(op);
688 COMPARE_SCALAR_FIELD(all);
689 COMPARE_NODE_FIELD(larg);
690 COMPARE_NODE_FIELD(rarg);
691 COMPARE_OIDLIST_FIELD(colTypes);
697 _equalAlterTableStmt(AlterTableStmt *a, AlterTableStmt *b)
699 COMPARE_SCALAR_FIELD(subtype);
700 COMPARE_NODE_FIELD(relation);
701 COMPARE_STRING_FIELD(name);
702 COMPARE_NODE_FIELD(def);
703 COMPARE_SCALAR_FIELD(behavior);
709 _equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
711 COMPARE_SCALAR_FIELD(subtype);
712 COMPARE_NODE_FIELD(typename);
713 COMPARE_STRING_FIELD(name);
714 COMPARE_NODE_FIELD(def);
715 COMPARE_SCALAR_FIELD(behavior);
721 _equalGrantStmt(GrantStmt *a, GrantStmt *b)
723 COMPARE_SCALAR_FIELD(is_grant);
724 COMPARE_SCALAR_FIELD(objtype);
725 COMPARE_NODE_FIELD(objects);
726 COMPARE_INTLIST_FIELD(privileges);
727 COMPARE_NODE_FIELD(grantees);
728 COMPARE_SCALAR_FIELD(grant_option);
729 COMPARE_SCALAR_FIELD(behavior);
735 _equalPrivGrantee(PrivGrantee *a, PrivGrantee *b)
737 COMPARE_STRING_FIELD(username);
738 COMPARE_STRING_FIELD(groupname);
744 _equalFuncWithArgs(FuncWithArgs *a, FuncWithArgs *b)
746 COMPARE_NODE_FIELD(funcname);
747 COMPARE_NODE_FIELD(funcargs);
753 _equalDeclareCursorStmt(DeclareCursorStmt *a, DeclareCursorStmt *b)
755 COMPARE_STRING_FIELD(portalname);
756 COMPARE_SCALAR_FIELD(options);
757 COMPARE_NODE_FIELD(query);
763 _equalClosePortalStmt(ClosePortalStmt *a, ClosePortalStmt *b)
765 COMPARE_STRING_FIELD(portalname);
771 _equalClusterStmt(ClusterStmt *a, ClusterStmt *b)
773 COMPARE_NODE_FIELD(relation);
774 COMPARE_STRING_FIELD(indexname);
780 _equalCopyStmt(CopyStmt *a, CopyStmt *b)
782 COMPARE_NODE_FIELD(relation);
783 COMPARE_NODE_FIELD(attlist);
784 COMPARE_SCALAR_FIELD(is_from);
785 COMPARE_STRING_FIELD(filename);
786 COMPARE_NODE_FIELD(options);
792 _equalCreateStmt(CreateStmt *a, CreateStmt *b)
794 COMPARE_NODE_FIELD(relation);
795 COMPARE_NODE_FIELD(tableElts);
796 COMPARE_NODE_FIELD(inhRelations);
797 COMPARE_NODE_FIELD(constraints);
798 COMPARE_SCALAR_FIELD(hasoids);
799 COMPARE_SCALAR_FIELD(oncommit);
805 _equalInhRelation(InhRelation *a, InhRelation *b)
807 COMPARE_NODE_FIELD(relation);
808 COMPARE_SCALAR_FIELD(including_defaults);
814 _equalDefineStmt(DefineStmt *a, DefineStmt *b)
816 COMPARE_SCALAR_FIELD(kind);
817 COMPARE_NODE_FIELD(defnames);
818 COMPARE_NODE_FIELD(definition);
824 _equalDropStmt(DropStmt *a, DropStmt *b)
826 COMPARE_NODE_FIELD(objects);
827 COMPARE_SCALAR_FIELD(removeType);
828 COMPARE_SCALAR_FIELD(behavior);
834 _equalTruncateStmt(TruncateStmt *a, TruncateStmt *b)
836 COMPARE_NODE_FIELD(relation);
842 _equalCommentStmt(CommentStmt *a, CommentStmt *b)
844 COMPARE_SCALAR_FIELD(objtype);
845 COMPARE_NODE_FIELD(objname);
846 COMPARE_NODE_FIELD(objargs);
847 COMPARE_STRING_FIELD(comment);
853 _equalFetchStmt(FetchStmt *a, FetchStmt *b)
855 COMPARE_SCALAR_FIELD(direction);
856 COMPARE_SCALAR_FIELD(howMany);
857 COMPARE_STRING_FIELD(portalname);
858 COMPARE_SCALAR_FIELD(ismove);
864 _equalIndexStmt(IndexStmt *a, IndexStmt *b)
866 COMPARE_STRING_FIELD(idxname);
867 COMPARE_NODE_FIELD(relation);
868 COMPARE_STRING_FIELD(accessMethod);
869 COMPARE_NODE_FIELD(indexParams);
870 COMPARE_NODE_FIELD(whereClause);
871 COMPARE_NODE_FIELD(rangetable);
872 COMPARE_SCALAR_FIELD(unique);
873 COMPARE_SCALAR_FIELD(primary);
874 COMPARE_SCALAR_FIELD(isconstraint);
880 _equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b)
882 COMPARE_SCALAR_FIELD(replace);
883 COMPARE_NODE_FIELD(funcname);
884 COMPARE_NODE_FIELD(argTypes);
885 COMPARE_NODE_FIELD(returnType);
886 COMPARE_NODE_FIELD(options);
887 COMPARE_NODE_FIELD(withClause);
893 _equalRemoveAggrStmt(RemoveAggrStmt *a, RemoveAggrStmt *b)
895 COMPARE_NODE_FIELD(aggname);
896 COMPARE_NODE_FIELD(aggtype);
897 COMPARE_SCALAR_FIELD(behavior);
903 _equalRemoveFuncStmt(RemoveFuncStmt *a, RemoveFuncStmt *b)
905 COMPARE_NODE_FIELD(funcname);
906 COMPARE_NODE_FIELD(args);
907 COMPARE_SCALAR_FIELD(behavior);
913 _equalRemoveOperStmt(RemoveOperStmt *a, RemoveOperStmt *b)
915 COMPARE_NODE_FIELD(opname);
916 COMPARE_NODE_FIELD(args);
917 COMPARE_SCALAR_FIELD(behavior);
923 _equalRemoveOpClassStmt(RemoveOpClassStmt *a, RemoveOpClassStmt *b)
925 COMPARE_NODE_FIELD(opclassname);
926 COMPARE_STRING_FIELD(amname);
927 COMPARE_SCALAR_FIELD(behavior);
933 _equalRenameStmt(RenameStmt *a, RenameStmt *b)
935 COMPARE_NODE_FIELD(relation);
936 COMPARE_NODE_FIELD(object);
937 COMPARE_NODE_FIELD(objarg);
938 COMPARE_STRING_FIELD(subname);
939 COMPARE_STRING_FIELD(newname);
940 COMPARE_SCALAR_FIELD(renameType);
946 _equalRuleStmt(RuleStmt *a, RuleStmt *b)
948 COMPARE_NODE_FIELD(relation);
949 COMPARE_STRING_FIELD(rulename);
950 COMPARE_NODE_FIELD(whereClause);
951 COMPARE_SCALAR_FIELD(event);
952 COMPARE_SCALAR_FIELD(instead);
953 COMPARE_NODE_FIELD(actions);
954 COMPARE_SCALAR_FIELD(replace);
960 _equalNotifyStmt(NotifyStmt *a, NotifyStmt *b)
962 COMPARE_NODE_FIELD(relation);
968 _equalListenStmt(ListenStmt *a, ListenStmt *b)
970 COMPARE_NODE_FIELD(relation);
976 _equalUnlistenStmt(UnlistenStmt *a, UnlistenStmt *b)
978 COMPARE_NODE_FIELD(relation);
984 _equalTransactionStmt(TransactionStmt *a, TransactionStmt *b)
986 COMPARE_SCALAR_FIELD(kind);
987 COMPARE_NODE_FIELD(options);
993 _equalCompositeTypeStmt(CompositeTypeStmt *a, CompositeTypeStmt *b)
995 COMPARE_NODE_FIELD(typevar);
996 COMPARE_NODE_FIELD(coldeflist);
1002 _equalViewStmt(ViewStmt *a, ViewStmt *b)
1004 COMPARE_NODE_FIELD(view);
1005 COMPARE_NODE_FIELD(aliases);
1006 COMPARE_NODE_FIELD(query);
1007 COMPARE_SCALAR_FIELD(replace);
1013 _equalLoadStmt(LoadStmt *a, LoadStmt *b)
1015 COMPARE_STRING_FIELD(filename);
1021 _equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b)
1023 COMPARE_NODE_FIELD(domainname);
1024 COMPARE_NODE_FIELD(typename);
1025 COMPARE_NODE_FIELD(constraints);
1031 _equalCreateOpClassStmt(CreateOpClassStmt *a, CreateOpClassStmt *b)
1033 COMPARE_NODE_FIELD(opclassname);
1034 COMPARE_STRING_FIELD(amname);
1035 COMPARE_NODE_FIELD(datatype);
1036 COMPARE_NODE_FIELD(items);
1037 COMPARE_SCALAR_FIELD(isDefault);
1043 _equalCreateOpClassItem(CreateOpClassItem *a, CreateOpClassItem *b)
1045 COMPARE_SCALAR_FIELD(itemtype);
1046 COMPARE_NODE_FIELD(name);
1047 COMPARE_NODE_FIELD(args);
1048 COMPARE_SCALAR_FIELD(number);
1049 COMPARE_SCALAR_FIELD(recheck);
1050 COMPARE_NODE_FIELD(storedtype);
1056 _equalCreatedbStmt(CreatedbStmt *a, CreatedbStmt *b)
1058 COMPARE_STRING_FIELD(dbname);
1059 COMPARE_NODE_FIELD(options);
1065 _equalAlterDatabaseSetStmt(AlterDatabaseSetStmt *a, AlterDatabaseSetStmt *b)
1067 COMPARE_STRING_FIELD(dbname);
1068 COMPARE_STRING_FIELD(variable);
1069 COMPARE_NODE_FIELD(value);
1075 _equalDropdbStmt(DropdbStmt *a, DropdbStmt *b)
1077 COMPARE_STRING_FIELD(dbname);
1083 _equalVacuumStmt(VacuumStmt *a, VacuumStmt *b)
1085 COMPARE_SCALAR_FIELD(vacuum);
1086 COMPARE_SCALAR_FIELD(full);
1087 COMPARE_SCALAR_FIELD(analyze);
1088 COMPARE_SCALAR_FIELD(freeze);
1089 COMPARE_SCALAR_FIELD(verbose);
1090 COMPARE_NODE_FIELD(relation);
1091 COMPARE_NODE_FIELD(va_cols);
1097 _equalExplainStmt(ExplainStmt *a, ExplainStmt *b)
1099 COMPARE_NODE_FIELD(query);
1100 COMPARE_SCALAR_FIELD(verbose);
1101 COMPARE_SCALAR_FIELD(analyze);
1107 _equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
1109 COMPARE_NODE_FIELD(sequence);
1110 COMPARE_NODE_FIELD(options);
1116 _equalAlterSeqStmt(AlterSeqStmt *a, AlterSeqStmt *b)
1118 COMPARE_NODE_FIELD(sequence);
1119 COMPARE_NODE_FIELD(options);
1125 _equalVariableSetStmt(VariableSetStmt *a, VariableSetStmt *b)
1127 COMPARE_STRING_FIELD(name);
1128 COMPARE_NODE_FIELD(args);
1129 COMPARE_SCALAR_FIELD(is_local);
1135 _equalVariableShowStmt(VariableShowStmt *a, VariableShowStmt *b)
1137 COMPARE_STRING_FIELD(name);
1143 _equalVariableResetStmt(VariableResetStmt *a, VariableResetStmt *b)
1145 COMPARE_STRING_FIELD(name);
1151 _equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
1153 COMPARE_STRING_FIELD(trigname);
1154 COMPARE_NODE_FIELD(relation);
1155 COMPARE_NODE_FIELD(funcname);
1156 COMPARE_NODE_FIELD(args);
1157 COMPARE_SCALAR_FIELD(before);
1158 COMPARE_SCALAR_FIELD(row);
1159 if (strcmp(a->actions, b->actions) != 0) /* in-line string field */
1161 COMPARE_SCALAR_FIELD(isconstraint);
1162 COMPARE_SCALAR_FIELD(deferrable);
1163 COMPARE_SCALAR_FIELD(initdeferred);
1164 COMPARE_NODE_FIELD(constrrel);
1170 _equalDropPropertyStmt(DropPropertyStmt *a, DropPropertyStmt *b)
1172 COMPARE_NODE_FIELD(relation);
1173 COMPARE_STRING_FIELD(property);
1174 COMPARE_SCALAR_FIELD(removeType);
1175 COMPARE_SCALAR_FIELD(behavior);
1181 _equalCreatePLangStmt(CreatePLangStmt *a, CreatePLangStmt *b)
1183 COMPARE_STRING_FIELD(plname);
1184 COMPARE_NODE_FIELD(plhandler);
1185 COMPARE_NODE_FIELD(plvalidator);
1186 COMPARE_SCALAR_FIELD(pltrusted);
1192 _equalDropPLangStmt(DropPLangStmt *a, DropPLangStmt *b)
1194 COMPARE_STRING_FIELD(plname);
1195 COMPARE_SCALAR_FIELD(behavior);
1201 _equalCreateUserStmt(CreateUserStmt *a, CreateUserStmt *b)
1203 COMPARE_STRING_FIELD(user);
1204 COMPARE_NODE_FIELD(options);
1210 _equalAlterUserStmt(AlterUserStmt *a, AlterUserStmt *b)
1212 COMPARE_STRING_FIELD(user);
1213 COMPARE_NODE_FIELD(options);
1219 _equalAlterUserSetStmt(AlterUserSetStmt *a, AlterUserSetStmt *b)
1221 COMPARE_STRING_FIELD(user);
1222 COMPARE_STRING_FIELD(variable);
1223 COMPARE_NODE_FIELD(value);
1229 _equalDropUserStmt(DropUserStmt *a, DropUserStmt *b)
1231 COMPARE_NODE_FIELD(users);
1237 _equalLockStmt(LockStmt *a, LockStmt *b)
1239 COMPARE_NODE_FIELD(relations);
1240 COMPARE_SCALAR_FIELD(mode);
1246 _equalConstraintsSetStmt(ConstraintsSetStmt *a, ConstraintsSetStmt *b)
1248 COMPARE_NODE_FIELD(constraints);
1249 COMPARE_SCALAR_FIELD(deferred);
1255 _equalCreateGroupStmt(CreateGroupStmt *a, CreateGroupStmt *b)
1257 COMPARE_STRING_FIELD(name);
1258 COMPARE_NODE_FIELD(options);
1264 _equalAlterGroupStmt(AlterGroupStmt *a, AlterGroupStmt *b)
1266 COMPARE_STRING_FIELD(name);
1267 COMPARE_SCALAR_FIELD(action);
1268 COMPARE_NODE_FIELD(listUsers);
1274 _equalDropGroupStmt(DropGroupStmt *a, DropGroupStmt *b)
1276 COMPARE_STRING_FIELD(name);
1282 _equalReindexStmt(ReindexStmt *a, ReindexStmt *b)
1284 COMPARE_SCALAR_FIELD(kind);
1285 COMPARE_NODE_FIELD(relation);
1286 COMPARE_STRING_FIELD(name);
1287 COMPARE_SCALAR_FIELD(force);
1288 COMPARE_SCALAR_FIELD(all);
1294 _equalCreateSchemaStmt(CreateSchemaStmt *a, CreateSchemaStmt *b)
1296 COMPARE_STRING_FIELD(schemaname);
1297 COMPARE_STRING_FIELD(authid);
1298 COMPARE_NODE_FIELD(schemaElts);
1304 _equalCreateConversionStmt(CreateConversionStmt *a, CreateConversionStmt *b)
1306 COMPARE_NODE_FIELD(conversion_name);
1307 COMPARE_STRING_FIELD(for_encoding_name);
1308 COMPARE_STRING_FIELD(to_encoding_name);
1309 COMPARE_NODE_FIELD(func_name);
1310 COMPARE_SCALAR_FIELD(def);
1316 _equalCreateCastStmt(CreateCastStmt *a, CreateCastStmt *b)
1318 COMPARE_NODE_FIELD(sourcetype);
1319 COMPARE_NODE_FIELD(targettype);
1320 COMPARE_NODE_FIELD(func);
1321 COMPARE_SCALAR_FIELD(context);
1327 _equalDropCastStmt(DropCastStmt *a, DropCastStmt *b)
1329 COMPARE_NODE_FIELD(sourcetype);
1330 COMPARE_NODE_FIELD(targettype);
1331 COMPARE_SCALAR_FIELD(behavior);
1337 _equalPrepareStmt(PrepareStmt *a, PrepareStmt *b)
1339 COMPARE_STRING_FIELD(name);
1340 COMPARE_NODE_FIELD(argtypes);
1341 COMPARE_OIDLIST_FIELD(argtype_oids);
1342 COMPARE_NODE_FIELD(query);
1348 _equalExecuteStmt(ExecuteStmt *a, ExecuteStmt *b)
1350 COMPARE_STRING_FIELD(name);
1351 COMPARE_NODE_FIELD(into);
1352 COMPARE_NODE_FIELD(params);
1358 _equalDeallocateStmt(DeallocateStmt *a, DeallocateStmt *b)
1360 COMPARE_STRING_FIELD(name);
1367 * stuff from parsenodes.h
1371 _equalAExpr(A_Expr *a, A_Expr *b)
1373 COMPARE_SCALAR_FIELD(kind);
1374 COMPARE_NODE_FIELD(name);
1375 COMPARE_NODE_FIELD(lexpr);
1376 COMPARE_NODE_FIELD(rexpr);
1382 _equalColumnRef(ColumnRef *a, ColumnRef *b)
1384 COMPARE_NODE_FIELD(fields);
1385 COMPARE_NODE_FIELD(indirection);
1391 _equalParamRef(ParamRef *a, ParamRef *b)
1393 COMPARE_SCALAR_FIELD(number);
1394 COMPARE_NODE_FIELD(fields);
1395 COMPARE_NODE_FIELD(indirection);
1401 _equalAConst(A_Const *a, A_Const *b)
1403 if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
1405 COMPARE_NODE_FIELD(typename);
1411 _equalFuncCall(FuncCall *a, FuncCall *b)
1413 COMPARE_NODE_FIELD(funcname);
1414 COMPARE_NODE_FIELD(args);
1415 COMPARE_SCALAR_FIELD(agg_star);
1416 COMPARE_SCALAR_FIELD(agg_distinct);
1422 _equalAIndices(A_Indices *a, A_Indices *b)
1424 COMPARE_NODE_FIELD(lidx);
1425 COMPARE_NODE_FIELD(uidx);
1431 _equalExprFieldSelect(ExprFieldSelect *a, ExprFieldSelect *b)
1433 COMPARE_NODE_FIELD(arg);
1434 COMPARE_NODE_FIELD(fields);
1435 COMPARE_NODE_FIELD(indirection);
1441 _equalResTarget(ResTarget *a, ResTarget *b)
1443 COMPARE_STRING_FIELD(name);
1444 COMPARE_NODE_FIELD(indirection);
1445 COMPARE_NODE_FIELD(val);
1451 _equalTypeName(TypeName *a, TypeName *b)
1453 COMPARE_NODE_FIELD(names);
1454 COMPARE_SCALAR_FIELD(typeid);
1455 COMPARE_SCALAR_FIELD(timezone);
1456 COMPARE_SCALAR_FIELD(setof);
1457 COMPARE_SCALAR_FIELD(pct_type);
1458 COMPARE_SCALAR_FIELD(typmod);
1459 COMPARE_NODE_FIELD(arrayBounds);
1465 _equalTypeCast(TypeCast *a, TypeCast *b)
1467 COMPARE_NODE_FIELD(arg);
1468 COMPARE_NODE_FIELD(typename);
1474 _equalSortGroupBy(SortGroupBy *a, SortGroupBy *b)
1476 COMPARE_NODE_FIELD(useOp);
1477 COMPARE_NODE_FIELD(node);
1483 _equalRangeSubselect(RangeSubselect *a, RangeSubselect *b)
1485 COMPARE_NODE_FIELD(subquery);
1486 COMPARE_NODE_FIELD(alias);
1492 _equalRangeFunction(RangeFunction *a, RangeFunction *b)
1494 COMPARE_NODE_FIELD(funccallnode);
1495 COMPARE_NODE_FIELD(alias);
1496 COMPARE_NODE_FIELD(coldeflist);
1502 _equalIndexElem(IndexElem *a, IndexElem *b)
1504 COMPARE_STRING_FIELD(name);
1505 COMPARE_NODE_FIELD(expr);
1506 COMPARE_NODE_FIELD(opclass);
1512 _equalColumnDef(ColumnDef *a, ColumnDef *b)
1514 COMPARE_STRING_FIELD(colname);
1515 COMPARE_NODE_FIELD(typename);
1516 COMPARE_SCALAR_FIELD(inhcount);
1517 COMPARE_SCALAR_FIELD(is_local);
1518 COMPARE_SCALAR_FIELD(is_not_null);
1519 COMPARE_NODE_FIELD(raw_default);
1520 COMPARE_STRING_FIELD(cooked_default);
1521 COMPARE_NODE_FIELD(constraints);
1522 COMPARE_NODE_FIELD(support);
1528 _equalConstraint(Constraint *a, Constraint *b)
1530 COMPARE_SCALAR_FIELD(contype);
1531 COMPARE_STRING_FIELD(name);
1532 COMPARE_NODE_FIELD(raw_expr);
1533 COMPARE_STRING_FIELD(cooked_expr);
1534 COMPARE_NODE_FIELD(keys);
1540 _equalDefElem(DefElem *a, DefElem *b)
1542 COMPARE_STRING_FIELD(defname);
1543 COMPARE_NODE_FIELD(arg);
1549 _equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
1551 COMPARE_SCALAR_FIELD(rtekind);
1552 COMPARE_SCALAR_FIELD(relid);
1553 COMPARE_NODE_FIELD(subquery);
1554 COMPARE_NODE_FIELD(funcexpr);
1555 COMPARE_NODE_FIELD(coldeflist);
1556 COMPARE_SCALAR_FIELD(jointype);
1557 COMPARE_NODE_FIELD(joinaliasvars);
1558 COMPARE_NODE_FIELD(alias);
1559 COMPARE_NODE_FIELD(eref);
1560 COMPARE_SCALAR_FIELD(inh);
1561 COMPARE_SCALAR_FIELD(inFromCl);
1562 COMPARE_SCALAR_FIELD(checkForRead);
1563 COMPARE_SCALAR_FIELD(checkForWrite);
1564 COMPARE_SCALAR_FIELD(checkAsUser);
1570 _equalSortClause(SortClause *a, SortClause *b)
1572 COMPARE_SCALAR_FIELD(tleSortGroupRef);
1573 COMPARE_SCALAR_FIELD(sortop);
1579 _equalFkConstraint(FkConstraint *a, FkConstraint *b)
1581 COMPARE_STRING_FIELD(constr_name);
1582 COMPARE_NODE_FIELD(pktable);
1583 COMPARE_NODE_FIELD(fk_attrs);
1584 COMPARE_NODE_FIELD(pk_attrs);
1585 COMPARE_SCALAR_FIELD(fk_matchtype);
1586 COMPARE_SCALAR_FIELD(fk_upd_action);
1587 COMPARE_SCALAR_FIELD(fk_del_action);
1588 COMPARE_SCALAR_FIELD(deferrable);
1589 COMPARE_SCALAR_FIELD(initdeferred);
1590 COMPARE_SCALAR_FIELD(skip_validation);
1597 * Stuff from pg_list.h
1601 _equalValue(Value *a, Value *b)
1603 COMPARE_SCALAR_FIELD(type);
1608 COMPARE_SCALAR_FIELD(val.ival);
1613 COMPARE_STRING_FIELD(val.str);
1619 elog(ERROR, "unrecognized node type: %d", (int) a->type);
1628 * returns whether two nodes are equal
1631 equal(void *a, void *b)
1639 * note that a!=b, so only one of them can be NULL
1641 if (a == NULL || b == NULL)
1645 * are they the same type of nodes?
1647 if (nodeTag(a) != nodeTag(b))
1656 retval = _equalResdom(a, b);
1659 retval = _equalAlias(a, b);
1662 retval = _equalRangeVar(a, b);
1665 retval = _equalVar(a, b);
1668 retval = _equalConst(a, b);
1671 retval = _equalParam(a, b);
1674 retval = _equalAggref(a, b);
1677 retval = _equalArrayRef(a, b);
1680 retval = _equalFuncExpr(a, b);
1683 retval = _equalOpExpr(a, b);
1685 case T_DistinctExpr:
1686 retval = _equalDistinctExpr(a, b);
1688 case T_ScalarArrayOpExpr:
1689 retval = _equalScalarArrayOpExpr(a, b);
1692 retval = _equalBoolExpr(a, b);
1695 retval = _equalSubLink(a, b);
1698 retval = _equalSubPlan(a, b);
1701 retval = _equalFieldSelect(a, b);
1704 retval = _equalRelabelType(a, b);
1707 retval = _equalCaseExpr(a, b);
1710 retval = _equalCaseWhen(a, b);
1713 retval = _equalArrayExpr(a, b);
1715 case T_CoalesceExpr:
1716 retval = _equalCoalesceExpr(a, b);
1719 retval = _equalNullIfExpr(a, b);
1722 retval = _equalNullTest(a, b);
1725 retval = _equalBooleanTest(a, b);
1727 case T_CoerceToDomain:
1728 retval = _equalCoerceToDomain(a, b);
1730 case T_CoerceToDomainValue:
1731 retval = _equalCoerceToDomainValue(a, b);
1733 case T_SetToDefault:
1734 retval = _equalSetToDefault(a, b);
1737 retval = _equalTargetEntry(a, b);
1740 retval = _equalRangeTblRef(a, b);
1743 retval = _equalFromExpr(a, b);
1746 retval = _equalJoinExpr(a, b);
1753 retval = _equalPathKeyItem(a, b);
1755 case T_RestrictInfo:
1756 retval = _equalRestrictInfo(a, b);
1759 retval = _equalJoinInfo(a, b);
1761 case T_InClauseInfo:
1762 retval = _equalInClauseInfo(a, b);
1770 List *la = (List *) a;
1771 List *lb = (List *) b;
1775 * Try to reject by length check before we grovel through
1776 * all the elements...
1778 if (length(la) != length(lb))
1782 if (!equal(lfirst(l), lfirst(lb)))
1795 retval = _equalValue(a, b);
1802 retval = _equalQuery(a, b);
1805 retval = _equalInsertStmt(a, b);
1808 retval = _equalDeleteStmt(a, b);
1811 retval = _equalUpdateStmt(a, b);
1814 retval = _equalSelectStmt(a, b);
1816 case T_SetOperationStmt:
1817 retval = _equalSetOperationStmt(a, b);
1819 case T_AlterTableStmt:
1820 retval = _equalAlterTableStmt(a, b);
1822 case T_AlterDomainStmt:
1823 retval = _equalAlterDomainStmt(a, b);
1826 retval = _equalGrantStmt(a, b);
1828 case T_DeclareCursorStmt:
1829 retval = _equalDeclareCursorStmt(a, b);
1831 case T_ClosePortalStmt:
1832 retval = _equalClosePortalStmt(a, b);
1835 retval = _equalClusterStmt(a, b);
1838 retval = _equalCopyStmt(a, b);
1841 retval = _equalCreateStmt(a, b);
1844 retval = _equalInhRelation(a,b);
1847 retval = _equalDefineStmt(a, b);
1850 retval = _equalDropStmt(a, b);
1852 case T_TruncateStmt:
1853 retval = _equalTruncateStmt(a, b);
1856 retval = _equalCommentStmt(a, b);
1859 retval = _equalFetchStmt(a, b);
1862 retval = _equalIndexStmt(a, b);
1864 case T_CreateFunctionStmt:
1865 retval = _equalCreateFunctionStmt(a, b);
1867 case T_RemoveAggrStmt:
1868 retval = _equalRemoveAggrStmt(a, b);
1870 case T_RemoveFuncStmt:
1871 retval = _equalRemoveFuncStmt(a, b);
1873 case T_RemoveOperStmt:
1874 retval = _equalRemoveOperStmt(a, b);
1876 case T_RemoveOpClassStmt:
1877 retval = _equalRemoveOpClassStmt(a, b);
1880 retval = _equalRenameStmt(a, b);
1883 retval = _equalRuleStmt(a, b);
1886 retval = _equalNotifyStmt(a, b);
1889 retval = _equalListenStmt(a, b);
1891 case T_UnlistenStmt:
1892 retval = _equalUnlistenStmt(a, b);
1894 case T_TransactionStmt:
1895 retval = _equalTransactionStmt(a, b);
1897 case T_CompositeTypeStmt:
1898 retval = _equalCompositeTypeStmt(a, b);
1901 retval = _equalViewStmt(a, b);
1904 retval = _equalLoadStmt(a, b);
1906 case T_CreateDomainStmt:
1907 retval = _equalCreateDomainStmt(a, b);
1909 case T_CreateOpClassStmt:
1910 retval = _equalCreateOpClassStmt(a, b);
1912 case T_CreateOpClassItem:
1913 retval = _equalCreateOpClassItem(a, b);
1915 case T_CreatedbStmt:
1916 retval = _equalCreatedbStmt(a, b);
1918 case T_AlterDatabaseSetStmt:
1919 retval = _equalAlterDatabaseSetStmt(a, b);
1922 retval = _equalDropdbStmt(a, b);
1925 retval = _equalVacuumStmt(a, b);
1928 retval = _equalExplainStmt(a, b);
1930 case T_CreateSeqStmt:
1931 retval = _equalCreateSeqStmt(a, b);
1933 case T_AlterSeqStmt:
1934 retval = _equalAlterSeqStmt(a, b);
1936 case T_VariableSetStmt:
1937 retval = _equalVariableSetStmt(a, b);
1939 case T_VariableShowStmt:
1940 retval = _equalVariableShowStmt(a, b);
1942 case T_VariableResetStmt:
1943 retval = _equalVariableResetStmt(a, b);
1945 case T_CreateTrigStmt:
1946 retval = _equalCreateTrigStmt(a, b);
1948 case T_DropPropertyStmt:
1949 retval = _equalDropPropertyStmt(a, b);
1951 case T_CreatePLangStmt:
1952 retval = _equalCreatePLangStmt(a, b);
1954 case T_DropPLangStmt:
1955 retval = _equalDropPLangStmt(a, b);
1957 case T_CreateUserStmt:
1958 retval = _equalCreateUserStmt(a, b);
1960 case T_AlterUserStmt:
1961 retval = _equalAlterUserStmt(a, b);
1963 case T_AlterUserSetStmt:
1964 retval = _equalAlterUserSetStmt(a, b);
1966 case T_DropUserStmt:
1967 retval = _equalDropUserStmt(a, b);
1970 retval = _equalLockStmt(a, b);
1972 case T_ConstraintsSetStmt:
1973 retval = _equalConstraintsSetStmt(a, b);
1975 case T_CreateGroupStmt:
1976 retval = _equalCreateGroupStmt(a, b);
1978 case T_AlterGroupStmt:
1979 retval = _equalAlterGroupStmt(a, b);
1981 case T_DropGroupStmt:
1982 retval = _equalDropGroupStmt(a, b);
1985 retval = _equalReindexStmt(a, b);
1987 case T_CheckPointStmt:
1990 case T_CreateSchemaStmt:
1991 retval = _equalCreateSchemaStmt(a, b);
1993 case T_CreateConversionStmt:
1994 retval = _equalCreateConversionStmt(a, b);
1996 case T_CreateCastStmt:
1997 retval = _equalCreateCastStmt(a, b);
1999 case T_DropCastStmt:
2000 retval = _equalDropCastStmt(a, b);
2003 retval = _equalPrepareStmt(a, b);
2006 retval = _equalExecuteStmt(a, b);
2008 case T_DeallocateStmt:
2009 retval = _equalDeallocateStmt(a, b);
2013 retval = _equalAExpr(a, b);
2016 retval = _equalColumnRef(a, b);
2019 retval = _equalParamRef(a, b);
2022 retval = _equalAConst(a, b);
2025 retval = _equalFuncCall(a, b);
2028 retval = _equalAIndices(a, b);
2030 case T_ExprFieldSelect:
2031 retval = _equalExprFieldSelect(a, b);
2034 retval = _equalResTarget(a, b);
2037 retval = _equalTypeCast(a, b);
2040 retval = _equalSortGroupBy(a, b);
2042 case T_RangeSubselect:
2043 retval = _equalRangeSubselect(a, b);
2045 case T_RangeFunction:
2046 retval = _equalRangeFunction(a, b);
2049 retval = _equalTypeName(a, b);
2052 retval = _equalIndexElem(a, b);
2055 retval = _equalColumnDef(a, b);
2058 retval = _equalConstraint(a, b);
2061 retval = _equalDefElem(a, b);
2063 case T_RangeTblEntry:
2064 retval = _equalRangeTblEntry(a, b);
2067 retval = _equalSortClause(a, b);
2070 /* GroupClause is equivalent to SortClause */
2071 retval = _equalSortClause(a, b);
2073 case T_FkConstraint:
2074 retval = _equalFkConstraint(a, b);
2077 retval = _equalPrivGrantee(a, b);
2079 case T_FuncWithArgs:
2080 retval = _equalFuncWithArgs(a, b);
2084 elog(ERROR, "unrecognized node type: %d",
2086 retval = false; /* keep compiler quiet */