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.
16 * NOTE: it is intentional that parse location fields (in nodes that have
17 * one) are not compared. This is because we want, for example, a variable
18 * "x" to be considered equal() to another reference to "x" in the query.
21 * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
22 * Portions Copyright (c) 1994, Regents of the University of California
25 * src/backend/nodes/equalfuncs.c
27 *-------------------------------------------------------------------------
32 #include "nodes/relation.h"
33 #include "utils/datum.h"
37 * Macros to simplify comparison of different kinds of fields. Use these
38 * wherever possible to reduce the chance for silly typos. Note that these
39 * hard-wire the convention that the local variables in an Equal routine are
43 /* Compare a simple scalar field (int, float, bool, enum, etc) */
44 #define COMPARE_SCALAR_FIELD(fldname) \
46 if (a->fldname != b->fldname) \
50 /* Compare a field that is a pointer to some kind of Node or Node tree */
51 #define COMPARE_NODE_FIELD(fldname) \
53 if (!equal(a->fldname, b->fldname)) \
57 /* Compare a field that is a pointer to a Bitmapset */
58 #define COMPARE_BITMAPSET_FIELD(fldname) \
60 if (!bms_equal(a->fldname, b->fldname)) \
64 /* Compare a field that is a pointer to a C string, or perhaps NULL */
65 #define COMPARE_STRING_FIELD(fldname) \
67 if (!equalstr(a->fldname, b->fldname)) \
71 /* Macro for comparing string fields that might be NULL */
72 #define equalstr(a, b) \
73 (((a) != NULL && (b) != NULL) ? (strcmp(a, b) == 0) : (a) == (b))
75 /* Compare a field that is a pointer to a simple palloc'd object of size sz */
76 #define COMPARE_POINTER_FIELD(fldname, sz) \
78 if (memcmp(a->fldname, b->fldname, (sz)) != 0) \
82 /* Compare a parse location field (this is a no-op, per note above) */
83 #define COMPARE_LOCATION_FIELD(fldname) \
88 * Stuff from primnodes.h
92 _equalAlias(Alias *a, Alias *b)
94 COMPARE_STRING_FIELD(aliasname);
95 COMPARE_NODE_FIELD(colnames);
101 _equalRangeVar(RangeVar *a, RangeVar *b)
103 COMPARE_STRING_FIELD(catalogname);
104 COMPARE_STRING_FIELD(schemaname);
105 COMPARE_STRING_FIELD(relname);
106 COMPARE_SCALAR_FIELD(inhOpt);
107 COMPARE_SCALAR_FIELD(istemp);
108 COMPARE_NODE_FIELD(alias);
109 COMPARE_LOCATION_FIELD(location);
115 _equalIntoClause(IntoClause *a, IntoClause *b)
117 COMPARE_NODE_FIELD(rel);
118 COMPARE_NODE_FIELD(colNames);
119 COMPARE_NODE_FIELD(options);
120 COMPARE_SCALAR_FIELD(onCommit);
121 COMPARE_STRING_FIELD(tableSpaceName);
127 * We don't need an _equalExpr because Expr is an abstract supertype which
128 * should never actually get instantiated. Also, since it has no common
129 * fields except NodeTag, there's no need for a helper routine to factor
130 * out comparing the common fields...
134 _equalVar(Var *a, Var *b)
136 COMPARE_SCALAR_FIELD(varno);
137 COMPARE_SCALAR_FIELD(varattno);
138 COMPARE_SCALAR_FIELD(vartype);
139 COMPARE_SCALAR_FIELD(vartypmod);
140 COMPARE_SCALAR_FIELD(varlevelsup);
141 COMPARE_SCALAR_FIELD(varnoold);
142 COMPARE_SCALAR_FIELD(varoattno);
143 COMPARE_LOCATION_FIELD(location);
149 _equalConst(Const *a, Const *b)
151 COMPARE_SCALAR_FIELD(consttype);
152 COMPARE_SCALAR_FIELD(consttypmod);
153 COMPARE_SCALAR_FIELD(constlen);
154 COMPARE_SCALAR_FIELD(constisnull);
155 COMPARE_SCALAR_FIELD(constbyval);
156 COMPARE_LOCATION_FIELD(location);
159 * We treat all NULL constants of the same type as equal. Someday this
160 * might need to change? But datumIsEqual doesn't work on nulls, so...
164 return datumIsEqual(a->constvalue, b->constvalue,
165 a->constbyval, a->constlen);
169 _equalParam(Param *a, Param *b)
171 COMPARE_SCALAR_FIELD(paramkind);
172 COMPARE_SCALAR_FIELD(paramid);
173 COMPARE_SCALAR_FIELD(paramtype);
174 COMPARE_SCALAR_FIELD(paramtypmod);
175 COMPARE_LOCATION_FIELD(location);
181 _equalAggref(Aggref *a, Aggref *b)
183 COMPARE_SCALAR_FIELD(aggfnoid);
184 COMPARE_SCALAR_FIELD(aggtype);
185 COMPARE_NODE_FIELD(args);
186 COMPARE_NODE_FIELD(aggorder);
187 COMPARE_NODE_FIELD(aggdistinct);
188 COMPARE_SCALAR_FIELD(aggstar);
189 COMPARE_SCALAR_FIELD(agglevelsup);
190 COMPARE_LOCATION_FIELD(location);
196 _equalWindowFunc(WindowFunc *a, WindowFunc *b)
198 COMPARE_SCALAR_FIELD(winfnoid);
199 COMPARE_SCALAR_FIELD(wintype);
200 COMPARE_NODE_FIELD(args);
201 COMPARE_SCALAR_FIELD(winref);
202 COMPARE_SCALAR_FIELD(winstar);
203 COMPARE_SCALAR_FIELD(winagg);
204 COMPARE_LOCATION_FIELD(location);
210 _equalArrayRef(ArrayRef *a, ArrayRef *b)
212 COMPARE_SCALAR_FIELD(refarraytype);
213 COMPARE_SCALAR_FIELD(refelemtype);
214 COMPARE_SCALAR_FIELD(reftypmod);
215 COMPARE_NODE_FIELD(refupperindexpr);
216 COMPARE_NODE_FIELD(reflowerindexpr);
217 COMPARE_NODE_FIELD(refexpr);
218 COMPARE_NODE_FIELD(refassgnexpr);
224 _equalFuncExpr(FuncExpr *a, FuncExpr *b)
226 COMPARE_SCALAR_FIELD(funcid);
227 COMPARE_SCALAR_FIELD(funcresulttype);
228 COMPARE_SCALAR_FIELD(funcretset);
231 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
232 * that are equal() to both explicit and implicit coercions.
234 if (a->funcformat != b->funcformat &&
235 a->funcformat != COERCE_DONTCARE &&
236 b->funcformat != COERCE_DONTCARE)
239 COMPARE_NODE_FIELD(args);
240 COMPARE_LOCATION_FIELD(location);
246 _equalNamedArgExpr(NamedArgExpr *a, NamedArgExpr *b)
248 COMPARE_NODE_FIELD(arg);
249 COMPARE_STRING_FIELD(name);
250 COMPARE_SCALAR_FIELD(argnumber);
251 COMPARE_LOCATION_FIELD(location);
257 _equalOpExpr(OpExpr *a, OpExpr *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 node
264 * isn't as far along in the parse/plan pipeline and hasn't had the
265 * 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);
275 COMPARE_LOCATION_FIELD(location);
281 _equalDistinctExpr(DistinctExpr *a, DistinctExpr *b)
283 COMPARE_SCALAR_FIELD(opno);
286 * Special-case opfuncid: it is allowable for it to differ if one node
287 * contains zero and the other doesn't. This just means that the one node
288 * isn't as far along in the parse/plan pipeline and hasn't had the
289 * opfuncid cache filled yet.
291 if (a->opfuncid != b->opfuncid &&
296 COMPARE_SCALAR_FIELD(opresulttype);
297 COMPARE_SCALAR_FIELD(opretset);
298 COMPARE_NODE_FIELD(args);
299 COMPARE_LOCATION_FIELD(location);
305 _equalScalarArrayOpExpr(ScalarArrayOpExpr *a, ScalarArrayOpExpr *b)
307 COMPARE_SCALAR_FIELD(opno);
310 * Special-case opfuncid: it is allowable for it to differ if one node
311 * contains zero and the other doesn't. This just means that the one node
312 * isn't as far along in the parse/plan pipeline and hasn't had the
313 * opfuncid cache filled yet.
315 if (a->opfuncid != b->opfuncid &&
320 COMPARE_SCALAR_FIELD(useOr);
321 COMPARE_NODE_FIELD(args);
322 COMPARE_LOCATION_FIELD(location);
328 _equalBoolExpr(BoolExpr *a, BoolExpr *b)
330 COMPARE_SCALAR_FIELD(boolop);
331 COMPARE_NODE_FIELD(args);
332 COMPARE_LOCATION_FIELD(location);
338 _equalSubLink(SubLink *a, SubLink *b)
340 COMPARE_SCALAR_FIELD(subLinkType);
341 COMPARE_NODE_FIELD(testexpr);
342 COMPARE_NODE_FIELD(operName);
343 COMPARE_NODE_FIELD(subselect);
344 COMPARE_LOCATION_FIELD(location);
350 _equalSubPlan(SubPlan *a, SubPlan *b)
352 COMPARE_SCALAR_FIELD(subLinkType);
353 COMPARE_NODE_FIELD(testexpr);
354 COMPARE_NODE_FIELD(paramIds);
355 COMPARE_SCALAR_FIELD(plan_id);
356 COMPARE_STRING_FIELD(plan_name);
357 COMPARE_SCALAR_FIELD(firstColType);
358 COMPARE_SCALAR_FIELD(firstColTypmod);
359 COMPARE_SCALAR_FIELD(useHashTable);
360 COMPARE_SCALAR_FIELD(unknownEqFalse);
361 COMPARE_NODE_FIELD(setParam);
362 COMPARE_NODE_FIELD(parParam);
363 COMPARE_NODE_FIELD(args);
364 COMPARE_SCALAR_FIELD(startup_cost);
365 COMPARE_SCALAR_FIELD(per_call_cost);
371 _equalAlternativeSubPlan(AlternativeSubPlan *a, AlternativeSubPlan *b)
373 COMPARE_NODE_FIELD(subplans);
379 _equalFieldSelect(FieldSelect *a, FieldSelect *b)
381 COMPARE_NODE_FIELD(arg);
382 COMPARE_SCALAR_FIELD(fieldnum);
383 COMPARE_SCALAR_FIELD(resulttype);
384 COMPARE_SCALAR_FIELD(resulttypmod);
390 _equalFieldStore(FieldStore *a, FieldStore *b)
392 COMPARE_NODE_FIELD(arg);
393 COMPARE_NODE_FIELD(newvals);
394 COMPARE_NODE_FIELD(fieldnums);
395 COMPARE_SCALAR_FIELD(resulttype);
401 _equalRelabelType(RelabelType *a, RelabelType *b)
403 COMPARE_NODE_FIELD(arg);
404 COMPARE_SCALAR_FIELD(resulttype);
405 COMPARE_SCALAR_FIELD(resulttypmod);
408 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
409 * that are equal() to both explicit and implicit coercions.
411 if (a->relabelformat != b->relabelformat &&
412 a->relabelformat != COERCE_DONTCARE &&
413 b->relabelformat != COERCE_DONTCARE)
416 COMPARE_LOCATION_FIELD(location);
422 _equalCoerceViaIO(CoerceViaIO *a, CoerceViaIO *b)
424 COMPARE_NODE_FIELD(arg);
425 COMPARE_SCALAR_FIELD(resulttype);
428 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
429 * that are equal() to both explicit and implicit coercions.
431 if (a->coerceformat != b->coerceformat &&
432 a->coerceformat != COERCE_DONTCARE &&
433 b->coerceformat != COERCE_DONTCARE)
436 COMPARE_LOCATION_FIELD(location);
442 _equalArrayCoerceExpr(ArrayCoerceExpr *a, ArrayCoerceExpr *b)
444 COMPARE_NODE_FIELD(arg);
445 COMPARE_SCALAR_FIELD(elemfuncid);
446 COMPARE_SCALAR_FIELD(resulttype);
447 COMPARE_SCALAR_FIELD(resulttypmod);
448 COMPARE_SCALAR_FIELD(isExplicit);
451 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
452 * that are equal() to both explicit and implicit coercions.
454 if (a->coerceformat != b->coerceformat &&
455 a->coerceformat != COERCE_DONTCARE &&
456 b->coerceformat != COERCE_DONTCARE)
459 COMPARE_LOCATION_FIELD(location);
465 _equalConvertRowtypeExpr(ConvertRowtypeExpr *a, ConvertRowtypeExpr *b)
467 COMPARE_NODE_FIELD(arg);
468 COMPARE_SCALAR_FIELD(resulttype);
471 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
472 * that are equal() to both explicit and implicit coercions.
474 if (a->convertformat != b->convertformat &&
475 a->convertformat != COERCE_DONTCARE &&
476 b->convertformat != COERCE_DONTCARE)
479 COMPARE_LOCATION_FIELD(location);
485 _equalCaseExpr(CaseExpr *a, CaseExpr *b)
487 COMPARE_SCALAR_FIELD(casetype);
488 COMPARE_NODE_FIELD(arg);
489 COMPARE_NODE_FIELD(args);
490 COMPARE_NODE_FIELD(defresult);
491 COMPARE_LOCATION_FIELD(location);
497 _equalCaseWhen(CaseWhen *a, CaseWhen *b)
499 COMPARE_NODE_FIELD(expr);
500 COMPARE_NODE_FIELD(result);
501 COMPARE_LOCATION_FIELD(location);
507 _equalCaseTestExpr(CaseTestExpr *a, CaseTestExpr *b)
509 COMPARE_SCALAR_FIELD(typeId);
510 COMPARE_SCALAR_FIELD(typeMod);
516 _equalArrayExpr(ArrayExpr *a, ArrayExpr *b)
518 COMPARE_SCALAR_FIELD(array_typeid);
519 COMPARE_SCALAR_FIELD(element_typeid);
520 COMPARE_NODE_FIELD(elements);
521 COMPARE_SCALAR_FIELD(multidims);
522 COMPARE_LOCATION_FIELD(location);
528 _equalRowExpr(RowExpr *a, RowExpr *b)
530 COMPARE_NODE_FIELD(args);
531 COMPARE_SCALAR_FIELD(row_typeid);
534 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
535 * that are equal() to both explicit and implicit coercions.
537 if (a->row_format != b->row_format &&
538 a->row_format != COERCE_DONTCARE &&
539 b->row_format != COERCE_DONTCARE)
542 COMPARE_NODE_FIELD(colnames);
543 COMPARE_LOCATION_FIELD(location);
549 _equalRowCompareExpr(RowCompareExpr *a, RowCompareExpr *b)
551 COMPARE_SCALAR_FIELD(rctype);
552 COMPARE_NODE_FIELD(opnos);
553 COMPARE_NODE_FIELD(opfamilies);
554 COMPARE_NODE_FIELD(largs);
555 COMPARE_NODE_FIELD(rargs);
561 _equalCoalesceExpr(CoalesceExpr *a, CoalesceExpr *b)
563 COMPARE_SCALAR_FIELD(coalescetype);
564 COMPARE_NODE_FIELD(args);
565 COMPARE_LOCATION_FIELD(location);
571 _equalMinMaxExpr(MinMaxExpr *a, MinMaxExpr *b)
573 COMPARE_SCALAR_FIELD(minmaxtype);
574 COMPARE_SCALAR_FIELD(op);
575 COMPARE_NODE_FIELD(args);
576 COMPARE_LOCATION_FIELD(location);
582 _equalXmlExpr(XmlExpr *a, XmlExpr *b)
584 COMPARE_SCALAR_FIELD(op);
585 COMPARE_STRING_FIELD(name);
586 COMPARE_NODE_FIELD(named_args);
587 COMPARE_NODE_FIELD(arg_names);
588 COMPARE_NODE_FIELD(args);
589 COMPARE_SCALAR_FIELD(xmloption);
590 COMPARE_SCALAR_FIELD(type);
591 COMPARE_SCALAR_FIELD(typmod);
592 COMPARE_LOCATION_FIELD(location);
598 _equalNullIfExpr(NullIfExpr *a, NullIfExpr *b)
600 COMPARE_SCALAR_FIELD(opno);
603 * Special-case opfuncid: it is allowable for it to differ if one node
604 * contains zero and the other doesn't. This just means that the one node
605 * isn't as far along in the parse/plan pipeline and hasn't had the
606 * opfuncid cache filled yet.
608 if (a->opfuncid != b->opfuncid &&
613 COMPARE_SCALAR_FIELD(opresulttype);
614 COMPARE_SCALAR_FIELD(opretset);
615 COMPARE_NODE_FIELD(args);
616 COMPARE_LOCATION_FIELD(location);
622 _equalNullTest(NullTest *a, NullTest *b)
624 COMPARE_NODE_FIELD(arg);
625 COMPARE_SCALAR_FIELD(nulltesttype);
626 COMPARE_SCALAR_FIELD(argisrow);
632 _equalBooleanTest(BooleanTest *a, BooleanTest *b)
634 COMPARE_NODE_FIELD(arg);
635 COMPARE_SCALAR_FIELD(booltesttype);
641 _equalCoerceToDomain(CoerceToDomain *a, CoerceToDomain *b)
643 COMPARE_NODE_FIELD(arg);
644 COMPARE_SCALAR_FIELD(resulttype);
645 COMPARE_SCALAR_FIELD(resulttypmod);
648 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
649 * that are equal() to both explicit and implicit coercions.
651 if (a->coercionformat != b->coercionformat &&
652 a->coercionformat != COERCE_DONTCARE &&
653 b->coercionformat != COERCE_DONTCARE)
656 COMPARE_LOCATION_FIELD(location);
662 _equalCoerceToDomainValue(CoerceToDomainValue *a, CoerceToDomainValue *b)
664 COMPARE_SCALAR_FIELD(typeId);
665 COMPARE_SCALAR_FIELD(typeMod);
666 COMPARE_LOCATION_FIELD(location);
672 _equalSetToDefault(SetToDefault *a, SetToDefault *b)
674 COMPARE_SCALAR_FIELD(typeId);
675 COMPARE_SCALAR_FIELD(typeMod);
676 COMPARE_LOCATION_FIELD(location);
682 _equalCurrentOfExpr(CurrentOfExpr *a, CurrentOfExpr *b)
684 COMPARE_SCALAR_FIELD(cvarno);
685 COMPARE_STRING_FIELD(cursor_name);
686 COMPARE_SCALAR_FIELD(cursor_param);
692 _equalTargetEntry(TargetEntry *a, TargetEntry *b)
694 COMPARE_NODE_FIELD(expr);
695 COMPARE_SCALAR_FIELD(resno);
696 COMPARE_STRING_FIELD(resname);
697 COMPARE_SCALAR_FIELD(ressortgroupref);
698 COMPARE_SCALAR_FIELD(resorigtbl);
699 COMPARE_SCALAR_FIELD(resorigcol);
700 COMPARE_SCALAR_FIELD(resjunk);
706 _equalRangeTblRef(RangeTblRef *a, RangeTblRef *b)
708 COMPARE_SCALAR_FIELD(rtindex);
714 _equalJoinExpr(JoinExpr *a, JoinExpr *b)
716 COMPARE_SCALAR_FIELD(jointype);
717 COMPARE_SCALAR_FIELD(isNatural);
718 COMPARE_NODE_FIELD(larg);
719 COMPARE_NODE_FIELD(rarg);
720 COMPARE_NODE_FIELD(usingClause);
721 COMPARE_NODE_FIELD(quals);
722 COMPARE_NODE_FIELD(alias);
723 COMPARE_SCALAR_FIELD(rtindex);
729 _equalFromExpr(FromExpr *a, FromExpr *b)
731 COMPARE_NODE_FIELD(fromlist);
732 COMPARE_NODE_FIELD(quals);
739 * Stuff from relation.h
743 _equalPathKey(PathKey *a, PathKey *b)
746 * This is normally used on non-canonicalized PathKeys, so must chase up
747 * to the topmost merged EquivalenceClass and see if those are the same
748 * (by pointer equality).
750 EquivalenceClass *a_eclass;
751 EquivalenceClass *b_eclass;
753 a_eclass = a->pk_eclass;
754 while (a_eclass->ec_merged)
755 a_eclass = a_eclass->ec_merged;
756 b_eclass = b->pk_eclass;
757 while (b_eclass->ec_merged)
758 b_eclass = b_eclass->ec_merged;
759 if (a_eclass != b_eclass)
761 COMPARE_SCALAR_FIELD(pk_opfamily);
762 COMPARE_SCALAR_FIELD(pk_strategy);
763 COMPARE_SCALAR_FIELD(pk_nulls_first);
769 _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
771 COMPARE_NODE_FIELD(clause);
772 COMPARE_SCALAR_FIELD(is_pushed_down);
773 COMPARE_SCALAR_FIELD(outerjoin_delayed);
774 COMPARE_BITMAPSET_FIELD(required_relids);
775 COMPARE_BITMAPSET_FIELD(nullable_relids);
778 * We ignore all the remaining fields, since they may not be set yet, and
779 * should be derivable from the clause anyway.
786 _equalPlaceHolderVar(PlaceHolderVar *a, PlaceHolderVar *b)
789 * We intentionally do not compare phexpr. Two PlaceHolderVars with the
790 * same ID and levelsup should be considered equal even if the contained
791 * expressions have managed to mutate to different states. One way in
792 * which that can happen is that initplan sublinks would get replaced by
793 * differently-numbered Params when sublink folding is done. (The end
794 * result of such a situation would be some unreferenced initplans, which
795 * is annoying but not really a problem.)
797 * COMPARE_NODE_FIELD(phexpr);
799 COMPARE_BITMAPSET_FIELD(phrels);
800 COMPARE_SCALAR_FIELD(phid);
801 COMPARE_SCALAR_FIELD(phlevelsup);
807 _equalSpecialJoinInfo(SpecialJoinInfo *a, SpecialJoinInfo *b)
809 COMPARE_BITMAPSET_FIELD(min_lefthand);
810 COMPARE_BITMAPSET_FIELD(min_righthand);
811 COMPARE_BITMAPSET_FIELD(syn_lefthand);
812 COMPARE_BITMAPSET_FIELD(syn_righthand);
813 COMPARE_SCALAR_FIELD(jointype);
814 COMPARE_SCALAR_FIELD(lhs_strict);
815 COMPARE_SCALAR_FIELD(delay_upper_joins);
816 COMPARE_NODE_FIELD(join_quals);
822 _equalAppendRelInfo(AppendRelInfo *a, AppendRelInfo *b)
824 COMPARE_SCALAR_FIELD(parent_relid);
825 COMPARE_SCALAR_FIELD(child_relid);
826 COMPARE_SCALAR_FIELD(parent_reltype);
827 COMPARE_SCALAR_FIELD(child_reltype);
828 COMPARE_NODE_FIELD(translated_vars);
829 COMPARE_SCALAR_FIELD(parent_reloid);
835 _equalPlaceHolderInfo(PlaceHolderInfo *a, PlaceHolderInfo *b)
837 COMPARE_SCALAR_FIELD(phid);
838 COMPARE_NODE_FIELD(ph_var);
839 COMPARE_BITMAPSET_FIELD(ph_eval_at);
840 COMPARE_BITMAPSET_FIELD(ph_needed);
841 COMPARE_BITMAPSET_FIELD(ph_may_need);
842 COMPARE_SCALAR_FIELD(ph_width);
849 * Stuff from parsenodes.h
853 _equalQuery(Query *a, Query *b)
855 COMPARE_SCALAR_FIELD(commandType);
856 COMPARE_SCALAR_FIELD(querySource);
857 COMPARE_SCALAR_FIELD(canSetTag);
858 COMPARE_NODE_FIELD(utilityStmt);
859 COMPARE_SCALAR_FIELD(resultRelation);
860 COMPARE_NODE_FIELD(intoClause);
861 COMPARE_SCALAR_FIELD(hasAggs);
862 COMPARE_SCALAR_FIELD(hasWindowFuncs);
863 COMPARE_SCALAR_FIELD(hasSubLinks);
864 COMPARE_SCALAR_FIELD(hasDistinctOn);
865 COMPARE_SCALAR_FIELD(hasRecursive);
866 COMPARE_SCALAR_FIELD(hasForUpdate);
867 COMPARE_NODE_FIELD(cteList);
868 COMPARE_NODE_FIELD(rtable);
869 COMPARE_NODE_FIELD(jointree);
870 COMPARE_NODE_FIELD(targetList);
871 COMPARE_NODE_FIELD(returningList);
872 COMPARE_NODE_FIELD(groupClause);
873 COMPARE_NODE_FIELD(havingQual);
874 COMPARE_NODE_FIELD(windowClause);
875 COMPARE_NODE_FIELD(distinctClause);
876 COMPARE_NODE_FIELD(sortClause);
877 COMPARE_NODE_FIELD(limitOffset);
878 COMPARE_NODE_FIELD(limitCount);
879 COMPARE_NODE_FIELD(rowMarks);
880 COMPARE_NODE_FIELD(setOperations);
881 COMPARE_NODE_FIELD(constraintDeps);
887 _equalInsertStmt(InsertStmt *a, InsertStmt *b)
889 COMPARE_NODE_FIELD(relation);
890 COMPARE_NODE_FIELD(cols);
891 COMPARE_NODE_FIELD(selectStmt);
892 COMPARE_NODE_FIELD(returningList);
893 COMPARE_NODE_FIELD(withClause);
899 _equalDeleteStmt(DeleteStmt *a, DeleteStmt *b)
901 COMPARE_NODE_FIELD(relation);
902 COMPARE_NODE_FIELD(usingClause);
903 COMPARE_NODE_FIELD(whereClause);
904 COMPARE_NODE_FIELD(returningList);
905 COMPARE_NODE_FIELD(withClause);
911 _equalUpdateStmt(UpdateStmt *a, UpdateStmt *b)
913 COMPARE_NODE_FIELD(relation);
914 COMPARE_NODE_FIELD(targetList);
915 COMPARE_NODE_FIELD(whereClause);
916 COMPARE_NODE_FIELD(fromClause);
917 COMPARE_NODE_FIELD(returningList);
918 COMPARE_NODE_FIELD(withClause);
924 _equalSelectStmt(SelectStmt *a, SelectStmt *b)
926 COMPARE_NODE_FIELD(distinctClause);
927 COMPARE_NODE_FIELD(intoClause);
928 COMPARE_NODE_FIELD(targetList);
929 COMPARE_NODE_FIELD(fromClause);
930 COMPARE_NODE_FIELD(whereClause);
931 COMPARE_NODE_FIELD(groupClause);
932 COMPARE_NODE_FIELD(havingClause);
933 COMPARE_NODE_FIELD(windowClause);
934 COMPARE_NODE_FIELD(withClause);
935 COMPARE_NODE_FIELD(valuesLists);
936 COMPARE_NODE_FIELD(sortClause);
937 COMPARE_NODE_FIELD(limitOffset);
938 COMPARE_NODE_FIELD(limitCount);
939 COMPARE_NODE_FIELD(lockingClause);
940 COMPARE_SCALAR_FIELD(op);
941 COMPARE_SCALAR_FIELD(all);
942 COMPARE_NODE_FIELD(larg);
943 COMPARE_NODE_FIELD(rarg);
949 _equalSetOperationStmt(SetOperationStmt *a, SetOperationStmt *b)
951 COMPARE_SCALAR_FIELD(op);
952 COMPARE_SCALAR_FIELD(all);
953 COMPARE_NODE_FIELD(larg);
954 COMPARE_NODE_FIELD(rarg);
955 COMPARE_NODE_FIELD(colTypes);
956 COMPARE_NODE_FIELD(colTypmods);
957 COMPARE_NODE_FIELD(groupClauses);
963 _equalAlterTableStmt(AlterTableStmt *a, AlterTableStmt *b)
965 COMPARE_NODE_FIELD(relation);
966 COMPARE_NODE_FIELD(cmds);
967 COMPARE_SCALAR_FIELD(relkind);
973 _equalAlterTableCmd(AlterTableCmd *a, AlterTableCmd *b)
975 COMPARE_SCALAR_FIELD(subtype);
976 COMPARE_STRING_FIELD(name);
977 COMPARE_NODE_FIELD(def);
978 COMPARE_NODE_FIELD(transform);
979 COMPARE_SCALAR_FIELD(behavior);
980 COMPARE_SCALAR_FIELD(missing_ok);
986 _equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
988 COMPARE_SCALAR_FIELD(subtype);
989 COMPARE_NODE_FIELD(typeName);
990 COMPARE_STRING_FIELD(name);
991 COMPARE_NODE_FIELD(def);
992 COMPARE_SCALAR_FIELD(behavior);
998 _equalGrantStmt(GrantStmt *a, GrantStmt *b)
1000 COMPARE_SCALAR_FIELD(is_grant);
1001 COMPARE_SCALAR_FIELD(targtype);
1002 COMPARE_SCALAR_FIELD(objtype);
1003 COMPARE_NODE_FIELD(objects);
1004 COMPARE_NODE_FIELD(privileges);
1005 COMPARE_NODE_FIELD(grantees);
1006 COMPARE_SCALAR_FIELD(grant_option);
1007 COMPARE_SCALAR_FIELD(behavior);
1013 _equalPrivGrantee(PrivGrantee *a, PrivGrantee *b)
1015 COMPARE_STRING_FIELD(rolname);
1021 _equalFuncWithArgs(FuncWithArgs *a, FuncWithArgs *b)
1023 COMPARE_NODE_FIELD(funcname);
1024 COMPARE_NODE_FIELD(funcargs);
1030 _equalAccessPriv(AccessPriv *a, AccessPriv *b)
1032 COMPARE_STRING_FIELD(priv_name);
1033 COMPARE_NODE_FIELD(cols);
1039 _equalGrantRoleStmt(GrantRoleStmt *a, GrantRoleStmt *b)
1041 COMPARE_NODE_FIELD(granted_roles);
1042 COMPARE_NODE_FIELD(grantee_roles);
1043 COMPARE_SCALAR_FIELD(is_grant);
1044 COMPARE_SCALAR_FIELD(admin_opt);
1045 COMPARE_STRING_FIELD(grantor);
1046 COMPARE_SCALAR_FIELD(behavior);
1052 _equalAlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *a, AlterDefaultPrivilegesStmt *b)
1054 COMPARE_NODE_FIELD(options);
1055 COMPARE_NODE_FIELD(action);
1061 _equalDeclareCursorStmt(DeclareCursorStmt *a, DeclareCursorStmt *b)
1063 COMPARE_STRING_FIELD(portalname);
1064 COMPARE_SCALAR_FIELD(options);
1065 COMPARE_NODE_FIELD(query);
1071 _equalClosePortalStmt(ClosePortalStmt *a, ClosePortalStmt *b)
1073 COMPARE_STRING_FIELD(portalname);
1079 _equalClusterStmt(ClusterStmt *a, ClusterStmt *b)
1081 COMPARE_NODE_FIELD(relation);
1082 COMPARE_STRING_FIELD(indexname);
1083 COMPARE_SCALAR_FIELD(verbose);
1089 _equalCopyStmt(CopyStmt *a, CopyStmt *b)
1091 COMPARE_NODE_FIELD(relation);
1092 COMPARE_NODE_FIELD(query);
1093 COMPARE_NODE_FIELD(attlist);
1094 COMPARE_SCALAR_FIELD(is_from);
1095 COMPARE_STRING_FIELD(filename);
1096 COMPARE_NODE_FIELD(options);
1102 _equalCreateStmt(CreateStmt *a, CreateStmt *b)
1104 COMPARE_NODE_FIELD(relation);
1105 COMPARE_NODE_FIELD(tableElts);
1106 COMPARE_NODE_FIELD(inhRelations);
1107 COMPARE_NODE_FIELD(ofTypename);
1108 COMPARE_NODE_FIELD(constraints);
1109 COMPARE_NODE_FIELD(options);
1110 COMPARE_SCALAR_FIELD(oncommit);
1111 COMPARE_STRING_FIELD(tablespacename);
1112 COMPARE_SCALAR_FIELD(if_not_exists);
1118 _equalInhRelation(InhRelation *a, InhRelation *b)
1120 COMPARE_NODE_FIELD(relation);
1121 COMPARE_SCALAR_FIELD(options);
1127 _equalDefineStmt(DefineStmt *a, DefineStmt *b)
1129 COMPARE_SCALAR_FIELD(kind);
1130 COMPARE_SCALAR_FIELD(oldstyle);
1131 COMPARE_NODE_FIELD(defnames);
1132 COMPARE_NODE_FIELD(args);
1133 COMPARE_NODE_FIELD(definition);
1139 _equalDropStmt(DropStmt *a, DropStmt *b)
1141 COMPARE_NODE_FIELD(objects);
1142 COMPARE_SCALAR_FIELD(removeType);
1143 COMPARE_SCALAR_FIELD(behavior);
1144 COMPARE_SCALAR_FIELD(missing_ok);
1150 _equalTruncateStmt(TruncateStmt *a, TruncateStmt *b)
1152 COMPARE_NODE_FIELD(relations);
1153 COMPARE_SCALAR_FIELD(restart_seqs);
1154 COMPARE_SCALAR_FIELD(behavior);
1160 _equalCommentStmt(CommentStmt *a, CommentStmt *b)
1162 COMPARE_SCALAR_FIELD(objtype);
1163 COMPARE_NODE_FIELD(objname);
1164 COMPARE_NODE_FIELD(objargs);
1165 COMPARE_STRING_FIELD(comment);
1171 _equalSecLabelStmt(SecLabelStmt *a, SecLabelStmt *b)
1173 COMPARE_SCALAR_FIELD(objtype);
1174 COMPARE_NODE_FIELD(objname);
1175 COMPARE_NODE_FIELD(objargs);
1176 COMPARE_STRING_FIELD(provider);
1177 COMPARE_STRING_FIELD(label);
1183 _equalFetchStmt(FetchStmt *a, FetchStmt *b)
1185 COMPARE_SCALAR_FIELD(direction);
1186 COMPARE_SCALAR_FIELD(howMany);
1187 COMPARE_STRING_FIELD(portalname);
1188 COMPARE_SCALAR_FIELD(ismove);
1194 _equalIndexStmt(IndexStmt *a, IndexStmt *b)
1196 COMPARE_STRING_FIELD(idxname);
1197 COMPARE_NODE_FIELD(relation);
1198 COMPARE_STRING_FIELD(accessMethod);
1199 COMPARE_STRING_FIELD(tableSpace);
1200 COMPARE_NODE_FIELD(indexParams);
1201 COMPARE_NODE_FIELD(options);
1202 COMPARE_NODE_FIELD(whereClause);
1203 COMPARE_NODE_FIELD(excludeOpNames);
1204 COMPARE_SCALAR_FIELD(unique);
1205 COMPARE_SCALAR_FIELD(primary);
1206 COMPARE_SCALAR_FIELD(isconstraint);
1207 COMPARE_SCALAR_FIELD(deferrable);
1208 COMPARE_SCALAR_FIELD(initdeferred);
1209 COMPARE_SCALAR_FIELD(concurrent);
1215 _equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b)
1217 COMPARE_SCALAR_FIELD(replace);
1218 COMPARE_NODE_FIELD(funcname);
1219 COMPARE_NODE_FIELD(parameters);
1220 COMPARE_NODE_FIELD(returnType);
1221 COMPARE_NODE_FIELD(options);
1222 COMPARE_NODE_FIELD(withClause);
1228 _equalFunctionParameter(FunctionParameter *a, FunctionParameter *b)
1230 COMPARE_STRING_FIELD(name);
1231 COMPARE_NODE_FIELD(argType);
1232 COMPARE_SCALAR_FIELD(mode);
1233 COMPARE_NODE_FIELD(defexpr);
1239 _equalAlterFunctionStmt(AlterFunctionStmt *a, AlterFunctionStmt *b)
1241 COMPARE_NODE_FIELD(func);
1242 COMPARE_NODE_FIELD(actions);
1248 _equalRemoveFuncStmt(RemoveFuncStmt *a, RemoveFuncStmt *b)
1250 COMPARE_SCALAR_FIELD(kind);
1251 COMPARE_NODE_FIELD(name);
1252 COMPARE_NODE_FIELD(args);
1253 COMPARE_SCALAR_FIELD(behavior);
1254 COMPARE_SCALAR_FIELD(missing_ok);
1260 _equalDoStmt(DoStmt *a, DoStmt *b)
1262 COMPARE_NODE_FIELD(args);
1268 _equalRemoveOpClassStmt(RemoveOpClassStmt *a, RemoveOpClassStmt *b)
1270 COMPARE_NODE_FIELD(opclassname);
1271 COMPARE_STRING_FIELD(amname);
1272 COMPARE_SCALAR_FIELD(behavior);
1273 COMPARE_SCALAR_FIELD(missing_ok);
1279 _equalRemoveOpFamilyStmt(RemoveOpFamilyStmt *a, RemoveOpFamilyStmt *b)
1281 COMPARE_NODE_FIELD(opfamilyname);
1282 COMPARE_STRING_FIELD(amname);
1283 COMPARE_SCALAR_FIELD(behavior);
1284 COMPARE_SCALAR_FIELD(missing_ok);
1290 _equalRenameStmt(RenameStmt *a, RenameStmt *b)
1292 COMPARE_SCALAR_FIELD(renameType);
1293 COMPARE_NODE_FIELD(relation);
1294 COMPARE_NODE_FIELD(object);
1295 COMPARE_NODE_FIELD(objarg);
1296 COMPARE_STRING_FIELD(subname);
1297 COMPARE_STRING_FIELD(newname);
1303 _equalAlterObjectSchemaStmt(AlterObjectSchemaStmt *a, AlterObjectSchemaStmt *b)
1305 COMPARE_SCALAR_FIELD(objectType);
1306 COMPARE_NODE_FIELD(relation);
1307 COMPARE_NODE_FIELD(object);
1308 COMPARE_NODE_FIELD(objarg);
1309 COMPARE_STRING_FIELD(addname);
1310 COMPARE_STRING_FIELD(newschema);
1316 _equalAlterOwnerStmt(AlterOwnerStmt *a, AlterOwnerStmt *b)
1318 COMPARE_SCALAR_FIELD(objectType);
1319 COMPARE_NODE_FIELD(relation);
1320 COMPARE_NODE_FIELD(object);
1321 COMPARE_NODE_FIELD(objarg);
1322 COMPARE_STRING_FIELD(addname);
1323 COMPARE_STRING_FIELD(newowner);
1329 _equalRuleStmt(RuleStmt *a, RuleStmt *b)
1331 COMPARE_NODE_FIELD(relation);
1332 COMPARE_STRING_FIELD(rulename);
1333 COMPARE_NODE_FIELD(whereClause);
1334 COMPARE_SCALAR_FIELD(event);
1335 COMPARE_SCALAR_FIELD(instead);
1336 COMPARE_NODE_FIELD(actions);
1337 COMPARE_SCALAR_FIELD(replace);
1343 _equalNotifyStmt(NotifyStmt *a, NotifyStmt *b)
1345 COMPARE_STRING_FIELD(conditionname);
1346 COMPARE_STRING_FIELD(payload);
1352 _equalListenStmt(ListenStmt *a, ListenStmt *b)
1354 COMPARE_STRING_FIELD(conditionname);
1360 _equalUnlistenStmt(UnlistenStmt *a, UnlistenStmt *b)
1362 COMPARE_STRING_FIELD(conditionname);
1368 _equalTransactionStmt(TransactionStmt *a, TransactionStmt *b)
1370 COMPARE_SCALAR_FIELD(kind);
1371 COMPARE_NODE_FIELD(options);
1372 COMPARE_STRING_FIELD(gid);
1378 _equalCompositeTypeStmt(CompositeTypeStmt *a, CompositeTypeStmt *b)
1380 COMPARE_NODE_FIELD(typevar);
1381 COMPARE_NODE_FIELD(coldeflist);
1387 _equalCreateEnumStmt(CreateEnumStmt *a, CreateEnumStmt *b)
1389 COMPARE_NODE_FIELD(typeName);
1390 COMPARE_NODE_FIELD(vals);
1396 _equalViewStmt(ViewStmt *a, ViewStmt *b)
1398 COMPARE_NODE_FIELD(view);
1399 COMPARE_NODE_FIELD(aliases);
1400 COMPARE_NODE_FIELD(query);
1401 COMPARE_SCALAR_FIELD(replace);
1407 _equalLoadStmt(LoadStmt *a, LoadStmt *b)
1409 COMPARE_STRING_FIELD(filename);
1415 _equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b)
1417 COMPARE_NODE_FIELD(domainname);
1418 COMPARE_NODE_FIELD(typeName);
1419 COMPARE_NODE_FIELD(constraints);
1425 _equalCreateOpClassStmt(CreateOpClassStmt *a, CreateOpClassStmt *b)
1427 COMPARE_NODE_FIELD(opclassname);
1428 COMPARE_NODE_FIELD(opfamilyname);
1429 COMPARE_STRING_FIELD(amname);
1430 COMPARE_NODE_FIELD(datatype);
1431 COMPARE_NODE_FIELD(items);
1432 COMPARE_SCALAR_FIELD(isDefault);
1438 _equalCreateOpClassItem(CreateOpClassItem *a, CreateOpClassItem *b)
1440 COMPARE_SCALAR_FIELD(itemtype);
1441 COMPARE_NODE_FIELD(name);
1442 COMPARE_NODE_FIELD(args);
1443 COMPARE_SCALAR_FIELD(number);
1444 COMPARE_NODE_FIELD(class_args);
1445 COMPARE_NODE_FIELD(storedtype);
1451 _equalCreateOpFamilyStmt(CreateOpFamilyStmt *a, CreateOpFamilyStmt *b)
1453 COMPARE_NODE_FIELD(opfamilyname);
1454 COMPARE_STRING_FIELD(amname);
1460 _equalAlterOpFamilyStmt(AlterOpFamilyStmt *a, AlterOpFamilyStmt *b)
1462 COMPARE_NODE_FIELD(opfamilyname);
1463 COMPARE_STRING_FIELD(amname);
1464 COMPARE_SCALAR_FIELD(isDrop);
1465 COMPARE_NODE_FIELD(items);
1471 _equalCreatedbStmt(CreatedbStmt *a, CreatedbStmt *b)
1473 COMPARE_STRING_FIELD(dbname);
1474 COMPARE_NODE_FIELD(options);
1480 _equalAlterDatabaseStmt(AlterDatabaseStmt *a, AlterDatabaseStmt *b)
1482 COMPARE_STRING_FIELD(dbname);
1483 COMPARE_NODE_FIELD(options);
1489 _equalAlterDatabaseSetStmt(AlterDatabaseSetStmt *a, AlterDatabaseSetStmt *b)
1491 COMPARE_STRING_FIELD(dbname);
1492 COMPARE_NODE_FIELD(setstmt);
1498 _equalDropdbStmt(DropdbStmt *a, DropdbStmt *b)
1500 COMPARE_STRING_FIELD(dbname);
1501 COMPARE_SCALAR_FIELD(missing_ok);
1507 _equalVacuumStmt(VacuumStmt *a, VacuumStmt *b)
1509 COMPARE_SCALAR_FIELD(options);
1510 COMPARE_SCALAR_FIELD(freeze_min_age);
1511 COMPARE_SCALAR_FIELD(freeze_table_age);
1512 COMPARE_NODE_FIELD(relation);
1513 COMPARE_NODE_FIELD(va_cols);
1519 _equalExplainStmt(ExplainStmt *a, ExplainStmt *b)
1521 COMPARE_NODE_FIELD(query);
1522 COMPARE_NODE_FIELD(options);
1528 _equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
1530 COMPARE_NODE_FIELD(sequence);
1531 COMPARE_NODE_FIELD(options);
1532 COMPARE_SCALAR_FIELD(ownerId);
1538 _equalAlterSeqStmt(AlterSeqStmt *a, AlterSeqStmt *b)
1540 COMPARE_NODE_FIELD(sequence);
1541 COMPARE_NODE_FIELD(options);
1547 _equalVariableSetStmt(VariableSetStmt *a, VariableSetStmt *b)
1549 COMPARE_SCALAR_FIELD(kind);
1550 COMPARE_STRING_FIELD(name);
1551 COMPARE_NODE_FIELD(args);
1552 COMPARE_SCALAR_FIELD(is_local);
1558 _equalVariableShowStmt(VariableShowStmt *a, VariableShowStmt *b)
1560 COMPARE_STRING_FIELD(name);
1566 _equalDiscardStmt(DiscardStmt *a, DiscardStmt *b)
1568 COMPARE_SCALAR_FIELD(target);
1574 _equalCreateTableSpaceStmt(CreateTableSpaceStmt *a, CreateTableSpaceStmt *b)
1576 COMPARE_STRING_FIELD(tablespacename);
1577 COMPARE_STRING_FIELD(owner);
1578 COMPARE_STRING_FIELD(location);
1584 _equalDropTableSpaceStmt(DropTableSpaceStmt *a, DropTableSpaceStmt *b)
1586 COMPARE_STRING_FIELD(tablespacename);
1587 COMPARE_SCALAR_FIELD(missing_ok);
1593 _equalAlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *a,
1594 AlterTableSpaceOptionsStmt *b)
1596 COMPARE_STRING_FIELD(tablespacename);
1597 COMPARE_NODE_FIELD(options);
1598 COMPARE_SCALAR_FIELD(isReset);
1604 _equalCreateFdwStmt(CreateFdwStmt *a, CreateFdwStmt *b)
1606 COMPARE_STRING_FIELD(fdwname);
1607 COMPARE_NODE_FIELD(validator);
1608 COMPARE_NODE_FIELD(options);
1614 _equalAlterFdwStmt(AlterFdwStmt *a, AlterFdwStmt *b)
1616 COMPARE_STRING_FIELD(fdwname);
1617 COMPARE_NODE_FIELD(validator);
1618 COMPARE_SCALAR_FIELD(change_validator);
1619 COMPARE_NODE_FIELD(options);
1625 _equalDropFdwStmt(DropFdwStmt *a, DropFdwStmt *b)
1627 COMPARE_STRING_FIELD(fdwname);
1628 COMPARE_SCALAR_FIELD(missing_ok);
1629 COMPARE_SCALAR_FIELD(behavior);
1635 _equalCreateForeignServerStmt(CreateForeignServerStmt *a, CreateForeignServerStmt *b)
1637 COMPARE_STRING_FIELD(servername);
1638 COMPARE_STRING_FIELD(servertype);
1639 COMPARE_STRING_FIELD(version);
1640 COMPARE_STRING_FIELD(fdwname);
1641 COMPARE_NODE_FIELD(options);
1647 _equalAlterForeignServerStmt(AlterForeignServerStmt *a, AlterForeignServerStmt *b)
1649 COMPARE_STRING_FIELD(servername);
1650 COMPARE_STRING_FIELD(version);
1651 COMPARE_NODE_FIELD(options);
1652 COMPARE_SCALAR_FIELD(has_version);
1658 _equalDropForeignServerStmt(DropForeignServerStmt *a, DropForeignServerStmt *b)
1660 COMPARE_STRING_FIELD(servername);
1661 COMPARE_SCALAR_FIELD(missing_ok);
1662 COMPARE_SCALAR_FIELD(behavior);
1668 _equalCreateUserMappingStmt(CreateUserMappingStmt *a, CreateUserMappingStmt *b)
1670 COMPARE_STRING_FIELD(username);
1671 COMPARE_STRING_FIELD(servername);
1672 COMPARE_NODE_FIELD(options);
1678 _equalAlterUserMappingStmt(AlterUserMappingStmt *a, AlterUserMappingStmt *b)
1680 COMPARE_STRING_FIELD(username);
1681 COMPARE_STRING_FIELD(servername);
1682 COMPARE_NODE_FIELD(options);
1688 _equalDropUserMappingStmt(DropUserMappingStmt *a, DropUserMappingStmt *b)
1690 COMPARE_STRING_FIELD(username);
1691 COMPARE_STRING_FIELD(servername);
1692 COMPARE_SCALAR_FIELD(missing_ok);
1698 _equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
1700 COMPARE_STRING_FIELD(trigname);
1701 COMPARE_NODE_FIELD(relation);
1702 COMPARE_NODE_FIELD(funcname);
1703 COMPARE_NODE_FIELD(args);
1704 COMPARE_SCALAR_FIELD(row);
1705 COMPARE_SCALAR_FIELD(timing);
1706 COMPARE_SCALAR_FIELD(events);
1707 COMPARE_NODE_FIELD(columns);
1708 COMPARE_NODE_FIELD(whenClause);
1709 COMPARE_SCALAR_FIELD(isconstraint);
1710 COMPARE_SCALAR_FIELD(deferrable);
1711 COMPARE_SCALAR_FIELD(initdeferred);
1712 COMPARE_NODE_FIELD(constrrel);
1718 _equalDropPropertyStmt(DropPropertyStmt *a, DropPropertyStmt *b)
1720 COMPARE_NODE_FIELD(relation);
1721 COMPARE_STRING_FIELD(property);
1722 COMPARE_SCALAR_FIELD(removeType);
1723 COMPARE_SCALAR_FIELD(behavior);
1724 COMPARE_SCALAR_FIELD(missing_ok);
1730 _equalCreatePLangStmt(CreatePLangStmt *a, CreatePLangStmt *b)
1732 COMPARE_SCALAR_FIELD(replace);
1733 COMPARE_STRING_FIELD(plname);
1734 COMPARE_NODE_FIELD(plhandler);
1735 COMPARE_NODE_FIELD(plinline);
1736 COMPARE_NODE_FIELD(plvalidator);
1737 COMPARE_SCALAR_FIELD(pltrusted);
1743 _equalDropPLangStmt(DropPLangStmt *a, DropPLangStmt *b)
1745 COMPARE_STRING_FIELD(plname);
1746 COMPARE_SCALAR_FIELD(behavior);
1747 COMPARE_SCALAR_FIELD(missing_ok);
1753 _equalCreateRoleStmt(CreateRoleStmt *a, CreateRoleStmt *b)
1755 COMPARE_SCALAR_FIELD(stmt_type);
1756 COMPARE_STRING_FIELD(role);
1757 COMPARE_NODE_FIELD(options);
1763 _equalAlterRoleStmt(AlterRoleStmt *a, AlterRoleStmt *b)
1765 COMPARE_STRING_FIELD(role);
1766 COMPARE_NODE_FIELD(options);
1767 COMPARE_SCALAR_FIELD(action);
1773 _equalAlterRoleSetStmt(AlterRoleSetStmt *a, AlterRoleSetStmt *b)
1775 COMPARE_STRING_FIELD(role);
1776 COMPARE_STRING_FIELD(database);
1777 COMPARE_NODE_FIELD(setstmt);
1783 _equalDropRoleStmt(DropRoleStmt *a, DropRoleStmt *b)
1785 COMPARE_NODE_FIELD(roles);
1786 COMPARE_SCALAR_FIELD(missing_ok);
1792 _equalLockStmt(LockStmt *a, LockStmt *b)
1794 COMPARE_NODE_FIELD(relations);
1795 COMPARE_SCALAR_FIELD(mode);
1796 COMPARE_SCALAR_FIELD(nowait);
1802 _equalConstraintsSetStmt(ConstraintsSetStmt *a, ConstraintsSetStmt *b)
1804 COMPARE_NODE_FIELD(constraints);
1805 COMPARE_SCALAR_FIELD(deferred);
1811 _equalReindexStmt(ReindexStmt *a, ReindexStmt *b)
1813 COMPARE_SCALAR_FIELD(kind);
1814 COMPARE_NODE_FIELD(relation);
1815 COMPARE_STRING_FIELD(name);
1816 COMPARE_SCALAR_FIELD(do_system);
1817 COMPARE_SCALAR_FIELD(do_user);
1823 _equalCreateSchemaStmt(CreateSchemaStmt *a, CreateSchemaStmt *b)
1825 COMPARE_STRING_FIELD(schemaname);
1826 COMPARE_STRING_FIELD(authid);
1827 COMPARE_NODE_FIELD(schemaElts);
1833 _equalCreateConversionStmt(CreateConversionStmt *a, CreateConversionStmt *b)
1835 COMPARE_NODE_FIELD(conversion_name);
1836 COMPARE_STRING_FIELD(for_encoding_name);
1837 COMPARE_STRING_FIELD(to_encoding_name);
1838 COMPARE_NODE_FIELD(func_name);
1839 COMPARE_SCALAR_FIELD(def);
1845 _equalCreateCastStmt(CreateCastStmt *a, CreateCastStmt *b)
1847 COMPARE_NODE_FIELD(sourcetype);
1848 COMPARE_NODE_FIELD(targettype);
1849 COMPARE_NODE_FIELD(func);
1850 COMPARE_SCALAR_FIELD(context);
1851 COMPARE_SCALAR_FIELD(inout);
1857 _equalDropCastStmt(DropCastStmt *a, DropCastStmt *b)
1859 COMPARE_NODE_FIELD(sourcetype);
1860 COMPARE_NODE_FIELD(targettype);
1861 COMPARE_SCALAR_FIELD(behavior);
1862 COMPARE_SCALAR_FIELD(missing_ok);
1868 _equalPrepareStmt(PrepareStmt *a, PrepareStmt *b)
1870 COMPARE_STRING_FIELD(name);
1871 COMPARE_NODE_FIELD(argtypes);
1872 COMPARE_NODE_FIELD(query);
1878 _equalExecuteStmt(ExecuteStmt *a, ExecuteStmt *b)
1880 COMPARE_STRING_FIELD(name);
1881 COMPARE_NODE_FIELD(into);
1882 COMPARE_NODE_FIELD(params);
1888 _equalDeallocateStmt(DeallocateStmt *a, DeallocateStmt *b)
1890 COMPARE_STRING_FIELD(name);
1896 _equalDropOwnedStmt(DropOwnedStmt *a, DropOwnedStmt *b)
1898 COMPARE_NODE_FIELD(roles);
1899 COMPARE_SCALAR_FIELD(behavior);
1905 _equalReassignOwnedStmt(ReassignOwnedStmt *a, ReassignOwnedStmt *b)
1907 COMPARE_NODE_FIELD(roles);
1908 COMPARE_NODE_FIELD(newrole);
1914 _equalAlterTSDictionaryStmt(AlterTSDictionaryStmt *a, AlterTSDictionaryStmt *b)
1916 COMPARE_NODE_FIELD(dictname);
1917 COMPARE_NODE_FIELD(options);
1923 _equalAlterTSConfigurationStmt(AlterTSConfigurationStmt *a,
1924 AlterTSConfigurationStmt *b)
1926 COMPARE_NODE_FIELD(cfgname);
1927 COMPARE_NODE_FIELD(tokentype);
1928 COMPARE_NODE_FIELD(dicts);
1929 COMPARE_SCALAR_FIELD(override);
1930 COMPARE_SCALAR_FIELD(replace);
1931 COMPARE_SCALAR_FIELD(missing_ok);
1937 _equalAExpr(A_Expr *a, A_Expr *b)
1939 COMPARE_SCALAR_FIELD(kind);
1940 COMPARE_NODE_FIELD(name);
1941 COMPARE_NODE_FIELD(lexpr);
1942 COMPARE_NODE_FIELD(rexpr);
1943 COMPARE_LOCATION_FIELD(location);
1949 _equalColumnRef(ColumnRef *a, ColumnRef *b)
1951 COMPARE_NODE_FIELD(fields);
1952 COMPARE_LOCATION_FIELD(location);
1958 _equalParamRef(ParamRef *a, ParamRef *b)
1960 COMPARE_SCALAR_FIELD(number);
1961 COMPARE_LOCATION_FIELD(location);
1967 _equalAConst(A_Const *a, A_Const *b)
1969 if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
1971 COMPARE_LOCATION_FIELD(location);
1977 _equalFuncCall(FuncCall *a, FuncCall *b)
1979 COMPARE_NODE_FIELD(funcname);
1980 COMPARE_NODE_FIELD(args);
1981 COMPARE_NODE_FIELD(agg_order);
1982 COMPARE_SCALAR_FIELD(agg_star);
1983 COMPARE_SCALAR_FIELD(agg_distinct);
1984 COMPARE_SCALAR_FIELD(func_variadic);
1985 COMPARE_NODE_FIELD(over);
1986 COMPARE_LOCATION_FIELD(location);
1992 _equalAStar(A_Star *a, A_Star *b)
1998 _equalAIndices(A_Indices *a, A_Indices *b)
2000 COMPARE_NODE_FIELD(lidx);
2001 COMPARE_NODE_FIELD(uidx);
2007 _equalA_Indirection(A_Indirection *a, A_Indirection *b)
2009 COMPARE_NODE_FIELD(arg);
2010 COMPARE_NODE_FIELD(indirection);
2016 _equalA_ArrayExpr(A_ArrayExpr *a, A_ArrayExpr *b)
2018 COMPARE_NODE_FIELD(elements);
2019 COMPARE_LOCATION_FIELD(location);
2025 _equalResTarget(ResTarget *a, ResTarget *b)
2027 COMPARE_STRING_FIELD(name);
2028 COMPARE_NODE_FIELD(indirection);
2029 COMPARE_NODE_FIELD(val);
2030 COMPARE_LOCATION_FIELD(location);
2036 _equalTypeName(TypeName *a, TypeName *b)
2038 COMPARE_NODE_FIELD(names);
2039 COMPARE_SCALAR_FIELD(typeOid);
2040 COMPARE_SCALAR_FIELD(setof);
2041 COMPARE_SCALAR_FIELD(pct_type);
2042 COMPARE_NODE_FIELD(typmods);
2043 COMPARE_SCALAR_FIELD(typemod);
2044 COMPARE_NODE_FIELD(arrayBounds);
2045 COMPARE_LOCATION_FIELD(location);
2051 _equalTypeCast(TypeCast *a, TypeCast *b)
2053 COMPARE_NODE_FIELD(arg);
2054 COMPARE_NODE_FIELD(typeName);
2055 COMPARE_LOCATION_FIELD(location);
2061 _equalSortBy(SortBy *a, SortBy *b)
2063 COMPARE_NODE_FIELD(node);
2064 COMPARE_SCALAR_FIELD(sortby_dir);
2065 COMPARE_SCALAR_FIELD(sortby_nulls);
2066 COMPARE_NODE_FIELD(useOp);
2067 COMPARE_LOCATION_FIELD(location);
2073 _equalWindowDef(WindowDef *a, WindowDef *b)
2075 COMPARE_STRING_FIELD(name);
2076 COMPARE_STRING_FIELD(refname);
2077 COMPARE_NODE_FIELD(partitionClause);
2078 COMPARE_NODE_FIELD(orderClause);
2079 COMPARE_SCALAR_FIELD(frameOptions);
2080 COMPARE_NODE_FIELD(startOffset);
2081 COMPARE_NODE_FIELD(endOffset);
2082 COMPARE_LOCATION_FIELD(location);
2088 _equalRangeSubselect(RangeSubselect *a, RangeSubselect *b)
2090 COMPARE_NODE_FIELD(subquery);
2091 COMPARE_NODE_FIELD(alias);
2097 _equalRangeFunction(RangeFunction *a, RangeFunction *b)
2099 COMPARE_NODE_FIELD(funccallnode);
2100 COMPARE_NODE_FIELD(alias);
2101 COMPARE_NODE_FIELD(coldeflist);
2107 _equalIndexElem(IndexElem *a, IndexElem *b)
2109 COMPARE_STRING_FIELD(name);
2110 COMPARE_NODE_FIELD(expr);
2111 COMPARE_STRING_FIELD(indexcolname);
2112 COMPARE_NODE_FIELD(opclass);
2113 COMPARE_SCALAR_FIELD(ordering);
2114 COMPARE_SCALAR_FIELD(nulls_ordering);
2120 _equalColumnDef(ColumnDef *a, ColumnDef *b)
2122 COMPARE_STRING_FIELD(colname);
2123 COMPARE_NODE_FIELD(typeName);
2124 COMPARE_SCALAR_FIELD(inhcount);
2125 COMPARE_SCALAR_FIELD(is_local);
2126 COMPARE_SCALAR_FIELD(is_not_null);
2127 COMPARE_SCALAR_FIELD(storage);
2128 COMPARE_NODE_FIELD(raw_default);
2129 COMPARE_NODE_FIELD(cooked_default);
2130 COMPARE_NODE_FIELD(constraints);
2136 _equalConstraint(Constraint *a, Constraint *b)
2138 COMPARE_SCALAR_FIELD(contype);
2139 COMPARE_STRING_FIELD(conname);
2140 COMPARE_SCALAR_FIELD(deferrable);
2141 COMPARE_SCALAR_FIELD(initdeferred);
2142 COMPARE_LOCATION_FIELD(location);
2143 COMPARE_NODE_FIELD(raw_expr);
2144 COMPARE_STRING_FIELD(cooked_expr);
2145 COMPARE_NODE_FIELD(keys);
2146 COMPARE_NODE_FIELD(exclusions);
2147 COMPARE_NODE_FIELD(options);
2148 COMPARE_STRING_FIELD(indexspace);
2149 COMPARE_STRING_FIELD(access_method);
2150 COMPARE_NODE_FIELD(where_clause);
2151 COMPARE_NODE_FIELD(pktable);
2152 COMPARE_NODE_FIELD(fk_attrs);
2153 COMPARE_NODE_FIELD(pk_attrs);
2154 COMPARE_SCALAR_FIELD(fk_matchtype);
2155 COMPARE_SCALAR_FIELD(fk_upd_action);
2156 COMPARE_SCALAR_FIELD(fk_del_action);
2157 COMPARE_SCALAR_FIELD(skip_validation);
2163 _equalDefElem(DefElem *a, DefElem *b)
2165 COMPARE_STRING_FIELD(defnamespace);
2166 COMPARE_STRING_FIELD(defname);
2167 COMPARE_NODE_FIELD(arg);
2168 COMPARE_SCALAR_FIELD(defaction);
2174 _equalLockingClause(LockingClause *a, LockingClause *b)
2176 COMPARE_NODE_FIELD(lockedRels);
2177 COMPARE_SCALAR_FIELD(forUpdate);
2178 COMPARE_SCALAR_FIELD(noWait);
2184 _equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
2186 COMPARE_SCALAR_FIELD(rtekind);
2187 COMPARE_SCALAR_FIELD(relid);
2188 COMPARE_NODE_FIELD(subquery);
2189 COMPARE_SCALAR_FIELD(jointype);
2190 COMPARE_NODE_FIELD(joinaliasvars);
2191 COMPARE_NODE_FIELD(funcexpr);
2192 COMPARE_NODE_FIELD(funccoltypes);
2193 COMPARE_NODE_FIELD(funccoltypmods);
2194 COMPARE_NODE_FIELD(values_lists);
2195 COMPARE_STRING_FIELD(ctename);
2196 COMPARE_SCALAR_FIELD(ctelevelsup);
2197 COMPARE_SCALAR_FIELD(self_reference);
2198 COMPARE_NODE_FIELD(ctecoltypes);
2199 COMPARE_NODE_FIELD(ctecoltypmods);
2200 COMPARE_NODE_FIELD(alias);
2201 COMPARE_NODE_FIELD(eref);
2202 COMPARE_SCALAR_FIELD(inh);
2203 COMPARE_SCALAR_FIELD(inFromCl);
2204 COMPARE_SCALAR_FIELD(requiredPerms);
2205 COMPARE_SCALAR_FIELD(checkAsUser);
2206 COMPARE_BITMAPSET_FIELD(selectedCols);
2207 COMPARE_BITMAPSET_FIELD(modifiedCols);
2213 _equalSortGroupClause(SortGroupClause *a, SortGroupClause *b)
2215 COMPARE_SCALAR_FIELD(tleSortGroupRef);
2216 COMPARE_SCALAR_FIELD(eqop);
2217 COMPARE_SCALAR_FIELD(sortop);
2218 COMPARE_SCALAR_FIELD(nulls_first);
2224 _equalWindowClause(WindowClause *a, WindowClause *b)
2226 COMPARE_STRING_FIELD(name);
2227 COMPARE_STRING_FIELD(refname);
2228 COMPARE_NODE_FIELD(partitionClause);
2229 COMPARE_NODE_FIELD(orderClause);
2230 COMPARE_SCALAR_FIELD(frameOptions);
2231 COMPARE_NODE_FIELD(startOffset);
2232 COMPARE_NODE_FIELD(endOffset);
2233 COMPARE_SCALAR_FIELD(winref);
2234 COMPARE_SCALAR_FIELD(copiedOrder);
2240 _equalRowMarkClause(RowMarkClause *a, RowMarkClause *b)
2242 COMPARE_SCALAR_FIELD(rti);
2243 COMPARE_SCALAR_FIELD(forUpdate);
2244 COMPARE_SCALAR_FIELD(noWait);
2245 COMPARE_SCALAR_FIELD(pushedDown);
2251 _equalWithClause(WithClause *a, WithClause *b)
2253 COMPARE_NODE_FIELD(ctes);
2254 COMPARE_SCALAR_FIELD(recursive);
2255 COMPARE_LOCATION_FIELD(location);
2261 _equalCommonTableExpr(CommonTableExpr *a, CommonTableExpr *b)
2263 COMPARE_STRING_FIELD(ctename);
2264 COMPARE_NODE_FIELD(aliascolnames);
2265 COMPARE_NODE_FIELD(ctequery);
2266 COMPARE_LOCATION_FIELD(location);
2267 COMPARE_SCALAR_FIELD(cterecursive);
2268 COMPARE_SCALAR_FIELD(cterefcount);
2269 COMPARE_NODE_FIELD(ctecolnames);
2270 COMPARE_NODE_FIELD(ctecoltypes);
2271 COMPARE_NODE_FIELD(ctecoltypmods);
2277 _equalXmlSerialize(XmlSerialize *a, XmlSerialize *b)
2279 COMPARE_SCALAR_FIELD(xmloption);
2280 COMPARE_NODE_FIELD(expr);
2281 COMPARE_NODE_FIELD(typeName);
2282 COMPARE_LOCATION_FIELD(location);
2288 * Stuff from pg_list.h
2292 _equalList(List *a, List *b)
2298 * Try to reject by simple scalar checks before grovelling through all the
2301 COMPARE_SCALAR_FIELD(type);
2302 COMPARE_SCALAR_FIELD(length);
2305 * We place the switch outside the loop for the sake of efficiency; this
2306 * may not be worth doing...
2311 forboth(item_a, a, item_b, b)
2313 if (!equal(lfirst(item_a), lfirst(item_b)))
2318 forboth(item_a, a, item_b, b)
2320 if (lfirst_int(item_a) != lfirst_int(item_b))
2325 forboth(item_a, a, item_b, b)
2327 if (lfirst_oid(item_a) != lfirst_oid(item_b))
2332 elog(ERROR, "unrecognized list node type: %d",
2334 return false; /* keep compiler quiet */
2338 * If we got here, we should have run out of elements of both lists
2340 Assert(item_a == NULL);
2341 Assert(item_b == NULL);
2347 * Stuff from value.h
2351 _equalValue(Value *a, Value *b)
2353 COMPARE_SCALAR_FIELD(type);
2358 COMPARE_SCALAR_FIELD(val.ival);
2363 COMPARE_STRING_FIELD(val.str);
2369 elog(ERROR, "unrecognized node type: %d", (int) a->type);
2378 * returns whether two nodes are equal
2381 equal(void *a, void *b)
2389 * note that a!=b, so only one of them can be NULL
2391 if (a == NULL || b == NULL)
2395 * are they the same type of nodes?
2397 if (nodeTag(a) != nodeTag(b))
2406 retval = _equalAlias(a, b);
2409 retval = _equalRangeVar(a, b);
2412 retval = _equalIntoClause(a, b);
2415 retval = _equalVar(a, b);
2418 retval = _equalConst(a, b);
2421 retval = _equalParam(a, b);
2424 retval = _equalAggref(a, b);
2427 retval = _equalWindowFunc(a, b);
2430 retval = _equalArrayRef(a, b);
2433 retval = _equalFuncExpr(a, b);
2435 case T_NamedArgExpr:
2436 retval = _equalNamedArgExpr(a, b);
2439 retval = _equalOpExpr(a, b);
2441 case T_DistinctExpr:
2442 retval = _equalDistinctExpr(a, b);
2444 case T_ScalarArrayOpExpr:
2445 retval = _equalScalarArrayOpExpr(a, b);
2448 retval = _equalBoolExpr(a, b);
2451 retval = _equalSubLink(a, b);
2454 retval = _equalSubPlan(a, b);
2456 case T_AlternativeSubPlan:
2457 retval = _equalAlternativeSubPlan(a, b);
2460 retval = _equalFieldSelect(a, b);
2463 retval = _equalFieldStore(a, b);
2466 retval = _equalRelabelType(a, b);
2469 retval = _equalCoerceViaIO(a, b);
2471 case T_ArrayCoerceExpr:
2472 retval = _equalArrayCoerceExpr(a, b);
2474 case T_ConvertRowtypeExpr:
2475 retval = _equalConvertRowtypeExpr(a, b);
2478 retval = _equalCaseExpr(a, b);
2481 retval = _equalCaseWhen(a, b);
2483 case T_CaseTestExpr:
2484 retval = _equalCaseTestExpr(a, b);
2487 retval = _equalArrayExpr(a, b);
2490 retval = _equalRowExpr(a, b);
2492 case T_RowCompareExpr:
2493 retval = _equalRowCompareExpr(a, b);
2495 case T_CoalesceExpr:
2496 retval = _equalCoalesceExpr(a, b);
2499 retval = _equalMinMaxExpr(a, b);
2502 retval = _equalXmlExpr(a, b);
2505 retval = _equalNullIfExpr(a, b);
2508 retval = _equalNullTest(a, b);
2511 retval = _equalBooleanTest(a, b);
2513 case T_CoerceToDomain:
2514 retval = _equalCoerceToDomain(a, b);
2516 case T_CoerceToDomainValue:
2517 retval = _equalCoerceToDomainValue(a, b);
2519 case T_SetToDefault:
2520 retval = _equalSetToDefault(a, b);
2522 case T_CurrentOfExpr:
2523 retval = _equalCurrentOfExpr(a, b);
2526 retval = _equalTargetEntry(a, b);
2529 retval = _equalRangeTblRef(a, b);
2532 retval = _equalFromExpr(a, b);
2535 retval = _equalJoinExpr(a, b);
2542 retval = _equalPathKey(a, b);
2544 case T_RestrictInfo:
2545 retval = _equalRestrictInfo(a, b);
2547 case T_PlaceHolderVar:
2548 retval = _equalPlaceHolderVar(a, b);
2550 case T_SpecialJoinInfo:
2551 retval = _equalSpecialJoinInfo(a, b);
2553 case T_AppendRelInfo:
2554 retval = _equalAppendRelInfo(a, b);
2556 case T_PlaceHolderInfo:
2557 retval = _equalPlaceHolderInfo(a, b);
2563 retval = _equalList(a, b);
2571 retval = _equalValue(a, b);
2578 retval = _equalQuery(a, b);
2581 retval = _equalInsertStmt(a, b);
2584 retval = _equalDeleteStmt(a, b);
2587 retval = _equalUpdateStmt(a, b);
2590 retval = _equalSelectStmt(a, b);
2592 case T_SetOperationStmt:
2593 retval = _equalSetOperationStmt(a, b);
2595 case T_AlterTableStmt:
2596 retval = _equalAlterTableStmt(a, b);
2598 case T_AlterTableCmd:
2599 retval = _equalAlterTableCmd(a, b);
2601 case T_AlterDomainStmt:
2602 retval = _equalAlterDomainStmt(a, b);
2605 retval = _equalGrantStmt(a, b);
2607 case T_GrantRoleStmt:
2608 retval = _equalGrantRoleStmt(a, b);
2610 case T_AlterDefaultPrivilegesStmt:
2611 retval = _equalAlterDefaultPrivilegesStmt(a, b);
2613 case T_DeclareCursorStmt:
2614 retval = _equalDeclareCursorStmt(a, b);
2616 case T_ClosePortalStmt:
2617 retval = _equalClosePortalStmt(a, b);
2620 retval = _equalClusterStmt(a, b);
2623 retval = _equalCopyStmt(a, b);
2626 retval = _equalCreateStmt(a, b);
2629 retval = _equalInhRelation(a, b);
2632 retval = _equalDefineStmt(a, b);
2635 retval = _equalDropStmt(a, b);
2637 case T_TruncateStmt:
2638 retval = _equalTruncateStmt(a, b);
2641 retval = _equalCommentStmt(a, b);
2643 case T_SecLabelStmt:
2644 retval = _equalSecLabelStmt(a, b);
2647 retval = _equalFetchStmt(a, b);
2650 retval = _equalIndexStmt(a, b);
2652 case T_CreateFunctionStmt:
2653 retval = _equalCreateFunctionStmt(a, b);
2655 case T_FunctionParameter:
2656 retval = _equalFunctionParameter(a, b);
2658 case T_AlterFunctionStmt:
2659 retval = _equalAlterFunctionStmt(a, b);
2661 case T_RemoveFuncStmt:
2662 retval = _equalRemoveFuncStmt(a, b);
2665 retval = _equalDoStmt(a, b);
2667 case T_RemoveOpClassStmt:
2668 retval = _equalRemoveOpClassStmt(a, b);
2670 case T_RemoveOpFamilyStmt:
2671 retval = _equalRemoveOpFamilyStmt(a, b);
2674 retval = _equalRenameStmt(a, b);
2676 case T_AlterObjectSchemaStmt:
2677 retval = _equalAlterObjectSchemaStmt(a, b);
2679 case T_AlterOwnerStmt:
2680 retval = _equalAlterOwnerStmt(a, b);
2683 retval = _equalRuleStmt(a, b);
2686 retval = _equalNotifyStmt(a, b);
2689 retval = _equalListenStmt(a, b);
2691 case T_UnlistenStmt:
2692 retval = _equalUnlistenStmt(a, b);
2694 case T_TransactionStmt:
2695 retval = _equalTransactionStmt(a, b);
2697 case T_CompositeTypeStmt:
2698 retval = _equalCompositeTypeStmt(a, b);
2700 case T_CreateEnumStmt:
2701 retval = _equalCreateEnumStmt(a, b);
2704 retval = _equalViewStmt(a, b);
2707 retval = _equalLoadStmt(a, b);
2709 case T_CreateDomainStmt:
2710 retval = _equalCreateDomainStmt(a, b);
2712 case T_CreateOpClassStmt:
2713 retval = _equalCreateOpClassStmt(a, b);
2715 case T_CreateOpClassItem:
2716 retval = _equalCreateOpClassItem(a, b);
2718 case T_CreateOpFamilyStmt:
2719 retval = _equalCreateOpFamilyStmt(a, b);
2721 case T_AlterOpFamilyStmt:
2722 retval = _equalAlterOpFamilyStmt(a, b);
2724 case T_CreatedbStmt:
2725 retval = _equalCreatedbStmt(a, b);
2727 case T_AlterDatabaseStmt:
2728 retval = _equalAlterDatabaseStmt(a, b);
2730 case T_AlterDatabaseSetStmt:
2731 retval = _equalAlterDatabaseSetStmt(a, b);
2734 retval = _equalDropdbStmt(a, b);
2737 retval = _equalVacuumStmt(a, b);
2740 retval = _equalExplainStmt(a, b);
2742 case T_CreateSeqStmt:
2743 retval = _equalCreateSeqStmt(a, b);
2745 case T_AlterSeqStmt:
2746 retval = _equalAlterSeqStmt(a, b);
2748 case T_VariableSetStmt:
2749 retval = _equalVariableSetStmt(a, b);
2751 case T_VariableShowStmt:
2752 retval = _equalVariableShowStmt(a, b);
2755 retval = _equalDiscardStmt(a, b);
2757 case T_CreateTableSpaceStmt:
2758 retval = _equalCreateTableSpaceStmt(a, b);
2760 case T_DropTableSpaceStmt:
2761 retval = _equalDropTableSpaceStmt(a, b);
2763 case T_AlterTableSpaceOptionsStmt:
2764 retval = _equalAlterTableSpaceOptionsStmt(a, b);
2766 case T_CreateFdwStmt:
2767 retval = _equalCreateFdwStmt(a, b);
2769 case T_AlterFdwStmt:
2770 retval = _equalAlterFdwStmt(a, b);
2773 retval = _equalDropFdwStmt(a, b);
2775 case T_CreateForeignServerStmt:
2776 retval = _equalCreateForeignServerStmt(a, b);
2778 case T_AlterForeignServerStmt:
2779 retval = _equalAlterForeignServerStmt(a, b);
2781 case T_DropForeignServerStmt:
2782 retval = _equalDropForeignServerStmt(a, b);
2784 case T_CreateUserMappingStmt:
2785 retval = _equalCreateUserMappingStmt(a, b);
2787 case T_AlterUserMappingStmt:
2788 retval = _equalAlterUserMappingStmt(a, b);
2790 case T_DropUserMappingStmt:
2791 retval = _equalDropUserMappingStmt(a, b);
2793 case T_CreateTrigStmt:
2794 retval = _equalCreateTrigStmt(a, b);
2796 case T_DropPropertyStmt:
2797 retval = _equalDropPropertyStmt(a, b);
2799 case T_CreatePLangStmt:
2800 retval = _equalCreatePLangStmt(a, b);
2802 case T_DropPLangStmt:
2803 retval = _equalDropPLangStmt(a, b);
2805 case T_CreateRoleStmt:
2806 retval = _equalCreateRoleStmt(a, b);
2808 case T_AlterRoleStmt:
2809 retval = _equalAlterRoleStmt(a, b);
2811 case T_AlterRoleSetStmt:
2812 retval = _equalAlterRoleSetStmt(a, b);
2814 case T_DropRoleStmt:
2815 retval = _equalDropRoleStmt(a, b);
2818 retval = _equalLockStmt(a, b);
2820 case T_ConstraintsSetStmt:
2821 retval = _equalConstraintsSetStmt(a, b);
2824 retval = _equalReindexStmt(a, b);
2826 case T_CheckPointStmt:
2829 case T_CreateSchemaStmt:
2830 retval = _equalCreateSchemaStmt(a, b);
2832 case T_CreateConversionStmt:
2833 retval = _equalCreateConversionStmt(a, b);
2835 case T_CreateCastStmt:
2836 retval = _equalCreateCastStmt(a, b);
2838 case T_DropCastStmt:
2839 retval = _equalDropCastStmt(a, b);
2842 retval = _equalPrepareStmt(a, b);
2845 retval = _equalExecuteStmt(a, b);
2847 case T_DeallocateStmt:
2848 retval = _equalDeallocateStmt(a, b);
2850 case T_DropOwnedStmt:
2851 retval = _equalDropOwnedStmt(a, b);
2853 case T_ReassignOwnedStmt:
2854 retval = _equalReassignOwnedStmt(a, b);
2856 case T_AlterTSDictionaryStmt:
2857 retval = _equalAlterTSDictionaryStmt(a, b);
2859 case T_AlterTSConfigurationStmt:
2860 retval = _equalAlterTSConfigurationStmt(a, b);
2864 retval = _equalAExpr(a, b);
2867 retval = _equalColumnRef(a, b);
2870 retval = _equalParamRef(a, b);
2873 retval = _equalAConst(a, b);
2876 retval = _equalFuncCall(a, b);
2879 retval = _equalAStar(a, b);
2882 retval = _equalAIndices(a, b);
2884 case T_A_Indirection:
2885 retval = _equalA_Indirection(a, b);
2888 retval = _equalA_ArrayExpr(a, b);
2891 retval = _equalResTarget(a, b);
2894 retval = _equalTypeCast(a, b);
2897 retval = _equalSortBy(a, b);
2900 retval = _equalWindowDef(a, b);
2902 case T_RangeSubselect:
2903 retval = _equalRangeSubselect(a, b);
2905 case T_RangeFunction:
2906 retval = _equalRangeFunction(a, b);
2909 retval = _equalTypeName(a, b);
2912 retval = _equalIndexElem(a, b);
2915 retval = _equalColumnDef(a, b);
2918 retval = _equalConstraint(a, b);
2921 retval = _equalDefElem(a, b);
2923 case T_LockingClause:
2924 retval = _equalLockingClause(a, b);
2926 case T_RangeTblEntry:
2927 retval = _equalRangeTblEntry(a, b);
2929 case T_SortGroupClause:
2930 retval = _equalSortGroupClause(a, b);
2932 case T_WindowClause:
2933 retval = _equalWindowClause(a, b);
2935 case T_RowMarkClause:
2936 retval = _equalRowMarkClause(a, b);
2939 retval = _equalWithClause(a, b);
2941 case T_CommonTableExpr:
2942 retval = _equalCommonTableExpr(a, b);
2945 retval = _equalPrivGrantee(a, b);
2947 case T_FuncWithArgs:
2948 retval = _equalFuncWithArgs(a, b);
2951 retval = _equalAccessPriv(a, b);
2953 case T_XmlSerialize:
2954 retval = _equalXmlSerialize(a, b);
2958 elog(ERROR, "unrecognized node type: %d",
2960 retval = false; /* keep compiler quiet */