PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
equalfuncs.c
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * equalfuncs.c
4  * Equality functions to compare node trees.
5  *
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.
12  *
13  * Currently, in fact, equal() doesn't know how to compare Plan trees
14  * either. This might need to be fixed someday.
15  *
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.
19  *
20  *
21  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
22  * Portions Copyright (c) 1994, Regents of the University of California
23  *
24  * IDENTIFICATION
25  * src/backend/nodes/equalfuncs.c
26  *
27  *-------------------------------------------------------------------------
28  */
29 
30 #include "postgres.h"
31 
32 #include "nodes/extensible.h"
33 #include "nodes/relation.h"
34 #include "utils/datum.h"
35 
36 
37 /*
38  * Macros to simplify comparison of different kinds of fields. Use these
39  * wherever possible to reduce the chance for silly typos. Note that these
40  * hard-wire the convention that the local variables in an Equal routine are
41  * named 'a' and 'b'.
42  */
43 
44 /* Compare a simple scalar field (int, float, bool, enum, etc) */
45 #define COMPARE_SCALAR_FIELD(fldname) \
46  do { \
47  if (a->fldname != b->fldname) \
48  return false; \
49  } while (0)
50 
51 /* Compare a field that is a pointer to some kind of Node or Node tree */
52 #define COMPARE_NODE_FIELD(fldname) \
53  do { \
54  if (!equal(a->fldname, b->fldname)) \
55  return false; \
56  } while (0)
57 
58 /* Compare a field that is a pointer to a Bitmapset */
59 #define COMPARE_BITMAPSET_FIELD(fldname) \
60  do { \
61  if (!bms_equal(a->fldname, b->fldname)) \
62  return false; \
63  } while (0)
64 
65 /* Compare a field that is a pointer to a C string, or perhaps NULL */
66 #define COMPARE_STRING_FIELD(fldname) \
67  do { \
68  if (!equalstr(a->fldname, b->fldname)) \
69  return false; \
70  } while (0)
71 
72 /* Macro for comparing string fields that might be NULL */
73 #define equalstr(a, b) \
74  (((a) != NULL && (b) != NULL) ? (strcmp(a, b) == 0) : (a) == (b))
75 
76 /* Compare a field that is a pointer to a simple palloc'd object of size sz */
77 #define COMPARE_POINTER_FIELD(fldname, sz) \
78  do { \
79  if (memcmp(a->fldname, b->fldname, (sz)) != 0) \
80  return false; \
81  } while (0)
82 
83 /* Compare a parse location field (this is a no-op, per note above) */
84 #define COMPARE_LOCATION_FIELD(fldname) \
85  ((void) 0)
86 
87 /* Compare a CoercionForm field (also a no-op, per comment in primnodes.h) */
88 #define COMPARE_COERCIONFORM_FIELD(fldname) \
89  ((void) 0)
90 
91 
92 /*
93  * Stuff from primnodes.h
94  */
95 
96 static bool
97 _equalAlias(const Alias *a, const Alias *b)
98 {
99  COMPARE_STRING_FIELD(aliasname);
100  COMPARE_NODE_FIELD(colnames);
101 
102  return true;
103 }
104 
105 static bool
106 _equalRangeVar(const RangeVar *a, const RangeVar *b)
107 {
108  COMPARE_STRING_FIELD(catalogname);
109  COMPARE_STRING_FIELD(schemaname);
110  COMPARE_STRING_FIELD(relname);
112  COMPARE_SCALAR_FIELD(relpersistence);
113  COMPARE_NODE_FIELD(alias);
114  COMPARE_LOCATION_FIELD(location);
115 
116  return true;
117 }
118 
119 static bool
121 {
122  COMPARE_NODE_FIELD(ns_names);
123  COMPARE_NODE_FIELD(ns_uris);
124  COMPARE_NODE_FIELD(docexpr);
125  COMPARE_NODE_FIELD(rowexpr);
126  COMPARE_NODE_FIELD(colnames);
127  COMPARE_NODE_FIELD(coltypes);
128  COMPARE_NODE_FIELD(coltypes);
129  COMPARE_NODE_FIELD(colcollations);
130  COMPARE_NODE_FIELD(colexprs);
131  COMPARE_NODE_FIELD(coldefexprs);
132  COMPARE_BITMAPSET_FIELD(notnulls);
133  COMPARE_SCALAR_FIELD(ordinalitycol);
134  COMPARE_LOCATION_FIELD(location);
135 
136  return true;
137 }
138 
139 static bool
141 {
142  COMPARE_NODE_FIELD(rel);
143  COMPARE_NODE_FIELD(colNames);
145  COMPARE_SCALAR_FIELD(onCommit);
146  COMPARE_STRING_FIELD(tableSpaceName);
147  COMPARE_NODE_FIELD(viewQuery);
148  COMPARE_SCALAR_FIELD(skipData);
149 
150  return true;
151 }
152 
153 /*
154  * We don't need an _equalExpr because Expr is an abstract supertype which
155  * should never actually get instantiated. Also, since it has no common
156  * fields except NodeTag, there's no need for a helper routine to factor
157  * out comparing the common fields...
158  */
159 
160 static bool
161 _equalVar(const Var *a, const Var *b)
162 {
163  COMPARE_SCALAR_FIELD(varno);
164  COMPARE_SCALAR_FIELD(varattno);
165  COMPARE_SCALAR_FIELD(vartype);
166  COMPARE_SCALAR_FIELD(vartypmod);
167  COMPARE_SCALAR_FIELD(varcollid);
168  COMPARE_SCALAR_FIELD(varlevelsup);
169  COMPARE_SCALAR_FIELD(varnoold);
170  COMPARE_SCALAR_FIELD(varoattno);
171  COMPARE_LOCATION_FIELD(location);
172 
173  return true;
174 }
175 
176 static bool
177 _equalConst(const Const *a, const Const *b)
178 {
179  COMPARE_SCALAR_FIELD(consttype);
180  COMPARE_SCALAR_FIELD(consttypmod);
181  COMPARE_SCALAR_FIELD(constcollid);
182  COMPARE_SCALAR_FIELD(constlen);
183  COMPARE_SCALAR_FIELD(constisnull);
184  COMPARE_SCALAR_FIELD(constbyval);
185  COMPARE_LOCATION_FIELD(location);
186 
187  /*
188  * We treat all NULL constants of the same type as equal. Someday this
189  * might need to change? But datumIsEqual doesn't work on nulls, so...
190  */
191  if (a->constisnull)
192  return true;
193  return datumIsEqual(a->constvalue, b->constvalue,
194  a->constbyval, a->constlen);
195 }
196 
197 static bool
198 _equalParam(const Param *a, const Param *b)
199 {
200  COMPARE_SCALAR_FIELD(paramkind);
201  COMPARE_SCALAR_FIELD(paramid);
202  COMPARE_SCALAR_FIELD(paramtype);
203  COMPARE_SCALAR_FIELD(paramtypmod);
204  COMPARE_SCALAR_FIELD(paramcollid);
205  COMPARE_LOCATION_FIELD(location);
206 
207  return true;
208 }
209 
210 static bool
211 _equalAggref(const Aggref *a, const Aggref *b)
212 {
213  COMPARE_SCALAR_FIELD(aggfnoid);
214  COMPARE_SCALAR_FIELD(aggtype);
215  COMPARE_SCALAR_FIELD(aggcollid);
216  COMPARE_SCALAR_FIELD(inputcollid);
217  /* ignore aggtranstype since it might not be set yet */
218  COMPARE_NODE_FIELD(aggargtypes);
219  COMPARE_NODE_FIELD(aggdirectargs);
221  COMPARE_NODE_FIELD(aggorder);
222  COMPARE_NODE_FIELD(aggdistinct);
223  COMPARE_NODE_FIELD(aggfilter);
224  COMPARE_SCALAR_FIELD(aggstar);
225  COMPARE_SCALAR_FIELD(aggvariadic);
226  COMPARE_SCALAR_FIELD(aggkind);
227  COMPARE_SCALAR_FIELD(agglevelsup);
228  COMPARE_SCALAR_FIELD(aggsplit);
229  COMPARE_LOCATION_FIELD(location);
230 
231  return true;
232 }
233 
234 static bool
236 {
238 
239  /*
240  * We must not compare the refs or cols field
241  */
242 
243  COMPARE_SCALAR_FIELD(agglevelsup);
244  COMPARE_LOCATION_FIELD(location);
245 
246  return true;
247 }
248 
249 static bool
251 {
252  COMPARE_SCALAR_FIELD(winfnoid);
253  COMPARE_SCALAR_FIELD(wintype);
254  COMPARE_SCALAR_FIELD(wincollid);
255  COMPARE_SCALAR_FIELD(inputcollid);
257  COMPARE_NODE_FIELD(aggfilter);
258  COMPARE_SCALAR_FIELD(winref);
259  COMPARE_SCALAR_FIELD(winstar);
260  COMPARE_SCALAR_FIELD(winagg);
261  COMPARE_LOCATION_FIELD(location);
262 
263  return true;
264 }
265 
266 static bool
267 _equalArrayRef(const ArrayRef *a, const ArrayRef *b)
268 {
269  COMPARE_SCALAR_FIELD(refarraytype);
270  COMPARE_SCALAR_FIELD(refelemtype);
271  COMPARE_SCALAR_FIELD(reftypmod);
272  COMPARE_SCALAR_FIELD(refcollid);
273  COMPARE_NODE_FIELD(refupperindexpr);
274  COMPARE_NODE_FIELD(reflowerindexpr);
275  COMPARE_NODE_FIELD(refexpr);
276  COMPARE_NODE_FIELD(refassgnexpr);
277 
278  return true;
279 }
280 
281 static bool
282 _equalFuncExpr(const FuncExpr *a, const FuncExpr *b)
283 {
284  COMPARE_SCALAR_FIELD(funcid);
285  COMPARE_SCALAR_FIELD(funcresulttype);
286  COMPARE_SCALAR_FIELD(funcretset);
287  COMPARE_SCALAR_FIELD(funcvariadic);
288  COMPARE_COERCIONFORM_FIELD(funcformat);
289  COMPARE_SCALAR_FIELD(funccollid);
290  COMPARE_SCALAR_FIELD(inputcollid);
292  COMPARE_LOCATION_FIELD(location);
293 
294  return true;
295 }
296 
297 static bool
299 {
302  COMPARE_SCALAR_FIELD(argnumber);
303  COMPARE_LOCATION_FIELD(location);
304 
305  return true;
306 }
307 
308 static bool
309 _equalOpExpr(const OpExpr *a, const OpExpr *b)
310 {
311  COMPARE_SCALAR_FIELD(opno);
312 
313  /*
314  * Special-case opfuncid: it is allowable for it to differ if one node
315  * contains zero and the other doesn't. This just means that the one node
316  * isn't as far along in the parse/plan pipeline and hasn't had the
317  * opfuncid cache filled yet.
318  */
319  if (a->opfuncid != b->opfuncid &&
320  a->opfuncid != 0 &&
321  b->opfuncid != 0)
322  return false;
323 
324  COMPARE_SCALAR_FIELD(opresulttype);
325  COMPARE_SCALAR_FIELD(opretset);
326  COMPARE_SCALAR_FIELD(opcollid);
327  COMPARE_SCALAR_FIELD(inputcollid);
329  COMPARE_LOCATION_FIELD(location);
330 
331  return true;
332 }
333 
334 static bool
336 {
337  COMPARE_SCALAR_FIELD(opno);
338 
339  /*
340  * Special-case opfuncid: it is allowable for it to differ if one node
341  * contains zero and the other doesn't. This just means that the one node
342  * isn't as far along in the parse/plan pipeline and hasn't had the
343  * opfuncid cache filled yet.
344  */
345  if (a->opfuncid != b->opfuncid &&
346  a->opfuncid != 0 &&
347  b->opfuncid != 0)
348  return false;
349 
350  COMPARE_SCALAR_FIELD(opresulttype);
351  COMPARE_SCALAR_FIELD(opretset);
352  COMPARE_SCALAR_FIELD(opcollid);
353  COMPARE_SCALAR_FIELD(inputcollid);
355  COMPARE_LOCATION_FIELD(location);
356 
357  return true;
358 }
359 
360 static bool
362 {
363  COMPARE_SCALAR_FIELD(opno);
364 
365  /*
366  * Special-case opfuncid: it is allowable for it to differ if one node
367  * contains zero and the other doesn't. This just means that the one node
368  * isn't as far along in the parse/plan pipeline and hasn't had the
369  * opfuncid cache filled yet.
370  */
371  if (a->opfuncid != b->opfuncid &&
372  a->opfuncid != 0 &&
373  b->opfuncid != 0)
374  return false;
375 
376  COMPARE_SCALAR_FIELD(opresulttype);
377  COMPARE_SCALAR_FIELD(opretset);
378  COMPARE_SCALAR_FIELD(opcollid);
379  COMPARE_SCALAR_FIELD(inputcollid);
381  COMPARE_LOCATION_FIELD(location);
382 
383  return true;
384 }
385 
386 static bool
388 {
389  COMPARE_SCALAR_FIELD(opno);
390 
391  /*
392  * Special-case opfuncid: it is allowable for it to differ if one node
393  * contains zero and the other doesn't. This just means that the one node
394  * isn't as far along in the parse/plan pipeline and hasn't had the
395  * opfuncid cache filled yet.
396  */
397  if (a->opfuncid != b->opfuncid &&
398  a->opfuncid != 0 &&
399  b->opfuncid != 0)
400  return false;
401 
402  COMPARE_SCALAR_FIELD(useOr);
403  COMPARE_SCALAR_FIELD(inputcollid);
405  COMPARE_LOCATION_FIELD(location);
406 
407  return true;
408 }
409 
410 static bool
411 _equalBoolExpr(const BoolExpr *a, const BoolExpr *b)
412 {
415  COMPARE_LOCATION_FIELD(location);
416 
417  return true;
418 }
419 
420 static bool
421 _equalSubLink(const SubLink *a, const SubLink *b)
422 {
423  COMPARE_SCALAR_FIELD(subLinkType);
424  COMPARE_SCALAR_FIELD(subLinkId);
425  COMPARE_NODE_FIELD(testexpr);
426  COMPARE_NODE_FIELD(operName);
427  COMPARE_NODE_FIELD(subselect);
428  COMPARE_LOCATION_FIELD(location);
429 
430  return true;
431 }
432 
433 static bool
434 _equalSubPlan(const SubPlan *a, const SubPlan *b)
435 {
436  COMPARE_SCALAR_FIELD(subLinkType);
437  COMPARE_NODE_FIELD(testexpr);
438  COMPARE_NODE_FIELD(paramIds);
439  COMPARE_SCALAR_FIELD(plan_id);
440  COMPARE_STRING_FIELD(plan_name);
441  COMPARE_SCALAR_FIELD(firstColType);
442  COMPARE_SCALAR_FIELD(firstColTypmod);
443  COMPARE_SCALAR_FIELD(firstColCollation);
444  COMPARE_SCALAR_FIELD(useHashTable);
445  COMPARE_SCALAR_FIELD(unknownEqFalse);
446  COMPARE_SCALAR_FIELD(parallel_safe);
447  COMPARE_NODE_FIELD(setParam);
448  COMPARE_NODE_FIELD(parParam);
450  COMPARE_SCALAR_FIELD(startup_cost);
451  COMPARE_SCALAR_FIELD(per_call_cost);
452 
453  return true;
454 }
455 
456 static bool
458 {
459  COMPARE_NODE_FIELD(subplans);
460 
461  return true;
462 }
463 
464 static bool
466 {
468  COMPARE_SCALAR_FIELD(fieldnum);
469  COMPARE_SCALAR_FIELD(resulttype);
470  COMPARE_SCALAR_FIELD(resulttypmod);
471  COMPARE_SCALAR_FIELD(resultcollid);
472 
473  return true;
474 }
475 
476 static bool
478 {
480  COMPARE_NODE_FIELD(newvals);
481  COMPARE_NODE_FIELD(fieldnums);
482  COMPARE_SCALAR_FIELD(resulttype);
483 
484  return true;
485 }
486 
487 static bool
489 {
491  COMPARE_SCALAR_FIELD(resulttype);
492  COMPARE_SCALAR_FIELD(resulttypmod);
493  COMPARE_SCALAR_FIELD(resultcollid);
494  COMPARE_COERCIONFORM_FIELD(relabelformat);
495  COMPARE_LOCATION_FIELD(location);
496 
497  return true;
498 }
499 
500 static bool
502 {
504  COMPARE_SCALAR_FIELD(resulttype);
505  COMPARE_SCALAR_FIELD(resultcollid);
506  COMPARE_COERCIONFORM_FIELD(coerceformat);
507  COMPARE_LOCATION_FIELD(location);
508 
509  return true;
510 }
511 
512 static bool
514 {
516  COMPARE_SCALAR_FIELD(elemfuncid);
517  COMPARE_SCALAR_FIELD(resulttype);
518  COMPARE_SCALAR_FIELD(resulttypmod);
519  COMPARE_SCALAR_FIELD(resultcollid);
520  COMPARE_SCALAR_FIELD(isExplicit);
521  COMPARE_COERCIONFORM_FIELD(coerceformat);
522  COMPARE_LOCATION_FIELD(location);
523 
524  return true;
525 }
526 
527 static bool
529 {
531  COMPARE_SCALAR_FIELD(resulttype);
532  COMPARE_COERCIONFORM_FIELD(convertformat);
533  COMPARE_LOCATION_FIELD(location);
534 
535  return true;
536 }
537 
538 static bool
540 {
542  COMPARE_SCALAR_FIELD(collOid);
543  COMPARE_LOCATION_FIELD(location);
544 
545  return true;
546 }
547 
548 static bool
549 _equalCaseExpr(const CaseExpr *a, const CaseExpr *b)
550 {
551  COMPARE_SCALAR_FIELD(casetype);
552  COMPARE_SCALAR_FIELD(casecollid);
555  COMPARE_NODE_FIELD(defresult);
556  COMPARE_LOCATION_FIELD(location);
557 
558  return true;
559 }
560 
561 static bool
562 _equalCaseWhen(const CaseWhen *a, const CaseWhen *b)
563 {
564  COMPARE_NODE_FIELD(expr);
566  COMPARE_LOCATION_FIELD(location);
567 
568  return true;
569 }
570 
571 static bool
573 {
574  COMPARE_SCALAR_FIELD(typeId);
575  COMPARE_SCALAR_FIELD(typeMod);
576  COMPARE_SCALAR_FIELD(collation);
577 
578  return true;
579 }
580 
581 static bool
583 {
584  COMPARE_SCALAR_FIELD(array_typeid);
585  COMPARE_SCALAR_FIELD(array_collid);
586  COMPARE_SCALAR_FIELD(element_typeid);
587  COMPARE_NODE_FIELD(elements);
588  COMPARE_SCALAR_FIELD(multidims);
589  COMPARE_LOCATION_FIELD(location);
590 
591  return true;
592 }
593 
594 static bool
595 _equalRowExpr(const RowExpr *a, const RowExpr *b)
596 {
598  COMPARE_SCALAR_FIELD(row_typeid);
599  COMPARE_COERCIONFORM_FIELD(row_format);
600  COMPARE_NODE_FIELD(colnames);
601  COMPARE_LOCATION_FIELD(location);
602 
603  return true;
604 }
605 
606 static bool
608 {
609  COMPARE_SCALAR_FIELD(rctype);
610  COMPARE_NODE_FIELD(opnos);
611  COMPARE_NODE_FIELD(opfamilies);
612  COMPARE_NODE_FIELD(inputcollids);
613  COMPARE_NODE_FIELD(largs);
614  COMPARE_NODE_FIELD(rargs);
615 
616  return true;
617 }
618 
619 static bool
621 {
622  COMPARE_SCALAR_FIELD(coalescetype);
623  COMPARE_SCALAR_FIELD(coalescecollid);
625  COMPARE_LOCATION_FIELD(location);
626 
627  return true;
628 }
629 
630 static bool
632 {
633  COMPARE_SCALAR_FIELD(minmaxtype);
634  COMPARE_SCALAR_FIELD(minmaxcollid);
635  COMPARE_SCALAR_FIELD(inputcollid);
638  COMPARE_LOCATION_FIELD(location);
639 
640  return true;
641 }
642 
643 static bool
645 {
647  COMPARE_SCALAR_FIELD(type);
648  COMPARE_SCALAR_FIELD(typmod);
649  COMPARE_LOCATION_FIELD(location);
650 
651  return true;
652 }
653 
654 static bool
655 _equalXmlExpr(const XmlExpr *a, const XmlExpr *b)
656 {
659  COMPARE_NODE_FIELD(named_args);
660  COMPARE_NODE_FIELD(arg_names);
663  COMPARE_SCALAR_FIELD(type);
664  COMPARE_SCALAR_FIELD(typmod);
665  COMPARE_LOCATION_FIELD(location);
666 
667  return true;
668 }
669 
670 static bool
671 _equalNullTest(const NullTest *a, const NullTest *b)
672 {
674  COMPARE_SCALAR_FIELD(nulltesttype);
675  COMPARE_SCALAR_FIELD(argisrow);
676  COMPARE_LOCATION_FIELD(location);
677 
678  return true;
679 }
680 
681 static bool
683 {
685  COMPARE_SCALAR_FIELD(booltesttype);
686  COMPARE_LOCATION_FIELD(location);
687 
688  return true;
689 }
690 
691 static bool
693 {
695  COMPARE_SCALAR_FIELD(resulttype);
696  COMPARE_SCALAR_FIELD(resulttypmod);
697  COMPARE_SCALAR_FIELD(resultcollid);
698  COMPARE_COERCIONFORM_FIELD(coercionformat);
699  COMPARE_LOCATION_FIELD(location);
700 
701  return true;
702 }
703 
704 static bool
706 {
707  COMPARE_SCALAR_FIELD(typeId);
708  COMPARE_SCALAR_FIELD(typeMod);
709  COMPARE_SCALAR_FIELD(collation);
710  COMPARE_LOCATION_FIELD(location);
711 
712  return true;
713 }
714 
715 static bool
717 {
718  COMPARE_SCALAR_FIELD(typeId);
719  COMPARE_SCALAR_FIELD(typeMod);
720  COMPARE_SCALAR_FIELD(collation);
721  COMPARE_LOCATION_FIELD(location);
722 
723  return true;
724 }
725 
726 static bool
728 {
729  COMPARE_SCALAR_FIELD(cvarno);
730  COMPARE_STRING_FIELD(cursor_name);
731  COMPARE_SCALAR_FIELD(cursor_param);
732 
733  return true;
734 }
735 
736 static bool
738 {
739  COMPARE_SCALAR_FIELD(seqid);
740  COMPARE_SCALAR_FIELD(typeId);
741 
742  return true;
743 }
744 
745 static bool
747 {
748  COMPARE_NODE_FIELD(expr);
749  COMPARE_SCALAR_FIELD(infercollid);
750  COMPARE_SCALAR_FIELD(inferopclass);
751 
752  return true;
753 }
754 
755 static bool
757 {
758  COMPARE_NODE_FIELD(expr);
759  COMPARE_SCALAR_FIELD(resno);
760  COMPARE_STRING_FIELD(resname);
761  COMPARE_SCALAR_FIELD(ressortgroupref);
762  COMPARE_SCALAR_FIELD(resorigtbl);
763  COMPARE_SCALAR_FIELD(resorigcol);
764  COMPARE_SCALAR_FIELD(resjunk);
765 
766  return true;
767 }
768 
769 static bool
771 {
772  COMPARE_SCALAR_FIELD(rtindex);
773 
774  return true;
775 }
776 
777 static bool
778 _equalJoinExpr(const JoinExpr *a, const JoinExpr *b)
779 {
780  COMPARE_SCALAR_FIELD(jointype);
781  COMPARE_SCALAR_FIELD(isNatural);
782  COMPARE_NODE_FIELD(larg);
783  COMPARE_NODE_FIELD(rarg);
784  COMPARE_NODE_FIELD(usingClause);
785  COMPARE_NODE_FIELD(quals);
786  COMPARE_NODE_FIELD(alias);
787  COMPARE_SCALAR_FIELD(rtindex);
788 
789  return true;
790 }
791 
792 static bool
793 _equalFromExpr(const FromExpr *a, const FromExpr *b)
794 {
795  COMPARE_NODE_FIELD(fromlist);
796  COMPARE_NODE_FIELD(quals);
797 
798  return true;
799 }
800 
801 static bool
803 {
804  COMPARE_SCALAR_FIELD(action);
805  COMPARE_NODE_FIELD(arbiterElems);
806  COMPARE_NODE_FIELD(arbiterWhere);
807  COMPARE_SCALAR_FIELD(constraint);
808  COMPARE_NODE_FIELD(onConflictSet);
809  COMPARE_NODE_FIELD(onConflictWhere);
810  COMPARE_SCALAR_FIELD(exclRelIndex);
811  COMPARE_NODE_FIELD(exclRelTlist);
812 
813  return true;
814 }
815 
816 /*
817  * Stuff from relation.h
818  */
819 
820 static bool
821 _equalPathKey(const PathKey *a, const PathKey *b)
822 {
823  /* We assume pointer equality is sufficient to compare the eclasses */
824  COMPARE_SCALAR_FIELD(pk_eclass);
825  COMPARE_SCALAR_FIELD(pk_opfamily);
826  COMPARE_SCALAR_FIELD(pk_strategy);
827  COMPARE_SCALAR_FIELD(pk_nulls_first);
828 
829  return true;
830 }
831 
832 static bool
834 {
835  COMPARE_NODE_FIELD(clause);
836  COMPARE_SCALAR_FIELD(is_pushed_down);
837  COMPARE_SCALAR_FIELD(outerjoin_delayed);
838  COMPARE_SCALAR_FIELD(security_level);
839  COMPARE_BITMAPSET_FIELD(required_relids);
840  COMPARE_BITMAPSET_FIELD(outer_relids);
841  COMPARE_BITMAPSET_FIELD(nullable_relids);
842 
843  /*
844  * We ignore all the remaining fields, since they may not be set yet, and
845  * should be derivable from the clause anyway.
846  */
847 
848  return true;
849 }
850 
851 static bool
853 {
854  /*
855  * We intentionally do not compare phexpr. Two PlaceHolderVars with the
856  * same ID and levelsup should be considered equal even if the contained
857  * expressions have managed to mutate to different states. This will
858  * happen during final plan construction when there are nested PHVs, since
859  * the inner PHV will get replaced by a Param in some copies of the outer
860  * PHV. Another way in which it can happen is that initplan sublinks
861  * could get replaced by differently-numbered Params when sublink folding
862  * is done. (The end result of such a situation would be some
863  * unreferenced initplans, which is annoying but not really a problem.) On
864  * the same reasoning, there is no need to examine phrels.
865  *
866  * COMPARE_NODE_FIELD(phexpr);
867  *
868  * COMPARE_BITMAPSET_FIELD(phrels);
869  */
870  COMPARE_SCALAR_FIELD(phid);
871  COMPARE_SCALAR_FIELD(phlevelsup);
872 
873  return true;
874 }
875 
876 static bool
878 {
879  COMPARE_BITMAPSET_FIELD(min_lefthand);
880  COMPARE_BITMAPSET_FIELD(min_righthand);
881  COMPARE_BITMAPSET_FIELD(syn_lefthand);
882  COMPARE_BITMAPSET_FIELD(syn_righthand);
883  COMPARE_SCALAR_FIELD(jointype);
884  COMPARE_SCALAR_FIELD(lhs_strict);
885  COMPARE_SCALAR_FIELD(delay_upper_joins);
886  COMPARE_SCALAR_FIELD(semi_can_btree);
887  COMPARE_SCALAR_FIELD(semi_can_hash);
888  COMPARE_NODE_FIELD(semi_operators);
889  COMPARE_NODE_FIELD(semi_rhs_exprs);
890 
891  return true;
892 }
893 
894 static bool
896 {
897  COMPARE_SCALAR_FIELD(parent_relid);
898  COMPARE_SCALAR_FIELD(child_relid);
899  COMPARE_SCALAR_FIELD(parent_reltype);
900  COMPARE_SCALAR_FIELD(child_reltype);
901  COMPARE_NODE_FIELD(translated_vars);
902  COMPARE_SCALAR_FIELD(parent_reloid);
903 
904  return true;
905 }
906 
907 static bool
909 {
910  COMPARE_SCALAR_FIELD(parent_relid);
911  COMPARE_NODE_FIELD(child_rels);
912 
913  return true;
914 }
915 
916 static bool
918 {
919  COMPARE_SCALAR_FIELD(phid);
920  COMPARE_NODE_FIELD(ph_var); /* should be redundant */
921  COMPARE_BITMAPSET_FIELD(ph_eval_at);
922  COMPARE_BITMAPSET_FIELD(ph_lateral);
923  COMPARE_BITMAPSET_FIELD(ph_needed);
924  COMPARE_SCALAR_FIELD(ph_width);
925 
926  return true;
927 }
928 
929 /*
930  * Stuff from extensible.h
931  */
932 static bool
934 {
935  const ExtensibleNodeMethods *methods;
936 
937  COMPARE_STRING_FIELD(extnodename);
938 
939  /* At this point, we know extnodename is the same for both nodes. */
940  methods = GetExtensibleNodeMethods(a->extnodename, false);
941 
942  /* compare the private fields */
943  if (!methods->nodeEqual(a, b))
944  return false;
945 
946  return true;
947 }
948 
949 /*
950  * Stuff from parsenodes.h
951  */
952 
953 static bool
954 _equalQuery(const Query *a, const Query *b)
955 {
956  COMPARE_SCALAR_FIELD(commandType);
957  COMPARE_SCALAR_FIELD(querySource);
958  /* we intentionally ignore queryId, since it might not be set */
959  COMPARE_SCALAR_FIELD(canSetTag);
960  COMPARE_NODE_FIELD(utilityStmt);
961  COMPARE_SCALAR_FIELD(resultRelation);
962  COMPARE_SCALAR_FIELD(hasAggs);
963  COMPARE_SCALAR_FIELD(hasWindowFuncs);
964  COMPARE_SCALAR_FIELD(hasTargetSRFs);
965  COMPARE_SCALAR_FIELD(hasSubLinks);
966  COMPARE_SCALAR_FIELD(hasDistinctOn);
967  COMPARE_SCALAR_FIELD(hasRecursive);
968  COMPARE_SCALAR_FIELD(hasModifyingCTE);
969  COMPARE_SCALAR_FIELD(hasForUpdate);
970  COMPARE_SCALAR_FIELD(hasRowSecurity);
971  COMPARE_NODE_FIELD(cteList);
972  COMPARE_NODE_FIELD(rtable);
973  COMPARE_NODE_FIELD(jointree);
974  COMPARE_NODE_FIELD(targetList);
975  COMPARE_SCALAR_FIELD(override);
976  COMPARE_NODE_FIELD(onConflict);
977  COMPARE_NODE_FIELD(returningList);
978  COMPARE_NODE_FIELD(groupClause);
979  COMPARE_NODE_FIELD(groupingSets);
980  COMPARE_NODE_FIELD(havingQual);
981  COMPARE_NODE_FIELD(windowClause);
982  COMPARE_NODE_FIELD(distinctClause);
983  COMPARE_NODE_FIELD(sortClause);
984  COMPARE_NODE_FIELD(limitOffset);
985  COMPARE_NODE_FIELD(limitCount);
986  COMPARE_NODE_FIELD(rowMarks);
987  COMPARE_NODE_FIELD(setOperations);
988  COMPARE_NODE_FIELD(constraintDeps);
989  COMPARE_NODE_FIELD(withCheckOptions);
990  COMPARE_LOCATION_FIELD(stmt_location);
991  COMPARE_LOCATION_FIELD(stmt_len);
992 
993  return true;
994 }
995 
996 static bool
997 _equalRawStmt(const RawStmt *a, const RawStmt *b)
998 {
999  COMPARE_NODE_FIELD(stmt);
1000  COMPARE_LOCATION_FIELD(stmt_location);
1001  COMPARE_LOCATION_FIELD(stmt_len);
1002 
1003  return true;
1004 }
1005 
1006 static bool
1008 {
1009  COMPARE_NODE_FIELD(relation);
1010  COMPARE_NODE_FIELD(cols);
1011  COMPARE_NODE_FIELD(selectStmt);
1012  COMPARE_NODE_FIELD(onConflictClause);
1013  COMPARE_NODE_FIELD(returningList);
1014  COMPARE_NODE_FIELD(withClause);
1015  COMPARE_SCALAR_FIELD(override);
1016 
1017  return true;
1018 }
1019 
1020 static bool
1022 {
1023  COMPARE_NODE_FIELD(relation);
1024  COMPARE_NODE_FIELD(usingClause);
1025  COMPARE_NODE_FIELD(whereClause);
1026  COMPARE_NODE_FIELD(returningList);
1027  COMPARE_NODE_FIELD(withClause);
1028 
1029  return true;
1030 }
1031 
1032 static bool
1034 {
1035  COMPARE_NODE_FIELD(relation);
1036  COMPARE_NODE_FIELD(targetList);
1037  COMPARE_NODE_FIELD(whereClause);
1038  COMPARE_NODE_FIELD(fromClause);
1039  COMPARE_NODE_FIELD(returningList);
1040  COMPARE_NODE_FIELD(withClause);
1041 
1042  return true;
1043 }
1044 
1045 static bool
1047 {
1048  COMPARE_NODE_FIELD(distinctClause);
1049  COMPARE_NODE_FIELD(intoClause);
1050  COMPARE_NODE_FIELD(targetList);
1051  COMPARE_NODE_FIELD(fromClause);
1052  COMPARE_NODE_FIELD(whereClause);
1053  COMPARE_NODE_FIELD(groupClause);
1054  COMPARE_NODE_FIELD(havingClause);
1055  COMPARE_NODE_FIELD(windowClause);
1056  COMPARE_NODE_FIELD(valuesLists);
1057  COMPARE_NODE_FIELD(sortClause);
1058  COMPARE_NODE_FIELD(limitOffset);
1059  COMPARE_NODE_FIELD(limitCount);
1060  COMPARE_NODE_FIELD(lockingClause);
1061  COMPARE_NODE_FIELD(withClause);
1063  COMPARE_SCALAR_FIELD(all);
1064  COMPARE_NODE_FIELD(larg);
1065  COMPARE_NODE_FIELD(rarg);
1066 
1067  return true;
1068 }
1069 
1070 static bool
1072 {
1074  COMPARE_SCALAR_FIELD(all);
1075  COMPARE_NODE_FIELD(larg);
1076  COMPARE_NODE_FIELD(rarg);
1077  COMPARE_NODE_FIELD(colTypes);
1078  COMPARE_NODE_FIELD(colTypmods);
1079  COMPARE_NODE_FIELD(colCollations);
1080  COMPARE_NODE_FIELD(groupClauses);
1081 
1082  return true;
1083 }
1084 
1085 static bool
1087 {
1088  COMPARE_NODE_FIELD(relation);
1089  COMPARE_NODE_FIELD(cmds);
1090  COMPARE_SCALAR_FIELD(relkind);
1091  COMPARE_SCALAR_FIELD(missing_ok);
1092 
1093  return true;
1094 }
1095 
1096 static bool
1098 {
1099  COMPARE_SCALAR_FIELD(subtype);
1101  COMPARE_NODE_FIELD(newowner);
1102  COMPARE_NODE_FIELD(def);
1103  COMPARE_SCALAR_FIELD(behavior);
1104  COMPARE_SCALAR_FIELD(missing_ok);
1105 
1106  return true;
1107 }
1108 
1109 static bool
1111 {
1112  COMPARE_NODE_FIELD(collname);
1113 
1114  return true;
1115 }
1116 
1117 static bool
1119 {
1120  COMPARE_SCALAR_FIELD(subtype);
1121  COMPARE_NODE_FIELD(typeName);
1123  COMPARE_NODE_FIELD(def);
1124  COMPARE_SCALAR_FIELD(behavior);
1125  COMPARE_SCALAR_FIELD(missing_ok);
1126 
1127  return true;
1128 }
1129 
1130 static bool
1132 {
1133  COMPARE_SCALAR_FIELD(is_grant);
1134  COMPARE_SCALAR_FIELD(targtype);
1135  COMPARE_SCALAR_FIELD(objtype);
1136  COMPARE_NODE_FIELD(objects);
1137  COMPARE_NODE_FIELD(privileges);
1138  COMPARE_NODE_FIELD(grantees);
1139  COMPARE_SCALAR_FIELD(grant_option);
1140  COMPARE_SCALAR_FIELD(behavior);
1141 
1142  return true;
1143 }
1144 
1145 static bool
1147 {
1148  COMPARE_NODE_FIELD(objname);
1149  COMPARE_NODE_FIELD(objargs);
1150  COMPARE_SCALAR_FIELD(args_unspecified);
1151 
1152  return true;
1153 }
1154 
1155 static bool
1157 {
1158  COMPARE_STRING_FIELD(priv_name);
1159  COMPARE_NODE_FIELD(cols);
1160 
1161  return true;
1162 }
1163 
1164 static bool
1166 {
1167  COMPARE_NODE_FIELD(granted_roles);
1168  COMPARE_NODE_FIELD(grantee_roles);
1169  COMPARE_SCALAR_FIELD(is_grant);
1170  COMPARE_SCALAR_FIELD(admin_opt);
1171  COMPARE_NODE_FIELD(grantor);
1172  COMPARE_SCALAR_FIELD(behavior);
1173 
1174  return true;
1175 }
1176 
1177 static bool
1179 {
1181  COMPARE_NODE_FIELD(action);
1182 
1183  return true;
1184 }
1185 
1186 static bool
1188 {
1189  COMPARE_STRING_FIELD(portalname);
1191  COMPARE_NODE_FIELD(query);
1192 
1193  return true;
1194 }
1195 
1196 static bool
1198 {
1199  COMPARE_STRING_FIELD(portalname);
1200 
1201  return true;
1202 }
1203 
1204 static bool
1206 {
1207  COMPARE_NODE_FIELD(relation);
1208  COMPARE_STRING_FIELD(indexname);
1210 
1211  return true;
1212 }
1213 
1214 static bool
1215 _equalCopyStmt(const CopyStmt *a, const CopyStmt *b)
1216 {
1217  COMPARE_NODE_FIELD(relation);
1218  COMPARE_NODE_FIELD(query);
1219  COMPARE_NODE_FIELD(attlist);
1220  COMPARE_SCALAR_FIELD(is_from);
1221  COMPARE_SCALAR_FIELD(is_program);
1224 
1225  return true;
1226 }
1227 
1228 static bool
1230 {
1231  COMPARE_NODE_FIELD(relation);
1232  COMPARE_NODE_FIELD(tableElts);
1233  COMPARE_NODE_FIELD(inhRelations);
1234  COMPARE_NODE_FIELD(partspec);
1235  COMPARE_NODE_FIELD(partbound);
1236  COMPARE_NODE_FIELD(ofTypename);
1237  COMPARE_NODE_FIELD(constraints);
1239  COMPARE_SCALAR_FIELD(oncommit);
1240  COMPARE_STRING_FIELD(tablespacename);
1241  COMPARE_SCALAR_FIELD(if_not_exists);
1242 
1243  return true;
1244 }
1245 
1246 static bool
1248 {
1249  COMPARE_NODE_FIELD(relation);
1251 
1252  return true;
1253 }
1254 
1255 static bool
1257 {
1258  COMPARE_SCALAR_FIELD(kind);
1259  COMPARE_SCALAR_FIELD(oldstyle);
1260  COMPARE_NODE_FIELD(defnames);
1262  COMPARE_NODE_FIELD(definition);
1263  COMPARE_SCALAR_FIELD(if_not_exists);
1264 
1265  return true;
1266 }
1267 
1268 static bool
1269 _equalDropStmt(const DropStmt *a, const DropStmt *b)
1270 {
1271  COMPARE_NODE_FIELD(objects);
1272  COMPARE_SCALAR_FIELD(removeType);
1273  COMPARE_SCALAR_FIELD(behavior);
1274  COMPARE_SCALAR_FIELD(missing_ok);
1275  COMPARE_SCALAR_FIELD(concurrent);
1276 
1277  return true;
1278 }
1279 
1280 static bool
1282 {
1283  COMPARE_NODE_FIELD(relations);
1284  COMPARE_SCALAR_FIELD(restart_seqs);
1285  COMPARE_SCALAR_FIELD(behavior);
1286 
1287  return true;
1288 }
1289 
1290 static bool
1292 {
1293  COMPARE_SCALAR_FIELD(objtype);
1294  COMPARE_NODE_FIELD(object);
1295  COMPARE_STRING_FIELD(comment);
1296 
1297  return true;
1298 }
1299 
1300 static bool
1302 {
1303  COMPARE_SCALAR_FIELD(objtype);
1304  COMPARE_NODE_FIELD(object);
1305  COMPARE_STRING_FIELD(provider);
1307 
1308  return true;
1309 }
1310 
1311 static bool
1313 {
1314  COMPARE_SCALAR_FIELD(direction);
1315  COMPARE_SCALAR_FIELD(howMany);
1316  COMPARE_STRING_FIELD(portalname);
1317  COMPARE_SCALAR_FIELD(ismove);
1318 
1319  return true;
1320 }
1321 
1322 static bool
1324 {
1325  COMPARE_STRING_FIELD(idxname);
1326  COMPARE_NODE_FIELD(relation);
1327  COMPARE_STRING_FIELD(accessMethod);
1328  COMPARE_STRING_FIELD(tableSpace);
1329  COMPARE_NODE_FIELD(indexParams);
1331  COMPARE_NODE_FIELD(whereClause);
1332  COMPARE_NODE_FIELD(excludeOpNames);
1333  COMPARE_STRING_FIELD(idxcomment);
1334  COMPARE_SCALAR_FIELD(indexOid);
1335  COMPARE_SCALAR_FIELD(oldNode);
1336  COMPARE_SCALAR_FIELD(unique);
1337  COMPARE_SCALAR_FIELD(primary);
1338  COMPARE_SCALAR_FIELD(isconstraint);
1339  COMPARE_SCALAR_FIELD(deferrable);
1340  COMPARE_SCALAR_FIELD(initdeferred);
1341  COMPARE_SCALAR_FIELD(transformed);
1342  COMPARE_SCALAR_FIELD(concurrent);
1343  COMPARE_SCALAR_FIELD(if_not_exists);
1344 
1345  return true;
1346 }
1347 
1348 static bool
1350 {
1351  COMPARE_NODE_FIELD(defnames);
1352  COMPARE_NODE_FIELD(relation);
1353  COMPARE_NODE_FIELD(keys);
1355  COMPARE_SCALAR_FIELD(if_not_exists);
1356 
1357  return true;
1358 }
1359 
1360 static bool
1362 {
1363  COMPARE_SCALAR_FIELD(replace);
1364  COMPARE_NODE_FIELD(funcname);
1365  COMPARE_NODE_FIELD(parameters);
1366  COMPARE_NODE_FIELD(returnType);
1368  COMPARE_NODE_FIELD(withClause);
1369 
1370  return true;
1371 }
1372 
1373 static bool
1375 {
1377  COMPARE_NODE_FIELD(argType);
1378  COMPARE_SCALAR_FIELD(mode);
1379  COMPARE_NODE_FIELD(defexpr);
1380 
1381  return true;
1382 }
1383 
1384 static bool
1386 {
1387  COMPARE_NODE_FIELD(func);
1388  COMPARE_NODE_FIELD(actions);
1389 
1390  return true;
1391 }
1392 
1393 static bool
1394 _equalDoStmt(const DoStmt *a, const DoStmt *b)
1395 {
1397 
1398  return true;
1399 }
1400 
1401 static bool
1403 {
1404  COMPARE_SCALAR_FIELD(renameType);
1405  COMPARE_SCALAR_FIELD(relationType);
1406  COMPARE_NODE_FIELD(relation);
1407  COMPARE_NODE_FIELD(object);
1408  COMPARE_STRING_FIELD(subname);
1409  COMPARE_STRING_FIELD(newname);
1410  COMPARE_SCALAR_FIELD(behavior);
1411  COMPARE_SCALAR_FIELD(missing_ok);
1412 
1413  return true;
1414 }
1415 
1416 static bool
1418 {
1419  COMPARE_SCALAR_FIELD(objectType);
1420  COMPARE_NODE_FIELD(relation);
1421  COMPARE_NODE_FIELD(object);
1422  COMPARE_NODE_FIELD(extname);
1423 
1424  return true;
1425 }
1426 
1427 static bool
1429 {
1430  COMPARE_SCALAR_FIELD(objectType);
1431  COMPARE_NODE_FIELD(relation);
1432  COMPARE_NODE_FIELD(object);
1433  COMPARE_STRING_FIELD(newschema);
1434  COMPARE_SCALAR_FIELD(missing_ok);
1435 
1436  return true;
1437 }
1438 
1439 static bool
1441 {
1442  COMPARE_SCALAR_FIELD(objectType);
1443  COMPARE_NODE_FIELD(relation);
1444  COMPARE_NODE_FIELD(object);
1445  COMPARE_NODE_FIELD(newowner);
1446 
1447  return true;
1448 }
1449 
1450 static bool
1452 {
1453  COMPARE_NODE_FIELD(opername);
1455 
1456  return true;
1457 }
1458 
1459 static bool
1460 _equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
1461 {
1462  COMPARE_NODE_FIELD(relation);
1463  COMPARE_STRING_FIELD(rulename);
1464  COMPARE_NODE_FIELD(whereClause);
1465  COMPARE_SCALAR_FIELD(event);
1466  COMPARE_SCALAR_FIELD(instead);
1467  COMPARE_NODE_FIELD(actions);
1468  COMPARE_SCALAR_FIELD(replace);
1469 
1470  return true;
1471 }
1472 
1473 static bool
1475 {
1476  COMPARE_STRING_FIELD(conditionname);
1477  COMPARE_STRING_FIELD(payload);
1478 
1479  return true;
1480 }
1481 
1482 static bool
1484 {
1485  COMPARE_STRING_FIELD(conditionname);
1486 
1487  return true;
1488 }
1489 
1490 static bool
1492 {
1493  COMPARE_STRING_FIELD(conditionname);
1494 
1495  return true;
1496 }
1497 
1498 static bool
1500 {
1501  COMPARE_SCALAR_FIELD(kind);
1503  COMPARE_STRING_FIELD(gid);
1504 
1505  return true;
1506 }
1507 
1508 static bool
1510 {
1511  COMPARE_NODE_FIELD(typevar);
1512  COMPARE_NODE_FIELD(coldeflist);
1513 
1514  return true;
1515 }
1516 
1517 static bool
1519 {
1520  COMPARE_NODE_FIELD(typeName);
1521  COMPARE_NODE_FIELD(vals);
1522 
1523  return true;
1524 }
1525 
1526 static bool
1528 {
1529  COMPARE_NODE_FIELD(typeName);
1530  COMPARE_NODE_FIELD(params);
1531 
1532  return true;
1533 }
1534 
1535 static bool
1537 {
1538  COMPARE_NODE_FIELD(typeName);
1539  COMPARE_STRING_FIELD(oldVal);
1540  COMPARE_STRING_FIELD(newVal);
1541  COMPARE_STRING_FIELD(newValNeighbor);
1542  COMPARE_SCALAR_FIELD(newValIsAfter);
1543  COMPARE_SCALAR_FIELD(skipIfNewValExists);
1544 
1545  return true;
1546 }
1547 
1548 static bool
1549 _equalViewStmt(const ViewStmt *a, const ViewStmt *b)
1550 {
1551  COMPARE_NODE_FIELD(view);
1552  COMPARE_NODE_FIELD(aliases);
1553  COMPARE_NODE_FIELD(query);
1554  COMPARE_SCALAR_FIELD(replace);
1556  COMPARE_SCALAR_FIELD(withCheckOption);
1557 
1558  return true;
1559 }
1560 
1561 static bool
1562 _equalLoadStmt(const LoadStmt *a, const LoadStmt *b)
1563 {
1565 
1566  return true;
1567 }
1568 
1569 static bool
1571 {
1572  COMPARE_NODE_FIELD(domainname);
1573  COMPARE_NODE_FIELD(typeName);
1574  COMPARE_NODE_FIELD(collClause);
1575  COMPARE_NODE_FIELD(constraints);
1576 
1577  return true;
1578 }
1579 
1580 static bool
1582 {
1583  COMPARE_NODE_FIELD(opclassname);
1584  COMPARE_NODE_FIELD(opfamilyname);
1585  COMPARE_STRING_FIELD(amname);
1586  COMPARE_NODE_FIELD(datatype);
1587  COMPARE_NODE_FIELD(items);
1588  COMPARE_SCALAR_FIELD(isDefault);
1589 
1590  return true;
1591 }
1592 
1593 static bool
1595 {
1596  COMPARE_SCALAR_FIELD(itemtype);
1598  COMPARE_SCALAR_FIELD(number);
1599  COMPARE_NODE_FIELD(order_family);
1600  COMPARE_NODE_FIELD(class_args);
1601  COMPARE_NODE_FIELD(storedtype);
1602 
1603  return true;
1604 }
1605 
1606 static bool
1608 {
1609  COMPARE_NODE_FIELD(opfamilyname);
1610  COMPARE_STRING_FIELD(amname);
1611 
1612  return true;
1613 }
1614 
1615 static bool
1617 {
1618  COMPARE_NODE_FIELD(opfamilyname);
1619  COMPARE_STRING_FIELD(amname);
1620  COMPARE_SCALAR_FIELD(isDrop);
1621  COMPARE_NODE_FIELD(items);
1622 
1623  return true;
1624 }
1625 
1626 static bool
1628 {
1631 
1632  return true;
1633 }
1634 
1635 static bool
1637 {
1640 
1641  return true;
1642 }
1643 
1644 static bool
1646 {
1648  COMPARE_NODE_FIELD(setstmt);
1649 
1650  return true;
1651 }
1652 
1653 static bool
1655 {
1657  COMPARE_SCALAR_FIELD(missing_ok);
1658 
1659  return true;
1660 }
1661 
1662 static bool
1664 {
1666  COMPARE_NODE_FIELD(relation);
1667  COMPARE_NODE_FIELD(va_cols);
1668 
1669  return true;
1670 }
1671 
1672 static bool
1674 {
1675  COMPARE_NODE_FIELD(query);
1677 
1678  return true;
1679 }
1680 
1681 static bool
1683 {
1684  COMPARE_NODE_FIELD(query);
1685  COMPARE_NODE_FIELD(into);
1686  COMPARE_SCALAR_FIELD(relkind);
1687  COMPARE_SCALAR_FIELD(is_select_into);
1688  COMPARE_SCALAR_FIELD(if_not_exists);
1689 
1690  return true;
1691 }
1692 
1693 static bool
1695 {
1696  COMPARE_SCALAR_FIELD(concurrent);
1697  COMPARE_SCALAR_FIELD(skipData);
1698  COMPARE_NODE_FIELD(relation);
1699 
1700  return true;
1701 }
1702 
1703 static bool
1705 {
1706  COMPARE_SCALAR_FIELD(identity_type);
1708 
1709  return true;
1710 }
1711 
1712 static bool
1714 {
1715  COMPARE_NODE_FIELD(setstmt);
1716 
1717  return true;
1718 }
1719 
1720 
1721 static bool
1723 {
1724  COMPARE_NODE_FIELD(sequence);
1726  COMPARE_SCALAR_FIELD(ownerId);
1727  COMPARE_SCALAR_FIELD(for_identity);
1728  COMPARE_SCALAR_FIELD(if_not_exists);
1729 
1730  return true;
1731 }
1732 
1733 static bool
1735 {
1736  COMPARE_NODE_FIELD(sequence);
1738  COMPARE_SCALAR_FIELD(for_identity);
1739  COMPARE_SCALAR_FIELD(missing_ok);
1740 
1741  return true;
1742 }
1743 
1744 static bool
1746 {
1747  COMPARE_SCALAR_FIELD(kind);
1750  COMPARE_SCALAR_FIELD(is_local);
1751 
1752  return true;
1753 }
1754 
1755 static bool
1757 {
1759 
1760  return true;
1761 }
1762 
1763 static bool
1765 {
1766  COMPARE_SCALAR_FIELD(target);
1767 
1768  return true;
1769 }
1770 
1771 static bool
1773 {
1774  COMPARE_STRING_FIELD(tablespacename);
1775  COMPARE_NODE_FIELD(owner);
1776  COMPARE_STRING_FIELD(location);
1778 
1779  return true;
1780 }
1781 
1782 static bool
1784 {
1785  COMPARE_STRING_FIELD(tablespacename);
1786  COMPARE_SCALAR_FIELD(missing_ok);
1787 
1788  return true;
1789 }
1790 
1791 static bool
1793  const AlterTableSpaceOptionsStmt *b)
1794 {
1795  COMPARE_STRING_FIELD(tablespacename);
1797  COMPARE_SCALAR_FIELD(isReset);
1798 
1799  return true;
1800 }
1801 
1802 static bool
1804  const AlterTableMoveAllStmt *b)
1805 {
1806  COMPARE_STRING_FIELD(orig_tablespacename);
1807  COMPARE_SCALAR_FIELD(objtype);
1808  COMPARE_NODE_FIELD(roles);
1809  COMPARE_STRING_FIELD(new_tablespacename);
1810  COMPARE_SCALAR_FIELD(nowait);
1811 
1812  return true;
1813 }
1814 
1815 static bool
1817 {
1818  COMPARE_STRING_FIELD(extname);
1819  COMPARE_SCALAR_FIELD(if_not_exists);
1821 
1822  return true;
1823 }
1824 
1825 static bool
1827 {
1828  COMPARE_STRING_FIELD(extname);
1830 
1831  return true;
1832 }
1833 
1834 static bool
1836 {
1837  COMPARE_STRING_FIELD(extname);
1838  COMPARE_SCALAR_FIELD(action);
1839  COMPARE_SCALAR_FIELD(objtype);
1840  COMPARE_NODE_FIELD(object);
1841 
1842  return true;
1843 }
1844 
1845 static bool
1847 {
1848  COMPARE_STRING_FIELD(fdwname);
1849  COMPARE_NODE_FIELD(func_options);
1851 
1852  return true;
1853 }
1854 
1855 static bool
1857 {
1858  COMPARE_STRING_FIELD(fdwname);
1859  COMPARE_NODE_FIELD(func_options);
1861 
1862  return true;
1863 }
1864 
1865 static bool
1867 {
1868  COMPARE_STRING_FIELD(servername);
1869  COMPARE_STRING_FIELD(servertype);
1870  COMPARE_STRING_FIELD(version);
1871  COMPARE_STRING_FIELD(fdwname);
1873  COMPARE_SCALAR_FIELD(if_not_exists);
1874 
1875  return true;
1876 }
1877 
1878 static bool
1880 {
1881  COMPARE_STRING_FIELD(servername);
1882  COMPARE_STRING_FIELD(version);
1884  COMPARE_SCALAR_FIELD(has_version);
1885 
1886  return true;
1887 }
1888 
1889 static bool
1891 {
1893  COMPARE_STRING_FIELD(servername);
1895  COMPARE_SCALAR_FIELD(if_not_exists);
1896 
1897  return true;
1898 }
1899 
1900 static bool
1902 {
1904  COMPARE_STRING_FIELD(servername);
1906 
1907  return true;
1908 }
1909 
1910 static bool
1912 {
1914  COMPARE_STRING_FIELD(servername);
1915  COMPARE_SCALAR_FIELD(missing_ok);
1916 
1917  return true;
1918 }
1919 
1920 static bool
1922 {
1923  if (!_equalCreateStmt(&a->base, &b->base))
1924  return false;
1925 
1926  COMPARE_STRING_FIELD(servername);
1928 
1929  return true;
1930 }
1931 
1932 static bool
1934 {
1935  COMPARE_STRING_FIELD(server_name);
1936  COMPARE_STRING_FIELD(remote_schema);
1937  COMPARE_STRING_FIELD(local_schema);
1938  COMPARE_SCALAR_FIELD(list_type);
1939  COMPARE_NODE_FIELD(table_list);
1941 
1942  return true;
1943 }
1944 
1945 static bool
1947 {
1948  COMPARE_SCALAR_FIELD(replace);
1949  COMPARE_NODE_FIELD(type_name);
1950  COMPARE_STRING_FIELD(lang);
1951  COMPARE_NODE_FIELD(fromsql);
1952  COMPARE_NODE_FIELD(tosql);
1953 
1954  return true;
1955 }
1956 
1957 static bool
1959 {
1960  COMPARE_STRING_FIELD(amname);
1961  COMPARE_NODE_FIELD(handler_name);
1962  COMPARE_SCALAR_FIELD(amtype);
1963 
1964  return true;
1965 }
1966 
1967 static bool
1969 {
1970  COMPARE_STRING_FIELD(trigname);
1971  COMPARE_NODE_FIELD(relation);
1972  COMPARE_NODE_FIELD(funcname);
1974  COMPARE_SCALAR_FIELD(row);
1975  COMPARE_SCALAR_FIELD(timing);
1976  COMPARE_SCALAR_FIELD(events);
1977  COMPARE_NODE_FIELD(columns);
1978  COMPARE_NODE_FIELD(whenClause);
1979  COMPARE_SCALAR_FIELD(isconstraint);
1980  COMPARE_NODE_FIELD(transitionRels);
1981  COMPARE_SCALAR_FIELD(deferrable);
1982  COMPARE_SCALAR_FIELD(initdeferred);
1983  COMPARE_NODE_FIELD(constrrel);
1984 
1985  return true;
1986 }
1987 
1988 static bool
1990 {
1991  COMPARE_STRING_FIELD(trigname);
1992  COMPARE_STRING_FIELD(eventname);
1993  COMPARE_NODE_FIELD(whenclause);
1994  COMPARE_NODE_FIELD(funcname);
1995 
1996  return true;
1997 }
1998 
1999 static bool
2001 {
2002  COMPARE_STRING_FIELD(trigname);
2003  COMPARE_SCALAR_FIELD(tgenabled);
2004 
2005  return true;
2006 }
2007 
2008 static bool
2010 {
2011  COMPARE_SCALAR_FIELD(replace);
2012  COMPARE_STRING_FIELD(plname);
2013  COMPARE_NODE_FIELD(plhandler);
2014  COMPARE_NODE_FIELD(plinline);
2015  COMPARE_NODE_FIELD(plvalidator);
2016  COMPARE_SCALAR_FIELD(pltrusted);
2017 
2018  return true;
2019 }
2020 
2021 static bool
2023 {
2024  COMPARE_SCALAR_FIELD(stmt_type);
2025  COMPARE_STRING_FIELD(role);
2027 
2028  return true;
2029 }
2030 
2031 static bool
2033 {
2034  COMPARE_NODE_FIELD(role);
2036  COMPARE_SCALAR_FIELD(action);
2037 
2038  return true;
2039 }
2040 
2041 static bool
2043 {
2044  COMPARE_NODE_FIELD(role);
2045  COMPARE_STRING_FIELD(database);
2046  COMPARE_NODE_FIELD(setstmt);
2047 
2048  return true;
2049 }
2050 
2051 static bool
2053 {
2054  COMPARE_NODE_FIELD(roles);
2055  COMPARE_SCALAR_FIELD(missing_ok);
2056 
2057  return true;
2058 }
2059 
2060 static bool
2061 _equalLockStmt(const LockStmt *a, const LockStmt *b)
2062 {
2063  COMPARE_NODE_FIELD(relations);
2064  COMPARE_SCALAR_FIELD(mode);
2065  COMPARE_SCALAR_FIELD(nowait);
2066 
2067  return true;
2068 }
2069 
2070 static bool
2072 {
2073  COMPARE_NODE_FIELD(constraints);
2074  COMPARE_SCALAR_FIELD(deferred);
2075 
2076  return true;
2077 }
2078 
2079 static bool
2081 {
2082  COMPARE_SCALAR_FIELD(kind);
2083  COMPARE_NODE_FIELD(relation);
2086 
2087  return true;
2088 }
2089 
2090 static bool
2092 {
2093  COMPARE_STRING_FIELD(schemaname);
2094  COMPARE_NODE_FIELD(authrole);
2095  COMPARE_NODE_FIELD(schemaElts);
2096  COMPARE_SCALAR_FIELD(if_not_exists);
2097 
2098  return true;
2099 }
2100 
2101 static bool
2103 {
2104  COMPARE_NODE_FIELD(conversion_name);
2105  COMPARE_STRING_FIELD(for_encoding_name);
2106  COMPARE_STRING_FIELD(to_encoding_name);
2107  COMPARE_NODE_FIELD(func_name);
2108  COMPARE_SCALAR_FIELD(def);
2109 
2110  return true;
2111 }
2112 
2113 static bool
2115 {
2116  COMPARE_NODE_FIELD(sourcetype);
2117  COMPARE_NODE_FIELD(targettype);
2118  COMPARE_NODE_FIELD(func);
2119  COMPARE_SCALAR_FIELD(context);
2120  COMPARE_SCALAR_FIELD(inout);
2121 
2122  return true;
2123 }
2124 
2125 static bool
2127 {
2129  COMPARE_NODE_FIELD(argtypes);
2130  COMPARE_NODE_FIELD(query);
2131 
2132  return true;
2133 }
2134 
2135 static bool
2137 {
2139  COMPARE_NODE_FIELD(params);
2140 
2141  return true;
2142 }
2143 
2144 static bool
2146 {
2148 
2149  return true;
2150 }
2151 
2152 static bool
2154 {
2155  COMPARE_NODE_FIELD(roles);
2156  COMPARE_SCALAR_FIELD(behavior);
2157 
2158  return true;
2159 }
2160 
2161 static bool
2163 {
2164  COMPARE_NODE_FIELD(roles);
2165  COMPARE_NODE_FIELD(newrole);
2166 
2167  return true;
2168 }
2169 
2170 static bool
2172 {
2173  COMPARE_NODE_FIELD(dictname);
2175 
2176  return true;
2177 }
2178 
2179 static bool
2181  const AlterTSConfigurationStmt *b)
2182 {
2183  COMPARE_SCALAR_FIELD(kind);
2184  COMPARE_NODE_FIELD(cfgname);
2185  COMPARE_NODE_FIELD(tokentype);
2186  COMPARE_NODE_FIELD(dicts);
2187  COMPARE_SCALAR_FIELD(override);
2188  COMPARE_SCALAR_FIELD(replace);
2189  COMPARE_SCALAR_FIELD(missing_ok);
2190 
2191  return true;
2192 }
2193 
2194 static bool
2196  const CreatePublicationStmt *b)
2197 {
2198  COMPARE_STRING_FIELD(pubname);
2200  COMPARE_NODE_FIELD(tables);
2201  COMPARE_SCALAR_FIELD(for_all_tables);
2202 
2203  return true;
2204 }
2205 
2206 static bool
2208  const AlterPublicationStmt *b)
2209 {
2210  COMPARE_STRING_FIELD(pubname);
2212  COMPARE_NODE_FIELD(tables);
2213  COMPARE_SCALAR_FIELD(for_all_tables);
2214  COMPARE_SCALAR_FIELD(tableAction);
2215 
2216  return true;
2217 }
2218 
2219 static bool
2221  const CreateSubscriptionStmt *b)
2222 {
2223  COMPARE_STRING_FIELD(subname);
2224  COMPARE_STRING_FIELD(conninfo);
2225  COMPARE_NODE_FIELD(publication);
2227 
2228  return true;
2229 }
2230 
2231 static bool
2233  const AlterSubscriptionStmt *b)
2234 {
2235  COMPARE_SCALAR_FIELD(kind);
2236  COMPARE_STRING_FIELD(subname);
2237  COMPARE_STRING_FIELD(conninfo);
2238  COMPARE_NODE_FIELD(publication);
2240 
2241  return true;
2242 }
2243 
2244 static bool
2246  const DropSubscriptionStmt *b)
2247 {
2248  COMPARE_STRING_FIELD(subname);
2249  COMPARE_SCALAR_FIELD(drop_slot);
2250  COMPARE_SCALAR_FIELD(missing_ok);
2251 
2252  return true;
2253 }
2254 
2255 static bool
2257 {
2258  COMPARE_STRING_FIELD(policy_name);
2259  COMPARE_NODE_FIELD(table);
2260  COMPARE_STRING_FIELD(cmd_name);
2261  COMPARE_SCALAR_FIELD(permissive);
2262  COMPARE_NODE_FIELD(roles);
2263  COMPARE_NODE_FIELD(qual);
2264  COMPARE_NODE_FIELD(with_check);
2265 
2266  return true;
2267 }
2268 
2269 static bool
2271 {
2272  COMPARE_STRING_FIELD(policy_name);
2273  COMPARE_NODE_FIELD(table);
2274  COMPARE_NODE_FIELD(roles);
2275  COMPARE_NODE_FIELD(qual);
2276  COMPARE_NODE_FIELD(with_check);
2277 
2278  return true;
2279 }
2280 
2281 static bool
2282 _equalAExpr(const A_Expr *a, const A_Expr *b)
2283 {
2284  COMPARE_SCALAR_FIELD(kind);
2286  COMPARE_NODE_FIELD(lexpr);
2287  COMPARE_NODE_FIELD(rexpr);
2288  COMPARE_LOCATION_FIELD(location);
2289 
2290  return true;
2291 }
2292 
2293 static bool
2295 {
2296  COMPARE_NODE_FIELD(fields);
2297  COMPARE_LOCATION_FIELD(location);
2298 
2299  return true;
2300 }
2301 
2302 static bool
2303 _equalParamRef(const ParamRef *a, const ParamRef *b)
2304 {
2305  COMPARE_SCALAR_FIELD(number);
2306  COMPARE_LOCATION_FIELD(location);
2307 
2308  return true;
2309 }
2310 
2311 static bool
2312 _equalAConst(const A_Const *a, const A_Const *b)
2313 {
2314  if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
2315  return false;
2316  COMPARE_LOCATION_FIELD(location);
2317 
2318  return true;
2319 }
2320 
2321 static bool
2322 _equalFuncCall(const FuncCall *a, const FuncCall *b)
2323 {
2324  COMPARE_NODE_FIELD(funcname);
2326  COMPARE_NODE_FIELD(agg_order);
2327  COMPARE_NODE_FIELD(agg_filter);
2328  COMPARE_SCALAR_FIELD(agg_within_group);
2329  COMPARE_SCALAR_FIELD(agg_star);
2330  COMPARE_SCALAR_FIELD(agg_distinct);
2331  COMPARE_SCALAR_FIELD(func_variadic);
2332  COMPARE_NODE_FIELD(over);
2333  COMPARE_LOCATION_FIELD(location);
2334 
2335  return true;
2336 }
2337 
2338 static bool
2339 _equalAStar(const A_Star *a, const A_Star *b)
2340 {
2341  return true;
2342 }
2343 
2344 static bool
2346 {
2347  COMPARE_SCALAR_FIELD(is_slice);
2348  COMPARE_NODE_FIELD(lidx);
2349  COMPARE_NODE_FIELD(uidx);
2350 
2351  return true;
2352 }
2353 
2354 static bool
2356 {
2358  COMPARE_NODE_FIELD(indirection);
2359 
2360  return true;
2361 }
2362 
2363 static bool
2365 {
2366  COMPARE_NODE_FIELD(elements);
2367  COMPARE_LOCATION_FIELD(location);
2368 
2369  return true;
2370 }
2371 
2372 static bool
2374 {
2376  COMPARE_NODE_FIELD(indirection);
2378  COMPARE_LOCATION_FIELD(location);
2379 
2380  return true;
2381 }
2382 
2383 static bool
2385 {
2386  COMPARE_NODE_FIELD(source);
2387  COMPARE_SCALAR_FIELD(colno);
2388  COMPARE_SCALAR_FIELD(ncolumns);
2389 
2390  return true;
2391 }
2392 
2393 static bool
2394 _equalTypeName(const TypeName *a, const TypeName *b)
2395 {
2396  COMPARE_NODE_FIELD(names);
2397  COMPARE_SCALAR_FIELD(typeOid);
2398  COMPARE_SCALAR_FIELD(setof);
2399  COMPARE_SCALAR_FIELD(pct_type);
2400  COMPARE_NODE_FIELD(typmods);
2401  COMPARE_SCALAR_FIELD(typemod);
2402  COMPARE_NODE_FIELD(arrayBounds);
2403  COMPARE_LOCATION_FIELD(location);
2404 
2405  return true;
2406 }
2407 
2408 static bool
2409 _equalTypeCast(const TypeCast *a, const TypeCast *b)
2410 {
2412  COMPARE_NODE_FIELD(typeName);
2413  COMPARE_LOCATION_FIELD(location);
2414 
2415  return true;
2416 }
2417 
2418 static bool
2420 {
2422  COMPARE_NODE_FIELD(collname);
2423  COMPARE_LOCATION_FIELD(location);
2424 
2425  return true;
2426 }
2427 
2428 static bool
2429 _equalSortBy(const SortBy *a, const SortBy *b)
2430 {
2431  COMPARE_NODE_FIELD(node);
2432  COMPARE_SCALAR_FIELD(sortby_dir);
2433  COMPARE_SCALAR_FIELD(sortby_nulls);
2434  COMPARE_NODE_FIELD(useOp);
2435  COMPARE_LOCATION_FIELD(location);
2436 
2437  return true;
2438 }
2439 
2440 static bool
2442 {
2444  COMPARE_STRING_FIELD(refname);
2445  COMPARE_NODE_FIELD(partitionClause);
2446  COMPARE_NODE_FIELD(orderClause);
2447  COMPARE_SCALAR_FIELD(frameOptions);
2448  COMPARE_NODE_FIELD(startOffset);
2449  COMPARE_NODE_FIELD(endOffset);
2450  COMPARE_LOCATION_FIELD(location);
2451 
2452  return true;
2453 }
2454 
2455 static bool
2457 {
2458  COMPARE_SCALAR_FIELD(lateral);
2459  COMPARE_NODE_FIELD(subquery);
2460  COMPARE_NODE_FIELD(alias);
2461 
2462  return true;
2463 }
2464 
2465 static bool
2467 {
2468  COMPARE_SCALAR_FIELD(lateral);
2469  COMPARE_SCALAR_FIELD(ordinality);
2470  COMPARE_SCALAR_FIELD(is_rowsfrom);
2472  COMPARE_NODE_FIELD(alias);
2473  COMPARE_NODE_FIELD(coldeflist);
2474 
2475  return true;
2476 }
2477 
2478 static bool
2480 {
2481  COMPARE_NODE_FIELD(relation);
2482  COMPARE_NODE_FIELD(method);
2484  COMPARE_NODE_FIELD(repeatable);
2485  COMPARE_LOCATION_FIELD(location);
2486 
2487  return true;
2488 }
2489 
2490 static bool
2492 {
2493  COMPARE_SCALAR_FIELD(lateral);
2494  COMPARE_NODE_FIELD(docexpr);
2495  COMPARE_NODE_FIELD(rowexpr);
2496  COMPARE_NODE_FIELD(namespaces);
2497  COMPARE_NODE_FIELD(columns);
2498  COMPARE_NODE_FIELD(alias);
2499  COMPARE_LOCATION_FIELD(location);
2500 
2501  return true;
2502 }
2503 
2504 static bool
2506 {
2507  COMPARE_STRING_FIELD(colname);
2508  COMPARE_NODE_FIELD(typeName);
2509  COMPARE_SCALAR_FIELD(for_ordinality);
2510  COMPARE_NODE_FIELD(typeName);
2511  COMPARE_SCALAR_FIELD(is_not_null);
2512  COMPARE_NODE_FIELD(colexpr);
2513  COMPARE_NODE_FIELD(coldefexpr);
2514  COMPARE_LOCATION_FIELD(location);
2515 
2516  return true;
2517 }
2518 
2519 
2520 static bool
2522 {
2524  COMPARE_NODE_FIELD(expr);
2525  COMPARE_STRING_FIELD(indexcolname);
2526  COMPARE_NODE_FIELD(collation);
2527  COMPARE_NODE_FIELD(opclass);
2528  COMPARE_SCALAR_FIELD(ordering);
2529  COMPARE_SCALAR_FIELD(nulls_ordering);
2530 
2531  return true;
2532 }
2533 
2534 static bool
2536 {
2537  COMPARE_STRING_FIELD(colname);
2538  COMPARE_NODE_FIELD(typeName);
2539  COMPARE_SCALAR_FIELD(inhcount);
2540  COMPARE_SCALAR_FIELD(is_local);
2541  COMPARE_SCALAR_FIELD(is_not_null);
2542  COMPARE_SCALAR_FIELD(is_from_type);
2543  COMPARE_SCALAR_FIELD(storage);
2544  COMPARE_NODE_FIELD(raw_default);
2545  COMPARE_NODE_FIELD(cooked_default);
2546  COMPARE_SCALAR_FIELD(identity);
2547  COMPARE_NODE_FIELD(collClause);
2548  COMPARE_SCALAR_FIELD(collOid);
2549  COMPARE_NODE_FIELD(constraints);
2550  COMPARE_NODE_FIELD(fdwoptions);
2551  COMPARE_LOCATION_FIELD(location);
2552 
2553  return true;
2554 }
2555 
2556 static bool
2558 {
2559  COMPARE_SCALAR_FIELD(contype);
2560  COMPARE_STRING_FIELD(conname);
2561  COMPARE_SCALAR_FIELD(deferrable);
2562  COMPARE_SCALAR_FIELD(initdeferred);
2563  COMPARE_LOCATION_FIELD(location);
2564  COMPARE_SCALAR_FIELD(is_no_inherit);
2565  COMPARE_NODE_FIELD(raw_expr);
2566  COMPARE_STRING_FIELD(cooked_expr);
2567  COMPARE_SCALAR_FIELD(generated_when);
2568  COMPARE_NODE_FIELD(keys);
2569  COMPARE_NODE_FIELD(exclusions);
2571  COMPARE_STRING_FIELD(indexname);
2572  COMPARE_STRING_FIELD(indexspace);
2573  COMPARE_STRING_FIELD(access_method);
2574  COMPARE_NODE_FIELD(where_clause);
2575  COMPARE_NODE_FIELD(pktable);
2576  COMPARE_NODE_FIELD(fk_attrs);
2577  COMPARE_NODE_FIELD(pk_attrs);
2578  COMPARE_SCALAR_FIELD(fk_matchtype);
2579  COMPARE_SCALAR_FIELD(fk_upd_action);
2580  COMPARE_SCALAR_FIELD(fk_del_action);
2581  COMPARE_NODE_FIELD(old_conpfeqop);
2582  COMPARE_SCALAR_FIELD(old_pktable_oid);
2583  COMPARE_SCALAR_FIELD(skip_validation);
2584  COMPARE_SCALAR_FIELD(initially_valid);
2585 
2586  return true;
2587 }
2588 
2589 static bool
2590 _equalDefElem(const DefElem *a, const DefElem *b)
2591 {
2592  COMPARE_STRING_FIELD(defnamespace);
2593  COMPARE_STRING_FIELD(defname);
2595  COMPARE_SCALAR_FIELD(defaction);
2596  COMPARE_LOCATION_FIELD(location);
2597 
2598  return true;
2599 }
2600 
2601 static bool
2603 {
2604  COMPARE_NODE_FIELD(lockedRels);
2605  COMPARE_SCALAR_FIELD(strength);
2606  COMPARE_SCALAR_FIELD(waitPolicy);
2607  COMPARE_LOCATION_FIELD(location);
2608 
2609  return true;
2610 }
2611 
2612 static bool
2614 {
2615  COMPARE_SCALAR_FIELD(rtekind);
2616  COMPARE_SCALAR_FIELD(relid);
2617  COMPARE_SCALAR_FIELD(relkind);
2618  COMPARE_NODE_FIELD(tablesample);
2619  COMPARE_NODE_FIELD(subquery);
2620  COMPARE_SCALAR_FIELD(security_barrier);
2621  COMPARE_SCALAR_FIELD(jointype);
2622  COMPARE_NODE_FIELD(joinaliasvars);
2624  COMPARE_NODE_FIELD(tablefunc);
2625  COMPARE_SCALAR_FIELD(funcordinality);
2626  COMPARE_NODE_FIELD(values_lists);
2627  COMPARE_STRING_FIELD(ctename);
2628  COMPARE_SCALAR_FIELD(ctelevelsup);
2629  COMPARE_SCALAR_FIELD(self_reference);
2630  COMPARE_NODE_FIELD(coltypes);
2631  COMPARE_NODE_FIELD(coltypmods);
2632  COMPARE_NODE_FIELD(colcollations);
2633  COMPARE_NODE_FIELD(alias);
2634  COMPARE_NODE_FIELD(eref);
2635  COMPARE_SCALAR_FIELD(lateral);
2636  COMPARE_SCALAR_FIELD(inh);
2637  COMPARE_SCALAR_FIELD(inFromCl);
2638  COMPARE_SCALAR_FIELD(requiredPerms);
2639  COMPARE_SCALAR_FIELD(checkAsUser);
2640  COMPARE_BITMAPSET_FIELD(selectedCols);
2641  COMPARE_BITMAPSET_FIELD(insertedCols);
2642  COMPARE_BITMAPSET_FIELD(updatedCols);
2643  COMPARE_NODE_FIELD(securityQuals);
2644 
2645  return true;
2646 }
2647 
2648 static bool
2650 {
2651  COMPARE_NODE_FIELD(funcexpr);
2652  COMPARE_SCALAR_FIELD(funccolcount);
2653  COMPARE_NODE_FIELD(funccolnames);
2654  COMPARE_NODE_FIELD(funccoltypes);
2655  COMPARE_NODE_FIELD(funccoltypmods);
2656  COMPARE_NODE_FIELD(funccolcollations);
2657  COMPARE_BITMAPSET_FIELD(funcparams);
2658 
2659  return true;
2660 }
2661 
2662 static bool
2664 {
2665  COMPARE_SCALAR_FIELD(tsmhandler);
2667  COMPARE_NODE_FIELD(repeatable);
2668 
2669  return true;
2670 }
2671 
2672 static bool
2674 {
2675  COMPARE_SCALAR_FIELD(kind);
2676  COMPARE_STRING_FIELD(relname);
2677  COMPARE_STRING_FIELD(polname);
2678  COMPARE_NODE_FIELD(qual);
2679  COMPARE_SCALAR_FIELD(cascaded);
2680 
2681  return true;
2682 }
2683 
2684 static bool
2686 {
2687  COMPARE_SCALAR_FIELD(tleSortGroupRef);
2688  COMPARE_SCALAR_FIELD(eqop);
2689  COMPARE_SCALAR_FIELD(sortop);
2690  COMPARE_SCALAR_FIELD(nulls_first);
2691  COMPARE_SCALAR_FIELD(hashable);
2692 
2693  return true;
2694 }
2695 
2696 static bool
2698 {
2699  COMPARE_SCALAR_FIELD(kind);
2700  COMPARE_NODE_FIELD(content);
2701  COMPARE_LOCATION_FIELD(location);
2702 
2703  return true;
2704 }
2705 
2706 static bool
2708 {
2710  COMPARE_STRING_FIELD(refname);
2711  COMPARE_NODE_FIELD(partitionClause);
2712  COMPARE_NODE_FIELD(orderClause);
2713  COMPARE_SCALAR_FIELD(frameOptions);
2714  COMPARE_NODE_FIELD(startOffset);
2715  COMPARE_NODE_FIELD(endOffset);
2716  COMPARE_SCALAR_FIELD(winref);
2717  COMPARE_SCALAR_FIELD(copiedOrder);
2718 
2719  return true;
2720 }
2721 
2722 static bool
2724 {
2725  COMPARE_SCALAR_FIELD(rti);
2726  COMPARE_SCALAR_FIELD(strength);
2727  COMPARE_SCALAR_FIELD(waitPolicy);
2728  COMPARE_SCALAR_FIELD(pushedDown);
2729 
2730  return true;
2731 }
2732 
2733 static bool
2735 {
2736  COMPARE_NODE_FIELD(ctes);
2737  COMPARE_SCALAR_FIELD(recursive);
2738  COMPARE_LOCATION_FIELD(location);
2739 
2740  return true;
2741 }
2742 
2743 static bool
2745 {
2746  COMPARE_NODE_FIELD(indexElems);
2747  COMPARE_NODE_FIELD(whereClause);
2748  COMPARE_STRING_FIELD(conname);
2749  COMPARE_LOCATION_FIELD(location);
2750 
2751  return true;
2752 }
2753 
2754 static bool
2756 {
2757  COMPARE_SCALAR_FIELD(action);
2758  COMPARE_NODE_FIELD(infer);
2759  COMPARE_NODE_FIELD(targetList);
2760  COMPARE_NODE_FIELD(whereClause);
2761  COMPARE_LOCATION_FIELD(location);
2762 
2763  return true;
2764 }
2765 
2766 static bool
2768 {
2769  COMPARE_STRING_FIELD(ctename);
2770  COMPARE_NODE_FIELD(aliascolnames);
2771  COMPARE_NODE_FIELD(ctequery);
2772  COMPARE_LOCATION_FIELD(location);
2773  COMPARE_SCALAR_FIELD(cterecursive);
2774  COMPARE_SCALAR_FIELD(cterefcount);
2775  COMPARE_NODE_FIELD(ctecolnames);
2776  COMPARE_NODE_FIELD(ctecoltypes);
2777  COMPARE_NODE_FIELD(ctecoltypmods);
2778  COMPARE_NODE_FIELD(ctecolcollations);
2779 
2780  return true;
2781 }
2782 
2783 static bool
2785 {
2787  COMPARE_NODE_FIELD(expr);
2788  COMPARE_NODE_FIELD(typeName);
2789  COMPARE_LOCATION_FIELD(location);
2790 
2791  return true;
2792 }
2793 
2794 static bool
2795 _equalRoleSpec(const RoleSpec *a, const RoleSpec *b)
2796 {
2797  COMPARE_SCALAR_FIELD(roletype);
2798  COMPARE_STRING_FIELD(rolename);
2799  COMPARE_LOCATION_FIELD(location);
2800 
2801  return true;
2802 }
2803 
2804 static bool
2806 {
2808  COMPARE_SCALAR_FIELD(isNew);
2809  COMPARE_SCALAR_FIELD(isTable);
2810 
2811  return true;
2812 }
2813 
2814 static bool
2816 {
2817  COMPARE_STRING_FIELD(strategy);
2818  COMPARE_NODE_FIELD(partParams);
2819  COMPARE_LOCATION_FIELD(location);
2820 
2821  return true;
2822 }
2823 
2824 static bool
2826 {
2828  COMPARE_NODE_FIELD(expr);
2829  COMPARE_NODE_FIELD(collation);
2830  COMPARE_NODE_FIELD(opclass);
2831  COMPARE_LOCATION_FIELD(location);
2832 
2833  return true;
2834 }
2835 
2836 static bool
2838 {
2839  COMPARE_SCALAR_FIELD(strategy);
2840  COMPARE_NODE_FIELD(listdatums);
2841  COMPARE_NODE_FIELD(lowerdatums);
2842  COMPARE_NODE_FIELD(upperdatums);
2843  COMPARE_LOCATION_FIELD(location);
2844 
2845  return true;
2846 }
2847 
2848 static bool
2850 {
2851  COMPARE_SCALAR_FIELD(infinite);
2853  COMPARE_LOCATION_FIELD(location);
2854 
2855  return true;
2856 }
2857 
2858 static bool
2860 {
2862  COMPARE_NODE_FIELD(bound);
2863 
2864  return true;
2865 }
2866 
2867 /*
2868  * Stuff from pg_list.h
2869  */
2870 
2871 static bool
2872 _equalList(const List *a, const List *b)
2873 {
2874  const ListCell *item_a;
2875  const ListCell *item_b;
2876 
2877  /*
2878  * Try to reject by simple scalar checks before grovelling through all the
2879  * list elements...
2880  */
2881  COMPARE_SCALAR_FIELD(type);
2883 
2884  /*
2885  * We place the switch outside the loop for the sake of efficiency; this
2886  * may not be worth doing...
2887  */
2888  switch (a->type)
2889  {
2890  case T_List:
2891  forboth(item_a, a, item_b, b)
2892  {
2893  if (!equal(lfirst(item_a), lfirst(item_b)))
2894  return false;
2895  }
2896  break;
2897  case T_IntList:
2898  forboth(item_a, a, item_b, b)
2899  {
2900  if (lfirst_int(item_a) != lfirst_int(item_b))
2901  return false;
2902  }
2903  break;
2904  case T_OidList:
2905  forboth(item_a, a, item_b, b)
2906  {
2907  if (lfirst_oid(item_a) != lfirst_oid(item_b))
2908  return false;
2909  }
2910  break;
2911  default:
2912  elog(ERROR, "unrecognized list node type: %d",
2913  (int) a->type);
2914  return false; /* keep compiler quiet */
2915  }
2916 
2917  /*
2918  * If we got here, we should have run out of elements of both lists
2919  */
2920  Assert(item_a == NULL);
2921  Assert(item_b == NULL);
2922 
2923  return true;
2924 }
2925 
2926 /*
2927  * Stuff from value.h
2928  */
2929 
2930 static bool
2931 _equalValue(const Value *a, const Value *b)
2932 {
2933  COMPARE_SCALAR_FIELD(type);
2934 
2935  switch (a->type)
2936  {
2937  case T_Integer:
2938  COMPARE_SCALAR_FIELD(val.ival);
2939  break;
2940  case T_Float:
2941  case T_String:
2942  case T_BitString:
2944  break;
2945  case T_Null:
2946  /* nothing to do */
2947  break;
2948  default:
2949  elog(ERROR, "unrecognized node type: %d", (int) a->type);
2950  break;
2951  }
2952 
2953  return true;
2954 }
2955 
2956 /*
2957  * equal
2958  * returns whether two nodes are equal
2959  */
2960 bool
2961 equal(const void *a, const void *b)
2962 {
2963  bool retval;
2964 
2965  if (a == b)
2966  return true;
2967 
2968  /*
2969  * note that a!=b, so only one of them can be NULL
2970  */
2971  if (a == NULL || b == NULL)
2972  return false;
2973 
2974  /*
2975  * are they the same type of nodes?
2976  */
2977  if (nodeTag(a) != nodeTag(b))
2978  return false;
2979 
2980  switch (nodeTag(a))
2981  {
2982  /*
2983  * PRIMITIVE NODES
2984  */
2985  case T_Alias:
2986  retval = _equalAlias(a, b);
2987  break;
2988  case T_RangeVar:
2989  retval = _equalRangeVar(a, b);
2990  break;
2991  case T_TableFunc:
2992  retval = _equalTableFunc(a, b);
2993  break;
2994  case T_IntoClause:
2995  retval = _equalIntoClause(a, b);
2996  break;
2997  case T_Var:
2998  retval = _equalVar(a, b);
2999  break;
3000  case T_Const:
3001  retval = _equalConst(a, b);
3002  break;
3003  case T_Param:
3004  retval = _equalParam(a, b);
3005  break;
3006  case T_Aggref:
3007  retval = _equalAggref(a, b);
3008  break;
3009  case T_GroupingFunc:
3010  retval = _equalGroupingFunc(a, b);
3011  break;
3012  case T_WindowFunc:
3013  retval = _equalWindowFunc(a, b);
3014  break;
3015  case T_ArrayRef:
3016  retval = _equalArrayRef(a, b);
3017  break;
3018  case T_FuncExpr:
3019  retval = _equalFuncExpr(a, b);
3020  break;
3021  case T_NamedArgExpr:
3022  retval = _equalNamedArgExpr(a, b);
3023  break;
3024  case T_OpExpr:
3025  retval = _equalOpExpr(a, b);
3026  break;
3027  case T_DistinctExpr:
3028  retval = _equalDistinctExpr(a, b);
3029  break;
3030  case T_NullIfExpr:
3031  retval = _equalNullIfExpr(a, b);
3032  break;
3033  case T_ScalarArrayOpExpr:
3034  retval = _equalScalarArrayOpExpr(a, b);
3035  break;
3036  case T_BoolExpr:
3037  retval = _equalBoolExpr(a, b);
3038  break;
3039  case T_SubLink:
3040  retval = _equalSubLink(a, b);
3041  break;
3042  case T_SubPlan:
3043  retval = _equalSubPlan(a, b);
3044  break;
3045  case T_AlternativeSubPlan:
3046  retval = _equalAlternativeSubPlan(a, b);
3047  break;
3048  case T_FieldSelect:
3049  retval = _equalFieldSelect(a, b);
3050  break;
3051  case T_FieldStore:
3052  retval = _equalFieldStore(a, b);
3053  break;
3054  case T_RelabelType:
3055  retval = _equalRelabelType(a, b);
3056  break;
3057  case T_CoerceViaIO:
3058  retval = _equalCoerceViaIO(a, b);
3059  break;
3060  case T_ArrayCoerceExpr:
3061  retval = _equalArrayCoerceExpr(a, b);
3062  break;
3063  case T_ConvertRowtypeExpr:
3064  retval = _equalConvertRowtypeExpr(a, b);
3065  break;
3066  case T_CollateExpr:
3067  retval = _equalCollateExpr(a, b);
3068  break;
3069  case T_CaseExpr:
3070  retval = _equalCaseExpr(a, b);
3071  break;
3072  case T_CaseWhen:
3073  retval = _equalCaseWhen(a, b);
3074  break;
3075  case T_CaseTestExpr:
3076  retval = _equalCaseTestExpr(a, b);
3077  break;
3078  case T_ArrayExpr:
3079  retval = _equalArrayExpr(a, b);
3080  break;
3081  case T_RowExpr:
3082  retval = _equalRowExpr(a, b);
3083  break;
3084  case T_RowCompareExpr:
3085  retval = _equalRowCompareExpr(a, b);
3086  break;
3087  case T_CoalesceExpr:
3088  retval = _equalCoalesceExpr(a, b);
3089  break;
3090  case T_MinMaxExpr:
3091  retval = _equalMinMaxExpr(a, b);
3092  break;
3093  case T_SQLValueFunction:
3094  retval = _equalSQLValueFunction(a, b);
3095  break;
3096  case T_XmlExpr:
3097  retval = _equalXmlExpr(a, b);
3098  break;
3099  case T_NullTest:
3100  retval = _equalNullTest(a, b);
3101  break;
3102  case T_BooleanTest:
3103  retval = _equalBooleanTest(a, b);
3104  break;
3105  case T_CoerceToDomain:
3106  retval = _equalCoerceToDomain(a, b);
3107  break;
3108  case T_CoerceToDomainValue:
3109  retval = _equalCoerceToDomainValue(a, b);
3110  break;
3111  case T_SetToDefault:
3112  retval = _equalSetToDefault(a, b);
3113  break;
3114  case T_CurrentOfExpr:
3115  retval = _equalCurrentOfExpr(a, b);
3116  break;
3117  case T_NextValueExpr:
3118  retval = _equalNextValueExpr(a, b);
3119  break;
3120  case T_InferenceElem:
3121  retval = _equalInferenceElem(a, b);
3122  break;
3123  case T_TargetEntry:
3124  retval = _equalTargetEntry(a, b);
3125  break;
3126  case T_RangeTblRef:
3127  retval = _equalRangeTblRef(a, b);
3128  break;
3129  case T_FromExpr:
3130  retval = _equalFromExpr(a, b);
3131  break;
3132  case T_OnConflictExpr:
3133  retval = _equalOnConflictExpr(a, b);
3134  break;
3135  case T_JoinExpr:
3136  retval = _equalJoinExpr(a, b);
3137  break;
3138 
3139  /*
3140  * RELATION NODES
3141  */
3142  case T_PathKey:
3143  retval = _equalPathKey(a, b);
3144  break;
3145  case T_RestrictInfo:
3146  retval = _equalRestrictInfo(a, b);
3147  break;
3148  case T_PlaceHolderVar:
3149  retval = _equalPlaceHolderVar(a, b);
3150  break;
3151  case T_SpecialJoinInfo:
3152  retval = _equalSpecialJoinInfo(a, b);
3153  break;
3154  case T_AppendRelInfo:
3155  retval = _equalAppendRelInfo(a, b);
3156  break;
3158  retval = _equalPartitionedChildRelInfo(a, b);
3159  break;
3160  case T_PlaceHolderInfo:
3161  retval = _equalPlaceHolderInfo(a, b);
3162  break;
3163 
3164  case T_List:
3165  case T_IntList:
3166  case T_OidList:
3167  retval = _equalList(a, b);
3168  break;
3169 
3170  case T_Integer:
3171  case T_Float:
3172  case T_String:
3173  case T_BitString:
3174  case T_Null:
3175  retval = _equalValue(a, b);
3176  break;
3177 
3178  /*
3179  * EXTENSIBLE NODES
3180  */
3181  case T_ExtensibleNode:
3182  retval = _equalExtensibleNode(a, b);
3183  break;
3184 
3185  /*
3186  * PARSE NODES
3187  */
3188  case T_Query:
3189  retval = _equalQuery(a, b);
3190  break;
3191  case T_RawStmt:
3192  retval = _equalRawStmt(a, b);
3193  break;
3194  case T_InsertStmt:
3195  retval = _equalInsertStmt(a, b);
3196  break;
3197  case T_DeleteStmt:
3198  retval = _equalDeleteStmt(a, b);
3199  break;
3200  case T_UpdateStmt:
3201  retval = _equalUpdateStmt(a, b);
3202  break;
3203  case T_SelectStmt:
3204  retval = _equalSelectStmt(a, b);
3205  break;
3206  case T_SetOperationStmt:
3207  retval = _equalSetOperationStmt(a, b);
3208  break;
3209  case T_AlterTableStmt:
3210  retval = _equalAlterTableStmt(a, b);
3211  break;
3212  case T_AlterTableCmd:
3213  retval = _equalAlterTableCmd(a, b);
3214  break;
3215  case T_AlterCollationStmt:
3216  retval = _equalAlterCollationStmt(a, b);
3217  break;
3218  case T_AlterDomainStmt:
3219  retval = _equalAlterDomainStmt(a, b);
3220  break;
3221  case T_GrantStmt:
3222  retval = _equalGrantStmt(a, b);
3223  break;
3224  case T_GrantRoleStmt:
3225  retval = _equalGrantRoleStmt(a, b);
3226  break;
3228  retval = _equalAlterDefaultPrivilegesStmt(a, b);
3229  break;
3230  case T_DeclareCursorStmt:
3231  retval = _equalDeclareCursorStmt(a, b);
3232  break;
3233  case T_ClosePortalStmt:
3234  retval = _equalClosePortalStmt(a, b);
3235  break;
3236  case T_ClusterStmt:
3237  retval = _equalClusterStmt(a, b);
3238  break;
3239  case T_CopyStmt:
3240  retval = _equalCopyStmt(a, b);
3241  break;
3242  case T_CreateStmt:
3243  retval = _equalCreateStmt(a, b);
3244  break;
3245  case T_TableLikeClause:
3246  retval = _equalTableLikeClause(a, b);
3247  break;
3248  case T_DefineStmt:
3249  retval = _equalDefineStmt(a, b);
3250  break;
3251  case T_DropStmt:
3252  retval = _equalDropStmt(a, b);
3253  break;
3254  case T_TruncateStmt:
3255  retval = _equalTruncateStmt(a, b);
3256  break;
3257  case T_CommentStmt:
3258  retval = _equalCommentStmt(a, b);
3259  break;
3260  case T_SecLabelStmt:
3261  retval = _equalSecLabelStmt(a, b);
3262  break;
3263  case T_FetchStmt:
3264  retval = _equalFetchStmt(a, b);
3265  break;
3266  case T_IndexStmt:
3267  retval = _equalIndexStmt(a, b);
3268  break;
3269  case T_CreateStatsStmt:
3270  retval = _equalCreateStatsStmt(a, b);
3271  break;
3272  case T_CreateFunctionStmt:
3273  retval = _equalCreateFunctionStmt(a, b);
3274  break;
3275  case T_FunctionParameter:
3276  retval = _equalFunctionParameter(a, b);
3277  break;
3278  case T_AlterFunctionStmt:
3279  retval = _equalAlterFunctionStmt(a, b);
3280  break;
3281  case T_DoStmt:
3282  retval = _equalDoStmt(a, b);
3283  break;
3284  case T_RenameStmt:
3285  retval = _equalRenameStmt(a, b);
3286  break;
3288  retval = _equalAlterObjectDependsStmt(a, b);
3289  break;
3291  retval = _equalAlterObjectSchemaStmt(a, b);
3292  break;
3293  case T_AlterOwnerStmt:
3294  retval = _equalAlterOwnerStmt(a, b);
3295  break;
3296  case T_AlterOperatorStmt:
3297  retval = _equalAlterOperatorStmt(a, b);
3298  break;
3299  case T_RuleStmt:
3300  retval = _equalRuleStmt(a, b);
3301  break;
3302  case T_NotifyStmt:
3303  retval = _equalNotifyStmt(a, b);
3304  break;
3305  case T_ListenStmt:
3306  retval = _equalListenStmt(a, b);
3307  break;
3308  case T_UnlistenStmt:
3309  retval = _equalUnlistenStmt(a, b);
3310  break;
3311  case T_TransactionStmt:
3312  retval = _equalTransactionStmt(a, b);
3313  break;
3314  case T_CompositeTypeStmt:
3315  retval = _equalCompositeTypeStmt(a, b);
3316  break;
3317  case T_CreateEnumStmt:
3318  retval = _equalCreateEnumStmt(a, b);
3319  break;
3320  case T_CreateRangeStmt:
3321  retval = _equalCreateRangeStmt(a, b);
3322  break;
3323  case T_AlterEnumStmt:
3324  retval = _equalAlterEnumStmt(a, b);
3325  break;
3326  case T_ViewStmt:
3327  retval = _equalViewStmt(a, b);
3328  break;
3329  case T_LoadStmt:
3330  retval = _equalLoadStmt(a, b);
3331  break;
3332  case T_CreateDomainStmt:
3333  retval = _equalCreateDomainStmt(a, b);
3334  break;
3335  case T_CreateOpClassStmt:
3336  retval = _equalCreateOpClassStmt(a, b);
3337  break;
3338  case T_CreateOpClassItem:
3339  retval = _equalCreateOpClassItem(a, b);
3340  break;
3341  case T_CreateOpFamilyStmt:
3342  retval = _equalCreateOpFamilyStmt(a, b);
3343  break;
3344  case T_AlterOpFamilyStmt:
3345  retval = _equalAlterOpFamilyStmt(a, b);
3346  break;
3347  case T_CreatedbStmt:
3348  retval = _equalCreatedbStmt(a, b);
3349  break;
3350  case T_AlterDatabaseStmt:
3351  retval = _equalAlterDatabaseStmt(a, b);
3352  break;
3354  retval = _equalAlterDatabaseSetStmt(a, b);
3355  break;
3356  case T_DropdbStmt:
3357  retval = _equalDropdbStmt(a, b);
3358  break;
3359  case T_VacuumStmt:
3360  retval = _equalVacuumStmt(a, b);
3361  break;
3362  case T_ExplainStmt:
3363  retval = _equalExplainStmt(a, b);
3364  break;
3365  case T_CreateTableAsStmt:
3366  retval = _equalCreateTableAsStmt(a, b);
3367  break;
3368  case T_RefreshMatViewStmt:
3369  retval = _equalRefreshMatViewStmt(a, b);
3370  break;
3371  case T_ReplicaIdentityStmt:
3372  retval = _equalReplicaIdentityStmt(a, b);
3373  break;
3374  case T_AlterSystemStmt:
3375  retval = _equalAlterSystemStmt(a, b);
3376  break;
3377  case T_CreateSeqStmt:
3378  retval = _equalCreateSeqStmt(a, b);
3379  break;
3380  case T_AlterSeqStmt:
3381  retval = _equalAlterSeqStmt(a, b);
3382  break;
3383  case T_VariableSetStmt:
3384  retval = _equalVariableSetStmt(a, b);
3385  break;
3386  case T_VariableShowStmt:
3387  retval = _equalVariableShowStmt(a, b);
3388  break;
3389  case T_DiscardStmt:
3390  retval = _equalDiscardStmt(a, b);
3391  break;
3393  retval = _equalCreateTableSpaceStmt(a, b);
3394  break;
3395  case T_DropTableSpaceStmt:
3396  retval = _equalDropTableSpaceStmt(a, b);
3397  break;
3399  retval = _equalAlterTableSpaceOptionsStmt(a, b);
3400  break;
3402  retval = _equalAlterTableMoveAllStmt(a, b);
3403  break;
3404  case T_CreateExtensionStmt:
3405  retval = _equalCreateExtensionStmt(a, b);
3406  break;
3407  case T_AlterExtensionStmt:
3408  retval = _equalAlterExtensionStmt(a, b);
3409  break;
3411  retval = _equalAlterExtensionContentsStmt(a, b);
3412  break;
3413  case T_CreateFdwStmt:
3414  retval = _equalCreateFdwStmt(a, b);
3415  break;
3416  case T_AlterFdwStmt:
3417  retval = _equalAlterFdwStmt(a, b);
3418  break;
3420  retval = _equalCreateForeignServerStmt(a, b);
3421  break;
3423  retval = _equalAlterForeignServerStmt(a, b);
3424  break;
3426  retval = _equalCreateUserMappingStmt(a, b);
3427  break;
3429  retval = _equalAlterUserMappingStmt(a, b);
3430  break;
3431  case T_DropUserMappingStmt:
3432  retval = _equalDropUserMappingStmt(a, b);
3433  break;
3435  retval = _equalCreateForeignTableStmt(a, b);
3436  break;
3438  retval = _equalImportForeignSchemaStmt(a, b);
3439  break;
3440  case T_CreateTransformStmt:
3441  retval = _equalCreateTransformStmt(a, b);
3442  break;
3443  case T_CreateAmStmt:
3444  retval = _equalCreateAmStmt(a, b);
3445  break;
3446  case T_CreateTrigStmt:
3447  retval = _equalCreateTrigStmt(a, b);
3448  break;
3449  case T_CreateEventTrigStmt:
3450  retval = _equalCreateEventTrigStmt(a, b);
3451  break;
3452  case T_AlterEventTrigStmt:
3453  retval = _equalAlterEventTrigStmt(a, b);
3454  break;
3455  case T_CreatePLangStmt:
3456  retval = _equalCreatePLangStmt(a, b);
3457  break;
3458  case T_CreateRoleStmt:
3459  retval = _equalCreateRoleStmt(a, b);
3460  break;
3461  case T_AlterRoleStmt:
3462  retval = _equalAlterRoleStmt(a, b);
3463  break;
3464  case T_AlterRoleSetStmt:
3465  retval = _equalAlterRoleSetStmt(a, b);
3466  break;
3467  case T_DropRoleStmt:
3468  retval = _equalDropRoleStmt(a, b);
3469  break;
3470  case T_LockStmt:
3471  retval = _equalLockStmt(a, b);
3472  break;
3473  case T_ConstraintsSetStmt:
3474  retval = _equalConstraintsSetStmt(a, b);
3475  break;
3476  case T_ReindexStmt:
3477  retval = _equalReindexStmt(a, b);
3478  break;
3479  case T_CheckPointStmt:
3480  retval = true;
3481  break;
3482  case T_CreateSchemaStmt:
3483  retval = _equalCreateSchemaStmt(a, b);
3484  break;
3486  retval = _equalCreateConversionStmt(a, b);
3487  break;
3488  case T_CreateCastStmt:
3489  retval = _equalCreateCastStmt(a, b);
3490  break;
3491  case T_PrepareStmt:
3492  retval = _equalPrepareStmt(a, b);
3493  break;
3494  case T_ExecuteStmt:
3495  retval = _equalExecuteStmt(a, b);
3496  break;
3497  case T_DeallocateStmt:
3498  retval = _equalDeallocateStmt(a, b);
3499  break;
3500  case T_DropOwnedStmt:
3501  retval = _equalDropOwnedStmt(a, b);
3502  break;
3503  case T_ReassignOwnedStmt:
3504  retval = _equalReassignOwnedStmt(a, b);
3505  break;
3507  retval = _equalAlterTSDictionaryStmt(a, b);
3508  break;
3510  retval = _equalAlterTSConfigurationStmt(a, b);
3511  break;
3512  case T_CreatePolicyStmt:
3513  retval = _equalCreatePolicyStmt(a, b);
3514  break;
3515  case T_AlterPolicyStmt:
3516  retval = _equalAlterPolicyStmt(a, b);
3517  break;
3519  retval = _equalCreatePublicationStmt(a, b);
3520  break;
3522  retval = _equalAlterPublicationStmt(a, b);
3523  break;
3525  retval = _equalCreateSubscriptionStmt(a, b);
3526  break;
3528  retval = _equalAlterSubscriptionStmt(a, b);
3529  break;
3531  retval = _equalDropSubscriptionStmt(a, b);
3532  break;
3533  case T_A_Expr:
3534  retval = _equalAExpr(a, b);
3535  break;
3536  case T_ColumnRef:
3537  retval = _equalColumnRef(a, b);
3538  break;
3539  case T_ParamRef:
3540  retval = _equalParamRef(a, b);
3541  break;
3542  case T_A_Const:
3543  retval = _equalAConst(a, b);
3544  break;
3545  case T_FuncCall:
3546  retval = _equalFuncCall(a, b);
3547  break;
3548  case T_A_Star:
3549  retval = _equalAStar(a, b);
3550  break;
3551  case T_A_Indices:
3552  retval = _equalAIndices(a, b);
3553  break;
3554  case T_A_Indirection:
3555  retval = _equalA_Indirection(a, b);
3556  break;
3557  case T_A_ArrayExpr:
3558  retval = _equalA_ArrayExpr(a, b);
3559  break;
3560  case T_ResTarget:
3561  retval = _equalResTarget(a, b);
3562  break;
3563  case T_MultiAssignRef:
3564  retval = _equalMultiAssignRef(a, b);
3565  break;
3566  case T_TypeCast:
3567  retval = _equalTypeCast(a, b);
3568  break;
3569  case T_CollateClause:
3570  retval = _equalCollateClause(a, b);
3571  break;
3572  case T_SortBy:
3573  retval = _equalSortBy(a, b);
3574  break;
3575  case T_WindowDef:
3576  retval = _equalWindowDef(a, b);
3577  break;
3578  case T_RangeSubselect:
3579  retval = _equalRangeSubselect(a, b);
3580  break;
3581  case T_RangeFunction:
3582  retval = _equalRangeFunction(a, b);
3583  break;
3584  case T_RangeTableSample:
3585  retval = _equalRangeTableSample(a, b);
3586  break;
3587  case T_RangeTableFunc:
3588  retval = _equalRangeTableFunc(a, b);
3589  break;
3590  case T_RangeTableFuncCol:
3591  retval = _equalRangeTableFuncCol(a, b);
3592  break;
3593  case T_TypeName:
3594  retval = _equalTypeName(a, b);
3595  break;
3596  case T_IndexElem:
3597  retval = _equalIndexElem(a, b);
3598  break;
3599  case T_ColumnDef:
3600  retval = _equalColumnDef(a, b);
3601  break;
3602  case T_Constraint:
3603  retval = _equalConstraint(a, b);
3604  break;
3605  case T_DefElem:
3606  retval = _equalDefElem(a, b);
3607  break;
3608  case T_LockingClause:
3609  retval = _equalLockingClause(a, b);
3610  break;
3611  case T_RangeTblEntry:
3612  retval = _equalRangeTblEntry(a, b);
3613  break;
3614  case T_RangeTblFunction:
3615  retval = _equalRangeTblFunction(a, b);
3616  break;
3617  case T_TableSampleClause:
3618  retval = _equalTableSampleClause(a, b);
3619  break;
3620  case T_WithCheckOption:
3621  retval = _equalWithCheckOption(a, b);
3622  break;
3623  case T_SortGroupClause:
3624  retval = _equalSortGroupClause(a, b);
3625  break;
3626  case T_GroupingSet:
3627  retval = _equalGroupingSet(a, b);
3628  break;
3629  case T_WindowClause:
3630  retval = _equalWindowClause(a, b);
3631  break;
3632  case T_RowMarkClause:
3633  retval = _equalRowMarkClause(a, b);
3634  break;
3635  case T_WithClause:
3636  retval = _equalWithClause(a, b);
3637  break;
3638  case T_InferClause:
3639  retval = _equalInferClause(a, b);
3640  break;
3641  case T_OnConflictClause:
3642  retval = _equalOnConflictClause(a, b);
3643  break;
3644  case T_CommonTableExpr:
3645  retval = _equalCommonTableExpr(a, b);
3646  break;
3647  case T_ObjectWithArgs:
3648  retval = _equalObjectWithArgs(a, b);
3649  break;
3650  case T_AccessPriv:
3651  retval = _equalAccessPriv(a, b);
3652  break;
3653  case T_XmlSerialize:
3654  retval = _equalXmlSerialize(a, b);
3655  break;
3656  case T_RoleSpec:
3657  retval = _equalRoleSpec(a, b);
3658  break;
3659  case T_TriggerTransition:
3660  retval = _equalTriggerTransition(a, b);
3661  break;
3662  case T_PartitionSpec:
3663  retval = _equalPartitionSpec(a, b);
3664  break;
3665  case T_PartitionElem:
3666  retval = _equalPartitionElem(a, b);
3667  break;
3668  case T_PartitionBoundSpec:
3669  retval = _equalPartitionBoundSpec(a, b);
3670  break;
3671  case T_PartitionRangeDatum:
3672  retval = _equalPartitionRangeDatum(a, b);
3673  break;
3674  case T_PartitionCmd:
3675  retval = _equalPartitionCmd(a, b);
3676  break;
3677 
3678  default:
3679  elog(ERROR, "unrecognized node type: %d",
3680  (int) nodeTag(a));
3681  retval = false; /* keep compiler quiet */
3682  break;
3683  }
3684 
3685  return retval;
3686 }
static bool _equalDropUserMappingStmt(const DropUserMappingStmt *a, const DropUserMappingStmt *b)
Definition: equalfuncs.c:1911
Datum constvalue
Definition: primnodes.h:196
static bool _equalWindowDef(const WindowDef *a, const WindowDef *b)
Definition: equalfuncs.c:2441
static bool _equalDiscardStmt(const DiscardStmt *a, const DiscardStmt *b)
Definition: equalfuncs.c:1764
static bool _equalAlterFdwStmt(const AlterFdwStmt *a, const AlterFdwStmt *b)
Definition: equalfuncs.c:1856
static bool _equalParamRef(const ParamRef *a, const ParamRef *b)
Definition: equalfuncs.c:2303
static bool _equalListenStmt(const ListenStmt *a, const ListenStmt *b)
Definition: equalfuncs.c:1483
static bool _equalAlterDomainStmt(const AlterDomainStmt *a, const AlterDomainStmt *b)
Definition: equalfuncs.c:1118
static bool _equalConstraintsSetStmt(const ConstraintsSetStmt *a, const ConstraintsSetStmt *b)
Definition: equalfuncs.c:2071
bool(* nodeEqual)(const struct ExtensibleNode *a, const struct ExtensibleNode *b)
Definition: extensible.h:66
int length(const List *list)
Definition: list.c:1271
static bool _equalScalarArrayOpExpr(const ScalarArrayOpExpr *a, const ScalarArrayOpExpr *b)
Definition: equalfuncs.c:387
static bool _equalAlterTableCmd(const AlterTableCmd *a, const AlterTableCmd *b)
Definition: equalfuncs.c:1097
Datum boolop(PG_FUNCTION_ARGS)
Definition: _int_bool.c:420
static bool _equalCreateEnumStmt(const CreateEnumStmt *a, const CreateEnumStmt *b)
Definition: equalfuncs.c:1518
static bool _equalCreateTableAsStmt(const CreateTableAsStmt *a, const CreateTableAsStmt *b)
Definition: equalfuncs.c:1682
static bool _equalAlterDatabaseStmt(const AlterDatabaseStmt *a, const AlterDatabaseStmt *b)
Definition: equalfuncs.c:1636
static bool _equalViewStmt(const ViewStmt *a, const ViewStmt *b)
Definition: equalfuncs.c:1549
static bool _equalDropStmt(const DropStmt *a, const DropStmt *b)
Definition: equalfuncs.c:1269
static bool _equalPartitionedChildRelInfo(const PartitionedChildRelInfo *a, const PartitionedChildRelInfo *b)
Definition: equalfuncs.c:908
static bool _equalCollateExpr(const CollateExpr *a, const CollateExpr *b)
Definition: equalfuncs.c:539
#define forboth(cell1, list1, cell2, list2)
Definition: pg_list.h:180
static bool _equalGroupingSet(const GroupingSet *a, const GroupingSet *b)
Definition: equalfuncs.c:2697
static bool _equalSortGroupClause(const SortGroupClause *a, const SortGroupClause *b)
Definition: equalfuncs.c:2685
static bool _equalCreateFdwStmt(const CreateFdwStmt *a, const CreateFdwStmt *b)
Definition: equalfuncs.c:1846
static bool _equalTargetEntry(const TargetEntry *a, const TargetEntry *b)
Definition: equalfuncs.c:756
bool constbyval
Definition: primnodes.h:199
static bool _equalBooleanTest(const BooleanTest *a, const BooleanTest *b)
Definition: equalfuncs.c:682
bool equal(const void *a, const void *b)
Definition: equalfuncs.c:2961
#define COMPARE_STRING_FIELD(fldname)
Definition: equalfuncs.c:66
static bool _equalMinMaxExpr(const MinMaxExpr *a, const MinMaxExpr *b)
Definition: equalfuncs.c:631
static bool _equalTriggerTransition(const TriggerTransition *a, const TriggerTransition *b)
Definition: equalfuncs.c:2805
static bool _equalCreateAmStmt(const CreateAmStmt *a, const CreateAmStmt *b)
Definition: equalfuncs.c:1958
static bool _equalAccessPriv(const AccessPriv *a, const AccessPriv *b)
Definition: equalfuncs.c:1156
static bool _equalVariableSetStmt(const VariableSetStmt *a, const VariableSetStmt *b)
Definition: equalfuncs.c:1745
static bool _equalDropTableSpaceStmt(const DropTableSpaceStmt *a, const DropTableSpaceStmt *b)
Definition: equalfuncs.c:1783
static bool _equalCoerceViaIO(const CoerceViaIO *a, const CoerceViaIO *b)
Definition: equalfuncs.c:501
static bool _equalRowExpr(const RowExpr *a, const RowExpr *b)
Definition: equalfuncs.c:595
static bool _equalReindexStmt(const ReindexStmt *a, const ReindexStmt *b)
Definition: equalfuncs.c:2080
static bool _equalPrepareStmt(const PrepareStmt *a, const PrepareStmt *b)
Definition: equalfuncs.c:2126
static bool _equalTypeName(const TypeName *a, const TypeName *b)
Definition: equalfuncs.c:2394
static bool _equalOnConflictClause(const OnConflictClause *a, const OnConflictClause *b)
Definition: equalfuncs.c:2755
static bool _equalExecuteStmt(const ExecuteStmt *a, const ExecuteStmt *b)
Definition: equalfuncs.c:2136
static bool _equalExtensibleNode(const ExtensibleNode *a, const ExtensibleNode *b)
Definition: equalfuncs.c:933
static bool _equalCommonTableExpr(const CommonTableExpr *a, const CommonTableExpr *b)
Definition: equalfuncs.c:2767
#define COMPARE_BITMAPSET_FIELD(fldname)
Definition: equalfuncs.c:59
static bool _equalVar(const Var *a, const Var *b)
Definition: equalfuncs.c:161
bool datumIsEqual(Datum value1, Datum value2, bool typByVal, int typLen)
Definition: datum.c:219
static bool _equalCreateCastStmt(const CreateCastStmt *a, const CreateCastStmt *b)
Definition: equalfuncs.c:2114
static bool _equalUpdateStmt(const UpdateStmt *a, const UpdateStmt *b)
Definition: equalfuncs.c:1033
static bool _equalArrayExpr(const ArrayExpr *a, const ArrayExpr *b)
Definition: equalfuncs.c:582
static bool _equalCreateTrigStmt(const CreateTrigStmt *a, const CreateTrigStmt *b)
Definition: equalfuncs.c:1968
static bool _equalIndexElem(const IndexElem *a, const IndexElem *b)
Definition: equalfuncs.c:2521
static bool _equalArrayCoerceExpr(const ArrayCoerceExpr *a, const ArrayCoerceExpr *b)
Definition: equalfuncs.c:513
static bool _equalTransactionStmt(const TransactionStmt *a, const TransactionStmt *b)
Definition: equalfuncs.c:1499
static bool _equalReplicaIdentityStmt(const ReplicaIdentityStmt *a, const ReplicaIdentityStmt *b)
Definition: equalfuncs.c:1704
static bool _equalInferClause(const InferClause *a, const InferClause *b)
Definition: equalfuncs.c:2744
return result
Definition: formatting.c:1618
#define COMPARE_COERCIONFORM_FIELD(fldname)
Definition: equalfuncs.c:88
static bool _equalCaseWhen(const CaseWhen *a, const CaseWhen *b)
Definition: equalfuncs.c:562
static bool _equalRoleSpec(const RoleSpec *a, const RoleSpec *b)
Definition: equalfuncs.c:2795
static bool _equalPathKey(const PathKey *a, const PathKey *b)
Definition: equalfuncs.c:821
static bool _equalDropRoleStmt(const DropRoleStmt *a, const DropRoleStmt *b)
Definition: equalfuncs.c:2052
static bool _equalRangeTableFuncCol(const RangeTableFuncCol *a, const RangeTableFuncCol *b)
Definition: equalfuncs.c:2505
static bool _equalGrantRoleStmt(const GrantRoleStmt *a, const GrantRoleStmt *b)
Definition: equalfuncs.c:1165
static bool _equalAlterFunctionStmt(const AlterFunctionStmt *a, const AlterFunctionStmt *b)
Definition: equalfuncs.c:1385
static bool _equalAlterOpFamilyStmt(const AlterOpFamilyStmt *a, const AlterOpFamilyStmt *b)
Definition: equalfuncs.c:1616
static bool _equalCreatedbStmt(const CreatedbStmt *a, const CreatedbStmt *b)
Definition: equalfuncs.c:1627
static bool _equalAppendRelInfo(const AppendRelInfo *a, const AppendRelInfo *b)
Definition: equalfuncs.c:895
Definition: primnodes.h:163
static bool _equalAlterRoleSetStmt(const AlterRoleSetStmt *a, const AlterRoleSetStmt *b)
Definition: equalfuncs.c:2042
static bool _equalReassignOwnedStmt(const ReassignOwnedStmt *a, const ReassignOwnedStmt *b)
Definition: equalfuncs.c:2162
static bool _equalTruncateStmt(const TruncateStmt *a, const TruncateStmt *b)
Definition: equalfuncs.c:1281
static bool _equalSelectStmt(const SelectStmt *a, const SelectStmt *b)
Definition: equalfuncs.c:1046
static bool _equalRangeTblRef(const RangeTblRef *a, const RangeTblRef *b)
Definition: equalfuncs.c:770
static bool _equalCoerceToDomain(const CoerceToDomain *a, const CoerceToDomain *b)
Definition: equalfuncs.c:692
static bool _equalUnlistenStmt(const UnlistenStmt *a, const UnlistenStmt *b)
Definition: equalfuncs.c:1491
static bool _equalDropdbStmt(const DropdbStmt *a, const DropdbStmt *b)
Definition: equalfuncs.c:1654
static bool _equalAlterSeqStmt(const AlterSeqStmt *a, const AlterSeqStmt *b)
Definition: equalfuncs.c:1734
static bool _equalAlterObjectSchemaStmt(const AlterObjectSchemaStmt *a, const AlterObjectSchemaStmt *b)
Definition: equalfuncs.c:1428
static bool _equalCreateExtensionStmt(const CreateExtensionStmt *a, const CreateExtensionStmt *b)
Definition: equalfuncs.c:1816
static bool _equalAlterCollationStmt(const AlterCollationStmt *a, const AlterCollationStmt *b)
Definition: equalfuncs.c:1110
static bool _equalAlterOperatorStmt(const AlterOperatorStmt *a, const AlterOperatorStmt *b)
Definition: equalfuncs.c:1451
static bool _equalTableLikeClause(const TableLikeClause *a, const TableLikeClause *b)
Definition: equalfuncs.c:1247
static bool _equalAlterDatabaseSetStmt(const AlterDatabaseSetStmt *a, const AlterDatabaseSetStmt *b)
Definition: equalfuncs.c:1645
static bool _equalParam(const Param *a, const Param *b)
Definition: equalfuncs.c:198
static bool _equalDefElem(const DefElem *a, const DefElem *b)
Definition: equalfuncs.c:2590
static bool _equalPartitionBoundSpec(const PartitionBoundSpec *a, const PartitionBoundSpec *b)
Definition: equalfuncs.c:2837
static bool _equalSortBy(const SortBy *a, const SortBy *b)
Definition: equalfuncs.c:2429
static bool _equalRelabelType(const RelabelType *a, const RelabelType *b)
Definition: equalfuncs.c:488
static bool _equalAlterTSDictionaryStmt(const AlterTSDictionaryStmt *a, const AlterTSDictionaryStmt *b)
Definition: equalfuncs.c:2171
static bool _equalCollateClause(const CollateClause *a, const CollateClause *b)
Definition: equalfuncs.c:2419
int constlen
Definition: primnodes.h:195
static bool _equalAlterExtensionStmt(const AlterExtensionStmt *a, const AlterExtensionStmt *b)
Definition: equalfuncs.c:1826
static bool _equalCreateOpFamilyStmt(const CreateOpFamilyStmt *a, const CreateOpFamilyStmt *b)
Definition: equalfuncs.c:1607
static bool _equalWithCheckOption(const WithCheckOption *a, const WithCheckOption *b)
Definition: equalfuncs.c:2673
static bool _equalAExpr(const A_Expr *a, const A_Expr *b)
Definition: equalfuncs.c:2282
static bool _equalSecLabelStmt(const SecLabelStmt *a, const SecLabelStmt *b)
Definition: equalfuncs.c:1301
static bool _equalFunctionParameter(const FunctionParameter *a, const FunctionParameter *b)
Definition: equalfuncs.c:1374
static bool _equalAlterExtensionContentsStmt(const AlterExtensionContentsStmt *a, const AlterExtensionContentsStmt *b)
Definition: equalfuncs.c:1835
static bool _equalCoalesceExpr(const CoalesceExpr *a, const CoalesceExpr *b)
Definition: equalfuncs.c:620
static bool _equalJoinExpr(const JoinExpr *a, const JoinExpr *b)
Definition: equalfuncs.c:778
static bool _equalSubLink(const SubLink *a, const SubLink *b)
Definition: equalfuncs.c:421
static bool _equalRangeTblFunction(const RangeTblFunction *a, const RangeTblFunction *b)
Definition: equalfuncs.c:2649
static bool _equalCreateStatsStmt(const CreateStatsStmt *a, const CreateStatsStmt *b)
Definition: equalfuncs.c:1349
#define ERROR
Definition: elog.h:43
static bool _equalVariableShowStmt(const VariableShowStmt *a, const VariableShowStmt *b)
Definition: equalfuncs.c:1756
static bool _equalCaseExpr(const CaseExpr *a, const CaseExpr *b)
Definition: equalfuncs.c:549
#define lfirst_int(lc)
Definition: pg_list.h:107
static bool _equalList(const List *a, const List *b)
Definition: equalfuncs.c:2872
static bool _equalAlterObjectDependsStmt(const AlterObjectDependsStmt *a, const AlterObjectDependsStmt *b)
Definition: equalfuncs.c:1417
static bool _equalNamedArgExpr(const NamedArgExpr *a, const NamedArgExpr *b)
Definition: equalfuncs.c:298
static bool _equalAlterEnumStmt(const AlterEnumStmt *a, const AlterEnumStmt *b)
Definition: equalfuncs.c:1536
static bool _equalAlterTableStmt(const AlterTableStmt *a, const AlterTableStmt *b)
Definition: equalfuncs.c:1086
static bool _equalPartitionCmd(const PartitionCmd *a, const PartitionCmd *b)
Definition: equalfuncs.c:2859
static bool _equalIntoClause(const IntoClause *a, const IntoClause *b)
Definition: equalfuncs.c:140
static bool _equalCreateConversionStmt(const CreateConversionStmt *a, const CreateConversionStmt *b)
Definition: equalfuncs.c:2102
static bool _equalRangeTableSample(const RangeTableSample *a, const RangeTableSample *b)
Definition: equalfuncs.c:2479
static bool _equalCreateFunctionStmt(const CreateFunctionStmt *a, const CreateFunctionStmt *b)
Definition: equalfuncs.c:1361
static bool _equalArrayRef(const ArrayRef *a, const ArrayRef *b)
Definition: equalfuncs.c:267
Definition: nodes.h:142
static bool _equalPartitionSpec(const PartitionSpec *a, const PartitionSpec *b)
Definition: equalfuncs.c:2815
static bool _equalCreatePLangStmt(const CreatePLangStmt *a, const CreatePLangStmt *b)
Definition: equalfuncs.c:2009
static bool _equalDistinctExpr(const DistinctExpr *a, const DistinctExpr *b)
Definition: equalfuncs.c:335
static bool _equalRowCompareExpr(const RowCompareExpr *a, const RowCompareExpr *b)
Definition: equalfuncs.c:607
static bool _equalAlterForeignServerStmt(const AlterForeignServerStmt *a, const AlterForeignServerStmt *b)
Definition: equalfuncs.c:1879
static bool _equalCoerceToDomainValue(const CoerceToDomainValue *a, const CoerceToDomainValue *b)
Definition: equalfuncs.c:705
static bool _equalAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *a, const AlterDefaultPrivilegesStmt *b)
Definition: equalfuncs.c:1178
static bool _equalAlias(const Alias *a, const Alias *b)
Definition: equalfuncs.c:97
static bool _equalWindowClause(const WindowClause *a, const WindowClause *b)
Definition: equalfuncs.c:2707
static bool _equalCurrentOfExpr(const CurrentOfExpr *a, const CurrentOfExpr *b)
Definition: equalfuncs.c:727
static bool _equalOpExpr(const OpExpr *a, const OpExpr *b)
Definition: equalfuncs.c:309
static bool _equalSetToDefault(const SetToDefault *a, const SetToDefault *b)
Definition: equalfuncs.c:716
static bool _equalFuncCall(const FuncCall *a, const FuncCall *b)
Definition: equalfuncs.c:2322
static bool _equalAlterEventTrigStmt(const AlterEventTrigStmt *a, const AlterEventTrigStmt *b)
Definition: equalfuncs.c:2000
static bool _equalQuery(const Query *a, const Query *b)
Definition: equalfuncs.c:954
static bool _equalConstraint(const Constraint *a, const Constraint *b)
Definition: equalfuncs.c:2557
static bool _equalCreateUserMappingStmt(const CreateUserMappingStmt *a, const CreateUserMappingStmt *b)
Definition: equalfuncs.c:1890
static bool _equalAlterTSConfigurationStmt(const AlterTSConfigurationStmt *a, const AlterTSConfigurationStmt *b)
Definition: equalfuncs.c:2180
static bool _equalCaseTestExpr(const CaseTestExpr *a, const CaseTestExpr *b)
Definition: equalfuncs.c:572
static bool _equalLoadStmt(const LoadStmt *a, const LoadStmt *b)
Definition: equalfuncs.c:1562
static bool _equalSQLValueFunction(const SQLValueFunction *a, const SQLValueFunction *b)
Definition: equalfuncs.c:644
static bool _equalCreateForeignServerStmt(const CreateForeignServerStmt *a, const CreateForeignServerStmt *b)
Definition: equalfuncs.c:1866
static bool _equalImportForeignSchemaStmt(const ImportForeignSchemaStmt *a, const ImportForeignSchemaStmt *b)
Definition: equalfuncs.c:1933
static bool _equalNullTest(const NullTest *a, const NullTest *b)
Definition: equalfuncs.c:671
static bool _equalPartitionRangeDatum(const PartitionRangeDatum *a, const PartitionRangeDatum *b)
Definition: equalfuncs.c:2849
static bool _equalInferenceElem(const InferenceElem *a, const InferenceElem *b)
Definition: equalfuncs.c:746
static bool _equalRangeTableFunc(const RangeTableFunc *a, const RangeTableFunc *b)
Definition: equalfuncs.c:2491
static bool _equalDoStmt(const DoStmt *a, const DoStmt *b)
Definition: equalfuncs.c:1394
static bool _equalSubPlan(const SubPlan *a, const SubPlan *b)
Definition: equalfuncs.c:434
static bool _equalAlterSubscriptionStmt(const AlterSubscriptionStmt *a, const AlterSubscriptionStmt *b)
Definition: equalfuncs.c:2232
Definition: nodes.h:291
static bool _equalCreateTableSpaceStmt(const CreateTableSpaceStmt *a, const CreateTableSpaceStmt *b)
Definition: equalfuncs.c:1772
static bool _equalNullIfExpr(const NullIfExpr *a, const NullIfExpr *b)
Definition: equalfuncs.c:361
static bool _equalPlaceHolderVar(const PlaceHolderVar *a, const PlaceHolderVar *b)
Definition: equalfuncs.c:852
static bool _equalNotifyStmt(const NotifyStmt *a, const NotifyStmt *b)
Definition: equalfuncs.c:1474
Definition: nodes.h:147
static bool _equalPartitionElem(const PartitionElem *a, const PartitionElem *b)
Definition: equalfuncs.c:2825
static bool _equalRawStmt(const RawStmt *a, const RawStmt *b)
Definition: equalfuncs.c:997
static int verbose
Definition: pg_basebackup.c:84
Definition: nodes.h:146
static bool _equalSpecialJoinInfo(const SpecialJoinInfo *a, const SpecialJoinInfo *b)
Definition: equalfuncs.c:877
static bool _equalAlterRoleStmt(const AlterRoleStmt *a, const AlterRoleStmt *b)
Definition: equalfuncs.c:2032
static bool _equalA_Indirection(const A_Indirection *a, const A_Indirection *b)
Definition: equalfuncs.c:2355
static bool _equalCreateRangeStmt(const CreateRangeStmt *a, const CreateRangeStmt *b)
Definition: equalfuncs.c:1527
Definition: nodes.h:304
static bool _equalCreateRoleStmt(const CreateRoleStmt *a, const CreateRoleStmt *b)
Definition: equalfuncs.c:2022
static bool _equalAlterPolicyStmt(const AlterPolicyStmt *a, const AlterPolicyStmt *b)
Definition: equalfuncs.c:2270
static bool _equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
Definition: equalfuncs.c:1460
static bool _equalAlternativeSubPlan(const AlternativeSubPlan *a, const AlternativeSubPlan *b)
Definition: equalfuncs.c:457
static bool _equalFromExpr(const FromExpr *a, const FromExpr *b)
Definition: equalfuncs.c:793
static bool _equalCreateDomainStmt(const CreateDomainStmt *a, const CreateDomainStmt *b)
Definition: equalfuncs.c:1570
Oid opfuncid
Definition: primnodes.h:496
static char * label
Definition: pg_basebackup.c:81
static bool _equalBoolExpr(const BoolExpr *a, const BoolExpr *b)
Definition: equalfuncs.c:411
static bool _equalExplainStmt(const ExplainStmt *a, const ExplainStmt *b)
Definition: equalfuncs.c:1673
static bool _equalVacuumStmt(const VacuumStmt *a, const VacuumStmt *b)
Definition: equalfuncs.c:1663
static bool _equalCreatePublicationStmt(const CreatePublicationStmt *a, const CreatePublicationStmt *b)
Definition: equalfuncs.c:2195
static bool _equalCreateTransformStmt(const CreateTransformStmt *a, const CreateTransformStmt *b)
Definition: equalfuncs.c:1946
const char * extnodename
Definition: extensible.h:35
static bool _equalDeleteStmt(const DeleteStmt *a, const DeleteStmt *b)
Definition: equalfuncs.c:1021
static bool _equalSetOperationStmt(const SetOperationStmt *a, const SetOperationStmt *b)
Definition: equalfuncs.c:1071
static bool _equalDeclareCursorStmt(const DeclareCursorStmt *a, const DeclareCursorStmt *b)
Definition: equalfuncs.c:1187
static bool _equalAlterPublicationStmt(const AlterPublicationStmt *a, const AlterPublicationStmt *b)
Definition: equalfuncs.c:2207
static bool _equalLockingClause(const LockingClause *a, const LockingClause *b)
Definition: equalfuncs.c:2602
static bool _equalTypeCast(const TypeCast *a, const TypeCast *b)
Definition: equalfuncs.c:2409
#define NULL
Definition: c.h:229
static bool _equalCreateSeqStmt(const CreateSeqStmt *a, const CreateSeqStmt *b)
Definition: equalfuncs.c:1722
#define Assert(condition)
Definition: c.h:675
#define lfirst(lc)
Definition: pg_list.h:106
static bool _equalWindowFunc(const WindowFunc *a, const WindowFunc *b)
Definition: equalfuncs.c:250
static bool _equalAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *a, const AlterTableSpaceOptionsStmt *b)
Definition: equalfuncs.c:1792
Definition: value.h:42
static bool _equalDropSubscriptionStmt(const DropSubscriptionStmt *a, const DropSubscriptionStmt *b)
Definition: equalfuncs.c:2245
static bool _equalFieldStore(const FieldStore *a, const FieldStore *b)
Definition: equalfuncs.c:477
static bool _equalPlaceHolderInfo(const PlaceHolderInfo *a, const PlaceHolderInfo *b)
Definition: equalfuncs.c:917
#define COMPARE_LOCATION_FIELD(fldname)
Definition: equalfuncs.c:84
static bool _equalResTarget(const ResTarget *a, const ResTarget *b)
Definition: equalfuncs.c:2373
static bool _equalTableFunc(const TableFunc *a, const TableFunc *b)
Definition: equalfuncs.c:120
static bool _equalCreatePolicyStmt(const CreatePolicyStmt *a, const CreatePolicyStmt *b)
Definition: equalfuncs.c:2256
char * dbname
Definition: streamutil.c:38
static bool _equalDropOwnedStmt(const DropOwnedStmt *a, const DropOwnedStmt *b)
Definition: equalfuncs.c:2153
static bool _equalXmlExpr(const XmlExpr *a, const XmlExpr *b)
Definition: equalfuncs.c:655
static const struct fns functions
Definition: regcomp.c:299
static bool _equalNextValueExpr(const NextValueExpr *a, const NextValueExpr *b)
Definition: equalfuncs.c:737
static bool _equalValue(const Value *a, const Value *b)
Definition: equalfuncs.c:2931
static bool _equalAlterUserMappingStmt(const AlterUserMappingStmt *a, const AlterUserMappingStmt *b)
Definition: equalfuncs.c:1901
static bool _equalCompositeTypeStmt(const CompositeTypeStmt *a, const CompositeTypeStmt *b)
Definition: equalfuncs.c:1509
const char * name
Definition: encode.c:521
static bool _equalCreateForeignTableStmt(const CreateForeignTableStmt *a, const CreateForeignTableStmt *b)
Definition: equalfuncs.c:1921
#define nodeTag(nodeptr)
Definition: nodes.h:514
static bool _equalDefineStmt(const DefineStmt *a, const DefineStmt *b)
Definition: equalfuncs.c:1256
static bool _equalFieldSelect(const FieldSelect *a, const FieldSelect *b)
Definition: equalfuncs.c:465
static bool _equalAStar(const A_Star *a, const A_Star *b)
Definition: equalfuncs.c:2339
static bool _equalFuncExpr(const FuncExpr *a, const FuncExpr *b)
Definition: equalfuncs.c:282
Definition: nodes.h:286
#define COMPARE_NODE_FIELD(fldname)
Definition: equalfuncs.c:52
static bool _equalTableSampleClause(const TableSampleClause *a, const TableSampleClause *b)
Definition: equalfuncs.c:2663
Definition: nodes.h:283
static char * filename
Definition: pg_dumpall.c:87
NodeTag type
Definition: pg_list.h:47
static bool _equalMultiAssignRef(const MultiAssignRef *a, const MultiAssignRef *b)
Definition: equalfuncs.c:2384
static char * user
Definition: pg_regress.c:92
static bool _equalRangeVar(const RangeVar *a, const RangeVar *b)
Definition: equalfuncs.c:106
static bool _equalColumnRef(const ColumnRef *a, const ColumnRef *b)
Definition: equalfuncs.c:2294
static bool _equalAConst(const A_Const *a, const A_Const *b)
Definition: equalfuncs.c:2312
static bool _equalRangeTblEntry(const RangeTblEntry *a, const RangeTblEntry *b)
Definition: equalfuncs.c:2613
static bool _equalCreateOpClassStmt(const CreateOpClassStmt *a, const CreateOpClassStmt *b)
Definition: equalfuncs.c:1581
static bool _equalRefreshMatViewStmt(const RefreshMatViewStmt *a, const RefreshMatViewStmt *b)
Definition: equalfuncs.c:1694
int xmloption
Definition: xml.c:97
static bool _equalGrantStmt(const GrantStmt *a, const GrantStmt *b)
Definition: equalfuncs.c:1131
static bool _equalAIndices(const A_Indices *a, const A_Indices *b)
Definition: equalfuncs.c:2345
static bool _equalConst(const Const *a, const Const *b)
Definition: equalfuncs.c:177
static bool _equalCreateSubscriptionStmt(const CreateSubscriptionStmt *a, const CreateSubscriptionStmt *b)
Definition: equalfuncs.c:2220
static bool _equalOnConflictExpr(const OnConflictExpr *a, const OnConflictExpr *b)
Definition: equalfuncs.c:802
static bool _equalFetchStmt(const FetchStmt *a, const FetchStmt *b)
Definition: equalfuncs.c:1312
void * arg
static bool _equalCreateOpClassItem(const CreateOpClassItem *a, const CreateOpClassItem *b)
Definition: equalfuncs.c:1594
static bool _equalInsertStmt(const InsertStmt *a, const InsertStmt *b)
Definition: equalfuncs.c:1007
static bool _equalCopyStmt(const CopyStmt *a, const CopyStmt *b)
Definition: equalfuncs.c:1215
static bool _equalRestrictInfo(const RestrictInfo *a, const RestrictInfo *b)
Definition: equalfuncs.c:833
static bool _equalDeallocateStmt(const DeallocateStmt *a, const DeallocateStmt *b)
Definition: equalfuncs.c:2145
static bool _equalRangeSubselect(const RangeSubselect *a, const RangeSubselect *b)
Definition: equalfuncs.c:2456
#define elog
Definition: elog.h:219
static bool _equalAlterTableMoveAllStmt(const AlterTableMoveAllStmt *a, const AlterTableMoveAllStmt *b)
Definition: equalfuncs.c:1803
static bool _equalGroupingFunc(const GroupingFunc *a, const GroupingFunc *b)
Definition: equalfuncs.c:235
static struct @121 value
static bool _equalWithClause(const WithClause *a, const WithClause *b)
Definition: equalfuncs.c:2734
static bool _equalCommentStmt(const CommentStmt *a, const CommentStmt *b)
Definition: equalfuncs.c:1291
static bool _equalA_ArrayExpr(const A_ArrayExpr *a, const A_ArrayExpr *b)
Definition: equalfuncs.c:2364
static bool _equalCreateSchemaStmt(const CreateSchemaStmt *a, const CreateSchemaStmt *b)
Definition: equalfuncs.c:2091
Value val
Definition: parsenodes.h:288
Definition: pg_list.h:45
static bool _equalCreateStmt(const CreateStmt *a, const CreateStmt *b)
Definition: equalfuncs.c:1229
static bool _equalRenameStmt(const RenameStmt *a, const RenameStmt *b)
Definition: equalfuncs.c:1402
static bool _equalClusterStmt(const ClusterStmt *a, const ClusterStmt *b)
Definition: equalfuncs.c:1205
long val
Definition: informix.c:689
static bool _equalAlterOwnerStmt(const AlterOwnerStmt *a, const AlterOwnerStmt *b)
Definition: equalfuncs.c:1440
static bool _equalAlterSystemStmt(const AlterSystemStmt *a, const AlterSystemStmt *b)
Definition: equalfuncs.c:1713
static bool _equalClosePortalStmt(const ClosePortalStmt *a, const ClosePortalStmt *b)
Definition: equalfuncs.c:1197
static bool _equalXmlSerialize(const XmlSerialize *a, const XmlSerialize *b)
Definition: equalfuncs.c:2784
bool constisnull
Definition: primnodes.h:197
static bool _equalIndexStmt(const IndexStmt *a, const IndexStmt *b)
Definition: equalfuncs.c:1323
static bool _equalObjectWithArgs(const ObjectWithArgs *a, const ObjectWithArgs *b)
Definition: equalfuncs.c:1146
static bool _equalLockStmt(const LockStmt *a, const LockStmt *b)
Definition: equalfuncs.c:2061
#define lfirst_oid(lc)
Definition: pg_list.h:108
NodeTag type
Definition: value.h:44
static bool _equalRangeFunction(const RangeFunction *a, const RangeFunction *b)
Definition: equalfuncs.c:2466
static bool _equalCreateEventTrigStmt(const CreateEventTrigStmt *a, const CreateEventTrigStmt *b)
Definition: equalfuncs.c:1989
const ExtensibleNodeMethods * GetExtensibleNodeMethods(const char *extnodename, bool missing_ok)
Definition: extensible.c:125
#define COMPARE_SCALAR_FIELD(fldname)
Definition: equalfuncs.c:45
static bool _equalConvertRowtypeExpr(const ConvertRowtypeExpr *a, const ConvertRowtypeExpr *b)
Definition: equalfuncs.c:528
static bool _equalAggref(const Aggref *a, const Aggref *b)
Definition: equalfuncs.c:211
static bool _equalRowMarkClause(const RowMarkClause *a, const RowMarkClause *b)
Definition: equalfuncs.c:2723
Definition: nodes.h:148
static bool _equalColumnDef(const ColumnDef *a, const ColumnDef *b)
Definition: equalfuncs.c:2535