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-2009, PostgreSQL Global Development Group
22 * Portions Copyright (c) 1994, Regents of the University of California
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_SCALAR_FIELD(agglevelsup
);
187 COMPARE_SCALAR_FIELD(aggstar
);
188 COMPARE_SCALAR_FIELD(aggdistinct
);
189 COMPARE_LOCATION_FIELD(location
);
195 _equalWindowFunc(WindowFunc
*a
, WindowFunc
*b
)
197 COMPARE_SCALAR_FIELD(winfnoid
);
198 COMPARE_SCALAR_FIELD(wintype
);
199 COMPARE_NODE_FIELD(args
);
200 COMPARE_SCALAR_FIELD(winref
);
201 COMPARE_SCALAR_FIELD(winstar
);
202 COMPARE_SCALAR_FIELD(winagg
);
203 COMPARE_LOCATION_FIELD(location
);
209 _equalArrayRef(ArrayRef
*a
, ArrayRef
*b
)
211 COMPARE_SCALAR_FIELD(refarraytype
);
212 COMPARE_SCALAR_FIELD(refelemtype
);
213 COMPARE_SCALAR_FIELD(reftypmod
);
214 COMPARE_NODE_FIELD(refupperindexpr
);
215 COMPARE_NODE_FIELD(reflowerindexpr
);
216 COMPARE_NODE_FIELD(refexpr
);
217 COMPARE_NODE_FIELD(refassgnexpr
);
223 _equalFuncExpr(FuncExpr
*a
, FuncExpr
*b
)
225 COMPARE_SCALAR_FIELD(funcid
);
226 COMPARE_SCALAR_FIELD(funcresulttype
);
227 COMPARE_SCALAR_FIELD(funcretset
);
230 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
231 * that are equal() to both explicit and implicit coercions.
233 if (a
->funcformat
!= b
->funcformat
&&
234 a
->funcformat
!= COERCE_DONTCARE
&&
235 b
->funcformat
!= COERCE_DONTCARE
)
238 COMPARE_NODE_FIELD(args
);
239 COMPARE_LOCATION_FIELD(location
);
245 _equalOpExpr(OpExpr
*a
, OpExpr
*b
)
247 COMPARE_SCALAR_FIELD(opno
);
250 * Special-case opfuncid: it is allowable for it to differ if one node
251 * contains zero and the other doesn't. This just means that the one node
252 * isn't as far along in the parse/plan pipeline and hasn't had the
253 * opfuncid cache filled yet.
255 if (a
->opfuncid
!= b
->opfuncid
&&
260 COMPARE_SCALAR_FIELD(opresulttype
);
261 COMPARE_SCALAR_FIELD(opretset
);
262 COMPARE_NODE_FIELD(args
);
263 COMPARE_LOCATION_FIELD(location
);
269 _equalDistinctExpr(DistinctExpr
*a
, DistinctExpr
*b
)
271 COMPARE_SCALAR_FIELD(opno
);
274 * Special-case opfuncid: it is allowable for it to differ if one node
275 * contains zero and the other doesn't. This just means that the one node
276 * isn't as far along in the parse/plan pipeline and hasn't had the
277 * opfuncid cache filled yet.
279 if (a
->opfuncid
!= b
->opfuncid
&&
284 COMPARE_SCALAR_FIELD(opresulttype
);
285 COMPARE_SCALAR_FIELD(opretset
);
286 COMPARE_NODE_FIELD(args
);
287 COMPARE_LOCATION_FIELD(location
);
293 _equalScalarArrayOpExpr(ScalarArrayOpExpr
*a
, ScalarArrayOpExpr
*b
)
295 COMPARE_SCALAR_FIELD(opno
);
298 * Special-case opfuncid: it is allowable for it to differ if one node
299 * contains zero and the other doesn't. This just means that the one node
300 * isn't as far along in the parse/plan pipeline and hasn't had the
301 * opfuncid cache filled yet.
303 if (a
->opfuncid
!= b
->opfuncid
&&
308 COMPARE_SCALAR_FIELD(useOr
);
309 COMPARE_NODE_FIELD(args
);
310 COMPARE_LOCATION_FIELD(location
);
316 _equalBoolExpr(BoolExpr
*a
, BoolExpr
*b
)
318 COMPARE_SCALAR_FIELD(boolop
);
319 COMPARE_NODE_FIELD(args
);
320 COMPARE_LOCATION_FIELD(location
);
326 _equalSubLink(SubLink
*a
, SubLink
*b
)
328 COMPARE_SCALAR_FIELD(subLinkType
);
329 COMPARE_NODE_FIELD(testexpr
);
330 COMPARE_NODE_FIELD(operName
);
331 COMPARE_NODE_FIELD(subselect
);
332 COMPARE_LOCATION_FIELD(location
);
338 _equalSubPlan(SubPlan
*a
, SubPlan
*b
)
340 COMPARE_SCALAR_FIELD(subLinkType
);
341 COMPARE_NODE_FIELD(testexpr
);
342 COMPARE_NODE_FIELD(paramIds
);
343 COMPARE_SCALAR_FIELD(plan_id
);
344 COMPARE_SCALAR_FIELD(firstColType
);
345 COMPARE_SCALAR_FIELD(useHashTable
);
346 COMPARE_SCALAR_FIELD(unknownEqFalse
);
347 COMPARE_NODE_FIELD(setParam
);
348 COMPARE_NODE_FIELD(parParam
);
349 COMPARE_NODE_FIELD(args
);
350 COMPARE_SCALAR_FIELD(startup_cost
);
351 COMPARE_SCALAR_FIELD(per_call_cost
);
357 _equalAlternativeSubPlan(AlternativeSubPlan
*a
, AlternativeSubPlan
*b
)
359 COMPARE_NODE_FIELD(subplans
);
365 _equalFieldSelect(FieldSelect
*a
, FieldSelect
*b
)
367 COMPARE_NODE_FIELD(arg
);
368 COMPARE_SCALAR_FIELD(fieldnum
);
369 COMPARE_SCALAR_FIELD(resulttype
);
370 COMPARE_SCALAR_FIELD(resulttypmod
);
376 _equalFieldStore(FieldStore
*a
, FieldStore
*b
)
378 COMPARE_NODE_FIELD(arg
);
379 COMPARE_NODE_FIELD(newvals
);
380 COMPARE_NODE_FIELD(fieldnums
);
381 COMPARE_SCALAR_FIELD(resulttype
);
387 _equalRelabelType(RelabelType
*a
, RelabelType
*b
)
389 COMPARE_NODE_FIELD(arg
);
390 COMPARE_SCALAR_FIELD(resulttype
);
391 COMPARE_SCALAR_FIELD(resulttypmod
);
394 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
395 * that are equal() to both explicit and implicit coercions.
397 if (a
->relabelformat
!= b
->relabelformat
&&
398 a
->relabelformat
!= COERCE_DONTCARE
&&
399 b
->relabelformat
!= COERCE_DONTCARE
)
402 COMPARE_LOCATION_FIELD(location
);
408 _equalCoerceViaIO(CoerceViaIO
*a
, CoerceViaIO
*b
)
410 COMPARE_NODE_FIELD(arg
);
411 COMPARE_SCALAR_FIELD(resulttype
);
414 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
415 * that are equal() to both explicit and implicit coercions.
417 if (a
->coerceformat
!= b
->coerceformat
&&
418 a
->coerceformat
!= COERCE_DONTCARE
&&
419 b
->coerceformat
!= COERCE_DONTCARE
)
422 COMPARE_LOCATION_FIELD(location
);
428 _equalArrayCoerceExpr(ArrayCoerceExpr
*a
, ArrayCoerceExpr
*b
)
430 COMPARE_NODE_FIELD(arg
);
431 COMPARE_SCALAR_FIELD(elemfuncid
);
432 COMPARE_SCALAR_FIELD(resulttype
);
433 COMPARE_SCALAR_FIELD(resulttypmod
);
434 COMPARE_SCALAR_FIELD(isExplicit
);
437 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
438 * that are equal() to both explicit and implicit coercions.
440 if (a
->coerceformat
!= b
->coerceformat
&&
441 a
->coerceformat
!= COERCE_DONTCARE
&&
442 b
->coerceformat
!= COERCE_DONTCARE
)
445 COMPARE_LOCATION_FIELD(location
);
451 _equalConvertRowtypeExpr(ConvertRowtypeExpr
*a
, ConvertRowtypeExpr
*b
)
453 COMPARE_NODE_FIELD(arg
);
454 COMPARE_SCALAR_FIELD(resulttype
);
457 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
458 * that are equal() to both explicit and implicit coercions.
460 if (a
->convertformat
!= b
->convertformat
&&
461 a
->convertformat
!= COERCE_DONTCARE
&&
462 b
->convertformat
!= COERCE_DONTCARE
)
465 COMPARE_LOCATION_FIELD(location
);
471 _equalCaseExpr(CaseExpr
*a
, CaseExpr
*b
)
473 COMPARE_SCALAR_FIELD(casetype
);
474 COMPARE_NODE_FIELD(arg
);
475 COMPARE_NODE_FIELD(args
);
476 COMPARE_NODE_FIELD(defresult
);
477 COMPARE_LOCATION_FIELD(location
);
483 _equalCaseWhen(CaseWhen
*a
, CaseWhen
*b
)
485 COMPARE_NODE_FIELD(expr
);
486 COMPARE_NODE_FIELD(result
);
487 COMPARE_LOCATION_FIELD(location
);
493 _equalCaseTestExpr(CaseTestExpr
*a
, CaseTestExpr
*b
)
495 COMPARE_SCALAR_FIELD(typeId
);
496 COMPARE_SCALAR_FIELD(typeMod
);
502 _equalArrayExpr(ArrayExpr
*a
, ArrayExpr
*b
)
504 COMPARE_SCALAR_FIELD(array_typeid
);
505 COMPARE_SCALAR_FIELD(element_typeid
);
506 COMPARE_NODE_FIELD(elements
);
507 COMPARE_SCALAR_FIELD(multidims
);
508 COMPARE_LOCATION_FIELD(location
);
514 _equalRowExpr(RowExpr
*a
, RowExpr
*b
)
516 COMPARE_NODE_FIELD(args
);
517 COMPARE_SCALAR_FIELD(row_typeid
);
520 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
521 * that are equal() to both explicit and implicit coercions.
523 if (a
->row_format
!= b
->row_format
&&
524 a
->row_format
!= COERCE_DONTCARE
&&
525 b
->row_format
!= COERCE_DONTCARE
)
528 COMPARE_NODE_FIELD(colnames
);
529 COMPARE_LOCATION_FIELD(location
);
535 _equalRowCompareExpr(RowCompareExpr
*a
, RowCompareExpr
*b
)
537 COMPARE_SCALAR_FIELD(rctype
);
538 COMPARE_NODE_FIELD(opnos
);
539 COMPARE_NODE_FIELD(opfamilies
);
540 COMPARE_NODE_FIELD(largs
);
541 COMPARE_NODE_FIELD(rargs
);
547 _equalCoalesceExpr(CoalesceExpr
*a
, CoalesceExpr
*b
)
549 COMPARE_SCALAR_FIELD(coalescetype
);
550 COMPARE_NODE_FIELD(args
);
551 COMPARE_LOCATION_FIELD(location
);
557 _equalMinMaxExpr(MinMaxExpr
*a
, MinMaxExpr
*b
)
559 COMPARE_SCALAR_FIELD(minmaxtype
);
560 COMPARE_SCALAR_FIELD(op
);
561 COMPARE_NODE_FIELD(args
);
562 COMPARE_LOCATION_FIELD(location
);
568 _equalXmlExpr(XmlExpr
*a
, XmlExpr
*b
)
570 COMPARE_SCALAR_FIELD(op
);
571 COMPARE_STRING_FIELD(name
);
572 COMPARE_NODE_FIELD(named_args
);
573 COMPARE_NODE_FIELD(arg_names
);
574 COMPARE_NODE_FIELD(args
);
575 COMPARE_SCALAR_FIELD(xmloption
);
576 COMPARE_SCALAR_FIELD(type
);
577 COMPARE_SCALAR_FIELD(typmod
);
578 COMPARE_LOCATION_FIELD(location
);
584 _equalNullIfExpr(NullIfExpr
*a
, NullIfExpr
*b
)
586 COMPARE_SCALAR_FIELD(opno
);
589 * Special-case opfuncid: it is allowable for it to differ if one node
590 * contains zero and the other doesn't. This just means that the one node
591 * isn't as far along in the parse/plan pipeline and hasn't had the
592 * opfuncid cache filled yet.
594 if (a
->opfuncid
!= b
->opfuncid
&&
599 COMPARE_SCALAR_FIELD(opresulttype
);
600 COMPARE_SCALAR_FIELD(opretset
);
601 COMPARE_NODE_FIELD(args
);
602 COMPARE_LOCATION_FIELD(location
);
608 _equalNullTest(NullTest
*a
, NullTest
*b
)
610 COMPARE_NODE_FIELD(arg
);
611 COMPARE_SCALAR_FIELD(nulltesttype
);
617 _equalBooleanTest(BooleanTest
*a
, BooleanTest
*b
)
619 COMPARE_NODE_FIELD(arg
);
620 COMPARE_SCALAR_FIELD(booltesttype
);
626 _equalCoerceToDomain(CoerceToDomain
*a
, CoerceToDomain
*b
)
628 COMPARE_NODE_FIELD(arg
);
629 COMPARE_SCALAR_FIELD(resulttype
);
630 COMPARE_SCALAR_FIELD(resulttypmod
);
633 * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
634 * that are equal() to both explicit and implicit coercions.
636 if (a
->coercionformat
!= b
->coercionformat
&&
637 a
->coercionformat
!= COERCE_DONTCARE
&&
638 b
->coercionformat
!= COERCE_DONTCARE
)
641 COMPARE_LOCATION_FIELD(location
);
647 _equalCoerceToDomainValue(CoerceToDomainValue
*a
, CoerceToDomainValue
*b
)
649 COMPARE_SCALAR_FIELD(typeId
);
650 COMPARE_SCALAR_FIELD(typeMod
);
651 COMPARE_LOCATION_FIELD(location
);
657 _equalSetToDefault(SetToDefault
*a
, SetToDefault
*b
)
659 COMPARE_SCALAR_FIELD(typeId
);
660 COMPARE_SCALAR_FIELD(typeMod
);
661 COMPARE_LOCATION_FIELD(location
);
667 _equalCurrentOfExpr(CurrentOfExpr
*a
, CurrentOfExpr
*b
)
669 COMPARE_SCALAR_FIELD(cvarno
);
670 COMPARE_STRING_FIELD(cursor_name
);
671 COMPARE_SCALAR_FIELD(cursor_param
);
677 _equalTargetEntry(TargetEntry
*a
, TargetEntry
*b
)
679 COMPARE_NODE_FIELD(expr
);
680 COMPARE_SCALAR_FIELD(resno
);
681 COMPARE_STRING_FIELD(resname
);
682 COMPARE_SCALAR_FIELD(ressortgroupref
);
683 COMPARE_SCALAR_FIELD(resorigtbl
);
684 COMPARE_SCALAR_FIELD(resorigcol
);
685 COMPARE_SCALAR_FIELD(resjunk
);
691 _equalRangeTblRef(RangeTblRef
*a
, RangeTblRef
*b
)
693 COMPARE_SCALAR_FIELD(rtindex
);
699 _equalJoinExpr(JoinExpr
*a
, JoinExpr
*b
)
701 COMPARE_SCALAR_FIELD(jointype
);
702 COMPARE_SCALAR_FIELD(isNatural
);
703 COMPARE_NODE_FIELD(larg
);
704 COMPARE_NODE_FIELD(rarg
);
705 COMPARE_NODE_FIELD(using);
706 COMPARE_NODE_FIELD(quals
);
707 COMPARE_NODE_FIELD(alias
);
708 COMPARE_SCALAR_FIELD(rtindex
);
714 _equalFromExpr(FromExpr
*a
, FromExpr
*b
)
716 COMPARE_NODE_FIELD(fromlist
);
717 COMPARE_NODE_FIELD(quals
);
724 * Stuff from relation.h
728 _equalPathKey(PathKey
*a
, PathKey
*b
)
731 * This is normally used on non-canonicalized PathKeys, so must chase up
732 * to the topmost merged EquivalenceClass and see if those are the same
733 * (by pointer equality).
735 EquivalenceClass
*a_eclass
;
736 EquivalenceClass
*b_eclass
;
738 a_eclass
= a
->pk_eclass
;
739 while (a_eclass
->ec_merged
)
740 a_eclass
= a_eclass
->ec_merged
;
741 b_eclass
= b
->pk_eclass
;
742 while (b_eclass
->ec_merged
)
743 b_eclass
= b_eclass
->ec_merged
;
744 if (a_eclass
!= b_eclass
)
746 COMPARE_SCALAR_FIELD(pk_opfamily
);
747 COMPARE_SCALAR_FIELD(pk_strategy
);
748 COMPARE_SCALAR_FIELD(pk_nulls_first
);
754 _equalRestrictInfo(RestrictInfo
*a
, RestrictInfo
*b
)
756 COMPARE_NODE_FIELD(clause
);
757 COMPARE_SCALAR_FIELD(is_pushed_down
);
758 COMPARE_SCALAR_FIELD(outerjoin_delayed
);
759 COMPARE_BITMAPSET_FIELD(required_relids
);
762 * We ignore all the remaining fields, since they may not be set yet, and
763 * should be derivable from the clause anyway.
770 _equalPlaceHolderVar(PlaceHolderVar
*a
, PlaceHolderVar
*b
)
773 * We intentionally do not compare phexpr. Two PlaceHolderVars with the
774 * same ID and levelsup should be considered equal even if the contained
775 * expressions have managed to mutate to different states. One way in
776 * which that can happen is that initplan sublinks would get replaced by
777 * differently-numbered Params when sublink folding is done. (The end
778 * result of such a situation would be some unreferenced initplans, which
779 * is annoying but not really a problem.)
781 * COMPARE_NODE_FIELD(phexpr);
783 COMPARE_BITMAPSET_FIELD(phrels
);
784 COMPARE_SCALAR_FIELD(phid
);
785 COMPARE_SCALAR_FIELD(phlevelsup
);
791 _equalSpecialJoinInfo(SpecialJoinInfo
*a
, SpecialJoinInfo
*b
)
793 COMPARE_BITMAPSET_FIELD(min_lefthand
);
794 COMPARE_BITMAPSET_FIELD(min_righthand
);
795 COMPARE_BITMAPSET_FIELD(syn_lefthand
);
796 COMPARE_BITMAPSET_FIELD(syn_righthand
);
797 COMPARE_SCALAR_FIELD(jointype
);
798 COMPARE_SCALAR_FIELD(lhs_strict
);
799 COMPARE_SCALAR_FIELD(delay_upper_joins
);
800 COMPARE_NODE_FIELD(join_quals
);
806 _equalAppendRelInfo(AppendRelInfo
*a
, AppendRelInfo
*b
)
808 COMPARE_SCALAR_FIELD(parent_relid
);
809 COMPARE_SCALAR_FIELD(child_relid
);
810 COMPARE_SCALAR_FIELD(parent_reltype
);
811 COMPARE_SCALAR_FIELD(child_reltype
);
812 COMPARE_NODE_FIELD(translated_vars
);
813 COMPARE_SCALAR_FIELD(parent_reloid
);
819 _equalPlaceHolderInfo(PlaceHolderInfo
*a
, PlaceHolderInfo
*b
)
821 COMPARE_SCALAR_FIELD(phid
);
822 COMPARE_NODE_FIELD(ph_var
);
823 COMPARE_BITMAPSET_FIELD(ph_eval_at
);
824 COMPARE_BITMAPSET_FIELD(ph_needed
);
825 COMPARE_SCALAR_FIELD(ph_width
);
832 * Stuff from parsenodes.h
836 _equalQuery(Query
*a
, Query
*b
)
838 COMPARE_SCALAR_FIELD(commandType
);
839 COMPARE_SCALAR_FIELD(querySource
);
840 COMPARE_SCALAR_FIELD(canSetTag
);
841 COMPARE_NODE_FIELD(utilityStmt
);
842 COMPARE_SCALAR_FIELD(resultRelation
);
843 COMPARE_NODE_FIELD(intoClause
);
844 COMPARE_SCALAR_FIELD(hasAggs
);
845 COMPARE_SCALAR_FIELD(hasWindowFuncs
);
846 COMPARE_SCALAR_FIELD(hasSubLinks
);
847 COMPARE_SCALAR_FIELD(hasDistinctOn
);
848 COMPARE_SCALAR_FIELD(hasRecursive
);
849 COMPARE_NODE_FIELD(cteList
);
850 COMPARE_NODE_FIELD(rtable
);
851 COMPARE_NODE_FIELD(jointree
);
852 COMPARE_NODE_FIELD(targetList
);
853 COMPARE_NODE_FIELD(returningList
);
854 COMPARE_NODE_FIELD(groupClause
);
855 COMPARE_NODE_FIELD(havingQual
);
856 COMPARE_NODE_FIELD(windowClause
);
857 COMPARE_NODE_FIELD(distinctClause
);
858 COMPARE_NODE_FIELD(sortClause
);
859 COMPARE_NODE_FIELD(limitOffset
);
860 COMPARE_NODE_FIELD(limitCount
);
861 COMPARE_NODE_FIELD(rowMarks
);
862 COMPARE_NODE_FIELD(setOperations
);
868 _equalInsertStmt(InsertStmt
*a
, InsertStmt
*b
)
870 COMPARE_NODE_FIELD(relation
);
871 COMPARE_NODE_FIELD(cols
);
872 COMPARE_NODE_FIELD(selectStmt
);
873 COMPARE_NODE_FIELD(returningList
);
879 _equalDeleteStmt(DeleteStmt
*a
, DeleteStmt
*b
)
881 COMPARE_NODE_FIELD(relation
);
882 COMPARE_NODE_FIELD(usingClause
);
883 COMPARE_NODE_FIELD(whereClause
);
884 COMPARE_NODE_FIELD(returningList
);
890 _equalUpdateStmt(UpdateStmt
*a
, UpdateStmt
*b
)
892 COMPARE_NODE_FIELD(relation
);
893 COMPARE_NODE_FIELD(targetList
);
894 COMPARE_NODE_FIELD(whereClause
);
895 COMPARE_NODE_FIELD(fromClause
);
896 COMPARE_NODE_FIELD(returningList
);
902 _equalSelectStmt(SelectStmt
*a
, SelectStmt
*b
)
904 COMPARE_NODE_FIELD(distinctClause
);
905 COMPARE_NODE_FIELD(intoClause
);
906 COMPARE_NODE_FIELD(targetList
);
907 COMPARE_NODE_FIELD(fromClause
);
908 COMPARE_NODE_FIELD(whereClause
);
909 COMPARE_NODE_FIELD(groupClause
);
910 COMPARE_NODE_FIELD(havingClause
);
911 COMPARE_NODE_FIELD(windowClause
);
912 COMPARE_NODE_FIELD(withClause
);
913 COMPARE_NODE_FIELD(valuesLists
);
914 COMPARE_NODE_FIELD(sortClause
);
915 COMPARE_NODE_FIELD(limitOffset
);
916 COMPARE_NODE_FIELD(limitCount
);
917 COMPARE_NODE_FIELD(lockingClause
);
918 COMPARE_SCALAR_FIELD(op
);
919 COMPARE_SCALAR_FIELD(all
);
920 COMPARE_NODE_FIELD(larg
);
921 COMPARE_NODE_FIELD(rarg
);
927 _equalSetOperationStmt(SetOperationStmt
*a
, SetOperationStmt
*b
)
929 COMPARE_SCALAR_FIELD(op
);
930 COMPARE_SCALAR_FIELD(all
);
931 COMPARE_NODE_FIELD(larg
);
932 COMPARE_NODE_FIELD(rarg
);
933 COMPARE_NODE_FIELD(colTypes
);
934 COMPARE_NODE_FIELD(colTypmods
);
935 COMPARE_NODE_FIELD(groupClauses
);
941 _equalAlterTableStmt(AlterTableStmt
*a
, AlterTableStmt
*b
)
943 COMPARE_NODE_FIELD(relation
);
944 COMPARE_NODE_FIELD(cmds
);
945 COMPARE_SCALAR_FIELD(relkind
);
951 _equalAlterTableCmd(AlterTableCmd
*a
, AlterTableCmd
*b
)
953 COMPARE_SCALAR_FIELD(subtype
);
954 COMPARE_STRING_FIELD(name
);
955 COMPARE_NODE_FIELD(def
);
956 COMPARE_NODE_FIELD(transform
);
957 COMPARE_SCALAR_FIELD(behavior
);
963 _equalAlterDomainStmt(AlterDomainStmt
*a
, AlterDomainStmt
*b
)
965 COMPARE_SCALAR_FIELD(subtype
);
966 COMPARE_NODE_FIELD(typename
);
967 COMPARE_STRING_FIELD(name
);
968 COMPARE_NODE_FIELD(def
);
969 COMPARE_SCALAR_FIELD(behavior
);
975 _equalGrantStmt(GrantStmt
*a
, GrantStmt
*b
)
977 COMPARE_SCALAR_FIELD(is_grant
);
978 COMPARE_SCALAR_FIELD(objtype
);
979 COMPARE_NODE_FIELD(objects
);
980 COMPARE_NODE_FIELD(privileges
);
981 COMPARE_NODE_FIELD(grantees
);
982 COMPARE_SCALAR_FIELD(grant_option
);
983 COMPARE_SCALAR_FIELD(behavior
);
989 _equalPrivGrantee(PrivGrantee
*a
, PrivGrantee
*b
)
991 COMPARE_STRING_FIELD(rolname
);
997 _equalFuncWithArgs(FuncWithArgs
*a
, FuncWithArgs
*b
)
999 COMPARE_NODE_FIELD(funcname
);
1000 COMPARE_NODE_FIELD(funcargs
);
1006 _equalAccessPriv(AccessPriv
*a
, AccessPriv
*b
)
1008 COMPARE_STRING_FIELD(priv_name
);
1009 COMPARE_NODE_FIELD(cols
);
1015 _equalGrantRoleStmt(GrantRoleStmt
*a
, GrantRoleStmt
*b
)
1017 COMPARE_NODE_FIELD(granted_roles
);
1018 COMPARE_NODE_FIELD(grantee_roles
);
1019 COMPARE_SCALAR_FIELD(is_grant
);
1020 COMPARE_SCALAR_FIELD(admin_opt
);
1021 COMPARE_STRING_FIELD(grantor
);
1022 COMPARE_SCALAR_FIELD(behavior
);
1028 _equalDeclareCursorStmt(DeclareCursorStmt
*a
, DeclareCursorStmt
*b
)
1030 COMPARE_STRING_FIELD(portalname
);
1031 COMPARE_SCALAR_FIELD(options
);
1032 COMPARE_NODE_FIELD(query
);
1038 _equalClosePortalStmt(ClosePortalStmt
*a
, ClosePortalStmt
*b
)
1040 COMPARE_STRING_FIELD(portalname
);
1046 _equalClusterStmt(ClusterStmt
*a
, ClusterStmt
*b
)
1048 COMPARE_NODE_FIELD(relation
);
1049 COMPARE_STRING_FIELD(indexname
);
1050 COMPARE_SCALAR_FIELD(verbose
);
1056 _equalCopyStmt(CopyStmt
*a
, CopyStmt
*b
)
1058 COMPARE_NODE_FIELD(relation
);
1059 COMPARE_NODE_FIELD(query
);
1060 COMPARE_NODE_FIELD(attlist
);
1061 COMPARE_SCALAR_FIELD(is_from
);
1062 COMPARE_STRING_FIELD(filename
);
1063 COMPARE_NODE_FIELD(options
);
1069 _equalCreateStmt(CreateStmt
*a
, CreateStmt
*b
)
1071 COMPARE_NODE_FIELD(relation
);
1072 COMPARE_NODE_FIELD(tableElts
);
1073 COMPARE_NODE_FIELD(inhRelations
);
1074 COMPARE_NODE_FIELD(constraints
);
1075 COMPARE_NODE_FIELD(options
);
1076 COMPARE_SCALAR_FIELD(oncommit
);
1077 COMPARE_STRING_FIELD(tablespacename
);
1083 _equalInhRelation(InhRelation
*a
, InhRelation
*b
)
1085 COMPARE_NODE_FIELD(relation
);
1086 COMPARE_NODE_FIELD(options
);
1092 _equalDefineStmt(DefineStmt
*a
, DefineStmt
*b
)
1094 COMPARE_SCALAR_FIELD(kind
);
1095 COMPARE_SCALAR_FIELD(oldstyle
);
1096 COMPARE_NODE_FIELD(defnames
);
1097 COMPARE_NODE_FIELD(args
);
1098 COMPARE_NODE_FIELD(definition
);
1104 _equalDropStmt(DropStmt
*a
, DropStmt
*b
)
1106 COMPARE_NODE_FIELD(objects
);
1107 COMPARE_SCALAR_FIELD(removeType
);
1108 COMPARE_SCALAR_FIELD(behavior
);
1109 COMPARE_SCALAR_FIELD(missing_ok
);
1115 _equalTruncateStmt(TruncateStmt
*a
, TruncateStmt
*b
)
1117 COMPARE_NODE_FIELD(relations
);
1118 COMPARE_SCALAR_FIELD(restart_seqs
);
1119 COMPARE_SCALAR_FIELD(behavior
);
1125 _equalCommentStmt(CommentStmt
*a
, CommentStmt
*b
)
1127 COMPARE_SCALAR_FIELD(objtype
);
1128 COMPARE_NODE_FIELD(objname
);
1129 COMPARE_NODE_FIELD(objargs
);
1130 COMPARE_STRING_FIELD(comment
);
1136 _equalFetchStmt(FetchStmt
*a
, FetchStmt
*b
)
1138 COMPARE_SCALAR_FIELD(direction
);
1139 COMPARE_SCALAR_FIELD(howMany
);
1140 COMPARE_STRING_FIELD(portalname
);
1141 COMPARE_SCALAR_FIELD(ismove
);
1147 _equalIndexStmt(IndexStmt
*a
, IndexStmt
*b
)
1149 COMPARE_STRING_FIELD(idxname
);
1150 COMPARE_NODE_FIELD(relation
);
1151 COMPARE_STRING_FIELD(accessMethod
);
1152 COMPARE_STRING_FIELD(tableSpace
);
1153 COMPARE_NODE_FIELD(indexParams
);
1154 COMPARE_NODE_FIELD(options
);
1155 COMPARE_NODE_FIELD(whereClause
);
1156 COMPARE_SCALAR_FIELD(unique
);
1157 COMPARE_SCALAR_FIELD(primary
);
1158 COMPARE_SCALAR_FIELD(isconstraint
);
1159 COMPARE_SCALAR_FIELD(concurrent
);
1165 _equalCreateFunctionStmt(CreateFunctionStmt
*a
, CreateFunctionStmt
*b
)
1167 COMPARE_SCALAR_FIELD(replace
);
1168 COMPARE_NODE_FIELD(funcname
);
1169 COMPARE_NODE_FIELD(parameters
);
1170 COMPARE_NODE_FIELD(returnType
);
1171 COMPARE_NODE_FIELD(options
);
1172 COMPARE_NODE_FIELD(withClause
);
1178 _equalFunctionParameter(FunctionParameter
*a
, FunctionParameter
*b
)
1180 COMPARE_STRING_FIELD(name
);
1181 COMPARE_NODE_FIELD(argType
);
1182 COMPARE_SCALAR_FIELD(mode
);
1183 COMPARE_NODE_FIELD(defexpr
);
1189 _equalAlterFunctionStmt(AlterFunctionStmt
*a
, AlterFunctionStmt
*b
)
1191 COMPARE_NODE_FIELD(func
);
1192 COMPARE_NODE_FIELD(actions
);
1198 _equalRemoveFuncStmt(RemoveFuncStmt
*a
, RemoveFuncStmt
*b
)
1200 COMPARE_SCALAR_FIELD(kind
);
1201 COMPARE_NODE_FIELD(name
);
1202 COMPARE_NODE_FIELD(args
);
1203 COMPARE_SCALAR_FIELD(behavior
);
1204 COMPARE_SCALAR_FIELD(missing_ok
);
1210 _equalRemoveOpClassStmt(RemoveOpClassStmt
*a
, RemoveOpClassStmt
*b
)
1212 COMPARE_NODE_FIELD(opclassname
);
1213 COMPARE_STRING_FIELD(amname
);
1214 COMPARE_SCALAR_FIELD(behavior
);
1215 COMPARE_SCALAR_FIELD(missing_ok
);
1221 _equalRemoveOpFamilyStmt(RemoveOpFamilyStmt
*a
, RemoveOpFamilyStmt
*b
)
1223 COMPARE_NODE_FIELD(opfamilyname
);
1224 COMPARE_STRING_FIELD(amname
);
1225 COMPARE_SCALAR_FIELD(behavior
);
1226 COMPARE_SCALAR_FIELD(missing_ok
);
1232 _equalRenameStmt(RenameStmt
*a
, RenameStmt
*b
)
1234 COMPARE_SCALAR_FIELD(renameType
);
1235 COMPARE_NODE_FIELD(relation
);
1236 COMPARE_NODE_FIELD(object
);
1237 COMPARE_NODE_FIELD(objarg
);
1238 COMPARE_STRING_FIELD(subname
);
1239 COMPARE_STRING_FIELD(newname
);
1245 _equalAlterObjectSchemaStmt(AlterObjectSchemaStmt
*a
, AlterObjectSchemaStmt
*b
)
1247 COMPARE_SCALAR_FIELD(objectType
);
1248 COMPARE_NODE_FIELD(relation
);
1249 COMPARE_NODE_FIELD(object
);
1250 COMPARE_NODE_FIELD(objarg
);
1251 COMPARE_STRING_FIELD(addname
);
1252 COMPARE_STRING_FIELD(newschema
);
1258 _equalAlterOwnerStmt(AlterOwnerStmt
*a
, AlterOwnerStmt
*b
)
1260 COMPARE_SCALAR_FIELD(objectType
);
1261 COMPARE_NODE_FIELD(relation
);
1262 COMPARE_NODE_FIELD(object
);
1263 COMPARE_NODE_FIELD(objarg
);
1264 COMPARE_STRING_FIELD(addname
);
1265 COMPARE_STRING_FIELD(newowner
);
1271 _equalRuleStmt(RuleStmt
*a
, RuleStmt
*b
)
1273 COMPARE_NODE_FIELD(relation
);
1274 COMPARE_STRING_FIELD(rulename
);
1275 COMPARE_NODE_FIELD(whereClause
);
1276 COMPARE_SCALAR_FIELD(event
);
1277 COMPARE_SCALAR_FIELD(instead
);
1278 COMPARE_NODE_FIELD(actions
);
1279 COMPARE_SCALAR_FIELD(replace
);
1285 _equalNotifyStmt(NotifyStmt
*a
, NotifyStmt
*b
)
1287 COMPARE_STRING_FIELD(conditionname
);
1293 _equalListenStmt(ListenStmt
*a
, ListenStmt
*b
)
1295 COMPARE_STRING_FIELD(conditionname
);
1301 _equalUnlistenStmt(UnlistenStmt
*a
, UnlistenStmt
*b
)
1303 COMPARE_STRING_FIELD(conditionname
);
1309 _equalTransactionStmt(TransactionStmt
*a
, TransactionStmt
*b
)
1311 COMPARE_SCALAR_FIELD(kind
);
1312 COMPARE_NODE_FIELD(options
);
1313 COMPARE_STRING_FIELD(gid
);
1319 _equalCompositeTypeStmt(CompositeTypeStmt
*a
, CompositeTypeStmt
*b
)
1321 COMPARE_NODE_FIELD(typevar
);
1322 COMPARE_NODE_FIELD(coldeflist
);
1328 _equalCreateEnumStmt(CreateEnumStmt
*a
, CreateEnumStmt
*b
)
1330 COMPARE_NODE_FIELD(typename
);
1331 COMPARE_NODE_FIELD(vals
);
1337 _equalViewStmt(ViewStmt
*a
, ViewStmt
*b
)
1339 COMPARE_NODE_FIELD(view
);
1340 COMPARE_NODE_FIELD(aliases
);
1341 COMPARE_NODE_FIELD(query
);
1342 COMPARE_SCALAR_FIELD(replace
);
1348 _equalLoadStmt(LoadStmt
*a
, LoadStmt
*b
)
1350 COMPARE_STRING_FIELD(filename
);
1356 _equalCreateDomainStmt(CreateDomainStmt
*a
, CreateDomainStmt
*b
)
1358 COMPARE_NODE_FIELD(domainname
);
1359 COMPARE_NODE_FIELD(typename
);
1360 COMPARE_NODE_FIELD(constraints
);
1366 _equalCreateOpClassStmt(CreateOpClassStmt
*a
, CreateOpClassStmt
*b
)
1368 COMPARE_NODE_FIELD(opclassname
);
1369 COMPARE_NODE_FIELD(opfamilyname
);
1370 COMPARE_STRING_FIELD(amname
);
1371 COMPARE_NODE_FIELD(datatype
);
1372 COMPARE_NODE_FIELD(items
);
1373 COMPARE_SCALAR_FIELD(isDefault
);
1379 _equalCreateOpClassItem(CreateOpClassItem
*a
, CreateOpClassItem
*b
)
1381 COMPARE_SCALAR_FIELD(itemtype
);
1382 COMPARE_NODE_FIELD(name
);
1383 COMPARE_NODE_FIELD(args
);
1384 COMPARE_SCALAR_FIELD(number
);
1385 COMPARE_NODE_FIELD(class_args
);
1386 COMPARE_NODE_FIELD(storedtype
);
1392 _equalCreateOpFamilyStmt(CreateOpFamilyStmt
*a
, CreateOpFamilyStmt
*b
)
1394 COMPARE_NODE_FIELD(opfamilyname
);
1395 COMPARE_STRING_FIELD(amname
);
1401 _equalAlterOpFamilyStmt(AlterOpFamilyStmt
*a
, AlterOpFamilyStmt
*b
)
1403 COMPARE_NODE_FIELD(opfamilyname
);
1404 COMPARE_STRING_FIELD(amname
);
1405 COMPARE_SCALAR_FIELD(isDrop
);
1406 COMPARE_NODE_FIELD(items
);
1412 _equalCreatedbStmt(CreatedbStmt
*a
, CreatedbStmt
*b
)
1414 COMPARE_STRING_FIELD(dbname
);
1415 COMPARE_NODE_FIELD(options
);
1421 _equalAlterDatabaseStmt(AlterDatabaseStmt
*a
, AlterDatabaseStmt
*b
)
1423 COMPARE_STRING_FIELD(dbname
);
1424 COMPARE_NODE_FIELD(options
);
1430 _equalAlterDatabaseSetStmt(AlterDatabaseSetStmt
*a
, AlterDatabaseSetStmt
*b
)
1432 COMPARE_STRING_FIELD(dbname
);
1433 COMPARE_NODE_FIELD(setstmt
);
1439 _equalDropdbStmt(DropdbStmt
*a
, DropdbStmt
*b
)
1441 COMPARE_STRING_FIELD(dbname
);
1442 COMPARE_SCALAR_FIELD(missing_ok
);
1448 _equalVacuumStmt(VacuumStmt
*a
, VacuumStmt
*b
)
1450 COMPARE_SCALAR_FIELD(vacuum
);
1451 COMPARE_SCALAR_FIELD(full
);
1452 COMPARE_SCALAR_FIELD(analyze
);
1453 COMPARE_SCALAR_FIELD(verbose
);
1454 COMPARE_SCALAR_FIELD(freeze_min_age
);
1455 COMPARE_SCALAR_FIELD(freeze_table_age
);
1456 COMPARE_NODE_FIELD(relation
);
1457 COMPARE_NODE_FIELD(va_cols
);
1463 _equalExplainStmt(ExplainStmt
*a
, ExplainStmt
*b
)
1465 COMPARE_NODE_FIELD(query
);
1466 COMPARE_SCALAR_FIELD(verbose
);
1467 COMPARE_SCALAR_FIELD(analyze
);
1473 _equalCreateSeqStmt(CreateSeqStmt
*a
, CreateSeqStmt
*b
)
1475 COMPARE_NODE_FIELD(sequence
);
1476 COMPARE_NODE_FIELD(options
);
1482 _equalAlterSeqStmt(AlterSeqStmt
*a
, AlterSeqStmt
*b
)
1484 COMPARE_NODE_FIELD(sequence
);
1485 COMPARE_NODE_FIELD(options
);
1491 _equalVariableSetStmt(VariableSetStmt
*a
, VariableSetStmt
*b
)
1493 COMPARE_SCALAR_FIELD(kind
);
1494 COMPARE_STRING_FIELD(name
);
1495 COMPARE_NODE_FIELD(args
);
1496 COMPARE_SCALAR_FIELD(is_local
);
1502 _equalVariableShowStmt(VariableShowStmt
*a
, VariableShowStmt
*b
)
1504 COMPARE_STRING_FIELD(name
);
1510 _equalDiscardStmt(DiscardStmt
*a
, DiscardStmt
*b
)
1512 COMPARE_SCALAR_FIELD(target
);
1518 _equalCreateTableSpaceStmt(CreateTableSpaceStmt
*a
, CreateTableSpaceStmt
*b
)
1520 COMPARE_STRING_FIELD(tablespacename
);
1521 COMPARE_STRING_FIELD(owner
);
1522 COMPARE_STRING_FIELD(location
);
1528 _equalDropTableSpaceStmt(DropTableSpaceStmt
*a
, DropTableSpaceStmt
*b
)
1530 COMPARE_STRING_FIELD(tablespacename
);
1531 COMPARE_SCALAR_FIELD(missing_ok
);
1537 _equalCreateFdwStmt(CreateFdwStmt
*a
, CreateFdwStmt
*b
)
1539 COMPARE_STRING_FIELD(fdwname
);
1540 COMPARE_NODE_FIELD(validator
);
1541 COMPARE_NODE_FIELD(options
);
1547 _equalAlterFdwStmt(AlterFdwStmt
*a
, AlterFdwStmt
*b
)
1549 COMPARE_STRING_FIELD(fdwname
);
1550 COMPARE_NODE_FIELD(validator
);
1551 COMPARE_SCALAR_FIELD(change_validator
);
1552 COMPARE_NODE_FIELD(options
);
1558 _equalDropFdwStmt(DropFdwStmt
*a
, DropFdwStmt
*b
)
1560 COMPARE_STRING_FIELD(fdwname
);
1561 COMPARE_SCALAR_FIELD(missing_ok
);
1562 COMPARE_SCALAR_FIELD(behavior
);
1568 _equalCreateForeignServerStmt(CreateForeignServerStmt
*a
, CreateForeignServerStmt
*b
)
1570 COMPARE_STRING_FIELD(servername
);
1571 COMPARE_STRING_FIELD(servertype
);
1572 COMPARE_STRING_FIELD(version
);
1573 COMPARE_STRING_FIELD(fdwname
);
1574 COMPARE_NODE_FIELD(options
);
1580 _equalAlterForeignServerStmt(AlterForeignServerStmt
*a
, AlterForeignServerStmt
*b
)
1582 COMPARE_STRING_FIELD(servername
);
1583 COMPARE_STRING_FIELD(version
);
1584 COMPARE_NODE_FIELD(options
);
1585 COMPARE_SCALAR_FIELD(has_version
);
1591 _equalDropForeignServerStmt(DropForeignServerStmt
*a
, DropForeignServerStmt
*b
)
1593 COMPARE_STRING_FIELD(servername
);
1594 COMPARE_SCALAR_FIELD(missing_ok
);
1595 COMPARE_SCALAR_FIELD(behavior
);
1601 _equalCreateUserMappingStmt(CreateUserMappingStmt
*a
, CreateUserMappingStmt
*b
)
1603 COMPARE_STRING_FIELD(username
);
1604 COMPARE_STRING_FIELD(servername
);
1605 COMPARE_NODE_FIELD(options
);
1611 _equalAlterUserMappingStmt(AlterUserMappingStmt
*a
, AlterUserMappingStmt
*b
)
1613 COMPARE_STRING_FIELD(username
);
1614 COMPARE_STRING_FIELD(servername
);
1615 COMPARE_NODE_FIELD(options
);
1621 _equalDropUserMappingStmt(DropUserMappingStmt
*a
, DropUserMappingStmt
*b
)
1623 COMPARE_STRING_FIELD(username
);
1624 COMPARE_STRING_FIELD(servername
);
1625 COMPARE_SCALAR_FIELD(missing_ok
);
1631 _equalCreateTrigStmt(CreateTrigStmt
*a
, CreateTrigStmt
*b
)
1633 COMPARE_STRING_FIELD(trigname
);
1634 COMPARE_NODE_FIELD(relation
);
1635 COMPARE_NODE_FIELD(funcname
);
1636 COMPARE_NODE_FIELD(args
);
1637 COMPARE_SCALAR_FIELD(before
);
1638 COMPARE_SCALAR_FIELD(row
);
1639 if (strcmp(a
->actions
, b
->actions
) != 0) /* in-line string field */
1641 COMPARE_SCALAR_FIELD(isconstraint
);
1642 COMPARE_SCALAR_FIELD(deferrable
);
1643 COMPARE_SCALAR_FIELD(initdeferred
);
1644 COMPARE_NODE_FIELD(constrrel
);
1650 _equalDropPropertyStmt(DropPropertyStmt
*a
, DropPropertyStmt
*b
)
1652 COMPARE_NODE_FIELD(relation
);
1653 COMPARE_STRING_FIELD(property
);
1654 COMPARE_SCALAR_FIELD(removeType
);
1655 COMPARE_SCALAR_FIELD(behavior
);
1656 COMPARE_SCALAR_FIELD(missing_ok
);
1662 _equalCreatePLangStmt(CreatePLangStmt
*a
, CreatePLangStmt
*b
)
1664 COMPARE_STRING_FIELD(plname
);
1665 COMPARE_NODE_FIELD(plhandler
);
1666 COMPARE_NODE_FIELD(plvalidator
);
1667 COMPARE_SCALAR_FIELD(pltrusted
);
1673 _equalDropPLangStmt(DropPLangStmt
*a
, DropPLangStmt
*b
)
1675 COMPARE_STRING_FIELD(plname
);
1676 COMPARE_SCALAR_FIELD(behavior
);
1677 COMPARE_SCALAR_FIELD(missing_ok
);
1683 _equalCreateRoleStmt(CreateRoleStmt
*a
, CreateRoleStmt
*b
)
1685 COMPARE_SCALAR_FIELD(stmt_type
);
1686 COMPARE_STRING_FIELD(role
);
1687 COMPARE_NODE_FIELD(options
);
1693 _equalAlterRoleStmt(AlterRoleStmt
*a
, AlterRoleStmt
*b
)
1695 COMPARE_STRING_FIELD(role
);
1696 COMPARE_NODE_FIELD(options
);
1697 COMPARE_SCALAR_FIELD(action
);
1703 _equalAlterRoleSetStmt(AlterRoleSetStmt
*a
, AlterRoleSetStmt
*b
)
1705 COMPARE_STRING_FIELD(role
);
1706 COMPARE_NODE_FIELD(setstmt
);
1712 _equalDropRoleStmt(DropRoleStmt
*a
, DropRoleStmt
*b
)
1714 COMPARE_NODE_FIELD(roles
);
1715 COMPARE_SCALAR_FIELD(missing_ok
);
1721 _equalLockStmt(LockStmt
*a
, LockStmt
*b
)
1723 COMPARE_NODE_FIELD(relations
);
1724 COMPARE_SCALAR_FIELD(mode
);
1725 COMPARE_SCALAR_FIELD(nowait
);
1731 _equalConstraintsSetStmt(ConstraintsSetStmt
*a
, ConstraintsSetStmt
*b
)
1733 COMPARE_NODE_FIELD(constraints
);
1734 COMPARE_SCALAR_FIELD(deferred
);
1740 _equalReindexStmt(ReindexStmt
*a
, ReindexStmt
*b
)
1742 COMPARE_SCALAR_FIELD(kind
);
1743 COMPARE_NODE_FIELD(relation
);
1744 COMPARE_STRING_FIELD(name
);
1745 COMPARE_SCALAR_FIELD(do_system
);
1746 COMPARE_SCALAR_FIELD(do_user
);
1752 _equalCreateSchemaStmt(CreateSchemaStmt
*a
, CreateSchemaStmt
*b
)
1754 COMPARE_STRING_FIELD(schemaname
);
1755 COMPARE_STRING_FIELD(authid
);
1756 COMPARE_NODE_FIELD(schemaElts
);
1762 _equalCreateConversionStmt(CreateConversionStmt
*a
, CreateConversionStmt
*b
)
1764 COMPARE_NODE_FIELD(conversion_name
);
1765 COMPARE_STRING_FIELD(for_encoding_name
);
1766 COMPARE_STRING_FIELD(to_encoding_name
);
1767 COMPARE_NODE_FIELD(func_name
);
1768 COMPARE_SCALAR_FIELD(def
);
1774 _equalCreateCastStmt(CreateCastStmt
*a
, CreateCastStmt
*b
)
1776 COMPARE_NODE_FIELD(sourcetype
);
1777 COMPARE_NODE_FIELD(targettype
);
1778 COMPARE_NODE_FIELD(func
);
1779 COMPARE_SCALAR_FIELD(context
);
1780 COMPARE_SCALAR_FIELD(inout
);
1786 _equalDropCastStmt(DropCastStmt
*a
, DropCastStmt
*b
)
1788 COMPARE_NODE_FIELD(sourcetype
);
1789 COMPARE_NODE_FIELD(targettype
);
1790 COMPARE_SCALAR_FIELD(behavior
);
1791 COMPARE_SCALAR_FIELD(missing_ok
);
1797 _equalPrepareStmt(PrepareStmt
*a
, PrepareStmt
*b
)
1799 COMPARE_STRING_FIELD(name
);
1800 COMPARE_NODE_FIELD(argtypes
);
1801 COMPARE_NODE_FIELD(query
);
1807 _equalExecuteStmt(ExecuteStmt
*a
, ExecuteStmt
*b
)
1809 COMPARE_STRING_FIELD(name
);
1810 COMPARE_NODE_FIELD(into
);
1811 COMPARE_NODE_FIELD(params
);
1817 _equalDeallocateStmt(DeallocateStmt
*a
, DeallocateStmt
*b
)
1819 COMPARE_STRING_FIELD(name
);
1825 _equalDropOwnedStmt(DropOwnedStmt
*a
, DropOwnedStmt
*b
)
1827 COMPARE_NODE_FIELD(roles
);
1828 COMPARE_SCALAR_FIELD(behavior
);
1834 _equalReassignOwnedStmt(ReassignOwnedStmt
*a
, ReassignOwnedStmt
*b
)
1836 COMPARE_NODE_FIELD(roles
);
1837 COMPARE_NODE_FIELD(newrole
);
1843 _equalAlterTSDictionaryStmt(AlterTSDictionaryStmt
*a
, AlterTSDictionaryStmt
*b
)
1845 COMPARE_NODE_FIELD(dictname
);
1846 COMPARE_NODE_FIELD(options
);
1852 _equalAlterTSConfigurationStmt(AlterTSConfigurationStmt
*a
,
1853 AlterTSConfigurationStmt
*b
)
1855 COMPARE_NODE_FIELD(cfgname
);
1856 COMPARE_NODE_FIELD(tokentype
);
1857 COMPARE_NODE_FIELD(dicts
);
1858 COMPARE_SCALAR_FIELD(override
);
1859 COMPARE_SCALAR_FIELD(replace
);
1860 COMPARE_SCALAR_FIELD(missing_ok
);
1866 _equalAExpr(A_Expr
*a
, A_Expr
*b
)
1868 COMPARE_SCALAR_FIELD(kind
);
1869 COMPARE_NODE_FIELD(name
);
1870 COMPARE_NODE_FIELD(lexpr
);
1871 COMPARE_NODE_FIELD(rexpr
);
1872 COMPARE_LOCATION_FIELD(location
);
1878 _equalColumnRef(ColumnRef
*a
, ColumnRef
*b
)
1880 COMPARE_NODE_FIELD(fields
);
1881 COMPARE_LOCATION_FIELD(location
);
1887 _equalParamRef(ParamRef
*a
, ParamRef
*b
)
1889 COMPARE_SCALAR_FIELD(number
);
1890 COMPARE_LOCATION_FIELD(location
);
1896 _equalAConst(A_Const
*a
, A_Const
*b
)
1898 if (!equal(&a
->val
, &b
->val
)) /* hack for in-line Value field */
1900 COMPARE_LOCATION_FIELD(location
);
1906 _equalFuncCall(FuncCall
*a
, FuncCall
*b
)
1908 COMPARE_NODE_FIELD(funcname
);
1909 COMPARE_NODE_FIELD(args
);
1910 COMPARE_SCALAR_FIELD(agg_star
);
1911 COMPARE_SCALAR_FIELD(agg_distinct
);
1912 COMPARE_SCALAR_FIELD(func_variadic
);
1913 COMPARE_NODE_FIELD(over
);
1914 COMPARE_LOCATION_FIELD(location
);
1920 _equalAStar(A_Star
*a
, A_Star
*b
)
1926 _equalAIndices(A_Indices
*a
, A_Indices
*b
)
1928 COMPARE_NODE_FIELD(lidx
);
1929 COMPARE_NODE_FIELD(uidx
);
1935 _equalA_Indirection(A_Indirection
*a
, A_Indirection
*b
)
1937 COMPARE_NODE_FIELD(arg
);
1938 COMPARE_NODE_FIELD(indirection
);
1944 _equalA_ArrayExpr(A_ArrayExpr
*a
, A_ArrayExpr
*b
)
1946 COMPARE_NODE_FIELD(elements
);
1947 COMPARE_LOCATION_FIELD(location
);
1953 _equalResTarget(ResTarget
*a
, ResTarget
*b
)
1955 COMPARE_STRING_FIELD(name
);
1956 COMPARE_NODE_FIELD(indirection
);
1957 COMPARE_NODE_FIELD(val
);
1958 COMPARE_LOCATION_FIELD(location
);
1964 _equalTypeName(TypeName
*a
, TypeName
*b
)
1966 COMPARE_NODE_FIELD(names
);
1967 COMPARE_SCALAR_FIELD(typeid);
1968 COMPARE_SCALAR_FIELD(setof
);
1969 COMPARE_SCALAR_FIELD(pct_type
);
1970 COMPARE_NODE_FIELD(typmods
);
1971 COMPARE_SCALAR_FIELD(typemod
);
1972 COMPARE_NODE_FIELD(arrayBounds
);
1973 COMPARE_LOCATION_FIELD(location
);
1979 _equalTypeCast(TypeCast
*a
, TypeCast
*b
)
1981 COMPARE_NODE_FIELD(arg
);
1982 COMPARE_NODE_FIELD(typename
);
1983 COMPARE_LOCATION_FIELD(location
);
1989 _equalSortBy(SortBy
*a
, SortBy
*b
)
1991 COMPARE_NODE_FIELD(node
);
1992 COMPARE_SCALAR_FIELD(sortby_dir
);
1993 COMPARE_SCALAR_FIELD(sortby_nulls
);
1994 COMPARE_NODE_FIELD(useOp
);
1995 COMPARE_LOCATION_FIELD(location
);
2001 _equalWindowDef(WindowDef
*a
, WindowDef
*b
)
2003 COMPARE_STRING_FIELD(name
);
2004 COMPARE_STRING_FIELD(refname
);
2005 COMPARE_NODE_FIELD(partitionClause
);
2006 COMPARE_NODE_FIELD(orderClause
);
2007 COMPARE_SCALAR_FIELD(frameOptions
);
2008 COMPARE_LOCATION_FIELD(location
);
2014 _equalRangeSubselect(RangeSubselect
*a
, RangeSubselect
*b
)
2016 COMPARE_NODE_FIELD(subquery
);
2017 COMPARE_NODE_FIELD(alias
);
2023 _equalRangeFunction(RangeFunction
*a
, RangeFunction
*b
)
2025 COMPARE_NODE_FIELD(funccallnode
);
2026 COMPARE_NODE_FIELD(alias
);
2027 COMPARE_NODE_FIELD(coldeflist
);
2033 _equalIndexElem(IndexElem
*a
, IndexElem
*b
)
2035 COMPARE_STRING_FIELD(name
);
2036 COMPARE_NODE_FIELD(expr
);
2037 COMPARE_NODE_FIELD(opclass
);
2038 COMPARE_SCALAR_FIELD(ordering
);
2039 COMPARE_SCALAR_FIELD(nulls_ordering
);
2045 _equalColumnDef(ColumnDef
*a
, ColumnDef
*b
)
2047 COMPARE_STRING_FIELD(colname
);
2048 COMPARE_NODE_FIELD(typename
);
2049 COMPARE_SCALAR_FIELD(inhcount
);
2050 COMPARE_SCALAR_FIELD(is_local
);
2051 COMPARE_SCALAR_FIELD(is_not_null
);
2052 COMPARE_NODE_FIELD(raw_default
);
2053 COMPARE_STRING_FIELD(cooked_default
);
2054 COMPARE_NODE_FIELD(constraints
);
2060 _equalConstraint(Constraint
*a
, Constraint
*b
)
2062 COMPARE_SCALAR_FIELD(contype
);
2063 COMPARE_STRING_FIELD(name
);
2064 COMPARE_NODE_FIELD(raw_expr
);
2065 COMPARE_STRING_FIELD(cooked_expr
);
2066 COMPARE_NODE_FIELD(keys
);
2067 COMPARE_NODE_FIELD(options
);
2068 COMPARE_STRING_FIELD(indexspace
);
2074 _equalDefElem(DefElem
*a
, DefElem
*b
)
2076 COMPARE_STRING_FIELD(defname
);
2077 COMPARE_NODE_FIELD(arg
);
2083 _equalOptionDefElem(OptionDefElem
*a
, OptionDefElem
*b
)
2085 COMPARE_SCALAR_FIELD(alter_op
);
2086 COMPARE_NODE_FIELD(def
);
2092 _equalReloptElem(ReloptElem
*a
, ReloptElem
*b
)
2094 COMPARE_STRING_FIELD(nmspc
);
2095 COMPARE_STRING_FIELD(optname
);
2096 COMPARE_NODE_FIELD(arg
);
2102 _equalLockingClause(LockingClause
*a
, LockingClause
*b
)
2104 COMPARE_NODE_FIELD(lockedRels
);
2105 COMPARE_SCALAR_FIELD(forUpdate
);
2106 COMPARE_SCALAR_FIELD(noWait
);
2112 _equalRangeTblEntry(RangeTblEntry
*a
, RangeTblEntry
*b
)
2114 COMPARE_SCALAR_FIELD(rtekind
);
2115 COMPARE_SCALAR_FIELD(relid
);
2116 COMPARE_NODE_FIELD(subquery
);
2117 COMPARE_SCALAR_FIELD(jointype
);
2118 COMPARE_NODE_FIELD(joinaliasvars
);
2119 COMPARE_NODE_FIELD(funcexpr
);
2120 COMPARE_NODE_FIELD(funccoltypes
);
2121 COMPARE_NODE_FIELD(funccoltypmods
);
2122 COMPARE_NODE_FIELD(values_lists
);
2123 COMPARE_STRING_FIELD(ctename
);
2124 COMPARE_SCALAR_FIELD(ctelevelsup
);
2125 COMPARE_SCALAR_FIELD(self_reference
);
2126 COMPARE_NODE_FIELD(ctecoltypes
);
2127 COMPARE_NODE_FIELD(ctecoltypmods
);
2128 COMPARE_NODE_FIELD(alias
);
2129 COMPARE_NODE_FIELD(eref
);
2130 COMPARE_SCALAR_FIELD(inh
);
2131 COMPARE_SCALAR_FIELD(inFromCl
);
2132 COMPARE_SCALAR_FIELD(requiredPerms
);
2133 COMPARE_SCALAR_FIELD(checkAsUser
);
2134 COMPARE_BITMAPSET_FIELD(selectedCols
);
2135 COMPARE_BITMAPSET_FIELD(modifiedCols
);
2141 _equalSortGroupClause(SortGroupClause
*a
, SortGroupClause
*b
)
2143 COMPARE_SCALAR_FIELD(tleSortGroupRef
);
2144 COMPARE_SCALAR_FIELD(eqop
);
2145 COMPARE_SCALAR_FIELD(sortop
);
2146 COMPARE_SCALAR_FIELD(nulls_first
);
2152 _equalWindowClause(WindowClause
*a
, WindowClause
*b
)
2154 COMPARE_STRING_FIELD(name
);
2155 COMPARE_STRING_FIELD(refname
);
2156 COMPARE_NODE_FIELD(partitionClause
);
2157 COMPARE_NODE_FIELD(orderClause
);
2158 COMPARE_SCALAR_FIELD(frameOptions
);
2159 COMPARE_SCALAR_FIELD(winref
);
2160 COMPARE_SCALAR_FIELD(copiedOrder
);
2166 _equalRowMarkClause(RowMarkClause
*a
, RowMarkClause
*b
)
2168 COMPARE_SCALAR_FIELD(rti
);
2169 COMPARE_SCALAR_FIELD(prti
);
2170 COMPARE_SCALAR_FIELD(forUpdate
);
2171 COMPARE_SCALAR_FIELD(noWait
);
2172 COMPARE_SCALAR_FIELD(isParent
);
2178 _equalWithClause(WithClause
*a
, WithClause
*b
)
2180 COMPARE_NODE_FIELD(ctes
);
2181 COMPARE_SCALAR_FIELD(recursive
);
2182 COMPARE_LOCATION_FIELD(location
);
2188 _equalCommonTableExpr(CommonTableExpr
*a
, CommonTableExpr
*b
)
2190 COMPARE_STRING_FIELD(ctename
);
2191 COMPARE_NODE_FIELD(aliascolnames
);
2192 COMPARE_NODE_FIELD(ctequery
);
2193 COMPARE_LOCATION_FIELD(location
);
2194 COMPARE_SCALAR_FIELD(cterecursive
);
2195 COMPARE_SCALAR_FIELD(cterefcount
);
2196 COMPARE_NODE_FIELD(ctecolnames
);
2197 COMPARE_NODE_FIELD(ctecoltypes
);
2198 COMPARE_NODE_FIELD(ctecoltypmods
);
2204 _equalFkConstraint(FkConstraint
*a
, FkConstraint
*b
)
2206 COMPARE_STRING_FIELD(constr_name
);
2207 COMPARE_NODE_FIELD(pktable
);
2208 COMPARE_NODE_FIELD(fk_attrs
);
2209 COMPARE_NODE_FIELD(pk_attrs
);
2210 COMPARE_SCALAR_FIELD(fk_matchtype
);
2211 COMPARE_SCALAR_FIELD(fk_upd_action
);
2212 COMPARE_SCALAR_FIELD(fk_del_action
);
2213 COMPARE_SCALAR_FIELD(deferrable
);
2214 COMPARE_SCALAR_FIELD(initdeferred
);
2215 COMPARE_SCALAR_FIELD(skip_validation
);
2221 _equalXmlSerialize(XmlSerialize
*a
, XmlSerialize
*b
)
2223 COMPARE_SCALAR_FIELD(xmloption
);
2224 COMPARE_NODE_FIELD(expr
);
2225 COMPARE_NODE_FIELD(typename
);
2226 COMPARE_LOCATION_FIELD(location
);
2232 * Stuff from pg_list.h
2236 _equalList(List
*a
, List
*b
)
2242 * Try to reject by simple scalar checks before grovelling through all the
2245 COMPARE_SCALAR_FIELD(type
);
2246 COMPARE_SCALAR_FIELD(length
);
2249 * We place the switch outside the loop for the sake of efficiency; this
2250 * may not be worth doing...
2255 forboth(item_a
, a
, item_b
, b
)
2257 if (!equal(lfirst(item_a
), lfirst(item_b
)))
2262 forboth(item_a
, a
, item_b
, b
)
2264 if (lfirst_int(item_a
) != lfirst_int(item_b
))
2269 forboth(item_a
, a
, item_b
, b
)
2271 if (lfirst_oid(item_a
) != lfirst_oid(item_b
))
2276 elog(ERROR
, "unrecognized list node type: %d",
2278 return false; /* keep compiler quiet */
2282 * If we got here, we should have run out of elements of both lists
2284 Assert(item_a
== NULL
);
2285 Assert(item_b
== NULL
);
2291 * Stuff from value.h
2295 _equalValue(Value
*a
, Value
*b
)
2297 COMPARE_SCALAR_FIELD(type
);
2302 COMPARE_SCALAR_FIELD(val
.ival
);
2307 COMPARE_STRING_FIELD(val
.str
);
2313 elog(ERROR
, "unrecognized node type: %d", (int) a
->type
);
2322 * returns whether two nodes are equal
2325 equal(void *a
, void *b
)
2333 * note that a!=b, so only one of them can be NULL
2335 if (a
== NULL
|| b
== NULL
)
2339 * are they the same type of nodes?
2341 if (nodeTag(a
) != nodeTag(b
))
2350 retval
= _equalAlias(a
, b
);
2353 retval
= _equalRangeVar(a
, b
);
2356 retval
= _equalIntoClause(a
, b
);
2359 retval
= _equalVar(a
, b
);
2362 retval
= _equalConst(a
, b
);
2365 retval
= _equalParam(a
, b
);
2368 retval
= _equalAggref(a
, b
);
2371 retval
= _equalWindowFunc(a
, b
);
2374 retval
= _equalArrayRef(a
, b
);
2377 retval
= _equalFuncExpr(a
, b
);
2380 retval
= _equalOpExpr(a
, b
);
2382 case T_DistinctExpr
:
2383 retval
= _equalDistinctExpr(a
, b
);
2385 case T_ScalarArrayOpExpr
:
2386 retval
= _equalScalarArrayOpExpr(a
, b
);
2389 retval
= _equalBoolExpr(a
, b
);
2392 retval
= _equalSubLink(a
, b
);
2395 retval
= _equalSubPlan(a
, b
);
2397 case T_AlternativeSubPlan
:
2398 retval
= _equalAlternativeSubPlan(a
, b
);
2401 retval
= _equalFieldSelect(a
, b
);
2404 retval
= _equalFieldStore(a
, b
);
2407 retval
= _equalRelabelType(a
, b
);
2410 retval
= _equalCoerceViaIO(a
, b
);
2412 case T_ArrayCoerceExpr
:
2413 retval
= _equalArrayCoerceExpr(a
, b
);
2415 case T_ConvertRowtypeExpr
:
2416 retval
= _equalConvertRowtypeExpr(a
, b
);
2419 retval
= _equalCaseExpr(a
, b
);
2422 retval
= _equalCaseWhen(a
, b
);
2424 case T_CaseTestExpr
:
2425 retval
= _equalCaseTestExpr(a
, b
);
2428 retval
= _equalArrayExpr(a
, b
);
2431 retval
= _equalRowExpr(a
, b
);
2433 case T_RowCompareExpr
:
2434 retval
= _equalRowCompareExpr(a
, b
);
2436 case T_CoalesceExpr
:
2437 retval
= _equalCoalesceExpr(a
, b
);
2440 retval
= _equalMinMaxExpr(a
, b
);
2443 retval
= _equalXmlExpr(a
, b
);
2446 retval
= _equalNullIfExpr(a
, b
);
2449 retval
= _equalNullTest(a
, b
);
2452 retval
= _equalBooleanTest(a
, b
);
2454 case T_CoerceToDomain
:
2455 retval
= _equalCoerceToDomain(a
, b
);
2457 case T_CoerceToDomainValue
:
2458 retval
= _equalCoerceToDomainValue(a
, b
);
2460 case T_SetToDefault
:
2461 retval
= _equalSetToDefault(a
, b
);
2463 case T_CurrentOfExpr
:
2464 retval
= _equalCurrentOfExpr(a
, b
);
2467 retval
= _equalTargetEntry(a
, b
);
2470 retval
= _equalRangeTblRef(a
, b
);
2473 retval
= _equalFromExpr(a
, b
);
2476 retval
= _equalJoinExpr(a
, b
);
2483 retval
= _equalPathKey(a
, b
);
2485 case T_RestrictInfo
:
2486 retval
= _equalRestrictInfo(a
, b
);
2488 case T_PlaceHolderVar
:
2489 retval
= _equalPlaceHolderVar(a
, b
);
2491 case T_SpecialJoinInfo
:
2492 retval
= _equalSpecialJoinInfo(a
, b
);
2494 case T_AppendRelInfo
:
2495 retval
= _equalAppendRelInfo(a
, b
);
2497 case T_PlaceHolderInfo
:
2498 retval
= _equalPlaceHolderInfo(a
, b
);
2504 retval
= _equalList(a
, b
);
2512 retval
= _equalValue(a
, b
);
2519 retval
= _equalQuery(a
, b
);
2522 retval
= _equalInsertStmt(a
, b
);
2525 retval
= _equalDeleteStmt(a
, b
);
2528 retval
= _equalUpdateStmt(a
, b
);
2531 retval
= _equalSelectStmt(a
, b
);
2533 case T_SetOperationStmt
:
2534 retval
= _equalSetOperationStmt(a
, b
);
2536 case T_AlterTableStmt
:
2537 retval
= _equalAlterTableStmt(a
, b
);
2539 case T_AlterTableCmd
:
2540 retval
= _equalAlterTableCmd(a
, b
);
2542 case T_AlterDomainStmt
:
2543 retval
= _equalAlterDomainStmt(a
, b
);
2546 retval
= _equalGrantStmt(a
, b
);
2548 case T_GrantRoleStmt
:
2549 retval
= _equalGrantRoleStmt(a
, b
);
2551 case T_DeclareCursorStmt
:
2552 retval
= _equalDeclareCursorStmt(a
, b
);
2554 case T_ClosePortalStmt
:
2555 retval
= _equalClosePortalStmt(a
, b
);
2558 retval
= _equalClusterStmt(a
, b
);
2561 retval
= _equalCopyStmt(a
, b
);
2564 retval
= _equalCreateStmt(a
, b
);
2567 retval
= _equalInhRelation(a
, b
);
2570 retval
= _equalDefineStmt(a
, b
);
2573 retval
= _equalDropStmt(a
, b
);
2575 case T_TruncateStmt
:
2576 retval
= _equalTruncateStmt(a
, b
);
2579 retval
= _equalCommentStmt(a
, b
);
2582 retval
= _equalFetchStmt(a
, b
);
2585 retval
= _equalIndexStmt(a
, b
);
2587 case T_CreateFunctionStmt
:
2588 retval
= _equalCreateFunctionStmt(a
, b
);
2590 case T_FunctionParameter
:
2591 retval
= _equalFunctionParameter(a
, b
);
2593 case T_AlterFunctionStmt
:
2594 retval
= _equalAlterFunctionStmt(a
, b
);
2596 case T_RemoveFuncStmt
:
2597 retval
= _equalRemoveFuncStmt(a
, b
);
2599 case T_RemoveOpClassStmt
:
2600 retval
= _equalRemoveOpClassStmt(a
, b
);
2602 case T_RemoveOpFamilyStmt
:
2603 retval
= _equalRemoveOpFamilyStmt(a
, b
);
2606 retval
= _equalRenameStmt(a
, b
);
2608 case T_AlterObjectSchemaStmt
:
2609 retval
= _equalAlterObjectSchemaStmt(a
, b
);
2611 case T_AlterOwnerStmt
:
2612 retval
= _equalAlterOwnerStmt(a
, b
);
2615 retval
= _equalRuleStmt(a
, b
);
2618 retval
= _equalNotifyStmt(a
, b
);
2621 retval
= _equalListenStmt(a
, b
);
2623 case T_UnlistenStmt
:
2624 retval
= _equalUnlistenStmt(a
, b
);
2626 case T_TransactionStmt
:
2627 retval
= _equalTransactionStmt(a
, b
);
2629 case T_CompositeTypeStmt
:
2630 retval
= _equalCompositeTypeStmt(a
, b
);
2632 case T_CreateEnumStmt
:
2633 retval
= _equalCreateEnumStmt(a
, b
);
2636 retval
= _equalViewStmt(a
, b
);
2639 retval
= _equalLoadStmt(a
, b
);
2641 case T_CreateDomainStmt
:
2642 retval
= _equalCreateDomainStmt(a
, b
);
2644 case T_CreateOpClassStmt
:
2645 retval
= _equalCreateOpClassStmt(a
, b
);
2647 case T_CreateOpClassItem
:
2648 retval
= _equalCreateOpClassItem(a
, b
);
2650 case T_CreateOpFamilyStmt
:
2651 retval
= _equalCreateOpFamilyStmt(a
, b
);
2653 case T_AlterOpFamilyStmt
:
2654 retval
= _equalAlterOpFamilyStmt(a
, b
);
2656 case T_CreatedbStmt
:
2657 retval
= _equalCreatedbStmt(a
, b
);
2659 case T_AlterDatabaseStmt
:
2660 retval
= _equalAlterDatabaseStmt(a
, b
);
2662 case T_AlterDatabaseSetStmt
:
2663 retval
= _equalAlterDatabaseSetStmt(a
, b
);
2666 retval
= _equalDropdbStmt(a
, b
);
2669 retval
= _equalVacuumStmt(a
, b
);
2672 retval
= _equalExplainStmt(a
, b
);
2674 case T_CreateSeqStmt
:
2675 retval
= _equalCreateSeqStmt(a
, b
);
2677 case T_AlterSeqStmt
:
2678 retval
= _equalAlterSeqStmt(a
, b
);
2680 case T_VariableSetStmt
:
2681 retval
= _equalVariableSetStmt(a
, b
);
2683 case T_VariableShowStmt
:
2684 retval
= _equalVariableShowStmt(a
, b
);
2687 retval
= _equalDiscardStmt(a
, b
);
2689 case T_CreateTableSpaceStmt
:
2690 retval
= _equalCreateTableSpaceStmt(a
, b
);
2692 case T_DropTableSpaceStmt
:
2693 retval
= _equalDropTableSpaceStmt(a
, b
);
2695 case T_CreateFdwStmt
:
2696 retval
= _equalCreateFdwStmt(a
, b
);
2698 case T_AlterFdwStmt
:
2699 retval
= _equalAlterFdwStmt(a
, b
);
2702 retval
= _equalDropFdwStmt(a
, b
);
2704 case T_CreateForeignServerStmt
:
2705 retval
= _equalCreateForeignServerStmt(a
, b
);
2707 case T_AlterForeignServerStmt
:
2708 retval
= _equalAlterForeignServerStmt(a
, b
);
2710 case T_DropForeignServerStmt
:
2711 retval
= _equalDropForeignServerStmt(a
, b
);
2713 case T_CreateUserMappingStmt
:
2714 retval
= _equalCreateUserMappingStmt(a
, b
);
2716 case T_AlterUserMappingStmt
:
2717 retval
= _equalAlterUserMappingStmt(a
, b
);
2719 case T_DropUserMappingStmt
:
2720 retval
= _equalDropUserMappingStmt(a
, b
);
2722 case T_CreateTrigStmt
:
2723 retval
= _equalCreateTrigStmt(a
, b
);
2725 case T_DropPropertyStmt
:
2726 retval
= _equalDropPropertyStmt(a
, b
);
2728 case T_CreatePLangStmt
:
2729 retval
= _equalCreatePLangStmt(a
, b
);
2731 case T_DropPLangStmt
:
2732 retval
= _equalDropPLangStmt(a
, b
);
2734 case T_CreateRoleStmt
:
2735 retval
= _equalCreateRoleStmt(a
, b
);
2737 case T_AlterRoleStmt
:
2738 retval
= _equalAlterRoleStmt(a
, b
);
2740 case T_AlterRoleSetStmt
:
2741 retval
= _equalAlterRoleSetStmt(a
, b
);
2743 case T_DropRoleStmt
:
2744 retval
= _equalDropRoleStmt(a
, b
);
2747 retval
= _equalLockStmt(a
, b
);
2749 case T_ConstraintsSetStmt
:
2750 retval
= _equalConstraintsSetStmt(a
, b
);
2753 retval
= _equalReindexStmt(a
, b
);
2755 case T_CheckPointStmt
:
2758 case T_CreateSchemaStmt
:
2759 retval
= _equalCreateSchemaStmt(a
, b
);
2761 case T_CreateConversionStmt
:
2762 retval
= _equalCreateConversionStmt(a
, b
);
2764 case T_CreateCastStmt
:
2765 retval
= _equalCreateCastStmt(a
, b
);
2767 case T_DropCastStmt
:
2768 retval
= _equalDropCastStmt(a
, b
);
2771 retval
= _equalPrepareStmt(a
, b
);
2774 retval
= _equalExecuteStmt(a
, b
);
2776 case T_DeallocateStmt
:
2777 retval
= _equalDeallocateStmt(a
, b
);
2779 case T_DropOwnedStmt
:
2780 retval
= _equalDropOwnedStmt(a
, b
);
2782 case T_ReassignOwnedStmt
:
2783 retval
= _equalReassignOwnedStmt(a
, b
);
2785 case T_AlterTSDictionaryStmt
:
2786 retval
= _equalAlterTSDictionaryStmt(a
, b
);
2788 case T_AlterTSConfigurationStmt
:
2789 retval
= _equalAlterTSConfigurationStmt(a
, b
);
2793 retval
= _equalAExpr(a
, b
);
2796 retval
= _equalColumnRef(a
, b
);
2799 retval
= _equalParamRef(a
, b
);
2802 retval
= _equalAConst(a
, b
);
2805 retval
= _equalFuncCall(a
, b
);
2808 retval
= _equalAStar(a
, b
);
2811 retval
= _equalAIndices(a
, b
);
2813 case T_A_Indirection
:
2814 retval
= _equalA_Indirection(a
, b
);
2817 retval
= _equalA_ArrayExpr(a
, b
);
2820 retval
= _equalResTarget(a
, b
);
2823 retval
= _equalTypeCast(a
, b
);
2826 retval
= _equalSortBy(a
, b
);
2829 retval
= _equalWindowDef(a
, b
);
2831 case T_RangeSubselect
:
2832 retval
= _equalRangeSubselect(a
, b
);
2834 case T_RangeFunction
:
2835 retval
= _equalRangeFunction(a
, b
);
2838 retval
= _equalTypeName(a
, b
);
2841 retval
= _equalIndexElem(a
, b
);
2844 retval
= _equalColumnDef(a
, b
);
2847 retval
= _equalConstraint(a
, b
);
2850 retval
= _equalDefElem(a
, b
);
2852 case T_OptionDefElem
:
2853 retval
= _equalOptionDefElem(a
, b
);
2856 retval
= _equalReloptElem(a
, b
);
2858 case T_LockingClause
:
2859 retval
= _equalLockingClause(a
, b
);
2861 case T_RangeTblEntry
:
2862 retval
= _equalRangeTblEntry(a
, b
);
2864 case T_SortGroupClause
:
2865 retval
= _equalSortGroupClause(a
, b
);
2867 case T_WindowClause
:
2868 retval
= _equalWindowClause(a
, b
);
2870 case T_RowMarkClause
:
2871 retval
= _equalRowMarkClause(a
, b
);
2874 retval
= _equalWithClause(a
, b
);
2876 case T_CommonTableExpr
:
2877 retval
= _equalCommonTableExpr(a
, b
);
2879 case T_FkConstraint
:
2880 retval
= _equalFkConstraint(a
, b
);
2883 retval
= _equalPrivGrantee(a
, b
);
2885 case T_FuncWithArgs
:
2886 retval
= _equalFuncWithArgs(a
, b
);
2889 retval
= _equalAccessPriv(a
, b
);
2891 case T_XmlSerialize
:
2892 retval
= _equalXmlSerialize(a
, b
);
2896 elog(ERROR
, "unrecognized node type: %d",
2898 retval
= false; /* keep compiler quiet */