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-2003, PostgreSQL Global Development Group
18 * Portions Copyright (c) 1994, Regents of the University of California
21 * $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.216 2004/03/11 01:47:35 ishii 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: %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);
234 * Special-case COERCE_DONTCARE, so that pathkeys can build coercion
235 * nodes that are equal() to both explicit and implicit coercions.
237 if (a->funcformat != b->funcformat &&
238 a->funcformat != COERCE_DONTCARE &&
239 b->funcformat != COERCE_DONTCARE)
242 COMPARE_NODE_FIELD(args);
248 _equalOpExpr(OpExpr *a, OpExpr *b)
250 COMPARE_SCALAR_FIELD(opno);
253 * Special-case opfuncid: it is allowable for it to differ if one node
254 * contains zero and the other doesn't. This just means that the one
255 * node isn't as far along in the parse/plan pipeline and hasn't had
256 * the opfuncid cache filled yet.
258 if (a->opfuncid != b->opfuncid &&
263 COMPARE_SCALAR_FIELD(opresulttype);
264 COMPARE_SCALAR_FIELD(opretset);
265 COMPARE_NODE_FIELD(args);
271 _equalDistinctExpr(DistinctExpr *a, DistinctExpr *b)
273 COMPARE_SCALAR_FIELD(opno);
276 * Special-case opfuncid: it is allowable for it to differ if one node
277 * contains zero and the other doesn't. This just means that the one
278 * node isn't as far along in the parse/plan pipeline and hasn't had
279 * the opfuncid cache filled yet.
281 if (a->opfuncid != b->opfuncid &&
286 COMPARE_SCALAR_FIELD(opresulttype);
287 COMPARE_SCALAR_FIELD(opretset);
288 COMPARE_NODE_FIELD(args);
294 _equalScalarArrayOpExpr(ScalarArrayOpExpr *a, ScalarArrayOpExpr *b)
296 COMPARE_SCALAR_FIELD(opno);
299 * Special-case opfuncid: it is allowable for it to differ if one node
300 * contains zero and the other doesn't. This just means that the one
301 * node isn't as far along in the parse/plan pipeline and hasn't had
302 * the opfuncid cache filled yet.
304 if (a->opfuncid != b->opfuncid &&
309 COMPARE_SCALAR_FIELD(useOr);
310 COMPARE_NODE_FIELD(args);
316 _equalBoolExpr(BoolExpr *a, BoolExpr *b)
318 COMPARE_SCALAR_FIELD(boolop);
319 COMPARE_NODE_FIELD(args);
325 _equalSubLink(SubLink *a, SubLink *b)
327 COMPARE_SCALAR_FIELD(subLinkType);
328 COMPARE_SCALAR_FIELD(useOr);
329 COMPARE_NODE_FIELD(lefthand);
330 COMPARE_NODE_FIELD(operName);
331 COMPARE_OIDLIST_FIELD(operOids);
332 COMPARE_NODE_FIELD(subselect);
338 _equalSubPlan(SubPlan *a, SubPlan *b)
340 COMPARE_SCALAR_FIELD(subLinkType);
341 COMPARE_SCALAR_FIELD(useOr);
342 COMPARE_NODE_FIELD(exprs);
343 COMPARE_INTLIST_FIELD(paramIds);
344 /* should compare plans, but have to settle for comparing plan IDs */
345 COMPARE_SCALAR_FIELD(plan_id);
346 COMPARE_NODE_FIELD(rtable);
347 COMPARE_SCALAR_FIELD(useHashTable);
348 COMPARE_SCALAR_FIELD(unknownEqFalse);
349 COMPARE_INTLIST_FIELD(setParam);
350 COMPARE_INTLIST_FIELD(parParam);
351 COMPARE_NODE_FIELD(args);
357 _equalFieldSelect(FieldSelect *a, FieldSelect *b)
359 COMPARE_NODE_FIELD(arg);
360 COMPARE_SCALAR_FIELD(fieldnum);
361 COMPARE_SCALAR_FIELD(resulttype);
362 COMPARE_SCALAR_FIELD(resulttypmod);
368 _equalRelabelType(RelabelType *a, RelabelType *b)
370 COMPARE_NODE_FIELD(arg);
371 COMPARE_SCALAR_FIELD(resulttype);
372 COMPARE_SCALAR_FIELD(resulttypmod);
375 * Special-case COERCE_DONTCARE, so that pathkeys can build coercion
376 * nodes that are equal() to both explicit and implicit coercions.
378 if (a->relabelformat != b->relabelformat &&
379 a->relabelformat != COERCE_DONTCARE &&
380 b->relabelformat != COERCE_DONTCARE)
387 _equalCaseExpr(CaseExpr *a, CaseExpr *b)
389 COMPARE_SCALAR_FIELD(casetype);
390 COMPARE_NODE_FIELD(arg);
391 COMPARE_NODE_FIELD(args);
392 COMPARE_NODE_FIELD(defresult);
398 _equalCaseWhen(CaseWhen *a, CaseWhen *b)
400 COMPARE_NODE_FIELD(expr);
401 COMPARE_NODE_FIELD(result);
407 _equalArrayExpr(ArrayExpr *a, ArrayExpr *b)
409 COMPARE_SCALAR_FIELD(array_typeid);
410 COMPARE_SCALAR_FIELD(element_typeid);
411 COMPARE_NODE_FIELD(elements);
412 COMPARE_SCALAR_FIELD(multidims);
418 _equalCoalesceExpr(CoalesceExpr *a, CoalesceExpr *b)
420 COMPARE_SCALAR_FIELD(coalescetype);
421 COMPARE_NODE_FIELD(args);
427 _equalNullIfExpr(NullIfExpr *a, NullIfExpr *b)
429 COMPARE_SCALAR_FIELD(opno);
432 * Special-case opfuncid: it is allowable for it to differ if one node
433 * contains zero and the other doesn't. This just means that the one
434 * node isn't as far along in the parse/plan pipeline and hasn't had
435 * the opfuncid cache filled yet.
437 if (a->opfuncid != b->opfuncid &&
442 COMPARE_SCALAR_FIELD(opresulttype);
443 COMPARE_SCALAR_FIELD(opretset);
444 COMPARE_NODE_FIELD(args);
450 _equalNullTest(NullTest *a, NullTest *b)
452 COMPARE_NODE_FIELD(arg);
453 COMPARE_SCALAR_FIELD(nulltesttype);
459 _equalBooleanTest(BooleanTest *a, BooleanTest *b)
461 COMPARE_NODE_FIELD(arg);
462 COMPARE_SCALAR_FIELD(booltesttype);
468 _equalCoerceToDomain(CoerceToDomain *a, CoerceToDomain *b)
470 COMPARE_NODE_FIELD(arg);
471 COMPARE_SCALAR_FIELD(resulttype);
472 COMPARE_SCALAR_FIELD(resulttypmod);
475 * Special-case COERCE_DONTCARE, so that pathkeys can build coercion
476 * nodes that are equal() to both explicit and implicit coercions.
478 if (a->coercionformat != b->coercionformat &&
479 a->coercionformat != COERCE_DONTCARE &&
480 b->coercionformat != COERCE_DONTCARE)
487 _equalCoerceToDomainValue(CoerceToDomainValue *a, CoerceToDomainValue *b)
489 COMPARE_SCALAR_FIELD(typeId);
490 COMPARE_SCALAR_FIELD(typeMod);
496 _equalSetToDefault(SetToDefault *a, SetToDefault *b)
498 COMPARE_SCALAR_FIELD(typeId);
499 COMPARE_SCALAR_FIELD(typeMod);
505 _equalTargetEntry(TargetEntry *a, TargetEntry *b)
507 COMPARE_NODE_FIELD(resdom);
508 COMPARE_NODE_FIELD(expr);
514 _equalRangeTblRef(RangeTblRef *a, RangeTblRef *b)
516 COMPARE_SCALAR_FIELD(rtindex);
522 _equalJoinExpr(JoinExpr *a, JoinExpr *b)
524 COMPARE_SCALAR_FIELD(jointype);
525 COMPARE_SCALAR_FIELD(isNatural);
526 COMPARE_NODE_FIELD(larg);
527 COMPARE_NODE_FIELD(rarg);
528 COMPARE_NODE_FIELD(using);
529 COMPARE_NODE_FIELD(quals);
530 COMPARE_NODE_FIELD(alias);
531 COMPARE_SCALAR_FIELD(rtindex);
537 _equalFromExpr(FromExpr *a, FromExpr *b)
539 COMPARE_NODE_FIELD(fromlist);
540 COMPARE_NODE_FIELD(quals);
547 * Stuff from relation.h
551 _equalPathKeyItem(PathKeyItem *a, PathKeyItem *b)
553 COMPARE_NODE_FIELD(key);
554 COMPARE_SCALAR_FIELD(sortop);
560 _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
562 COMPARE_NODE_FIELD(clause);
563 COMPARE_SCALAR_FIELD(is_pushed_down);
564 COMPARE_SCALAR_FIELD(valid_everywhere);
567 * We ignore all the remaining fields, since they may not be set yet,
568 * and should be derivable from the clause anyway.
575 _equalJoinInfo(JoinInfo *a, JoinInfo *b)
577 COMPARE_BITMAPSET_FIELD(unjoined_relids);
578 COMPARE_NODE_FIELD(jinfo_restrictinfo);
584 _equalInClauseInfo(InClauseInfo *a, InClauseInfo *b)
586 COMPARE_BITMAPSET_FIELD(lefthand);
587 COMPARE_BITMAPSET_FIELD(righthand);
588 COMPARE_NODE_FIELD(sub_targetlist);
595 * Stuff from parsenodes.h
599 _equalQuery(Query *a, Query *b)
601 COMPARE_SCALAR_FIELD(commandType);
602 COMPARE_SCALAR_FIELD(querySource);
603 COMPARE_SCALAR_FIELD(canSetTag);
604 COMPARE_NODE_FIELD(utilityStmt);
605 COMPARE_SCALAR_FIELD(resultRelation);
606 COMPARE_NODE_FIELD(into);
607 COMPARE_SCALAR_FIELD(intoHasOids);
608 COMPARE_SCALAR_FIELD(hasAggs);
609 COMPARE_SCALAR_FIELD(hasSubLinks);
610 COMPARE_NODE_FIELD(rtable);
611 COMPARE_NODE_FIELD(jointree);
612 COMPARE_INTLIST_FIELD(rowMarks);
613 COMPARE_NODE_FIELD(targetList);
614 COMPARE_NODE_FIELD(groupClause);
615 COMPARE_NODE_FIELD(havingQual);
616 COMPARE_NODE_FIELD(distinctClause);
617 COMPARE_NODE_FIELD(sortClause);
618 COMPARE_NODE_FIELD(limitOffset);
619 COMPARE_NODE_FIELD(limitCount);
620 COMPARE_NODE_FIELD(setOperations);
621 COMPARE_INTLIST_FIELD(resultRelations);
622 COMPARE_NODE_FIELD(in_info_list);
623 COMPARE_SCALAR_FIELD(hasJoinRTEs);
626 * We do not check the other planner internal fields: base_rel_list,
627 * other_rel_list, join_rel_list, equi_key_list, query_pathkeys. They
628 * might not be set yet, and in any case they should be derivable from
635 _equalInsertStmt(InsertStmt *a, InsertStmt *b)
637 COMPARE_NODE_FIELD(relation);
638 COMPARE_NODE_FIELD(cols);
639 COMPARE_NODE_FIELD(targetList);
640 COMPARE_NODE_FIELD(selectStmt);
646 _equalDeleteStmt(DeleteStmt *a, DeleteStmt *b)
648 COMPARE_NODE_FIELD(relation);
649 COMPARE_NODE_FIELD(whereClause);
655 _equalUpdateStmt(UpdateStmt *a, UpdateStmt *b)
657 COMPARE_NODE_FIELD(relation);
658 COMPARE_NODE_FIELD(targetList);
659 COMPARE_NODE_FIELD(whereClause);
660 COMPARE_NODE_FIELD(fromClause);
666 _equalSelectStmt(SelectStmt *a, SelectStmt *b)
668 COMPARE_NODE_FIELD(distinctClause);
669 COMPARE_NODE_FIELD(into);
670 COMPARE_NODE_FIELD(intoColNames);
671 COMPARE_SCALAR_FIELD(intoHasOids);
672 COMPARE_NODE_FIELD(targetList);
673 COMPARE_NODE_FIELD(fromClause);
674 COMPARE_NODE_FIELD(whereClause);
675 COMPARE_NODE_FIELD(groupClause);
676 COMPARE_NODE_FIELD(havingClause);
677 COMPARE_NODE_FIELD(sortClause);
678 COMPARE_NODE_FIELD(limitOffset);
679 COMPARE_NODE_FIELD(limitCount);
680 COMPARE_NODE_FIELD(forUpdate);
681 COMPARE_SCALAR_FIELD(op);
682 COMPARE_SCALAR_FIELD(all);
683 COMPARE_NODE_FIELD(larg);
684 COMPARE_NODE_FIELD(rarg);
690 _equalSetOperationStmt(SetOperationStmt *a, SetOperationStmt *b)
692 COMPARE_SCALAR_FIELD(op);
693 COMPARE_SCALAR_FIELD(all);
694 COMPARE_NODE_FIELD(larg);
695 COMPARE_NODE_FIELD(rarg);
696 COMPARE_OIDLIST_FIELD(colTypes);
702 _equalAlterTableStmt(AlterTableStmt *a, AlterTableStmt *b)
704 COMPARE_SCALAR_FIELD(subtype);
705 COMPARE_NODE_FIELD(relation);
706 COMPARE_STRING_FIELD(name);
707 COMPARE_NODE_FIELD(def);
708 COMPARE_SCALAR_FIELD(behavior);
714 _equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
716 COMPARE_SCALAR_FIELD(subtype);
717 COMPARE_NODE_FIELD(typename);
718 COMPARE_STRING_FIELD(name);
719 COMPARE_NODE_FIELD(def);
720 COMPARE_SCALAR_FIELD(behavior);
726 _equalGrantStmt(GrantStmt *a, GrantStmt *b)
728 COMPARE_SCALAR_FIELD(is_grant);
729 COMPARE_SCALAR_FIELD(objtype);
730 COMPARE_NODE_FIELD(objects);
731 COMPARE_INTLIST_FIELD(privileges);
732 COMPARE_NODE_FIELD(grantees);
733 COMPARE_SCALAR_FIELD(grant_option);
734 COMPARE_SCALAR_FIELD(behavior);
740 _equalPrivGrantee(PrivGrantee *a, PrivGrantee *b)
742 COMPARE_STRING_FIELD(username);
743 COMPARE_STRING_FIELD(groupname);
749 _equalFuncWithArgs(FuncWithArgs *a, FuncWithArgs *b)
751 COMPARE_NODE_FIELD(funcname);
752 COMPARE_NODE_FIELD(funcargs);
758 _equalDeclareCursorStmt(DeclareCursorStmt *a, DeclareCursorStmt *b)
760 COMPARE_STRING_FIELD(portalname);
761 COMPARE_SCALAR_FIELD(options);
762 COMPARE_NODE_FIELD(query);
768 _equalClosePortalStmt(ClosePortalStmt *a, ClosePortalStmt *b)
770 COMPARE_STRING_FIELD(portalname);
776 _equalClusterStmt(ClusterStmt *a, ClusterStmt *b)
778 COMPARE_NODE_FIELD(relation);
779 COMPARE_STRING_FIELD(indexname);
785 _equalCopyStmt(CopyStmt *a, CopyStmt *b)
787 COMPARE_NODE_FIELD(relation);
788 COMPARE_NODE_FIELD(attlist);
789 COMPARE_SCALAR_FIELD(is_from);
790 COMPARE_STRING_FIELD(filename);
791 COMPARE_NODE_FIELD(options);
797 _equalCreateStmt(CreateStmt *a, CreateStmt *b)
799 COMPARE_NODE_FIELD(relation);
800 COMPARE_NODE_FIELD(tableElts);
801 COMPARE_NODE_FIELD(inhRelations);
802 COMPARE_NODE_FIELD(constraints);
803 COMPARE_SCALAR_FIELD(hasoids);
804 COMPARE_SCALAR_FIELD(oncommit);
810 _equalInhRelation(InhRelation *a, InhRelation *b)
812 COMPARE_NODE_FIELD(relation);
813 COMPARE_SCALAR_FIELD(including_defaults);
819 _equalDefineStmt(DefineStmt *a, DefineStmt *b)
821 COMPARE_SCALAR_FIELD(kind);
822 COMPARE_NODE_FIELD(defnames);
823 COMPARE_NODE_FIELD(definition);
829 _equalDropStmt(DropStmt *a, DropStmt *b)
831 COMPARE_NODE_FIELD(objects);
832 COMPARE_SCALAR_FIELD(removeType);
833 COMPARE_SCALAR_FIELD(behavior);
839 _equalTruncateStmt(TruncateStmt *a, TruncateStmt *b)
841 COMPARE_NODE_FIELD(relation);
847 _equalCommentStmt(CommentStmt *a, CommentStmt *b)
849 COMPARE_SCALAR_FIELD(objtype);
850 COMPARE_NODE_FIELD(objname);
851 COMPARE_NODE_FIELD(objargs);
852 COMPARE_STRING_FIELD(comment);
858 _equalFetchStmt(FetchStmt *a, FetchStmt *b)
860 COMPARE_SCALAR_FIELD(direction);
861 COMPARE_SCALAR_FIELD(howMany);
862 COMPARE_STRING_FIELD(portalname);
863 COMPARE_SCALAR_FIELD(ismove);
869 _equalIndexStmt(IndexStmt *a, IndexStmt *b)
871 COMPARE_STRING_FIELD(idxname);
872 COMPARE_NODE_FIELD(relation);
873 COMPARE_STRING_FIELD(accessMethod);
874 COMPARE_NODE_FIELD(indexParams);
875 COMPARE_NODE_FIELD(whereClause);
876 COMPARE_NODE_FIELD(rangetable);
877 COMPARE_SCALAR_FIELD(unique);
878 COMPARE_SCALAR_FIELD(primary);
879 COMPARE_SCALAR_FIELD(isconstraint);
885 _equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b)
887 COMPARE_SCALAR_FIELD(replace);
888 COMPARE_NODE_FIELD(funcname);
889 COMPARE_NODE_FIELD(parameters);
890 COMPARE_NODE_FIELD(returnType);
891 COMPARE_NODE_FIELD(options);
892 COMPARE_NODE_FIELD(withClause);
898 _equalFunctionParameter(FunctionParameter *a, FunctionParameter *b)
900 COMPARE_STRING_FIELD(name);
901 COMPARE_NODE_FIELD(argType);
907 _equalRemoveAggrStmt(RemoveAggrStmt *a, RemoveAggrStmt *b)
909 COMPARE_NODE_FIELD(aggname);
910 COMPARE_NODE_FIELD(aggtype);
911 COMPARE_SCALAR_FIELD(behavior);
917 _equalRemoveFuncStmt(RemoveFuncStmt *a, RemoveFuncStmt *b)
919 COMPARE_NODE_FIELD(funcname);
920 COMPARE_NODE_FIELD(args);
921 COMPARE_SCALAR_FIELD(behavior);
927 _equalRemoveOperStmt(RemoveOperStmt *a, RemoveOperStmt *b)
929 COMPARE_NODE_FIELD(opname);
930 COMPARE_NODE_FIELD(args);
931 COMPARE_SCALAR_FIELD(behavior);
937 _equalRemoveOpClassStmt(RemoveOpClassStmt *a, RemoveOpClassStmt *b)
939 COMPARE_NODE_FIELD(opclassname);
940 COMPARE_STRING_FIELD(amname);
941 COMPARE_SCALAR_FIELD(behavior);
947 _equalRenameStmt(RenameStmt *a, RenameStmt *b)
949 COMPARE_NODE_FIELD(relation);
950 COMPARE_NODE_FIELD(object);
951 COMPARE_NODE_FIELD(objarg);
952 COMPARE_STRING_FIELD(subname);
953 COMPARE_STRING_FIELD(newname);
954 COMPARE_SCALAR_FIELD(renameType);
960 _equalRuleStmt(RuleStmt *a, RuleStmt *b)
962 COMPARE_NODE_FIELD(relation);
963 COMPARE_STRING_FIELD(rulename);
964 COMPARE_NODE_FIELD(whereClause);
965 COMPARE_SCALAR_FIELD(event);
966 COMPARE_SCALAR_FIELD(instead);
967 COMPARE_NODE_FIELD(actions);
968 COMPARE_SCALAR_FIELD(replace);
974 _equalNotifyStmt(NotifyStmt *a, NotifyStmt *b)
976 COMPARE_NODE_FIELD(relation);
982 _equalListenStmt(ListenStmt *a, ListenStmt *b)
984 COMPARE_NODE_FIELD(relation);
990 _equalUnlistenStmt(UnlistenStmt *a, UnlistenStmt *b)
992 COMPARE_NODE_FIELD(relation);
998 _equalTransactionStmt(TransactionStmt *a, TransactionStmt *b)
1000 COMPARE_SCALAR_FIELD(kind);
1001 COMPARE_NODE_FIELD(options);
1007 _equalCompositeTypeStmt(CompositeTypeStmt *a, CompositeTypeStmt *b)
1009 COMPARE_NODE_FIELD(typevar);
1010 COMPARE_NODE_FIELD(coldeflist);
1016 _equalViewStmt(ViewStmt *a, ViewStmt *b)
1018 COMPARE_NODE_FIELD(view);
1019 COMPARE_NODE_FIELD(aliases);
1020 COMPARE_NODE_FIELD(query);
1021 COMPARE_SCALAR_FIELD(replace);
1027 _equalLoadStmt(LoadStmt *a, LoadStmt *b)
1029 COMPARE_STRING_FIELD(filename);
1035 _equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b)
1037 COMPARE_NODE_FIELD(domainname);
1038 COMPARE_NODE_FIELD(typename);
1039 COMPARE_NODE_FIELD(constraints);
1045 _equalCreateOpClassStmt(CreateOpClassStmt *a, CreateOpClassStmt *b)
1047 COMPARE_NODE_FIELD(opclassname);
1048 COMPARE_STRING_FIELD(amname);
1049 COMPARE_NODE_FIELD(datatype);
1050 COMPARE_NODE_FIELD(items);
1051 COMPARE_SCALAR_FIELD(isDefault);
1057 _equalCreateOpClassItem(CreateOpClassItem *a, CreateOpClassItem *b)
1059 COMPARE_SCALAR_FIELD(itemtype);
1060 COMPARE_NODE_FIELD(name);
1061 COMPARE_NODE_FIELD(args);
1062 COMPARE_SCALAR_FIELD(number);
1063 COMPARE_SCALAR_FIELD(recheck);
1064 COMPARE_NODE_FIELD(storedtype);
1070 _equalCreatedbStmt(CreatedbStmt *a, CreatedbStmt *b)
1072 COMPARE_STRING_FIELD(dbname);
1073 COMPARE_NODE_FIELD(options);
1079 _equalAlterDatabaseSetStmt(AlterDatabaseSetStmt *a, AlterDatabaseSetStmt *b)
1081 COMPARE_STRING_FIELD(dbname);
1082 COMPARE_STRING_FIELD(variable);
1083 COMPARE_NODE_FIELD(value);
1089 _equalDropdbStmt(DropdbStmt *a, DropdbStmt *b)
1091 COMPARE_STRING_FIELD(dbname);
1097 _equalVacuumStmt(VacuumStmt *a, VacuumStmt *b)
1099 COMPARE_SCALAR_FIELD(vacuum);
1100 COMPARE_SCALAR_FIELD(full);
1101 COMPARE_SCALAR_FIELD(analyze);
1102 COMPARE_SCALAR_FIELD(freeze);
1103 COMPARE_SCALAR_FIELD(verbose);
1104 COMPARE_NODE_FIELD(relation);
1105 COMPARE_NODE_FIELD(va_cols);
1111 _equalExplainStmt(ExplainStmt *a, ExplainStmt *b)
1113 COMPARE_NODE_FIELD(query);
1114 COMPARE_SCALAR_FIELD(verbose);
1115 COMPARE_SCALAR_FIELD(analyze);
1121 _equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
1123 COMPARE_NODE_FIELD(sequence);
1124 COMPARE_NODE_FIELD(options);
1130 _equalAlterSeqStmt(AlterSeqStmt *a, AlterSeqStmt *b)
1132 COMPARE_NODE_FIELD(sequence);
1133 COMPARE_NODE_FIELD(options);
1139 _equalVariableSetStmt(VariableSetStmt *a, VariableSetStmt *b)
1141 COMPARE_STRING_FIELD(name);
1142 COMPARE_NODE_FIELD(args);
1143 COMPARE_SCALAR_FIELD(is_local);
1149 _equalVariableShowStmt(VariableShowStmt *a, VariableShowStmt *b)
1151 COMPARE_STRING_FIELD(name);
1157 _equalVariableResetStmt(VariableResetStmt *a, VariableResetStmt *b)
1159 COMPARE_STRING_FIELD(name);
1165 _equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
1167 COMPARE_STRING_FIELD(trigname);
1168 COMPARE_NODE_FIELD(relation);
1169 COMPARE_NODE_FIELD(funcname);
1170 COMPARE_NODE_FIELD(args);
1171 COMPARE_SCALAR_FIELD(before);
1172 COMPARE_SCALAR_FIELD(row);
1173 if (strcmp(a->actions, b->actions) != 0) /* in-line string field */
1175 COMPARE_SCALAR_FIELD(isconstraint);
1176 COMPARE_SCALAR_FIELD(deferrable);
1177 COMPARE_SCALAR_FIELD(initdeferred);
1178 COMPARE_NODE_FIELD(constrrel);
1184 _equalDropPropertyStmt(DropPropertyStmt *a, DropPropertyStmt *b)
1186 COMPARE_NODE_FIELD(relation);
1187 COMPARE_STRING_FIELD(property);
1188 COMPARE_SCALAR_FIELD(removeType);
1189 COMPARE_SCALAR_FIELD(behavior);
1195 _equalCreatePLangStmt(CreatePLangStmt *a, CreatePLangStmt *b)
1197 COMPARE_STRING_FIELD(plname);
1198 COMPARE_NODE_FIELD(plhandler);
1199 COMPARE_NODE_FIELD(plvalidator);
1200 COMPARE_SCALAR_FIELD(pltrusted);
1206 _equalDropPLangStmt(DropPLangStmt *a, DropPLangStmt *b)
1208 COMPARE_STRING_FIELD(plname);
1209 COMPARE_SCALAR_FIELD(behavior);
1215 _equalCreateUserStmt(CreateUserStmt *a, CreateUserStmt *b)
1217 COMPARE_STRING_FIELD(user);
1218 COMPARE_NODE_FIELD(options);
1224 _equalAlterUserStmt(AlterUserStmt *a, AlterUserStmt *b)
1226 COMPARE_STRING_FIELD(user);
1227 COMPARE_NODE_FIELD(options);
1233 _equalAlterUserSetStmt(AlterUserSetStmt *a, AlterUserSetStmt *b)
1235 COMPARE_STRING_FIELD(user);
1236 COMPARE_STRING_FIELD(variable);
1237 COMPARE_NODE_FIELD(value);
1243 _equalDropUserStmt(DropUserStmt *a, DropUserStmt *b)
1245 COMPARE_NODE_FIELD(users);
1251 _equalLockStmt(LockStmt *a, LockStmt *b)
1253 COMPARE_NODE_FIELD(relations);
1254 COMPARE_SCALAR_FIELD(mode);
1255 COMPARE_SCALAR_FIELD(nowait);
1261 _equalConstraintsSetStmt(ConstraintsSetStmt *a, ConstraintsSetStmt *b)
1263 COMPARE_NODE_FIELD(constraints);
1264 COMPARE_SCALAR_FIELD(deferred);
1270 _equalCreateGroupStmt(CreateGroupStmt *a, CreateGroupStmt *b)
1272 COMPARE_STRING_FIELD(name);
1273 COMPARE_NODE_FIELD(options);
1279 _equalAlterGroupStmt(AlterGroupStmt *a, AlterGroupStmt *b)
1281 COMPARE_STRING_FIELD(name);
1282 COMPARE_SCALAR_FIELD(action);
1283 COMPARE_NODE_FIELD(listUsers);
1289 _equalDropGroupStmt(DropGroupStmt *a, DropGroupStmt *b)
1291 COMPARE_STRING_FIELD(name);
1297 _equalReindexStmt(ReindexStmt *a, ReindexStmt *b)
1299 COMPARE_SCALAR_FIELD(kind);
1300 COMPARE_NODE_FIELD(relation);
1301 COMPARE_STRING_FIELD(name);
1302 COMPARE_SCALAR_FIELD(force);
1303 COMPARE_SCALAR_FIELD(all);
1309 _equalCreateSchemaStmt(CreateSchemaStmt *a, CreateSchemaStmt *b)
1311 COMPARE_STRING_FIELD(schemaname);
1312 COMPARE_STRING_FIELD(authid);
1313 COMPARE_NODE_FIELD(schemaElts);
1319 _equalCreateConversionStmt(CreateConversionStmt *a, CreateConversionStmt *b)
1321 COMPARE_NODE_FIELD(conversion_name);
1322 COMPARE_STRING_FIELD(for_encoding_name);
1323 COMPARE_STRING_FIELD(to_encoding_name);
1324 COMPARE_NODE_FIELD(func_name);
1325 COMPARE_SCALAR_FIELD(def);
1331 _equalCreateCastStmt(CreateCastStmt *a, CreateCastStmt *b)
1333 COMPARE_NODE_FIELD(sourcetype);
1334 COMPARE_NODE_FIELD(targettype);
1335 COMPARE_NODE_FIELD(func);
1336 COMPARE_SCALAR_FIELD(context);
1342 _equalDropCastStmt(DropCastStmt *a, DropCastStmt *b)
1344 COMPARE_NODE_FIELD(sourcetype);
1345 COMPARE_NODE_FIELD(targettype);
1346 COMPARE_SCALAR_FIELD(behavior);
1352 _equalPrepareStmt(PrepareStmt *a, PrepareStmt *b)
1354 COMPARE_STRING_FIELD(name);
1355 COMPARE_NODE_FIELD(argtypes);
1356 COMPARE_OIDLIST_FIELD(argtype_oids);
1357 COMPARE_NODE_FIELD(query);
1363 _equalExecuteStmt(ExecuteStmt *a, ExecuteStmt *b)
1365 COMPARE_STRING_FIELD(name);
1366 COMPARE_NODE_FIELD(into);
1367 COMPARE_NODE_FIELD(params);
1373 _equalDeallocateStmt(DeallocateStmt *a, DeallocateStmt *b)
1375 COMPARE_STRING_FIELD(name);
1382 * stuff from parsenodes.h
1386 _equalAExpr(A_Expr *a, A_Expr *b)
1388 COMPARE_SCALAR_FIELD(kind);
1389 COMPARE_NODE_FIELD(name);
1390 COMPARE_NODE_FIELD(lexpr);
1391 COMPARE_NODE_FIELD(rexpr);
1397 _equalColumnRef(ColumnRef *a, ColumnRef *b)
1399 COMPARE_NODE_FIELD(fields);
1400 COMPARE_NODE_FIELD(indirection);
1406 _equalParamRef(ParamRef *a, ParamRef *b)
1408 COMPARE_SCALAR_FIELD(number);
1409 COMPARE_NODE_FIELD(fields);
1410 COMPARE_NODE_FIELD(indirection);
1416 _equalAConst(A_Const *a, A_Const *b)
1418 if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
1420 COMPARE_NODE_FIELD(typename);
1426 _equalFuncCall(FuncCall *a, FuncCall *b)
1428 COMPARE_NODE_FIELD(funcname);
1429 COMPARE_NODE_FIELD(args);
1430 COMPARE_SCALAR_FIELD(agg_star);
1431 COMPARE_SCALAR_FIELD(agg_distinct);
1437 _equalAIndices(A_Indices *a, A_Indices *b)
1439 COMPARE_NODE_FIELD(lidx);
1440 COMPARE_NODE_FIELD(uidx);
1446 _equalExprFieldSelect(ExprFieldSelect *a, ExprFieldSelect *b)
1448 COMPARE_NODE_FIELD(arg);
1449 COMPARE_NODE_FIELD(fields);
1450 COMPARE_NODE_FIELD(indirection);
1456 _equalResTarget(ResTarget *a, ResTarget *b)
1458 COMPARE_STRING_FIELD(name);
1459 COMPARE_NODE_FIELD(indirection);
1460 COMPARE_NODE_FIELD(val);
1466 _equalTypeName(TypeName *a, TypeName *b)
1468 COMPARE_NODE_FIELD(names);
1469 COMPARE_SCALAR_FIELD(typeid);
1470 COMPARE_SCALAR_FIELD(timezone);
1471 COMPARE_SCALAR_FIELD(setof);
1472 COMPARE_SCALAR_FIELD(pct_type);
1473 COMPARE_SCALAR_FIELD(typmod);
1474 COMPARE_NODE_FIELD(arrayBounds);
1480 _equalTypeCast(TypeCast *a, TypeCast *b)
1482 COMPARE_NODE_FIELD(arg);
1483 COMPARE_NODE_FIELD(typename);
1489 _equalSortBy(SortBy *a, SortBy *b)
1491 COMPARE_SCALAR_FIELD(sortby_kind);
1492 COMPARE_NODE_FIELD(useOp);
1493 COMPARE_NODE_FIELD(node);
1499 _equalRangeSubselect(RangeSubselect *a, RangeSubselect *b)
1501 COMPARE_NODE_FIELD(subquery);
1502 COMPARE_NODE_FIELD(alias);
1508 _equalRangeFunction(RangeFunction *a, RangeFunction *b)
1510 COMPARE_NODE_FIELD(funccallnode);
1511 COMPARE_NODE_FIELD(alias);
1512 COMPARE_NODE_FIELD(coldeflist);
1518 _equalIndexElem(IndexElem *a, IndexElem *b)
1520 COMPARE_STRING_FIELD(name);
1521 COMPARE_NODE_FIELD(expr);
1522 COMPARE_NODE_FIELD(opclass);
1528 _equalColumnDef(ColumnDef *a, ColumnDef *b)
1530 COMPARE_STRING_FIELD(colname);
1531 COMPARE_NODE_FIELD(typename);
1532 COMPARE_SCALAR_FIELD(inhcount);
1533 COMPARE_SCALAR_FIELD(is_local);
1534 COMPARE_SCALAR_FIELD(is_not_null);
1535 COMPARE_NODE_FIELD(raw_default);
1536 COMPARE_STRING_FIELD(cooked_default);
1537 COMPARE_NODE_FIELD(constraints);
1538 COMPARE_NODE_FIELD(support);
1544 _equalConstraint(Constraint *a, Constraint *b)
1546 COMPARE_SCALAR_FIELD(contype);
1547 COMPARE_STRING_FIELD(name);
1548 COMPARE_NODE_FIELD(raw_expr);
1549 COMPARE_STRING_FIELD(cooked_expr);
1550 COMPARE_NODE_FIELD(keys);
1556 _equalDefElem(DefElem *a, DefElem *b)
1558 COMPARE_STRING_FIELD(defname);
1559 COMPARE_NODE_FIELD(arg);
1565 _equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
1567 COMPARE_SCALAR_FIELD(rtekind);
1568 COMPARE_SCALAR_FIELD(relid);
1569 COMPARE_NODE_FIELD(subquery);
1570 COMPARE_NODE_FIELD(funcexpr);
1571 COMPARE_NODE_FIELD(coldeflist);
1572 COMPARE_SCALAR_FIELD(jointype);
1573 COMPARE_NODE_FIELD(joinaliasvars);
1574 COMPARE_NODE_FIELD(alias);
1575 COMPARE_NODE_FIELD(eref);
1576 COMPARE_SCALAR_FIELD(inh);
1577 COMPARE_SCALAR_FIELD(inFromCl);
1578 COMPARE_SCALAR_FIELD(requiredPerms);
1579 COMPARE_SCALAR_FIELD(checkAsUser);
1585 _equalSortClause(SortClause *a, SortClause *b)
1587 COMPARE_SCALAR_FIELD(tleSortGroupRef);
1588 COMPARE_SCALAR_FIELD(sortop);
1594 _equalFkConstraint(FkConstraint *a, FkConstraint *b)
1596 COMPARE_STRING_FIELD(constr_name);
1597 COMPARE_NODE_FIELD(pktable);
1598 COMPARE_NODE_FIELD(fk_attrs);
1599 COMPARE_NODE_FIELD(pk_attrs);
1600 COMPARE_SCALAR_FIELD(fk_matchtype);
1601 COMPARE_SCALAR_FIELD(fk_upd_action);
1602 COMPARE_SCALAR_FIELD(fk_del_action);
1603 COMPARE_SCALAR_FIELD(deferrable);
1604 COMPARE_SCALAR_FIELD(initdeferred);
1605 COMPARE_SCALAR_FIELD(skip_validation);
1612 * Stuff from pg_list.h
1616 _equalValue(Value *a, Value *b)
1618 COMPARE_SCALAR_FIELD(type);
1623 COMPARE_SCALAR_FIELD(val.ival);
1628 COMPARE_STRING_FIELD(val.str);
1634 elog(ERROR, "unrecognized node type: %d", (int) a->type);
1643 * returns whether two nodes are equal
1646 equal(void *a, void *b)
1654 * note that a!=b, so only one of them can be NULL
1656 if (a == NULL || b == NULL)
1660 * are they the same type of nodes?
1662 if (nodeTag(a) != nodeTag(b))
1671 retval = _equalResdom(a, b);
1674 retval = _equalAlias(a, b);
1677 retval = _equalRangeVar(a, b);
1680 retval = _equalVar(a, b);
1683 retval = _equalConst(a, b);
1686 retval = _equalParam(a, b);
1689 retval = _equalAggref(a, b);
1692 retval = _equalArrayRef(a, b);
1695 retval = _equalFuncExpr(a, b);
1698 retval = _equalOpExpr(a, b);
1700 case T_DistinctExpr:
1701 retval = _equalDistinctExpr(a, b);
1703 case T_ScalarArrayOpExpr:
1704 retval = _equalScalarArrayOpExpr(a, b);
1707 retval = _equalBoolExpr(a, b);
1710 retval = _equalSubLink(a, b);
1713 retval = _equalSubPlan(a, b);
1716 retval = _equalFieldSelect(a, b);
1719 retval = _equalRelabelType(a, b);
1722 retval = _equalCaseExpr(a, b);
1725 retval = _equalCaseWhen(a, b);
1728 retval = _equalArrayExpr(a, b);
1730 case T_CoalesceExpr:
1731 retval = _equalCoalesceExpr(a, b);
1734 retval = _equalNullIfExpr(a, b);
1737 retval = _equalNullTest(a, b);
1740 retval = _equalBooleanTest(a, b);
1742 case T_CoerceToDomain:
1743 retval = _equalCoerceToDomain(a, b);
1745 case T_CoerceToDomainValue:
1746 retval = _equalCoerceToDomainValue(a, b);
1748 case T_SetToDefault:
1749 retval = _equalSetToDefault(a, b);
1752 retval = _equalTargetEntry(a, b);
1755 retval = _equalRangeTblRef(a, b);
1758 retval = _equalFromExpr(a, b);
1761 retval = _equalJoinExpr(a, b);
1768 retval = _equalPathKeyItem(a, b);
1770 case T_RestrictInfo:
1771 retval = _equalRestrictInfo(a, b);
1774 retval = _equalJoinInfo(a, b);
1776 case T_InClauseInfo:
1777 retval = _equalInClauseInfo(a, b);
1785 List *la = (List *) a;
1786 List *lb = (List *) b;
1790 * Try to reject by length check before we grovel through
1791 * all the elements...
1793 if (length(la) != length(lb))
1797 if (!equal(lfirst(l), lfirst(lb)))
1810 retval = _equalValue(a, b);
1817 retval = _equalQuery(a, b);
1820 retval = _equalInsertStmt(a, b);
1823 retval = _equalDeleteStmt(a, b);
1826 retval = _equalUpdateStmt(a, b);
1829 retval = _equalSelectStmt(a, b);
1831 case T_SetOperationStmt:
1832 retval = _equalSetOperationStmt(a, b);
1834 case T_AlterTableStmt:
1835 retval = _equalAlterTableStmt(a, b);
1837 case T_AlterDomainStmt:
1838 retval = _equalAlterDomainStmt(a, b);
1841 retval = _equalGrantStmt(a, b);
1843 case T_DeclareCursorStmt:
1844 retval = _equalDeclareCursorStmt(a, b);
1846 case T_ClosePortalStmt:
1847 retval = _equalClosePortalStmt(a, b);
1850 retval = _equalClusterStmt(a, b);
1853 retval = _equalCopyStmt(a, b);
1856 retval = _equalCreateStmt(a, b);
1859 retval = _equalInhRelation(a, b);
1862 retval = _equalDefineStmt(a, b);
1865 retval = _equalDropStmt(a, b);
1867 case T_TruncateStmt:
1868 retval = _equalTruncateStmt(a, b);
1871 retval = _equalCommentStmt(a, b);
1874 retval = _equalFetchStmt(a, b);
1877 retval = _equalIndexStmt(a, b);
1879 case T_CreateFunctionStmt:
1880 retval = _equalCreateFunctionStmt(a, b);
1882 case T_FunctionParameter:
1883 retval = _equalFunctionParameter(a, b);
1885 case T_RemoveAggrStmt:
1886 retval = _equalRemoveAggrStmt(a, b);
1888 case T_RemoveFuncStmt:
1889 retval = _equalRemoveFuncStmt(a, b);
1891 case T_RemoveOperStmt:
1892 retval = _equalRemoveOperStmt(a, b);
1894 case T_RemoveOpClassStmt:
1895 retval = _equalRemoveOpClassStmt(a, b);
1898 retval = _equalRenameStmt(a, b);
1901 retval = _equalRuleStmt(a, b);
1904 retval = _equalNotifyStmt(a, b);
1907 retval = _equalListenStmt(a, b);
1909 case T_UnlistenStmt:
1910 retval = _equalUnlistenStmt(a, b);
1912 case T_TransactionStmt:
1913 retval = _equalTransactionStmt(a, b);
1915 case T_CompositeTypeStmt:
1916 retval = _equalCompositeTypeStmt(a, b);
1919 retval = _equalViewStmt(a, b);
1922 retval = _equalLoadStmt(a, b);
1924 case T_CreateDomainStmt:
1925 retval = _equalCreateDomainStmt(a, b);
1927 case T_CreateOpClassStmt:
1928 retval = _equalCreateOpClassStmt(a, b);
1930 case T_CreateOpClassItem:
1931 retval = _equalCreateOpClassItem(a, b);
1933 case T_CreatedbStmt:
1934 retval = _equalCreatedbStmt(a, b);
1936 case T_AlterDatabaseSetStmt:
1937 retval = _equalAlterDatabaseSetStmt(a, b);
1940 retval = _equalDropdbStmt(a, b);
1943 retval = _equalVacuumStmt(a, b);
1946 retval = _equalExplainStmt(a, b);
1948 case T_CreateSeqStmt:
1949 retval = _equalCreateSeqStmt(a, b);
1951 case T_AlterSeqStmt:
1952 retval = _equalAlterSeqStmt(a, b);
1954 case T_VariableSetStmt:
1955 retval = _equalVariableSetStmt(a, b);
1957 case T_VariableShowStmt:
1958 retval = _equalVariableShowStmt(a, b);
1960 case T_VariableResetStmt:
1961 retval = _equalVariableResetStmt(a, b);
1963 case T_CreateTrigStmt:
1964 retval = _equalCreateTrigStmt(a, b);
1966 case T_DropPropertyStmt:
1967 retval = _equalDropPropertyStmt(a, b);
1969 case T_CreatePLangStmt:
1970 retval = _equalCreatePLangStmt(a, b);
1972 case T_DropPLangStmt:
1973 retval = _equalDropPLangStmt(a, b);
1975 case T_CreateUserStmt:
1976 retval = _equalCreateUserStmt(a, b);
1978 case T_AlterUserStmt:
1979 retval = _equalAlterUserStmt(a, b);
1981 case T_AlterUserSetStmt:
1982 retval = _equalAlterUserSetStmt(a, b);
1984 case T_DropUserStmt:
1985 retval = _equalDropUserStmt(a, b);
1988 retval = _equalLockStmt(a, b);
1990 case T_ConstraintsSetStmt:
1991 retval = _equalConstraintsSetStmt(a, b);
1993 case T_CreateGroupStmt:
1994 retval = _equalCreateGroupStmt(a, b);
1996 case T_AlterGroupStmt:
1997 retval = _equalAlterGroupStmt(a, b);
1999 case T_DropGroupStmt:
2000 retval = _equalDropGroupStmt(a, b);
2003 retval = _equalReindexStmt(a, b);
2005 case T_CheckPointStmt:
2008 case T_CreateSchemaStmt:
2009 retval = _equalCreateSchemaStmt(a, b);
2011 case T_CreateConversionStmt:
2012 retval = _equalCreateConversionStmt(a, b);
2014 case T_CreateCastStmt:
2015 retval = _equalCreateCastStmt(a, b);
2017 case T_DropCastStmt:
2018 retval = _equalDropCastStmt(a, b);
2021 retval = _equalPrepareStmt(a, b);
2024 retval = _equalExecuteStmt(a, b);
2026 case T_DeallocateStmt:
2027 retval = _equalDeallocateStmt(a, b);
2031 retval = _equalAExpr(a, b);
2034 retval = _equalColumnRef(a, b);
2037 retval = _equalParamRef(a, b);
2040 retval = _equalAConst(a, b);
2043 retval = _equalFuncCall(a, b);
2046 retval = _equalAIndices(a, b);
2048 case T_ExprFieldSelect:
2049 retval = _equalExprFieldSelect(a, b);
2052 retval = _equalResTarget(a, b);
2055 retval = _equalTypeCast(a, b);
2058 retval = _equalSortBy(a, b);
2060 case T_RangeSubselect:
2061 retval = _equalRangeSubselect(a, b);
2063 case T_RangeFunction:
2064 retval = _equalRangeFunction(a, b);
2067 retval = _equalTypeName(a, b);
2070 retval = _equalIndexElem(a, b);
2073 retval = _equalColumnDef(a, b);
2076 retval = _equalConstraint(a, b);
2079 retval = _equalDefElem(a, b);
2081 case T_RangeTblEntry:
2082 retval = _equalRangeTblEntry(a, b);
2085 retval = _equalSortClause(a, b);
2088 /* GroupClause is equivalent to SortClause */
2089 retval = _equalSortClause(a, b);
2091 case T_FkConstraint:
2092 retval = _equalFkConstraint(a, b);
2095 retval = _equalPrivGrantee(a, b);
2097 case T_FuncWithArgs:
2098 retval = _equalFuncWithArgs(a, b);
2102 elog(ERROR, "unrecognized node type: %d",
2104 retval = false; /* keep compiler quiet */