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-2005, 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.235 2005/01/27 03:17:45 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 Bitmapset */
56 #define COMPARE_BITMAPSET_FIELD(fldname) \
58 if (!bms_equal(a->fldname, b->fldname)) \
62 /* Compare a field that is a pointer to a C string, or perhaps NULL */
63 #define COMPARE_STRING_FIELD(fldname) \
65 if (!equalstr(a->fldname, b->fldname)) \
69 /* Macro for comparing string fields that might be NULL */
70 #define equalstr(a, b) \
71 (((a) != NULL && (b) != NULL) ? (strcmp(a, b) == 0) : (a) == (b))
73 /* Compare a field that is a pointer to a simple palloc'd object of size sz */
74 #define COMPARE_POINTER_FIELD(fldname, sz) \
76 if (memcmp(a->fldname, b->fldname, (sz)) != 0) \
82 * Stuff from primnodes.h
86 _equalResdom(Resdom *a, Resdom *b)
88 COMPARE_SCALAR_FIELD(resno);
89 COMPARE_SCALAR_FIELD(restype);
90 COMPARE_SCALAR_FIELD(restypmod);
91 COMPARE_STRING_FIELD(resname);
92 COMPARE_SCALAR_FIELD(ressortgroupref);
93 COMPARE_SCALAR_FIELD(resorigtbl);
94 COMPARE_SCALAR_FIELD(resorigcol);
95 COMPARE_SCALAR_FIELD(resjunk);
101 _equalAlias(Alias *a, Alias *b)
103 COMPARE_STRING_FIELD(aliasname);
104 COMPARE_NODE_FIELD(colnames);
110 _equalRangeVar(RangeVar *a, RangeVar *b)
112 COMPARE_STRING_FIELD(catalogname);
113 COMPARE_STRING_FIELD(schemaname);
114 COMPARE_STRING_FIELD(relname);
115 COMPARE_SCALAR_FIELD(inhOpt);
116 COMPARE_SCALAR_FIELD(istemp);
117 COMPARE_NODE_FIELD(alias);
123 * We don't need an _equalExpr because Expr is an abstract supertype which
124 * should never actually get instantiated. Also, since it has no common
125 * fields except NodeTag, there's no need for a helper routine to factor
126 * out comparing the common fields...
130 _equalVar(Var *a, Var *b)
132 COMPARE_SCALAR_FIELD(varno);
133 COMPARE_SCALAR_FIELD(varattno);
134 COMPARE_SCALAR_FIELD(vartype);
135 COMPARE_SCALAR_FIELD(vartypmod);
136 COMPARE_SCALAR_FIELD(varlevelsup);
137 COMPARE_SCALAR_FIELD(varnoold);
138 COMPARE_SCALAR_FIELD(varoattno);
144 _equalConst(Const *a, Const *b)
146 COMPARE_SCALAR_FIELD(consttype);
147 COMPARE_SCALAR_FIELD(constlen);
148 COMPARE_SCALAR_FIELD(constisnull);
149 COMPARE_SCALAR_FIELD(constbyval);
152 * We treat all NULL constants of the same type as equal. Someday this
153 * might need to change? But datumIsEqual doesn't work on nulls,
158 return datumIsEqual(a->constvalue, b->constvalue,
159 a->constbyval, a->constlen);
163 _equalParam(Param *a, Param *b)
165 COMPARE_SCALAR_FIELD(paramkind);
166 COMPARE_SCALAR_FIELD(paramtype);
168 switch (a->paramkind)
171 COMPARE_STRING_FIELD(paramname);
175 COMPARE_SCALAR_FIELD(paramid);
178 elog(ERROR, "unrecognized paramkind: %d",
186 _equalAggref(Aggref *a, Aggref *b)
188 COMPARE_SCALAR_FIELD(aggfnoid);
189 COMPARE_SCALAR_FIELD(aggtype);
190 COMPARE_NODE_FIELD(target);
191 COMPARE_SCALAR_FIELD(agglevelsup);
192 COMPARE_SCALAR_FIELD(aggstar);
193 COMPARE_SCALAR_FIELD(aggdistinct);
199 _equalArrayRef(ArrayRef *a, ArrayRef *b)
201 COMPARE_SCALAR_FIELD(refrestype);
202 COMPARE_SCALAR_FIELD(refarraytype);
203 COMPARE_SCALAR_FIELD(refelemtype);
204 COMPARE_NODE_FIELD(refupperindexpr);
205 COMPARE_NODE_FIELD(reflowerindexpr);
206 COMPARE_NODE_FIELD(refexpr);
207 COMPARE_NODE_FIELD(refassgnexpr);
213 _equalFuncExpr(FuncExpr *a, FuncExpr *b)
215 COMPARE_SCALAR_FIELD(funcid);
216 COMPARE_SCALAR_FIELD(funcresulttype);
217 COMPARE_SCALAR_FIELD(funcretset);
220 * Special-case COERCE_DONTCARE, so that planner can build coercion
221 * nodes that are equal() to both explicit and implicit coercions.
223 if (a->funcformat != b->funcformat &&
224 a->funcformat != COERCE_DONTCARE &&
225 b->funcformat != COERCE_DONTCARE)
228 COMPARE_NODE_FIELD(args);
234 _equalOpExpr(OpExpr *a, OpExpr *b)
236 COMPARE_SCALAR_FIELD(opno);
239 * Special-case opfuncid: it is allowable for it to differ if one node
240 * contains zero and the other doesn't. This just means that the one
241 * node isn't as far along in the parse/plan pipeline and hasn't had
242 * the opfuncid cache filled yet.
244 if (a->opfuncid != b->opfuncid &&
249 COMPARE_SCALAR_FIELD(opresulttype);
250 COMPARE_SCALAR_FIELD(opretset);
251 COMPARE_NODE_FIELD(args);
257 _equalDistinctExpr(DistinctExpr *a, DistinctExpr *b)
259 COMPARE_SCALAR_FIELD(opno);
262 * Special-case opfuncid: it is allowable for it to differ if one node
263 * contains zero and the other doesn't. This just means that the one
264 * node isn't as far along in the parse/plan pipeline and hasn't had
265 * the opfuncid cache filled yet.
267 if (a->opfuncid != b->opfuncid &&
272 COMPARE_SCALAR_FIELD(opresulttype);
273 COMPARE_SCALAR_FIELD(opretset);
274 COMPARE_NODE_FIELD(args);
280 _equalScalarArrayOpExpr(ScalarArrayOpExpr *a, ScalarArrayOpExpr *b)
282 COMPARE_SCALAR_FIELD(opno);
285 * Special-case opfuncid: it is allowable for it to differ if one node
286 * contains zero and the other doesn't. This just means that the one
287 * node isn't as far along in the parse/plan pipeline and hasn't had
288 * the opfuncid cache filled yet.
290 if (a->opfuncid != b->opfuncid &&
295 COMPARE_SCALAR_FIELD(useOr);
296 COMPARE_NODE_FIELD(args);
302 _equalBoolExpr(BoolExpr *a, BoolExpr *b)
304 COMPARE_SCALAR_FIELD(boolop);
305 COMPARE_NODE_FIELD(args);
311 _equalSubLink(SubLink *a, SubLink *b)
313 COMPARE_SCALAR_FIELD(subLinkType);
314 COMPARE_SCALAR_FIELD(useOr);
315 COMPARE_NODE_FIELD(lefthand);
316 COMPARE_NODE_FIELD(operName);
317 COMPARE_NODE_FIELD(operOids);
318 COMPARE_NODE_FIELD(subselect);
324 _equalSubPlan(SubPlan *a, SubPlan *b)
326 COMPARE_SCALAR_FIELD(subLinkType);
327 COMPARE_SCALAR_FIELD(useOr);
328 COMPARE_NODE_FIELD(exprs);
329 COMPARE_NODE_FIELD(paramIds);
330 /* should compare plans, but have to settle for comparing plan IDs */
331 COMPARE_SCALAR_FIELD(plan_id);
332 COMPARE_NODE_FIELD(rtable);
333 COMPARE_SCALAR_FIELD(useHashTable);
334 COMPARE_SCALAR_FIELD(unknownEqFalse);
335 COMPARE_NODE_FIELD(setParam);
336 COMPARE_NODE_FIELD(parParam);
337 COMPARE_NODE_FIELD(args);
343 _equalFieldSelect(FieldSelect *a, FieldSelect *b)
345 COMPARE_NODE_FIELD(arg);
346 COMPARE_SCALAR_FIELD(fieldnum);
347 COMPARE_SCALAR_FIELD(resulttype);
348 COMPARE_SCALAR_FIELD(resulttypmod);
354 _equalFieldStore(FieldStore *a, FieldStore *b)
356 COMPARE_NODE_FIELD(arg);
357 COMPARE_NODE_FIELD(newvals);
358 COMPARE_NODE_FIELD(fieldnums);
359 COMPARE_SCALAR_FIELD(resulttype);
365 _equalRelabelType(RelabelType *a, RelabelType *b)
367 COMPARE_NODE_FIELD(arg);
368 COMPARE_SCALAR_FIELD(resulttype);
369 COMPARE_SCALAR_FIELD(resulttypmod);
372 * Special-case COERCE_DONTCARE, so that planner can build coercion
373 * nodes that are equal() to both explicit and implicit coercions.
375 if (a->relabelformat != b->relabelformat &&
376 a->relabelformat != COERCE_DONTCARE &&
377 b->relabelformat != COERCE_DONTCARE)
384 _equalConvertRowtypeExpr(ConvertRowtypeExpr *a, ConvertRowtypeExpr *b)
386 COMPARE_NODE_FIELD(arg);
387 COMPARE_SCALAR_FIELD(resulttype);
390 * Special-case COERCE_DONTCARE, so that planner can build coercion
391 * nodes that are equal() to both explicit and implicit coercions.
393 if (a->convertformat != b->convertformat &&
394 a->convertformat != COERCE_DONTCARE &&
395 b->convertformat != COERCE_DONTCARE)
402 _equalCaseExpr(CaseExpr *a, CaseExpr *b)
404 COMPARE_SCALAR_FIELD(casetype);
405 COMPARE_NODE_FIELD(arg);
406 COMPARE_NODE_FIELD(args);
407 COMPARE_NODE_FIELD(defresult);
413 _equalCaseWhen(CaseWhen *a, CaseWhen *b)
415 COMPARE_NODE_FIELD(expr);
416 COMPARE_NODE_FIELD(result);
422 _equalCaseTestExpr(CaseTestExpr *a, CaseTestExpr *b)
424 COMPARE_SCALAR_FIELD(typeId);
425 COMPARE_SCALAR_FIELD(typeMod);
431 _equalArrayExpr(ArrayExpr *a, ArrayExpr *b)
433 COMPARE_SCALAR_FIELD(array_typeid);
434 COMPARE_SCALAR_FIELD(element_typeid);
435 COMPARE_NODE_FIELD(elements);
436 COMPARE_SCALAR_FIELD(multidims);
442 _equalRowExpr(RowExpr *a, RowExpr *b)
444 COMPARE_NODE_FIELD(args);
445 COMPARE_SCALAR_FIELD(row_typeid);
448 * Special-case COERCE_DONTCARE, so that planner can build coercion
449 * nodes that are equal() to both explicit and implicit coercions.
451 if (a->row_format != b->row_format &&
452 a->row_format != COERCE_DONTCARE &&
453 b->row_format != COERCE_DONTCARE)
460 _equalCoalesceExpr(CoalesceExpr *a, CoalesceExpr *b)
462 COMPARE_SCALAR_FIELD(coalescetype);
463 COMPARE_NODE_FIELD(args);
469 _equalNullIfExpr(NullIfExpr *a, NullIfExpr *b)
471 COMPARE_SCALAR_FIELD(opno);
474 * Special-case opfuncid: it is allowable for it to differ if one node
475 * contains zero and the other doesn't. This just means that the one
476 * node isn't as far along in the parse/plan pipeline and hasn't had
477 * the opfuncid cache filled yet.
479 if (a->opfuncid != b->opfuncid &&
484 COMPARE_SCALAR_FIELD(opresulttype);
485 COMPARE_SCALAR_FIELD(opretset);
486 COMPARE_NODE_FIELD(args);
492 _equalNullTest(NullTest *a, NullTest *b)
494 COMPARE_NODE_FIELD(arg);
495 COMPARE_SCALAR_FIELD(nulltesttype);
501 _equalBooleanTest(BooleanTest *a, BooleanTest *b)
503 COMPARE_NODE_FIELD(arg);
504 COMPARE_SCALAR_FIELD(booltesttype);
510 _equalCoerceToDomain(CoerceToDomain *a, CoerceToDomain *b)
512 COMPARE_NODE_FIELD(arg);
513 COMPARE_SCALAR_FIELD(resulttype);
514 COMPARE_SCALAR_FIELD(resulttypmod);
517 * Special-case COERCE_DONTCARE, so that planner can build coercion
518 * nodes that are equal() to both explicit and implicit coercions.
520 if (a->coercionformat != b->coercionformat &&
521 a->coercionformat != COERCE_DONTCARE &&
522 b->coercionformat != COERCE_DONTCARE)
529 _equalCoerceToDomainValue(CoerceToDomainValue *a, CoerceToDomainValue *b)
531 COMPARE_SCALAR_FIELD(typeId);
532 COMPARE_SCALAR_FIELD(typeMod);
538 _equalSetToDefault(SetToDefault *a, SetToDefault *b)
540 COMPARE_SCALAR_FIELD(typeId);
541 COMPARE_SCALAR_FIELD(typeMod);
547 _equalTargetEntry(TargetEntry *a, TargetEntry *b)
549 COMPARE_NODE_FIELD(resdom);
550 COMPARE_NODE_FIELD(expr);
556 _equalRangeTblRef(RangeTblRef *a, RangeTblRef *b)
558 COMPARE_SCALAR_FIELD(rtindex);
564 _equalJoinExpr(JoinExpr *a, JoinExpr *b)
566 COMPARE_SCALAR_FIELD(jointype);
567 COMPARE_SCALAR_FIELD(isNatural);
568 COMPARE_NODE_FIELD(larg);
569 COMPARE_NODE_FIELD(rarg);
570 COMPARE_NODE_FIELD(using);
571 COMPARE_NODE_FIELD(quals);
572 COMPARE_NODE_FIELD(alias);
573 COMPARE_SCALAR_FIELD(rtindex);
579 _equalFromExpr(FromExpr *a, FromExpr *b)
581 COMPARE_NODE_FIELD(fromlist);
582 COMPARE_NODE_FIELD(quals);
589 * Stuff from relation.h
593 _equalPathKeyItem(PathKeyItem *a, PathKeyItem *b)
595 COMPARE_NODE_FIELD(key);
596 COMPARE_SCALAR_FIELD(sortop);
602 _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
604 COMPARE_NODE_FIELD(clause);
605 COMPARE_SCALAR_FIELD(is_pushed_down);
606 COMPARE_SCALAR_FIELD(valid_everywhere);
609 * We ignore all the remaining fields, since they may not be set yet,
610 * and should be derivable from the clause anyway.
617 _equalJoinInfo(JoinInfo *a, JoinInfo *b)
619 COMPARE_BITMAPSET_FIELD(unjoined_relids);
620 COMPARE_NODE_FIELD(jinfo_restrictinfo);
626 _equalInClauseInfo(InClauseInfo *a, InClauseInfo *b)
628 COMPARE_BITMAPSET_FIELD(lefthand);
629 COMPARE_BITMAPSET_FIELD(righthand);
630 COMPARE_NODE_FIELD(sub_targetlist);
637 * Stuff from parsenodes.h
641 _equalQuery(Query *a, Query *b)
643 COMPARE_SCALAR_FIELD(commandType);
644 COMPARE_SCALAR_FIELD(querySource);
645 COMPARE_SCALAR_FIELD(canSetTag);
646 COMPARE_NODE_FIELD(utilityStmt);
647 COMPARE_SCALAR_FIELD(resultRelation);
648 COMPARE_NODE_FIELD(into);
649 COMPARE_SCALAR_FIELD(intoHasOids);
650 COMPARE_SCALAR_FIELD(hasAggs);
651 COMPARE_SCALAR_FIELD(hasSubLinks);
652 COMPARE_NODE_FIELD(rtable);
653 COMPARE_NODE_FIELD(jointree);
654 COMPARE_NODE_FIELD(rowMarks);
655 COMPARE_NODE_FIELD(targetList);
656 COMPARE_NODE_FIELD(groupClause);
657 COMPARE_NODE_FIELD(havingQual);
658 COMPARE_NODE_FIELD(distinctClause);
659 COMPARE_NODE_FIELD(sortClause);
660 COMPARE_NODE_FIELD(limitOffset);
661 COMPARE_NODE_FIELD(limitCount);
662 COMPARE_NODE_FIELD(setOperations);
663 COMPARE_NODE_FIELD(resultRelations);
664 COMPARE_NODE_FIELD(in_info_list);
665 COMPARE_SCALAR_FIELD(hasJoinRTEs);
668 * We do not check the other planner internal fields: base_rel_list,
669 * other_rel_list, join_rel_list, equi_key_list, query_pathkeys. They
670 * might not be set yet, and in any case they should be derivable from
677 _equalInsertStmt(InsertStmt *a, InsertStmt *b)
679 COMPARE_NODE_FIELD(relation);
680 COMPARE_NODE_FIELD(cols);
681 COMPARE_NODE_FIELD(targetList);
682 COMPARE_NODE_FIELD(selectStmt);
688 _equalDeleteStmt(DeleteStmt *a, DeleteStmt *b)
690 COMPARE_NODE_FIELD(relation);
691 COMPARE_NODE_FIELD(whereClause);
697 _equalUpdateStmt(UpdateStmt *a, UpdateStmt *b)
699 COMPARE_NODE_FIELD(relation);
700 COMPARE_NODE_FIELD(targetList);
701 COMPARE_NODE_FIELD(whereClause);
702 COMPARE_NODE_FIELD(fromClause);
708 _equalSelectStmt(SelectStmt *a, SelectStmt *b)
710 COMPARE_NODE_FIELD(distinctClause);
711 COMPARE_NODE_FIELD(into);
712 COMPARE_NODE_FIELD(intoColNames);
713 COMPARE_SCALAR_FIELD(intoHasOids);
714 COMPARE_NODE_FIELD(targetList);
715 COMPARE_NODE_FIELD(fromClause);
716 COMPARE_NODE_FIELD(whereClause);
717 COMPARE_NODE_FIELD(groupClause);
718 COMPARE_NODE_FIELD(havingClause);
719 COMPARE_NODE_FIELD(sortClause);
720 COMPARE_NODE_FIELD(limitOffset);
721 COMPARE_NODE_FIELD(limitCount);
722 COMPARE_NODE_FIELD(forUpdate);
723 COMPARE_SCALAR_FIELD(op);
724 COMPARE_SCALAR_FIELD(all);
725 COMPARE_NODE_FIELD(larg);
726 COMPARE_NODE_FIELD(rarg);
732 _equalSetOperationStmt(SetOperationStmt *a, SetOperationStmt *b)
734 COMPARE_SCALAR_FIELD(op);
735 COMPARE_SCALAR_FIELD(all);
736 COMPARE_NODE_FIELD(larg);
737 COMPARE_NODE_FIELD(rarg);
738 COMPARE_NODE_FIELD(colTypes);
744 _equalAlterTableStmt(AlterTableStmt *a, AlterTableStmt *b)
746 COMPARE_NODE_FIELD(relation);
747 COMPARE_NODE_FIELD(cmds);
748 COMPARE_SCALAR_FIELD(relkind);
754 _equalAlterTableCmd(AlterTableCmd *a, AlterTableCmd *b)
756 COMPARE_SCALAR_FIELD(subtype);
757 COMPARE_STRING_FIELD(name);
758 COMPARE_NODE_FIELD(def);
759 COMPARE_NODE_FIELD(transform);
760 COMPARE_SCALAR_FIELD(behavior);
766 _equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
768 COMPARE_SCALAR_FIELD(subtype);
769 COMPARE_NODE_FIELD(typename);
770 COMPARE_STRING_FIELD(name);
771 COMPARE_NODE_FIELD(def);
772 COMPARE_SCALAR_FIELD(behavior);
778 _equalGrantStmt(GrantStmt *a, GrantStmt *b)
780 COMPARE_SCALAR_FIELD(is_grant);
781 COMPARE_SCALAR_FIELD(objtype);
782 COMPARE_NODE_FIELD(objects);
783 COMPARE_NODE_FIELD(privileges);
784 COMPARE_NODE_FIELD(grantees);
785 COMPARE_SCALAR_FIELD(grant_option);
786 COMPARE_SCALAR_FIELD(behavior);
792 _equalPrivGrantee(PrivGrantee *a, PrivGrantee *b)
794 COMPARE_STRING_FIELD(username);
795 COMPARE_STRING_FIELD(groupname);
801 _equalFuncWithArgs(FuncWithArgs *a, FuncWithArgs *b)
803 COMPARE_NODE_FIELD(funcname);
804 COMPARE_NODE_FIELD(funcargs);
810 _equalDeclareCursorStmt(DeclareCursorStmt *a, DeclareCursorStmt *b)
812 COMPARE_STRING_FIELD(portalname);
813 COMPARE_SCALAR_FIELD(options);
814 COMPARE_NODE_FIELD(query);
820 _equalClosePortalStmt(ClosePortalStmt *a, ClosePortalStmt *b)
822 COMPARE_STRING_FIELD(portalname);
828 _equalClusterStmt(ClusterStmt *a, ClusterStmt *b)
830 COMPARE_NODE_FIELD(relation);
831 COMPARE_STRING_FIELD(indexname);
837 _equalCopyStmt(CopyStmt *a, CopyStmt *b)
839 COMPARE_NODE_FIELD(relation);
840 COMPARE_NODE_FIELD(attlist);
841 COMPARE_SCALAR_FIELD(is_from);
842 COMPARE_STRING_FIELD(filename);
843 COMPARE_NODE_FIELD(options);
849 _equalCreateStmt(CreateStmt *a, CreateStmt *b)
851 COMPARE_NODE_FIELD(relation);
852 COMPARE_NODE_FIELD(tableElts);
853 COMPARE_NODE_FIELD(inhRelations);
854 COMPARE_NODE_FIELD(constraints);
855 COMPARE_SCALAR_FIELD(hasoids);
856 COMPARE_SCALAR_FIELD(oncommit);
857 COMPARE_STRING_FIELD(tablespacename);
863 _equalInhRelation(InhRelation *a, InhRelation *b)
865 COMPARE_NODE_FIELD(relation);
866 COMPARE_SCALAR_FIELD(including_defaults);
872 _equalDefineStmt(DefineStmt *a, DefineStmt *b)
874 COMPARE_SCALAR_FIELD(kind);
875 COMPARE_NODE_FIELD(defnames);
876 COMPARE_NODE_FIELD(definition);
882 _equalDropStmt(DropStmt *a, DropStmt *b)
884 COMPARE_NODE_FIELD(objects);
885 COMPARE_SCALAR_FIELD(removeType);
886 COMPARE_SCALAR_FIELD(behavior);
892 _equalTruncateStmt(TruncateStmt *a, TruncateStmt *b)
894 COMPARE_NODE_FIELD(relations);
900 _equalCommentStmt(CommentStmt *a, CommentStmt *b)
902 COMPARE_SCALAR_FIELD(objtype);
903 COMPARE_NODE_FIELD(objname);
904 COMPARE_NODE_FIELD(objargs);
905 COMPARE_STRING_FIELD(comment);
911 _equalFetchStmt(FetchStmt *a, FetchStmt *b)
913 COMPARE_SCALAR_FIELD(direction);
914 COMPARE_SCALAR_FIELD(howMany);
915 COMPARE_STRING_FIELD(portalname);
916 COMPARE_SCALAR_FIELD(ismove);
922 _equalIndexStmt(IndexStmt *a, IndexStmt *b)
924 COMPARE_STRING_FIELD(idxname);
925 COMPARE_NODE_FIELD(relation);
926 COMPARE_STRING_FIELD(accessMethod);
927 COMPARE_STRING_FIELD(tableSpace);
928 COMPARE_NODE_FIELD(indexParams);
929 COMPARE_NODE_FIELD(whereClause);
930 COMPARE_NODE_FIELD(rangetable);
931 COMPARE_SCALAR_FIELD(unique);
932 COMPARE_SCALAR_FIELD(primary);
933 COMPARE_SCALAR_FIELD(isconstraint);
939 _equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b)
941 COMPARE_SCALAR_FIELD(replace);
942 COMPARE_NODE_FIELD(funcname);
943 COMPARE_NODE_FIELD(parameters);
944 COMPARE_NODE_FIELD(returnType);
945 COMPARE_NODE_FIELD(options);
946 COMPARE_NODE_FIELD(withClause);
952 _equalFunctionParameter(FunctionParameter *a, FunctionParameter *b)
954 COMPARE_STRING_FIELD(name);
955 COMPARE_NODE_FIELD(argType);
961 _equalRemoveAggrStmt(RemoveAggrStmt *a, RemoveAggrStmt *b)
963 COMPARE_NODE_FIELD(aggname);
964 COMPARE_NODE_FIELD(aggtype);
965 COMPARE_SCALAR_FIELD(behavior);
971 _equalRemoveFuncStmt(RemoveFuncStmt *a, RemoveFuncStmt *b)
973 COMPARE_NODE_FIELD(funcname);
974 COMPARE_NODE_FIELD(args);
975 COMPARE_SCALAR_FIELD(behavior);
981 _equalRemoveOperStmt(RemoveOperStmt *a, RemoveOperStmt *b)
983 COMPARE_NODE_FIELD(opname);
984 COMPARE_NODE_FIELD(args);
985 COMPARE_SCALAR_FIELD(behavior);
991 _equalRemoveOpClassStmt(RemoveOpClassStmt *a, RemoveOpClassStmt *b)
993 COMPARE_NODE_FIELD(opclassname);
994 COMPARE_STRING_FIELD(amname);
995 COMPARE_SCALAR_FIELD(behavior);
1001 _equalRenameStmt(RenameStmt *a, RenameStmt *b)
1003 COMPARE_NODE_FIELD(relation);
1004 COMPARE_NODE_FIELD(object);
1005 COMPARE_NODE_FIELD(objarg);
1006 COMPARE_STRING_FIELD(subname);
1007 COMPARE_STRING_FIELD(newname);
1008 COMPARE_SCALAR_FIELD(renameType);
1014 _equalAlterOwnerStmt(AlterOwnerStmt *a, AlterOwnerStmt *b)
1016 COMPARE_NODE_FIELD(relation);
1017 COMPARE_NODE_FIELD(object);
1018 COMPARE_NODE_FIELD(objarg);
1019 COMPARE_STRING_FIELD(addname);
1020 COMPARE_STRING_FIELD(newowner);
1021 COMPARE_SCALAR_FIELD(objectType);
1027 _equalRuleStmt(RuleStmt *a, RuleStmt *b)
1029 COMPARE_NODE_FIELD(relation);
1030 COMPARE_STRING_FIELD(rulename);
1031 COMPARE_NODE_FIELD(whereClause);
1032 COMPARE_SCALAR_FIELD(event);
1033 COMPARE_SCALAR_FIELD(instead);
1034 COMPARE_NODE_FIELD(actions);
1035 COMPARE_SCALAR_FIELD(replace);
1041 _equalNotifyStmt(NotifyStmt *a, NotifyStmt *b)
1043 COMPARE_NODE_FIELD(relation);
1049 _equalListenStmt(ListenStmt *a, ListenStmt *b)
1051 COMPARE_NODE_FIELD(relation);
1057 _equalUnlistenStmt(UnlistenStmt *a, UnlistenStmt *b)
1059 COMPARE_NODE_FIELD(relation);
1065 _equalTransactionStmt(TransactionStmt *a, TransactionStmt *b)
1067 COMPARE_SCALAR_FIELD(kind);
1068 COMPARE_NODE_FIELD(options);
1074 _equalCompositeTypeStmt(CompositeTypeStmt *a, CompositeTypeStmt *b)
1076 COMPARE_NODE_FIELD(typevar);
1077 COMPARE_NODE_FIELD(coldeflist);
1083 _equalViewStmt(ViewStmt *a, ViewStmt *b)
1085 COMPARE_NODE_FIELD(view);
1086 COMPARE_NODE_FIELD(aliases);
1087 COMPARE_NODE_FIELD(query);
1088 COMPARE_SCALAR_FIELD(replace);
1094 _equalLoadStmt(LoadStmt *a, LoadStmt *b)
1096 COMPARE_STRING_FIELD(filename);
1102 _equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b)
1104 COMPARE_NODE_FIELD(domainname);
1105 COMPARE_NODE_FIELD(typename);
1106 COMPARE_NODE_FIELD(constraints);
1112 _equalCreateOpClassStmt(CreateOpClassStmt *a, CreateOpClassStmt *b)
1114 COMPARE_NODE_FIELD(opclassname);
1115 COMPARE_STRING_FIELD(amname);
1116 COMPARE_NODE_FIELD(datatype);
1117 COMPARE_NODE_FIELD(items);
1118 COMPARE_SCALAR_FIELD(isDefault);
1124 _equalCreateOpClassItem(CreateOpClassItem *a, CreateOpClassItem *b)
1126 COMPARE_SCALAR_FIELD(itemtype);
1127 COMPARE_NODE_FIELD(name);
1128 COMPARE_NODE_FIELD(args);
1129 COMPARE_SCALAR_FIELD(number);
1130 COMPARE_SCALAR_FIELD(recheck);
1131 COMPARE_NODE_FIELD(storedtype);
1137 _equalCreatedbStmt(CreatedbStmt *a, CreatedbStmt *b)
1139 COMPARE_STRING_FIELD(dbname);
1140 COMPARE_NODE_FIELD(options);
1146 _equalAlterDatabaseSetStmt(AlterDatabaseSetStmt *a, AlterDatabaseSetStmt *b)
1148 COMPARE_STRING_FIELD(dbname);
1149 COMPARE_STRING_FIELD(variable);
1150 COMPARE_NODE_FIELD(value);
1156 _equalDropdbStmt(DropdbStmt *a, DropdbStmt *b)
1158 COMPARE_STRING_FIELD(dbname);
1164 _equalVacuumStmt(VacuumStmt *a, VacuumStmt *b)
1166 COMPARE_SCALAR_FIELD(vacuum);
1167 COMPARE_SCALAR_FIELD(full);
1168 COMPARE_SCALAR_FIELD(analyze);
1169 COMPARE_SCALAR_FIELD(freeze);
1170 COMPARE_SCALAR_FIELD(verbose);
1171 COMPARE_NODE_FIELD(relation);
1172 COMPARE_NODE_FIELD(va_cols);
1178 _equalExplainStmt(ExplainStmt *a, ExplainStmt *b)
1180 COMPARE_NODE_FIELD(query);
1181 COMPARE_SCALAR_FIELD(verbose);
1182 COMPARE_SCALAR_FIELD(analyze);
1188 _equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
1190 COMPARE_NODE_FIELD(sequence);
1191 COMPARE_NODE_FIELD(options);
1197 _equalAlterSeqStmt(AlterSeqStmt *a, AlterSeqStmt *b)
1199 COMPARE_NODE_FIELD(sequence);
1200 COMPARE_NODE_FIELD(options);
1206 _equalVariableSetStmt(VariableSetStmt *a, VariableSetStmt *b)
1208 COMPARE_STRING_FIELD(name);
1209 COMPARE_NODE_FIELD(args);
1210 COMPARE_SCALAR_FIELD(is_local);
1216 _equalVariableShowStmt(VariableShowStmt *a, VariableShowStmt *b)
1218 COMPARE_STRING_FIELD(name);
1224 _equalVariableResetStmt(VariableResetStmt *a, VariableResetStmt *b)
1226 COMPARE_STRING_FIELD(name);
1232 _equalCreateTableSpaceStmt(CreateTableSpaceStmt *a, CreateTableSpaceStmt *b)
1234 COMPARE_STRING_FIELD(tablespacename);
1235 COMPARE_STRING_FIELD(owner);
1236 COMPARE_STRING_FIELD(location);
1242 _equalDropTableSpaceStmt(DropTableSpaceStmt *a, DropTableSpaceStmt *b)
1244 COMPARE_STRING_FIELD(tablespacename);
1250 _equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
1252 COMPARE_STRING_FIELD(trigname);
1253 COMPARE_NODE_FIELD(relation);
1254 COMPARE_NODE_FIELD(funcname);
1255 COMPARE_NODE_FIELD(args);
1256 COMPARE_SCALAR_FIELD(before);
1257 COMPARE_SCALAR_FIELD(row);
1258 if (strcmp(a->actions, b->actions) != 0) /* in-line string field */
1260 COMPARE_SCALAR_FIELD(isconstraint);
1261 COMPARE_SCALAR_FIELD(deferrable);
1262 COMPARE_SCALAR_FIELD(initdeferred);
1263 COMPARE_NODE_FIELD(constrrel);
1269 _equalDropPropertyStmt(DropPropertyStmt *a, DropPropertyStmt *b)
1271 COMPARE_NODE_FIELD(relation);
1272 COMPARE_STRING_FIELD(property);
1273 COMPARE_SCALAR_FIELD(removeType);
1274 COMPARE_SCALAR_FIELD(behavior);
1280 _equalCreatePLangStmt(CreatePLangStmt *a, CreatePLangStmt *b)
1282 COMPARE_STRING_FIELD(plname);
1283 COMPARE_NODE_FIELD(plhandler);
1284 COMPARE_NODE_FIELD(plvalidator);
1285 COMPARE_SCALAR_FIELD(pltrusted);
1291 _equalDropPLangStmt(DropPLangStmt *a, DropPLangStmt *b)
1293 COMPARE_STRING_FIELD(plname);
1294 COMPARE_SCALAR_FIELD(behavior);
1300 _equalCreateUserStmt(CreateUserStmt *a, CreateUserStmt *b)
1302 COMPARE_STRING_FIELD(user);
1303 COMPARE_NODE_FIELD(options);
1309 _equalAlterUserStmt(AlterUserStmt *a, AlterUserStmt *b)
1311 COMPARE_STRING_FIELD(user);
1312 COMPARE_NODE_FIELD(options);
1318 _equalAlterUserSetStmt(AlterUserSetStmt *a, AlterUserSetStmt *b)
1320 COMPARE_STRING_FIELD(user);
1321 COMPARE_STRING_FIELD(variable);
1322 COMPARE_NODE_FIELD(value);
1328 _equalDropUserStmt(DropUserStmt *a, DropUserStmt *b)
1330 COMPARE_NODE_FIELD(users);
1336 _equalLockStmt(LockStmt *a, LockStmt *b)
1338 COMPARE_NODE_FIELD(relations);
1339 COMPARE_SCALAR_FIELD(mode);
1340 COMPARE_SCALAR_FIELD(nowait);
1346 _equalConstraintsSetStmt(ConstraintsSetStmt *a, ConstraintsSetStmt *b)
1348 COMPARE_NODE_FIELD(constraints);
1349 COMPARE_SCALAR_FIELD(deferred);
1355 _equalCreateGroupStmt(CreateGroupStmt *a, CreateGroupStmt *b)
1357 COMPARE_STRING_FIELD(name);
1358 COMPARE_NODE_FIELD(options);
1364 _equalAlterGroupStmt(AlterGroupStmt *a, AlterGroupStmt *b)
1366 COMPARE_STRING_FIELD(name);
1367 COMPARE_SCALAR_FIELD(action);
1368 COMPARE_NODE_FIELD(listUsers);
1374 _equalDropGroupStmt(DropGroupStmt *a, DropGroupStmt *b)
1376 COMPARE_STRING_FIELD(name);
1382 _equalReindexStmt(ReindexStmt *a, ReindexStmt *b)
1384 COMPARE_SCALAR_FIELD(kind);
1385 COMPARE_NODE_FIELD(relation);
1386 COMPARE_STRING_FIELD(name);
1387 COMPARE_SCALAR_FIELD(force);
1388 COMPARE_SCALAR_FIELD(all);
1394 _equalCreateSchemaStmt(CreateSchemaStmt *a, CreateSchemaStmt *b)
1396 COMPARE_STRING_FIELD(schemaname);
1397 COMPARE_STRING_FIELD(authid);
1398 COMPARE_NODE_FIELD(schemaElts);
1404 _equalCreateConversionStmt(CreateConversionStmt *a, CreateConversionStmt *b)
1406 COMPARE_NODE_FIELD(conversion_name);
1407 COMPARE_STRING_FIELD(for_encoding_name);
1408 COMPARE_STRING_FIELD(to_encoding_name);
1409 COMPARE_NODE_FIELD(func_name);
1410 COMPARE_SCALAR_FIELD(def);
1416 _equalCreateCastStmt(CreateCastStmt *a, CreateCastStmt *b)
1418 COMPARE_NODE_FIELD(sourcetype);
1419 COMPARE_NODE_FIELD(targettype);
1420 COMPARE_NODE_FIELD(func);
1421 COMPARE_SCALAR_FIELD(context);
1427 _equalDropCastStmt(DropCastStmt *a, DropCastStmt *b)
1429 COMPARE_NODE_FIELD(sourcetype);
1430 COMPARE_NODE_FIELD(targettype);
1431 COMPARE_SCALAR_FIELD(behavior);
1437 _equalPrepareStmt(PrepareStmt *a, PrepareStmt *b)
1439 COMPARE_STRING_FIELD(name);
1440 COMPARE_NODE_FIELD(argtypes);
1441 COMPARE_NODE_FIELD(argtype_oids);
1442 COMPARE_NODE_FIELD(query);
1448 _equalExecuteStmt(ExecuteStmt *a, ExecuteStmt *b)
1450 COMPARE_STRING_FIELD(name);
1451 COMPARE_NODE_FIELD(into);
1452 COMPARE_NODE_FIELD(params);
1458 _equalDeallocateStmt(DeallocateStmt *a, DeallocateStmt *b)
1460 COMPARE_STRING_FIELD(name);
1467 * stuff from parsenodes.h
1471 _equalAExpr(A_Expr *a, A_Expr *b)
1473 COMPARE_SCALAR_FIELD(kind);
1474 COMPARE_NODE_FIELD(name);
1475 COMPARE_NODE_FIELD(lexpr);
1476 COMPARE_NODE_FIELD(rexpr);
1482 _equalColumnRef(ColumnRef *a, ColumnRef *b)
1484 COMPARE_NODE_FIELD(fields);
1490 _equalParamRef(ParamRef *a, ParamRef *b)
1492 COMPARE_SCALAR_FIELD(number);
1498 _equalAConst(A_Const *a, A_Const *b)
1500 if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
1502 COMPARE_NODE_FIELD(typename);
1508 _equalFuncCall(FuncCall *a, FuncCall *b)
1510 COMPARE_NODE_FIELD(funcname);
1511 COMPARE_NODE_FIELD(args);
1512 COMPARE_SCALAR_FIELD(agg_star);
1513 COMPARE_SCALAR_FIELD(agg_distinct);
1519 _equalAIndices(A_Indices *a, A_Indices *b)
1521 COMPARE_NODE_FIELD(lidx);
1522 COMPARE_NODE_FIELD(uidx);
1528 _equalA_Indirection(A_Indirection *a, A_Indirection *b)
1530 COMPARE_NODE_FIELD(arg);
1531 COMPARE_NODE_FIELD(indirection);
1537 _equalResTarget(ResTarget *a, ResTarget *b)
1539 COMPARE_STRING_FIELD(name);
1540 COMPARE_NODE_FIELD(indirection);
1541 COMPARE_NODE_FIELD(val);
1547 _equalTypeName(TypeName *a, TypeName *b)
1549 COMPARE_NODE_FIELD(names);
1550 COMPARE_SCALAR_FIELD(typeid);
1551 COMPARE_SCALAR_FIELD(timezone);
1552 COMPARE_SCALAR_FIELD(setof);
1553 COMPARE_SCALAR_FIELD(pct_type);
1554 COMPARE_SCALAR_FIELD(typmod);
1555 COMPARE_NODE_FIELD(arrayBounds);
1561 _equalTypeCast(TypeCast *a, TypeCast *b)
1563 COMPARE_NODE_FIELD(arg);
1564 COMPARE_NODE_FIELD(typename);
1570 _equalSortBy(SortBy *a, SortBy *b)
1572 COMPARE_SCALAR_FIELD(sortby_kind);
1573 COMPARE_NODE_FIELD(useOp);
1574 COMPARE_NODE_FIELD(node);
1580 _equalRangeSubselect(RangeSubselect *a, RangeSubselect *b)
1582 COMPARE_NODE_FIELD(subquery);
1583 COMPARE_NODE_FIELD(alias);
1589 _equalRangeFunction(RangeFunction *a, RangeFunction *b)
1591 COMPARE_NODE_FIELD(funccallnode);
1592 COMPARE_NODE_FIELD(alias);
1593 COMPARE_NODE_FIELD(coldeflist);
1599 _equalIndexElem(IndexElem *a, IndexElem *b)
1601 COMPARE_STRING_FIELD(name);
1602 COMPARE_NODE_FIELD(expr);
1603 COMPARE_NODE_FIELD(opclass);
1609 _equalColumnDef(ColumnDef *a, ColumnDef *b)
1611 COMPARE_STRING_FIELD(colname);
1612 COMPARE_NODE_FIELD(typename);
1613 COMPARE_SCALAR_FIELD(inhcount);
1614 COMPARE_SCALAR_FIELD(is_local);
1615 COMPARE_SCALAR_FIELD(is_not_null);
1616 COMPARE_NODE_FIELD(raw_default);
1617 COMPARE_STRING_FIELD(cooked_default);
1618 COMPARE_NODE_FIELD(constraints);
1619 COMPARE_NODE_FIELD(support);
1625 _equalConstraint(Constraint *a, Constraint *b)
1627 COMPARE_SCALAR_FIELD(contype);
1628 COMPARE_STRING_FIELD(name);
1629 COMPARE_NODE_FIELD(raw_expr);
1630 COMPARE_STRING_FIELD(cooked_expr);
1631 COMPARE_NODE_FIELD(keys);
1632 COMPARE_STRING_FIELD(indexspace);
1638 _equalDefElem(DefElem *a, DefElem *b)
1640 COMPARE_STRING_FIELD(defname);
1641 COMPARE_NODE_FIELD(arg);
1647 _equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
1649 COMPARE_SCALAR_FIELD(rtekind);
1650 COMPARE_SCALAR_FIELD(relid);
1651 COMPARE_NODE_FIELD(subquery);
1652 COMPARE_NODE_FIELD(funcexpr);
1653 COMPARE_NODE_FIELD(coldeflist);
1654 COMPARE_SCALAR_FIELD(jointype);
1655 COMPARE_NODE_FIELD(joinaliasvars);
1656 COMPARE_NODE_FIELD(alias);
1657 COMPARE_NODE_FIELD(eref);
1658 COMPARE_SCALAR_FIELD(inh);
1659 COMPARE_SCALAR_FIELD(inFromCl);
1660 COMPARE_SCALAR_FIELD(requiredPerms);
1661 COMPARE_SCALAR_FIELD(checkAsUser);
1667 _equalSortClause(SortClause *a, SortClause *b)
1669 COMPARE_SCALAR_FIELD(tleSortGroupRef);
1670 COMPARE_SCALAR_FIELD(sortop);
1676 _equalFkConstraint(FkConstraint *a, FkConstraint *b)
1678 COMPARE_STRING_FIELD(constr_name);
1679 COMPARE_NODE_FIELD(pktable);
1680 COMPARE_NODE_FIELD(fk_attrs);
1681 COMPARE_NODE_FIELD(pk_attrs);
1682 COMPARE_SCALAR_FIELD(fk_matchtype);
1683 COMPARE_SCALAR_FIELD(fk_upd_action);
1684 COMPARE_SCALAR_FIELD(fk_del_action);
1685 COMPARE_SCALAR_FIELD(deferrable);
1686 COMPARE_SCALAR_FIELD(initdeferred);
1687 COMPARE_SCALAR_FIELD(skip_validation);
1694 * Stuff from pg_list.h
1698 _equalList(List *a, List *b)
1704 * Try to reject by simple scalar checks before grovelling through all
1705 * the list elements...
1707 COMPARE_SCALAR_FIELD(type);
1708 COMPARE_SCALAR_FIELD(length);
1711 * We place the switch outside the loop for the sake of efficiency;
1712 * this may not be worth doing...
1717 forboth(item_a, a, item_b, b)
1719 if (!equal(lfirst(item_a), lfirst(item_b)))
1724 forboth(item_a, a, item_b, b)
1726 if (lfirst_int(item_a) != lfirst_int(item_b))
1731 forboth(item_a, a, item_b, b)
1733 if (lfirst_oid(item_a) != lfirst_oid(item_b))
1738 elog(ERROR, "unrecognized list node type: %d",
1740 return false; /* keep compiler quiet */
1744 * If we got here, we should have run out of elements of both lists
1746 Assert(item_a == NULL);
1747 Assert(item_b == NULL);
1753 * Stuff from value.h
1757 _equalValue(Value *a, Value *b)
1759 COMPARE_SCALAR_FIELD(type);
1764 COMPARE_SCALAR_FIELD(val.ival);
1769 COMPARE_STRING_FIELD(val.str);
1775 elog(ERROR, "unrecognized node type: %d", (int) a->type);
1784 * returns whether two nodes are equal
1787 equal(void *a, void *b)
1795 * note that a!=b, so only one of them can be NULL
1797 if (a == NULL || b == NULL)
1801 * are they the same type of nodes?
1803 if (nodeTag(a) != nodeTag(b))
1812 retval = _equalResdom(a, b);
1815 retval = _equalAlias(a, b);
1818 retval = _equalRangeVar(a, b);
1821 retval = _equalVar(a, b);
1824 retval = _equalConst(a, b);
1827 retval = _equalParam(a, b);
1830 retval = _equalAggref(a, b);
1833 retval = _equalArrayRef(a, b);
1836 retval = _equalFuncExpr(a, b);
1839 retval = _equalOpExpr(a, b);
1841 case T_DistinctExpr:
1842 retval = _equalDistinctExpr(a, b);
1844 case T_ScalarArrayOpExpr:
1845 retval = _equalScalarArrayOpExpr(a, b);
1848 retval = _equalBoolExpr(a, b);
1851 retval = _equalSubLink(a, b);
1854 retval = _equalSubPlan(a, b);
1857 retval = _equalFieldSelect(a, b);
1860 retval = _equalFieldStore(a, b);
1863 retval = _equalRelabelType(a, b);
1865 case T_ConvertRowtypeExpr:
1866 retval = _equalConvertRowtypeExpr(a, b);
1869 retval = _equalCaseExpr(a, b);
1872 retval = _equalCaseWhen(a, b);
1874 case T_CaseTestExpr:
1875 retval = _equalCaseTestExpr(a, b);
1878 retval = _equalArrayExpr(a, b);
1881 retval = _equalRowExpr(a, b);
1883 case T_CoalesceExpr:
1884 retval = _equalCoalesceExpr(a, b);
1887 retval = _equalNullIfExpr(a, b);
1890 retval = _equalNullTest(a, b);
1893 retval = _equalBooleanTest(a, b);
1895 case T_CoerceToDomain:
1896 retval = _equalCoerceToDomain(a, b);
1898 case T_CoerceToDomainValue:
1899 retval = _equalCoerceToDomainValue(a, b);
1901 case T_SetToDefault:
1902 retval = _equalSetToDefault(a, b);
1905 retval = _equalTargetEntry(a, b);
1908 retval = _equalRangeTblRef(a, b);
1911 retval = _equalFromExpr(a, b);
1914 retval = _equalJoinExpr(a, b);
1921 retval = _equalPathKeyItem(a, b);
1923 case T_RestrictInfo:
1924 retval = _equalRestrictInfo(a, b);
1927 retval = _equalJoinInfo(a, b);
1929 case T_InClauseInfo:
1930 retval = _equalInClauseInfo(a, b);
1935 retval = _equalList(a, b);
1943 retval = _equalValue(a, b);
1950 retval = _equalQuery(a, b);
1953 retval = _equalInsertStmt(a, b);
1956 retval = _equalDeleteStmt(a, b);
1959 retval = _equalUpdateStmt(a, b);
1962 retval = _equalSelectStmt(a, b);
1964 case T_SetOperationStmt:
1965 retval = _equalSetOperationStmt(a, b);
1967 case T_AlterTableStmt:
1968 retval = _equalAlterTableStmt(a, b);
1970 case T_AlterTableCmd:
1971 retval = _equalAlterTableCmd(a, b);
1973 case T_AlterDomainStmt:
1974 retval = _equalAlterDomainStmt(a, b);
1977 retval = _equalGrantStmt(a, b);
1979 case T_DeclareCursorStmt:
1980 retval = _equalDeclareCursorStmt(a, b);
1982 case T_ClosePortalStmt:
1983 retval = _equalClosePortalStmt(a, b);
1986 retval = _equalClusterStmt(a, b);
1989 retval = _equalCopyStmt(a, b);
1992 retval = _equalCreateStmt(a, b);
1995 retval = _equalInhRelation(a, b);
1998 retval = _equalDefineStmt(a, b);
2001 retval = _equalDropStmt(a, b);
2003 case T_TruncateStmt:
2004 retval = _equalTruncateStmt(a, b);
2007 retval = _equalCommentStmt(a, b);
2010 retval = _equalFetchStmt(a, b);
2013 retval = _equalIndexStmt(a, b);
2015 case T_CreateFunctionStmt:
2016 retval = _equalCreateFunctionStmt(a, b);
2018 case T_FunctionParameter:
2019 retval = _equalFunctionParameter(a, b);
2021 case T_RemoveAggrStmt:
2022 retval = _equalRemoveAggrStmt(a, b);
2024 case T_RemoveFuncStmt:
2025 retval = _equalRemoveFuncStmt(a, b);
2027 case T_RemoveOperStmt:
2028 retval = _equalRemoveOperStmt(a, b);
2030 case T_RemoveOpClassStmt:
2031 retval = _equalRemoveOpClassStmt(a, b);
2034 retval = _equalRenameStmt(a, b);
2036 case T_AlterOwnerStmt:
2037 retval = _equalAlterOwnerStmt(a, b);
2040 retval = _equalRuleStmt(a, b);
2043 retval = _equalNotifyStmt(a, b);
2046 retval = _equalListenStmt(a, b);
2048 case T_UnlistenStmt:
2049 retval = _equalUnlistenStmt(a, b);
2051 case T_TransactionStmt:
2052 retval = _equalTransactionStmt(a, b);
2054 case T_CompositeTypeStmt:
2055 retval = _equalCompositeTypeStmt(a, b);
2058 retval = _equalViewStmt(a, b);
2061 retval = _equalLoadStmt(a, b);
2063 case T_CreateDomainStmt:
2064 retval = _equalCreateDomainStmt(a, b);
2066 case T_CreateOpClassStmt:
2067 retval = _equalCreateOpClassStmt(a, b);
2069 case T_CreateOpClassItem:
2070 retval = _equalCreateOpClassItem(a, b);
2072 case T_CreatedbStmt:
2073 retval = _equalCreatedbStmt(a, b);
2075 case T_AlterDatabaseSetStmt:
2076 retval = _equalAlterDatabaseSetStmt(a, b);
2079 retval = _equalDropdbStmt(a, b);
2082 retval = _equalVacuumStmt(a, b);
2085 retval = _equalExplainStmt(a, b);
2087 case T_CreateSeqStmt:
2088 retval = _equalCreateSeqStmt(a, b);
2090 case T_AlterSeqStmt:
2091 retval = _equalAlterSeqStmt(a, b);
2093 case T_VariableSetStmt:
2094 retval = _equalVariableSetStmt(a, b);
2096 case T_VariableShowStmt:
2097 retval = _equalVariableShowStmt(a, b);
2099 case T_VariableResetStmt:
2100 retval = _equalVariableResetStmt(a, b);
2102 case T_CreateTableSpaceStmt:
2103 retval = _equalCreateTableSpaceStmt(a, b);
2105 case T_DropTableSpaceStmt:
2106 retval = _equalDropTableSpaceStmt(a, b);
2108 case T_CreateTrigStmt:
2109 retval = _equalCreateTrigStmt(a, b);
2111 case T_DropPropertyStmt:
2112 retval = _equalDropPropertyStmt(a, b);
2114 case T_CreatePLangStmt:
2115 retval = _equalCreatePLangStmt(a, b);
2117 case T_DropPLangStmt:
2118 retval = _equalDropPLangStmt(a, b);
2120 case T_CreateUserStmt:
2121 retval = _equalCreateUserStmt(a, b);
2123 case T_AlterUserStmt:
2124 retval = _equalAlterUserStmt(a, b);
2126 case T_AlterUserSetStmt:
2127 retval = _equalAlterUserSetStmt(a, b);
2129 case T_DropUserStmt:
2130 retval = _equalDropUserStmt(a, b);
2133 retval = _equalLockStmt(a, b);
2135 case T_ConstraintsSetStmt:
2136 retval = _equalConstraintsSetStmt(a, b);
2138 case T_CreateGroupStmt:
2139 retval = _equalCreateGroupStmt(a, b);
2141 case T_AlterGroupStmt:
2142 retval = _equalAlterGroupStmt(a, b);
2144 case T_DropGroupStmt:
2145 retval = _equalDropGroupStmt(a, b);
2148 retval = _equalReindexStmt(a, b);
2150 case T_CheckPointStmt:
2153 case T_CreateSchemaStmt:
2154 retval = _equalCreateSchemaStmt(a, b);
2156 case T_CreateConversionStmt:
2157 retval = _equalCreateConversionStmt(a, b);
2159 case T_CreateCastStmt:
2160 retval = _equalCreateCastStmt(a, b);
2162 case T_DropCastStmt:
2163 retval = _equalDropCastStmt(a, b);
2166 retval = _equalPrepareStmt(a, b);
2169 retval = _equalExecuteStmt(a, b);
2171 case T_DeallocateStmt:
2172 retval = _equalDeallocateStmt(a, b);
2176 retval = _equalAExpr(a, b);
2179 retval = _equalColumnRef(a, b);
2182 retval = _equalParamRef(a, b);
2185 retval = _equalAConst(a, b);
2188 retval = _equalFuncCall(a, b);
2191 retval = _equalAIndices(a, b);
2193 case T_A_Indirection:
2194 retval = _equalA_Indirection(a, b);
2197 retval = _equalResTarget(a, b);
2200 retval = _equalTypeCast(a, b);
2203 retval = _equalSortBy(a, b);
2205 case T_RangeSubselect:
2206 retval = _equalRangeSubselect(a, b);
2208 case T_RangeFunction:
2209 retval = _equalRangeFunction(a, b);
2212 retval = _equalTypeName(a, b);
2215 retval = _equalIndexElem(a, b);
2218 retval = _equalColumnDef(a, b);
2221 retval = _equalConstraint(a, b);
2224 retval = _equalDefElem(a, b);
2226 case T_RangeTblEntry:
2227 retval = _equalRangeTblEntry(a, b);
2230 retval = _equalSortClause(a, b);
2233 /* GroupClause is equivalent to SortClause */
2234 retval = _equalSortClause(a, b);
2236 case T_FkConstraint:
2237 retval = _equalFkConstraint(a, b);
2240 retval = _equalPrivGrantee(a, b);
2242 case T_FuncWithArgs:
2243 retval = _equalFuncWithArgs(a, b);
2247 elog(ERROR, "unrecognized node type: %d",
2249 retval = false; /* keep compiler quiet */