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_NODE_FIELD(expr);
740  COMPARE_SCALAR_FIELD(infercollid);
741  COMPARE_SCALAR_FIELD(inferopclass);
742 
743  return true;
744 }
745 
746 static bool
748 {
749  COMPARE_NODE_FIELD(expr);
750  COMPARE_SCALAR_FIELD(resno);
751  COMPARE_STRING_FIELD(resname);
752  COMPARE_SCALAR_FIELD(ressortgroupref);
753  COMPARE_SCALAR_FIELD(resorigtbl);
754  COMPARE_SCALAR_FIELD(resorigcol);
755  COMPARE_SCALAR_FIELD(resjunk);
756 
757  return true;
758 }
759 
760 static bool
762 {
763  COMPARE_SCALAR_FIELD(rtindex);
764 
765  return true;
766 }
767 
768 static bool
769 _equalJoinExpr(const JoinExpr *a, const JoinExpr *b)
770 {
771  COMPARE_SCALAR_FIELD(jointype);
772  COMPARE_SCALAR_FIELD(isNatural);
773  COMPARE_NODE_FIELD(larg);
774  COMPARE_NODE_FIELD(rarg);
775  COMPARE_NODE_FIELD(usingClause);
776  COMPARE_NODE_FIELD(quals);
777  COMPARE_NODE_FIELD(alias);
778  COMPARE_SCALAR_FIELD(rtindex);
779 
780  return true;
781 }
782 
783 static bool
784 _equalFromExpr(const FromExpr *a, const FromExpr *b)
785 {
786  COMPARE_NODE_FIELD(fromlist);
787  COMPARE_NODE_FIELD(quals);
788 
789  return true;
790 }
791 
792 static bool
794 {
795  COMPARE_SCALAR_FIELD(action);
796  COMPARE_NODE_FIELD(arbiterElems);
797  COMPARE_NODE_FIELD(arbiterWhere);
798  COMPARE_SCALAR_FIELD(constraint);
799  COMPARE_NODE_FIELD(onConflictSet);
800  COMPARE_NODE_FIELD(onConflictWhere);
801  COMPARE_SCALAR_FIELD(exclRelIndex);
802  COMPARE_NODE_FIELD(exclRelTlist);
803 
804  return true;
805 }
806 
807 /*
808  * Stuff from relation.h
809  */
810 
811 static bool
812 _equalPathKey(const PathKey *a, const PathKey *b)
813 {
814  /* We assume pointer equality is sufficient to compare the eclasses */
815  COMPARE_SCALAR_FIELD(pk_eclass);
816  COMPARE_SCALAR_FIELD(pk_opfamily);
817  COMPARE_SCALAR_FIELD(pk_strategy);
818  COMPARE_SCALAR_FIELD(pk_nulls_first);
819 
820  return true;
821 }
822 
823 static bool
825 {
826  COMPARE_NODE_FIELD(clause);
827  COMPARE_SCALAR_FIELD(is_pushed_down);
828  COMPARE_SCALAR_FIELD(outerjoin_delayed);
829  COMPARE_SCALAR_FIELD(security_level);
830  COMPARE_BITMAPSET_FIELD(required_relids);
831  COMPARE_BITMAPSET_FIELD(outer_relids);
832  COMPARE_BITMAPSET_FIELD(nullable_relids);
833 
834  /*
835  * We ignore all the remaining fields, since they may not be set yet, and
836  * should be derivable from the clause anyway.
837  */
838 
839  return true;
840 }
841 
842 static bool
844 {
845  /*
846  * We intentionally do not compare phexpr. Two PlaceHolderVars with the
847  * same ID and levelsup should be considered equal even if the contained
848  * expressions have managed to mutate to different states. This will
849  * happen during final plan construction when there are nested PHVs, since
850  * the inner PHV will get replaced by a Param in some copies of the outer
851  * PHV. Another way in which it can happen is that initplan sublinks
852  * could get replaced by differently-numbered Params when sublink folding
853  * is done. (The end result of such a situation would be some
854  * unreferenced initplans, which is annoying but not really a problem.) On
855  * the same reasoning, there is no need to examine phrels.
856  *
857  * COMPARE_NODE_FIELD(phexpr);
858  *
859  * COMPARE_BITMAPSET_FIELD(phrels);
860  */
861  COMPARE_SCALAR_FIELD(phid);
862  COMPARE_SCALAR_FIELD(phlevelsup);
863 
864  return true;
865 }
866 
867 static bool
869 {
870  COMPARE_BITMAPSET_FIELD(min_lefthand);
871  COMPARE_BITMAPSET_FIELD(min_righthand);
872  COMPARE_BITMAPSET_FIELD(syn_lefthand);
873  COMPARE_BITMAPSET_FIELD(syn_righthand);
874  COMPARE_SCALAR_FIELD(jointype);
875  COMPARE_SCALAR_FIELD(lhs_strict);
876  COMPARE_SCALAR_FIELD(delay_upper_joins);
877  COMPARE_SCALAR_FIELD(semi_can_btree);
878  COMPARE_SCALAR_FIELD(semi_can_hash);
879  COMPARE_NODE_FIELD(semi_operators);
880  COMPARE_NODE_FIELD(semi_rhs_exprs);
881 
882  return true;
883 }
884 
885 static bool
887 {
888  COMPARE_SCALAR_FIELD(parent_relid);
889  COMPARE_SCALAR_FIELD(child_relid);
890  COMPARE_SCALAR_FIELD(parent_reltype);
891  COMPARE_SCALAR_FIELD(child_reltype);
892  COMPARE_NODE_FIELD(translated_vars);
893  COMPARE_SCALAR_FIELD(parent_reloid);
894 
895  return true;
896 }
897 
898 static bool
900 {
901  COMPARE_SCALAR_FIELD(parent_relid);
902  COMPARE_NODE_FIELD(child_rels);
903 
904  return true;
905 }
906 
907 static bool
909 {
910  COMPARE_SCALAR_FIELD(phid);
911  COMPARE_NODE_FIELD(ph_var); /* should be redundant */
912  COMPARE_BITMAPSET_FIELD(ph_eval_at);
913  COMPARE_BITMAPSET_FIELD(ph_lateral);
914  COMPARE_BITMAPSET_FIELD(ph_needed);
915  COMPARE_SCALAR_FIELD(ph_width);
916 
917  return true;
918 }
919 
920 /*
921  * Stuff from extensible.h
922  */
923 static bool
925 {
926  const ExtensibleNodeMethods *methods;
927 
928  COMPARE_STRING_FIELD(extnodename);
929 
930  /* At this point, we know extnodename is the same for both nodes. */
931  methods = GetExtensibleNodeMethods(a->extnodename, false);
932 
933  /* compare the private fields */
934  if (!methods->nodeEqual(a, b))
935  return false;
936 
937  return true;
938 }
939 
940 /*
941  * Stuff from parsenodes.h
942  */
943 
944 static bool
945 _equalQuery(const Query *a, const Query *b)
946 {
947  COMPARE_SCALAR_FIELD(commandType);
948  COMPARE_SCALAR_FIELD(querySource);
949  /* we intentionally ignore queryId, since it might not be set */
950  COMPARE_SCALAR_FIELD(canSetTag);
951  COMPARE_NODE_FIELD(utilityStmt);
952  COMPARE_SCALAR_FIELD(resultRelation);
953  COMPARE_SCALAR_FIELD(hasAggs);
954  COMPARE_SCALAR_FIELD(hasWindowFuncs);
955  COMPARE_SCALAR_FIELD(hasTargetSRFs);
956  COMPARE_SCALAR_FIELD(hasSubLinks);
957  COMPARE_SCALAR_FIELD(hasDistinctOn);
958  COMPARE_SCALAR_FIELD(hasRecursive);
959  COMPARE_SCALAR_FIELD(hasModifyingCTE);
960  COMPARE_SCALAR_FIELD(hasForUpdate);
961  COMPARE_SCALAR_FIELD(hasRowSecurity);
962  COMPARE_NODE_FIELD(cteList);
963  COMPARE_NODE_FIELD(rtable);
964  COMPARE_NODE_FIELD(jointree);
965  COMPARE_NODE_FIELD(targetList);
966  COMPARE_NODE_FIELD(onConflict);
967  COMPARE_NODE_FIELD(returningList);
968  COMPARE_NODE_FIELD(groupClause);
969  COMPARE_NODE_FIELD(groupingSets);
970  COMPARE_NODE_FIELD(havingQual);
971  COMPARE_NODE_FIELD(windowClause);
972  COMPARE_NODE_FIELD(distinctClause);
973  COMPARE_NODE_FIELD(sortClause);
974  COMPARE_NODE_FIELD(limitOffset);
975  COMPARE_NODE_FIELD(limitCount);
976  COMPARE_NODE_FIELD(rowMarks);
977  COMPARE_NODE_FIELD(setOperations);
978  COMPARE_NODE_FIELD(constraintDeps);
979  COMPARE_NODE_FIELD(withCheckOptions);
980  COMPARE_LOCATION_FIELD(stmt_location);
981  COMPARE_LOCATION_FIELD(stmt_len);
982 
983  return true;
984 }
985 
986 static bool
987 _equalRawStmt(const RawStmt *a, const RawStmt *b)
988 {
989  COMPARE_NODE_FIELD(stmt);
990  COMPARE_LOCATION_FIELD(stmt_location);
991  COMPARE_LOCATION_FIELD(stmt_len);
992 
993  return true;
994 }
995 
996 static bool
998 {
999  COMPARE_NODE_FIELD(relation);
1000  COMPARE_NODE_FIELD(cols);
1001  COMPARE_NODE_FIELD(selectStmt);
1002  COMPARE_NODE_FIELD(onConflictClause);
1003  COMPARE_NODE_FIELD(returningList);
1004  COMPARE_NODE_FIELD(withClause);
1005 
1006  return true;
1007 }
1008 
1009 static bool
1011 {
1012  COMPARE_NODE_FIELD(relation);
1013  COMPARE_NODE_FIELD(usingClause);
1014  COMPARE_NODE_FIELD(whereClause);
1015  COMPARE_NODE_FIELD(returningList);
1016  COMPARE_NODE_FIELD(withClause);
1017 
1018  return true;
1019 }
1020 
1021 static bool
1023 {
1024  COMPARE_NODE_FIELD(relation);
1025  COMPARE_NODE_FIELD(targetList);
1026  COMPARE_NODE_FIELD(whereClause);
1027  COMPARE_NODE_FIELD(fromClause);
1028  COMPARE_NODE_FIELD(returningList);
1029  COMPARE_NODE_FIELD(withClause);
1030 
1031  return true;
1032 }
1033 
1034 static bool
1036 {
1037  COMPARE_NODE_FIELD(distinctClause);
1038  COMPARE_NODE_FIELD(intoClause);
1039  COMPARE_NODE_FIELD(targetList);
1040  COMPARE_NODE_FIELD(fromClause);
1041  COMPARE_NODE_FIELD(whereClause);
1042  COMPARE_NODE_FIELD(groupClause);
1043  COMPARE_NODE_FIELD(havingClause);
1044  COMPARE_NODE_FIELD(windowClause);
1045  COMPARE_NODE_FIELD(valuesLists);
1046  COMPARE_NODE_FIELD(sortClause);
1047  COMPARE_NODE_FIELD(limitOffset);
1048  COMPARE_NODE_FIELD(limitCount);
1049  COMPARE_NODE_FIELD(lockingClause);
1050  COMPARE_NODE_FIELD(withClause);
1052  COMPARE_SCALAR_FIELD(all);
1053  COMPARE_NODE_FIELD(larg);
1054  COMPARE_NODE_FIELD(rarg);
1055 
1056  return true;
1057 }
1058 
1059 static bool
1061 {
1063  COMPARE_SCALAR_FIELD(all);
1064  COMPARE_NODE_FIELD(larg);
1065  COMPARE_NODE_FIELD(rarg);
1066  COMPARE_NODE_FIELD(colTypes);
1067  COMPARE_NODE_FIELD(colTypmods);
1068  COMPARE_NODE_FIELD(colCollations);
1069  COMPARE_NODE_FIELD(groupClauses);
1070 
1071  return true;
1072 }
1073 
1074 static bool
1076 {
1077  COMPARE_NODE_FIELD(relation);
1078  COMPARE_NODE_FIELD(cmds);
1079  COMPARE_SCALAR_FIELD(relkind);
1080  COMPARE_SCALAR_FIELD(missing_ok);
1081 
1082  return true;
1083 }
1084 
1085 static bool
1087 {
1088  COMPARE_SCALAR_FIELD(subtype);
1090  COMPARE_NODE_FIELD(newowner);
1091  COMPARE_NODE_FIELD(def);
1092  COMPARE_SCALAR_FIELD(behavior);
1093  COMPARE_SCALAR_FIELD(missing_ok);
1094 
1095  return true;
1096 }
1097 
1098 static bool
1100 {
1101  COMPARE_NODE_FIELD(collname);
1102 
1103  return true;
1104 }
1105 
1106 static bool
1108 {
1109  COMPARE_SCALAR_FIELD(subtype);
1110  COMPARE_NODE_FIELD(typeName);
1112  COMPARE_NODE_FIELD(def);
1113  COMPARE_SCALAR_FIELD(behavior);
1114  COMPARE_SCALAR_FIELD(missing_ok);
1115 
1116  return true;
1117 }
1118 
1119 static bool
1121 {
1122  COMPARE_SCALAR_FIELD(is_grant);
1123  COMPARE_SCALAR_FIELD(targtype);
1124  COMPARE_SCALAR_FIELD(objtype);
1125  COMPARE_NODE_FIELD(objects);
1126  COMPARE_NODE_FIELD(privileges);
1127  COMPARE_NODE_FIELD(grantees);
1128  COMPARE_SCALAR_FIELD(grant_option);
1129  COMPARE_SCALAR_FIELD(behavior);
1130 
1131  return true;
1132 }
1133 
1134 static bool
1136 {
1137  COMPARE_NODE_FIELD(objname);
1138  COMPARE_NODE_FIELD(objargs);
1139  COMPARE_SCALAR_FIELD(args_unspecified);
1140 
1141  return true;
1142 }
1143 
1144 static bool
1146 {
1147  COMPARE_STRING_FIELD(priv_name);
1148  COMPARE_NODE_FIELD(cols);
1149 
1150  return true;
1151 }
1152 
1153 static bool
1155 {
1156  COMPARE_NODE_FIELD(granted_roles);
1157  COMPARE_NODE_FIELD(grantee_roles);
1158  COMPARE_SCALAR_FIELD(is_grant);
1159  COMPARE_SCALAR_FIELD(admin_opt);
1160  COMPARE_NODE_FIELD(grantor);
1161  COMPARE_SCALAR_FIELD(behavior);
1162 
1163  return true;
1164 }
1165 
1166 static bool
1168 {
1170  COMPARE_NODE_FIELD(action);
1171 
1172  return true;
1173 }
1174 
1175 static bool
1177 {
1178  COMPARE_STRING_FIELD(portalname);
1180  COMPARE_NODE_FIELD(query);
1181 
1182  return true;
1183 }
1184 
1185 static bool
1187 {
1188  COMPARE_STRING_FIELD(portalname);
1189 
1190  return true;
1191 }
1192 
1193 static bool
1195 {
1196  COMPARE_NODE_FIELD(relation);
1197  COMPARE_STRING_FIELD(indexname);
1199 
1200  return true;
1201 }
1202 
1203 static bool
1204 _equalCopyStmt(const CopyStmt *a, const CopyStmt *b)
1205 {
1206  COMPARE_NODE_FIELD(relation);
1207  COMPARE_NODE_FIELD(query);
1208  COMPARE_NODE_FIELD(attlist);
1209  COMPARE_SCALAR_FIELD(is_from);
1210  COMPARE_SCALAR_FIELD(is_program);
1213 
1214  return true;
1215 }
1216 
1217 static bool
1219 {
1220  COMPARE_NODE_FIELD(relation);
1221  COMPARE_NODE_FIELD(tableElts);
1222  COMPARE_NODE_FIELD(inhRelations);
1223  COMPARE_NODE_FIELD(partspec);
1224  COMPARE_NODE_FIELD(partbound);
1225  COMPARE_NODE_FIELD(ofTypename);
1226  COMPARE_NODE_FIELD(constraints);
1228  COMPARE_SCALAR_FIELD(oncommit);
1229  COMPARE_STRING_FIELD(tablespacename);
1230  COMPARE_SCALAR_FIELD(if_not_exists);
1231 
1232  return true;
1233 }
1234 
1235 static bool
1237 {
1238  COMPARE_NODE_FIELD(relation);
1240 
1241  return true;
1242 }
1243 
1244 static bool
1246 {
1247  COMPARE_SCALAR_FIELD(kind);
1248  COMPARE_SCALAR_FIELD(oldstyle);
1249  COMPARE_NODE_FIELD(defnames);
1251  COMPARE_NODE_FIELD(definition);
1252  COMPARE_SCALAR_FIELD(if_not_exists);
1253 
1254  return true;
1255 }
1256 
1257 static bool
1258 _equalDropStmt(const DropStmt *a, const DropStmt *b)
1259 {
1260  COMPARE_NODE_FIELD(objects);
1261  COMPARE_SCALAR_FIELD(removeType);
1262  COMPARE_SCALAR_FIELD(behavior);
1263  COMPARE_SCALAR_FIELD(missing_ok);
1264  COMPARE_SCALAR_FIELD(concurrent);
1265 
1266  return true;
1267 }
1268 
1269 static bool
1271 {
1272  COMPARE_NODE_FIELD(relations);
1273  COMPARE_SCALAR_FIELD(restart_seqs);
1274  COMPARE_SCALAR_FIELD(behavior);
1275 
1276  return true;
1277 }
1278 
1279 static bool
1281 {
1282  COMPARE_SCALAR_FIELD(objtype);
1283  COMPARE_NODE_FIELD(object);
1284  COMPARE_STRING_FIELD(comment);
1285 
1286  return true;
1287 }
1288 
1289 static bool
1291 {
1292  COMPARE_SCALAR_FIELD(objtype);
1293  COMPARE_NODE_FIELD(object);
1294  COMPARE_STRING_FIELD(provider);
1296 
1297  return true;
1298 }
1299 
1300 static bool
1302 {
1303  COMPARE_SCALAR_FIELD(direction);
1304  COMPARE_SCALAR_FIELD(howMany);
1305  COMPARE_STRING_FIELD(portalname);
1306  COMPARE_SCALAR_FIELD(ismove);
1307 
1308  return true;
1309 }
1310 
1311 static bool
1313 {
1314  COMPARE_STRING_FIELD(idxname);
1315  COMPARE_NODE_FIELD(relation);
1316  COMPARE_STRING_FIELD(accessMethod);
1317  COMPARE_STRING_FIELD(tableSpace);
1318  COMPARE_NODE_FIELD(indexParams);
1320  COMPARE_NODE_FIELD(whereClause);
1321  COMPARE_NODE_FIELD(excludeOpNames);
1322  COMPARE_STRING_FIELD(idxcomment);
1323  COMPARE_SCALAR_FIELD(indexOid);
1324  COMPARE_SCALAR_FIELD(oldNode);
1325  COMPARE_SCALAR_FIELD(unique);
1326  COMPARE_SCALAR_FIELD(primary);
1327  COMPARE_SCALAR_FIELD(isconstraint);
1328  COMPARE_SCALAR_FIELD(deferrable);
1329  COMPARE_SCALAR_FIELD(initdeferred);
1330  COMPARE_SCALAR_FIELD(transformed);
1331  COMPARE_SCALAR_FIELD(concurrent);
1332  COMPARE_SCALAR_FIELD(if_not_exists);
1333 
1334  return true;
1335 }
1336 
1337 static bool
1339 {
1340  COMPARE_SCALAR_FIELD(replace);
1341  COMPARE_NODE_FIELD(funcname);
1342  COMPARE_NODE_FIELD(parameters);
1343  COMPARE_NODE_FIELD(returnType);
1345  COMPARE_NODE_FIELD(withClause);
1346 
1347  return true;
1348 }
1349 
1350 static bool
1352 {
1354  COMPARE_NODE_FIELD(argType);
1355  COMPARE_SCALAR_FIELD(mode);
1356  COMPARE_NODE_FIELD(defexpr);
1357 
1358  return true;
1359 }
1360 
1361 static bool
1363 {
1364  COMPARE_NODE_FIELD(func);
1365  COMPARE_NODE_FIELD(actions);
1366 
1367  return true;
1368 }
1369 
1370 static bool
1371 _equalDoStmt(const DoStmt *a, const DoStmt *b)
1372 {
1374 
1375  return true;
1376 }
1377 
1378 static bool
1380 {
1381  COMPARE_SCALAR_FIELD(renameType);
1382  COMPARE_SCALAR_FIELD(relationType);
1383  COMPARE_NODE_FIELD(relation);
1384  COMPARE_NODE_FIELD(object);
1385  COMPARE_STRING_FIELD(subname);
1386  COMPARE_STRING_FIELD(newname);
1387  COMPARE_SCALAR_FIELD(behavior);
1388  COMPARE_SCALAR_FIELD(missing_ok);
1389 
1390  return true;
1391 }
1392 
1393 static bool
1395 {
1396  COMPARE_SCALAR_FIELD(objectType);
1397  COMPARE_NODE_FIELD(relation);
1398  COMPARE_NODE_FIELD(object);
1399  COMPARE_NODE_FIELD(extname);
1400 
1401  return true;
1402 }
1403 
1404 static bool
1406 {
1407  COMPARE_SCALAR_FIELD(objectType);
1408  COMPARE_NODE_FIELD(relation);
1409  COMPARE_NODE_FIELD(object);
1410  COMPARE_STRING_FIELD(newschema);
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(newowner);
1423 
1424  return true;
1425 }
1426 
1427 static bool
1429 {
1430  COMPARE_NODE_FIELD(opername);
1432 
1433  return true;
1434 }
1435 
1436 static bool
1437 _equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
1438 {
1439  COMPARE_NODE_FIELD(relation);
1440  COMPARE_STRING_FIELD(rulename);
1441  COMPARE_NODE_FIELD(whereClause);
1442  COMPARE_SCALAR_FIELD(event);
1443  COMPARE_SCALAR_FIELD(instead);
1444  COMPARE_NODE_FIELD(actions);
1445  COMPARE_SCALAR_FIELD(replace);
1446 
1447  return true;
1448 }
1449 
1450 static bool
1452 {
1453  COMPARE_STRING_FIELD(conditionname);
1454  COMPARE_STRING_FIELD(payload);
1455 
1456  return true;
1457 }
1458 
1459 static bool
1461 {
1462  COMPARE_STRING_FIELD(conditionname);
1463 
1464  return true;
1465 }
1466 
1467 static bool
1469 {
1470  COMPARE_STRING_FIELD(conditionname);
1471 
1472  return true;
1473 }
1474 
1475 static bool
1477 {
1478  COMPARE_SCALAR_FIELD(kind);
1480  COMPARE_STRING_FIELD(gid);
1481 
1482  return true;
1483 }
1484 
1485 static bool
1487 {
1488  COMPARE_NODE_FIELD(typevar);
1489  COMPARE_NODE_FIELD(coldeflist);
1490 
1491  return true;
1492 }
1493 
1494 static bool
1496 {
1497  COMPARE_NODE_FIELD(typeName);
1498  COMPARE_NODE_FIELD(vals);
1499 
1500  return true;
1501 }
1502 
1503 static bool
1505 {
1506  COMPARE_NODE_FIELD(typeName);
1507  COMPARE_NODE_FIELD(params);
1508 
1509  return true;
1510 }
1511 
1512 static bool
1514 {
1515  COMPARE_NODE_FIELD(typeName);
1516  COMPARE_STRING_FIELD(oldVal);
1517  COMPARE_STRING_FIELD(newVal);
1518  COMPARE_STRING_FIELD(newValNeighbor);
1519  COMPARE_SCALAR_FIELD(newValIsAfter);
1520  COMPARE_SCALAR_FIELD(skipIfNewValExists);
1521 
1522  return true;
1523 }
1524 
1525 static bool
1526 _equalViewStmt(const ViewStmt *a, const ViewStmt *b)
1527 {
1528  COMPARE_NODE_FIELD(view);
1529  COMPARE_NODE_FIELD(aliases);
1530  COMPARE_NODE_FIELD(query);
1531  COMPARE_SCALAR_FIELD(replace);
1533  COMPARE_SCALAR_FIELD(withCheckOption);
1534 
1535  return true;
1536 }
1537 
1538 static bool
1539 _equalLoadStmt(const LoadStmt *a, const LoadStmt *b)
1540 {
1542 
1543  return true;
1544 }
1545 
1546 static bool
1548 {
1549  COMPARE_NODE_FIELD(domainname);
1550  COMPARE_NODE_FIELD(typeName);
1551  COMPARE_NODE_FIELD(collClause);
1552  COMPARE_NODE_FIELD(constraints);
1553 
1554  return true;
1555 }
1556 
1557 static bool
1559 {
1560  COMPARE_NODE_FIELD(opclassname);
1561  COMPARE_NODE_FIELD(opfamilyname);
1562  COMPARE_STRING_FIELD(amname);
1563  COMPARE_NODE_FIELD(datatype);
1564  COMPARE_NODE_FIELD(items);
1565  COMPARE_SCALAR_FIELD(isDefault);
1566 
1567  return true;
1568 }
1569 
1570 static bool
1572 {
1573  COMPARE_SCALAR_FIELD(itemtype);
1575  COMPARE_SCALAR_FIELD(number);
1576  COMPARE_NODE_FIELD(order_family);
1577  COMPARE_NODE_FIELD(class_args);
1578  COMPARE_NODE_FIELD(storedtype);
1579 
1580  return true;
1581 }
1582 
1583 static bool
1585 {
1586  COMPARE_NODE_FIELD(opfamilyname);
1587  COMPARE_STRING_FIELD(amname);
1588 
1589  return true;
1590 }
1591 
1592 static bool
1594 {
1595  COMPARE_NODE_FIELD(opfamilyname);
1596  COMPARE_STRING_FIELD(amname);
1597  COMPARE_SCALAR_FIELD(isDrop);
1598  COMPARE_NODE_FIELD(items);
1599 
1600  return true;
1601 }
1602 
1603 static bool
1605 {
1608 
1609  return true;
1610 }
1611 
1612 static bool
1614 {
1617 
1618  return true;
1619 }
1620 
1621 static bool
1623 {
1625  COMPARE_NODE_FIELD(setstmt);
1626 
1627  return true;
1628 }
1629 
1630 static bool
1632 {
1634  COMPARE_SCALAR_FIELD(missing_ok);
1635 
1636  return true;
1637 }
1638 
1639 static bool
1641 {
1643  COMPARE_NODE_FIELD(relation);
1644  COMPARE_NODE_FIELD(va_cols);
1645 
1646  return true;
1647 }
1648 
1649 static bool
1651 {
1652  COMPARE_NODE_FIELD(query);
1654 
1655  return true;
1656 }
1657 
1658 static bool
1660 {
1661  COMPARE_NODE_FIELD(query);
1662  COMPARE_NODE_FIELD(into);
1663  COMPARE_SCALAR_FIELD(relkind);
1664  COMPARE_SCALAR_FIELD(is_select_into);
1665  COMPARE_SCALAR_FIELD(if_not_exists);
1666 
1667  return true;
1668 }
1669 
1670 static bool
1672 {
1673  COMPARE_SCALAR_FIELD(concurrent);
1674  COMPARE_SCALAR_FIELD(skipData);
1675  COMPARE_NODE_FIELD(relation);
1676 
1677  return true;
1678 }
1679 
1680 static bool
1682 {
1683  COMPARE_SCALAR_FIELD(identity_type);
1685 
1686  return true;
1687 }
1688 
1689 static bool
1691 {
1692  COMPARE_NODE_FIELD(setstmt);
1693 
1694  return true;
1695 }
1696 
1697 
1698 static bool
1700 {
1701  COMPARE_NODE_FIELD(sequence);
1703  COMPARE_SCALAR_FIELD(ownerId);
1704  COMPARE_SCALAR_FIELD(if_not_exists);
1705 
1706  return true;
1707 }
1708 
1709 static bool
1711 {
1712  COMPARE_NODE_FIELD(sequence);
1714  COMPARE_SCALAR_FIELD(missing_ok);
1715 
1716  return true;
1717 }
1718 
1719 static bool
1721 {
1722  COMPARE_SCALAR_FIELD(kind);
1725  COMPARE_SCALAR_FIELD(is_local);
1726 
1727  return true;
1728 }
1729 
1730 static bool
1732 {
1734 
1735  return true;
1736 }
1737 
1738 static bool
1740 {
1741  COMPARE_SCALAR_FIELD(target);
1742 
1743  return true;
1744 }
1745 
1746 static bool
1748 {
1749  COMPARE_STRING_FIELD(tablespacename);
1750  COMPARE_NODE_FIELD(owner);
1751  COMPARE_STRING_FIELD(location);
1753 
1754  return true;
1755 }
1756 
1757 static bool
1759 {
1760  COMPARE_STRING_FIELD(tablespacename);
1761  COMPARE_SCALAR_FIELD(missing_ok);
1762 
1763  return true;
1764 }
1765 
1766 static bool
1768  const AlterTableSpaceOptionsStmt *b)
1769 {
1770  COMPARE_STRING_FIELD(tablespacename);
1772  COMPARE_SCALAR_FIELD(isReset);
1773 
1774  return true;
1775 }
1776 
1777 static bool
1779  const AlterTableMoveAllStmt *b)
1780 {
1781  COMPARE_STRING_FIELD(orig_tablespacename);
1782  COMPARE_SCALAR_FIELD(objtype);
1783  COMPARE_NODE_FIELD(roles);
1784  COMPARE_STRING_FIELD(new_tablespacename);
1785  COMPARE_SCALAR_FIELD(nowait);
1786 
1787  return true;
1788 }
1789 
1790 static bool
1792 {
1793  COMPARE_STRING_FIELD(extname);
1794  COMPARE_SCALAR_FIELD(if_not_exists);
1796 
1797  return true;
1798 }
1799 
1800 static bool
1802 {
1803  COMPARE_STRING_FIELD(extname);
1805 
1806  return true;
1807 }
1808 
1809 static bool
1811 {
1812  COMPARE_STRING_FIELD(extname);
1813  COMPARE_SCALAR_FIELD(action);
1814  COMPARE_SCALAR_FIELD(objtype);
1815  COMPARE_NODE_FIELD(object);
1816 
1817  return true;
1818 }
1819 
1820 static bool
1822 {
1823  COMPARE_STRING_FIELD(fdwname);
1824  COMPARE_NODE_FIELD(func_options);
1826 
1827  return true;
1828 }
1829 
1830 static bool
1832 {
1833  COMPARE_STRING_FIELD(fdwname);
1834  COMPARE_NODE_FIELD(func_options);
1836 
1837  return true;
1838 }
1839 
1840 static bool
1842 {
1843  COMPARE_STRING_FIELD(servername);
1844  COMPARE_STRING_FIELD(servertype);
1845  COMPARE_STRING_FIELD(version);
1846  COMPARE_STRING_FIELD(fdwname);
1848  COMPARE_SCALAR_FIELD(if_not_exists);
1849 
1850  return true;
1851 }
1852 
1853 static bool
1855 {
1856  COMPARE_STRING_FIELD(servername);
1857  COMPARE_STRING_FIELD(version);
1859  COMPARE_SCALAR_FIELD(has_version);
1860 
1861  return true;
1862 }
1863 
1864 static bool
1866 {
1868  COMPARE_STRING_FIELD(servername);
1870  COMPARE_SCALAR_FIELD(if_not_exists);
1871 
1872  return true;
1873 }
1874 
1875 static bool
1877 {
1879  COMPARE_STRING_FIELD(servername);
1881 
1882  return true;
1883 }
1884 
1885 static bool
1887 {
1889  COMPARE_STRING_FIELD(servername);
1890  COMPARE_SCALAR_FIELD(missing_ok);
1891 
1892  return true;
1893 }
1894 
1895 static bool
1897 {
1898  if (!_equalCreateStmt(&a->base, &b->base))
1899  return false;
1900 
1901  COMPARE_STRING_FIELD(servername);
1903 
1904  return true;
1905 }
1906 
1907 static bool
1909 {
1910  COMPARE_STRING_FIELD(server_name);
1911  COMPARE_STRING_FIELD(remote_schema);
1912  COMPARE_STRING_FIELD(local_schema);
1913  COMPARE_SCALAR_FIELD(list_type);
1914  COMPARE_NODE_FIELD(table_list);
1916 
1917  return true;
1918 }
1919 
1920 static bool
1922 {
1923  COMPARE_SCALAR_FIELD(replace);
1924  COMPARE_NODE_FIELD(type_name);
1925  COMPARE_STRING_FIELD(lang);
1926  COMPARE_NODE_FIELD(fromsql);
1927  COMPARE_NODE_FIELD(tosql);
1928 
1929  return true;
1930 }
1931 
1932 static bool
1934 {
1935  COMPARE_STRING_FIELD(amname);
1936  COMPARE_NODE_FIELD(handler_name);
1937  COMPARE_SCALAR_FIELD(amtype);
1938 
1939  return true;
1940 }
1941 
1942 static bool
1944 {
1945  COMPARE_STRING_FIELD(trigname);
1946  COMPARE_NODE_FIELD(relation);
1947  COMPARE_NODE_FIELD(funcname);
1949  COMPARE_SCALAR_FIELD(row);
1950  COMPARE_SCALAR_FIELD(timing);
1951  COMPARE_SCALAR_FIELD(events);
1952  COMPARE_NODE_FIELD(columns);
1953  COMPARE_NODE_FIELD(whenClause);
1954  COMPARE_SCALAR_FIELD(isconstraint);
1955  COMPARE_NODE_FIELD(transitionRels);
1956  COMPARE_SCALAR_FIELD(deferrable);
1957  COMPARE_SCALAR_FIELD(initdeferred);
1958  COMPARE_NODE_FIELD(constrrel);
1959 
1960  return true;
1961 }
1962 
1963 static bool
1965 {
1966  COMPARE_STRING_FIELD(trigname);
1967  COMPARE_STRING_FIELD(eventname);
1968  COMPARE_NODE_FIELD(whenclause);
1969  COMPARE_NODE_FIELD(funcname);
1970 
1971  return true;
1972 }
1973 
1974 static bool
1976 {
1977  COMPARE_STRING_FIELD(trigname);
1978  COMPARE_SCALAR_FIELD(tgenabled);
1979 
1980  return true;
1981 }
1982 
1983 static bool
1985 {
1986  COMPARE_SCALAR_FIELD(replace);
1987  COMPARE_STRING_FIELD(plname);
1988  COMPARE_NODE_FIELD(plhandler);
1989  COMPARE_NODE_FIELD(plinline);
1990  COMPARE_NODE_FIELD(plvalidator);
1991  COMPARE_SCALAR_FIELD(pltrusted);
1992 
1993  return true;
1994 }
1995 
1996 static bool
1998 {
1999  COMPARE_SCALAR_FIELD(stmt_type);
2000  COMPARE_STRING_FIELD(role);
2002 
2003  return true;
2004 }
2005 
2006 static bool
2008 {
2009  COMPARE_NODE_FIELD(role);
2011  COMPARE_SCALAR_FIELD(action);
2012 
2013  return true;
2014 }
2015 
2016 static bool
2018 {
2019  COMPARE_NODE_FIELD(role);
2020  COMPARE_STRING_FIELD(database);
2021  COMPARE_NODE_FIELD(setstmt);
2022 
2023  return true;
2024 }
2025 
2026 static bool
2028 {
2029  COMPARE_NODE_FIELD(roles);
2030  COMPARE_SCALAR_FIELD(missing_ok);
2031 
2032  return true;
2033 }
2034 
2035 static bool
2036 _equalLockStmt(const LockStmt *a, const LockStmt *b)
2037 {
2038  COMPARE_NODE_FIELD(relations);
2039  COMPARE_SCALAR_FIELD(mode);
2040  COMPARE_SCALAR_FIELD(nowait);
2041 
2042  return true;
2043 }
2044 
2045 static bool
2047 {
2048  COMPARE_NODE_FIELD(constraints);
2049  COMPARE_SCALAR_FIELD(deferred);
2050 
2051  return true;
2052 }
2053 
2054 static bool
2056 {
2057  COMPARE_SCALAR_FIELD(kind);
2058  COMPARE_NODE_FIELD(relation);
2061 
2062  return true;
2063 }
2064 
2065 static bool
2067 {
2068  COMPARE_STRING_FIELD(schemaname);
2069  COMPARE_NODE_FIELD(authrole);
2070  COMPARE_NODE_FIELD(schemaElts);
2071  COMPARE_SCALAR_FIELD(if_not_exists);
2072 
2073  return true;
2074 }
2075 
2076 static bool
2078 {
2079  COMPARE_NODE_FIELD(conversion_name);
2080  COMPARE_STRING_FIELD(for_encoding_name);
2081  COMPARE_STRING_FIELD(to_encoding_name);
2082  COMPARE_NODE_FIELD(func_name);
2083  COMPARE_SCALAR_FIELD(def);
2084 
2085  return true;
2086 }
2087 
2088 static bool
2090 {
2091  COMPARE_NODE_FIELD(sourcetype);
2092  COMPARE_NODE_FIELD(targettype);
2093  COMPARE_NODE_FIELD(func);
2094  COMPARE_SCALAR_FIELD(context);
2095  COMPARE_SCALAR_FIELD(inout);
2096 
2097  return true;
2098 }
2099 
2100 static bool
2102 {
2104  COMPARE_NODE_FIELD(argtypes);
2105  COMPARE_NODE_FIELD(query);
2106 
2107  return true;
2108 }
2109 
2110 static bool
2112 {
2114  COMPARE_NODE_FIELD(params);
2115 
2116  return true;
2117 }
2118 
2119 static bool
2121 {
2123 
2124  return true;
2125 }
2126 
2127 static bool
2129 {
2130  COMPARE_NODE_FIELD(roles);
2131  COMPARE_SCALAR_FIELD(behavior);
2132 
2133  return true;
2134 }
2135 
2136 static bool
2138 {
2139  COMPARE_NODE_FIELD(roles);
2140  COMPARE_NODE_FIELD(newrole);
2141 
2142  return true;
2143 }
2144 
2145 static bool
2147 {
2148  COMPARE_NODE_FIELD(dictname);
2150 
2151  return true;
2152 }
2153 
2154 static bool
2156  const AlterTSConfigurationStmt *b)
2157 {
2158  COMPARE_SCALAR_FIELD(kind);
2159  COMPARE_NODE_FIELD(cfgname);
2160  COMPARE_NODE_FIELD(tokentype);
2161  COMPARE_NODE_FIELD(dicts);
2162  COMPARE_SCALAR_FIELD(override);
2163  COMPARE_SCALAR_FIELD(replace);
2164  COMPARE_SCALAR_FIELD(missing_ok);
2165 
2166  return true;
2167 }
2168 
2169 static bool
2171  const CreatePublicationStmt *b)
2172 {
2173  COMPARE_STRING_FIELD(pubname);
2175  COMPARE_NODE_FIELD(tables);
2176  COMPARE_SCALAR_FIELD(for_all_tables);
2177 
2178  return true;
2179 }
2180 
2181 static bool
2183  const AlterPublicationStmt *b)
2184 {
2185  COMPARE_STRING_FIELD(pubname);
2187  COMPARE_NODE_FIELD(tables);
2188  COMPARE_SCALAR_FIELD(for_all_tables);
2189  COMPARE_SCALAR_FIELD(tableAction);
2190 
2191  return true;
2192 }
2193 
2194 static bool
2196  const CreateSubscriptionStmt *b)
2197 {
2198  COMPARE_STRING_FIELD(subname);
2199  COMPARE_STRING_FIELD(conninfo);
2200  COMPARE_NODE_FIELD(publication);
2202 
2203  return true;
2204 }
2205 
2206 static bool
2208  const AlterSubscriptionStmt *b)
2209 {
2210  COMPARE_SCALAR_FIELD(kind);
2211  COMPARE_STRING_FIELD(subname);
2212  COMPARE_STRING_FIELD(conninfo);
2213  COMPARE_NODE_FIELD(publication);
2215 
2216  return true;
2217 }
2218 
2219 static bool
2221  const DropSubscriptionStmt *b)
2222 {
2223  COMPARE_STRING_FIELD(subname);
2224  COMPARE_SCALAR_FIELD(drop_slot);
2225  COMPARE_SCALAR_FIELD(missing_ok);
2226 
2227  return true;
2228 }
2229 
2230 static bool
2232 {
2233  COMPARE_STRING_FIELD(policy_name);
2234  COMPARE_NODE_FIELD(table);
2235  COMPARE_STRING_FIELD(cmd_name);
2236  COMPARE_SCALAR_FIELD(permissive);
2237  COMPARE_NODE_FIELD(roles);
2238  COMPARE_NODE_FIELD(qual);
2239  COMPARE_NODE_FIELD(with_check);
2240 
2241  return true;
2242 }
2243 
2244 static bool
2246 {
2247  COMPARE_STRING_FIELD(policy_name);
2248  COMPARE_NODE_FIELD(table);
2249  COMPARE_NODE_FIELD(roles);
2250  COMPARE_NODE_FIELD(qual);
2251  COMPARE_NODE_FIELD(with_check);
2252 
2253  return true;
2254 }
2255 
2256 static bool
2257 _equalAExpr(const A_Expr *a, const A_Expr *b)
2258 {
2259  COMPARE_SCALAR_FIELD(kind);
2261  COMPARE_NODE_FIELD(lexpr);
2262  COMPARE_NODE_FIELD(rexpr);
2263  COMPARE_LOCATION_FIELD(location);
2264 
2265  return true;
2266 }
2267 
2268 static bool
2270 {
2271  COMPARE_NODE_FIELD(fields);
2272  COMPARE_LOCATION_FIELD(location);
2273 
2274  return true;
2275 }
2276 
2277 static bool
2278 _equalParamRef(const ParamRef *a, const ParamRef *b)
2279 {
2280  COMPARE_SCALAR_FIELD(number);
2281  COMPARE_LOCATION_FIELD(location);
2282 
2283  return true;
2284 }
2285 
2286 static bool
2287 _equalAConst(const A_Const *a, const A_Const *b)
2288 {
2289  if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
2290  return false;
2291  COMPARE_LOCATION_FIELD(location);
2292 
2293  return true;
2294 }
2295 
2296 static bool
2297 _equalFuncCall(const FuncCall *a, const FuncCall *b)
2298 {
2299  COMPARE_NODE_FIELD(funcname);
2301  COMPARE_NODE_FIELD(agg_order);
2302  COMPARE_NODE_FIELD(agg_filter);
2303  COMPARE_SCALAR_FIELD(agg_within_group);
2304  COMPARE_SCALAR_FIELD(agg_star);
2305  COMPARE_SCALAR_FIELD(agg_distinct);
2306  COMPARE_SCALAR_FIELD(func_variadic);
2307  COMPARE_NODE_FIELD(over);
2308  COMPARE_LOCATION_FIELD(location);
2309 
2310  return true;
2311 }
2312 
2313 static bool
2314 _equalAStar(const A_Star *a, const A_Star *b)
2315 {
2316  return true;
2317 }
2318 
2319 static bool
2321 {
2322  COMPARE_SCALAR_FIELD(is_slice);
2323  COMPARE_NODE_FIELD(lidx);
2324  COMPARE_NODE_FIELD(uidx);
2325 
2326  return true;
2327 }
2328 
2329 static bool
2331 {
2333  COMPARE_NODE_FIELD(indirection);
2334 
2335  return true;
2336 }
2337 
2338 static bool
2340 {
2341  COMPARE_NODE_FIELD(elements);
2342  COMPARE_LOCATION_FIELD(location);
2343 
2344  return true;
2345 }
2346 
2347 static bool
2349 {
2351  COMPARE_NODE_FIELD(indirection);
2353  COMPARE_LOCATION_FIELD(location);
2354 
2355  return true;
2356 }
2357 
2358 static bool
2360 {
2361  COMPARE_NODE_FIELD(source);
2362  COMPARE_SCALAR_FIELD(colno);
2363  COMPARE_SCALAR_FIELD(ncolumns);
2364 
2365  return true;
2366 }
2367 
2368 static bool
2369 _equalTypeName(const TypeName *a, const TypeName *b)
2370 {
2371  COMPARE_NODE_FIELD(names);
2372  COMPARE_SCALAR_FIELD(typeOid);
2373  COMPARE_SCALAR_FIELD(setof);
2374  COMPARE_SCALAR_FIELD(pct_type);
2375  COMPARE_NODE_FIELD(typmods);
2376  COMPARE_SCALAR_FIELD(typemod);
2377  COMPARE_NODE_FIELD(arrayBounds);
2378  COMPARE_LOCATION_FIELD(location);
2379 
2380  return true;
2381 }
2382 
2383 static bool
2384 _equalTypeCast(const TypeCast *a, const TypeCast *b)
2385 {
2387  COMPARE_NODE_FIELD(typeName);
2388  COMPARE_LOCATION_FIELD(location);
2389 
2390  return true;
2391 }
2392 
2393 static bool
2395 {
2397  COMPARE_NODE_FIELD(collname);
2398  COMPARE_LOCATION_FIELD(location);
2399 
2400  return true;
2401 }
2402 
2403 static bool
2404 _equalSortBy(const SortBy *a, const SortBy *b)
2405 {
2406  COMPARE_NODE_FIELD(node);
2407  COMPARE_SCALAR_FIELD(sortby_dir);
2408  COMPARE_SCALAR_FIELD(sortby_nulls);
2409  COMPARE_NODE_FIELD(useOp);
2410  COMPARE_LOCATION_FIELD(location);
2411 
2412  return true;
2413 }
2414 
2415 static bool
2417 {
2419  COMPARE_STRING_FIELD(refname);
2420  COMPARE_NODE_FIELD(partitionClause);
2421  COMPARE_NODE_FIELD(orderClause);
2422  COMPARE_SCALAR_FIELD(frameOptions);
2423  COMPARE_NODE_FIELD(startOffset);
2424  COMPARE_NODE_FIELD(endOffset);
2425  COMPARE_LOCATION_FIELD(location);
2426 
2427  return true;
2428 }
2429 
2430 static bool
2432 {
2433  COMPARE_SCALAR_FIELD(lateral);
2434  COMPARE_NODE_FIELD(subquery);
2435  COMPARE_NODE_FIELD(alias);
2436 
2437  return true;
2438 }
2439 
2440 static bool
2442 {
2443  COMPARE_SCALAR_FIELD(lateral);
2444  COMPARE_SCALAR_FIELD(ordinality);
2445  COMPARE_SCALAR_FIELD(is_rowsfrom);
2447  COMPARE_NODE_FIELD(alias);
2448  COMPARE_NODE_FIELD(coldeflist);
2449 
2450  return true;
2451 }
2452 
2453 static bool
2455 {
2456  COMPARE_NODE_FIELD(relation);
2457  COMPARE_NODE_FIELD(method);
2459  COMPARE_NODE_FIELD(repeatable);
2460  COMPARE_LOCATION_FIELD(location);
2461 
2462  return true;
2463 }
2464 
2465 static bool
2467 {
2468  COMPARE_SCALAR_FIELD(lateral);
2469  COMPARE_NODE_FIELD(docexpr);
2470  COMPARE_NODE_FIELD(rowexpr);
2471  COMPARE_NODE_FIELD(namespaces);
2472  COMPARE_NODE_FIELD(columns);
2473  COMPARE_NODE_FIELD(alias);
2474  COMPARE_LOCATION_FIELD(location);
2475 
2476  return true;
2477 }
2478 
2479 static bool
2481 {
2482  COMPARE_STRING_FIELD(colname);
2483  COMPARE_NODE_FIELD(typeName);
2484  COMPARE_SCALAR_FIELD(for_ordinality);
2485  COMPARE_NODE_FIELD(typeName);
2486  COMPARE_SCALAR_FIELD(is_not_null);
2487  COMPARE_NODE_FIELD(colexpr);
2488  COMPARE_NODE_FIELD(coldefexpr);
2489  COMPARE_LOCATION_FIELD(location);
2490 
2491  return true;
2492 }
2493 
2494 
2495 static bool
2497 {
2499  COMPARE_NODE_FIELD(expr);
2500  COMPARE_STRING_FIELD(indexcolname);
2501  COMPARE_NODE_FIELD(collation);
2502  COMPARE_NODE_FIELD(opclass);
2503  COMPARE_SCALAR_FIELD(ordering);
2504  COMPARE_SCALAR_FIELD(nulls_ordering);
2505 
2506  return true;
2507 }
2508 
2509 static bool
2511 {
2512  COMPARE_STRING_FIELD(colname);
2513  COMPARE_NODE_FIELD(typeName);
2514  COMPARE_SCALAR_FIELD(inhcount);
2515  COMPARE_SCALAR_FIELD(is_local);
2516  COMPARE_SCALAR_FIELD(is_not_null);
2517  COMPARE_SCALAR_FIELD(is_from_type);
2518  COMPARE_SCALAR_FIELD(storage);
2519  COMPARE_NODE_FIELD(raw_default);
2520  COMPARE_NODE_FIELD(cooked_default);
2521  COMPARE_NODE_FIELD(collClause);
2522  COMPARE_SCALAR_FIELD(collOid);
2523  COMPARE_NODE_FIELD(constraints);
2524  COMPARE_NODE_FIELD(fdwoptions);
2525  COMPARE_LOCATION_FIELD(location);
2526 
2527  return true;
2528 }
2529 
2530 static bool
2532 {
2533  COMPARE_SCALAR_FIELD(contype);
2534  COMPARE_STRING_FIELD(conname);
2535  COMPARE_SCALAR_FIELD(deferrable);
2536  COMPARE_SCALAR_FIELD(initdeferred);
2537  COMPARE_LOCATION_FIELD(location);
2538  COMPARE_SCALAR_FIELD(is_no_inherit);
2539  COMPARE_NODE_FIELD(raw_expr);
2540  COMPARE_STRING_FIELD(cooked_expr);
2541  COMPARE_NODE_FIELD(keys);
2542  COMPARE_NODE_FIELD(exclusions);
2544  COMPARE_STRING_FIELD(indexname);
2545  COMPARE_STRING_FIELD(indexspace);
2546  COMPARE_STRING_FIELD(access_method);
2547  COMPARE_NODE_FIELD(where_clause);
2548  COMPARE_NODE_FIELD(pktable);
2549  COMPARE_NODE_FIELD(fk_attrs);
2550  COMPARE_NODE_FIELD(pk_attrs);
2551  COMPARE_SCALAR_FIELD(fk_matchtype);
2552  COMPARE_SCALAR_FIELD(fk_upd_action);
2553  COMPARE_SCALAR_FIELD(fk_del_action);
2554  COMPARE_NODE_FIELD(old_conpfeqop);
2555  COMPARE_SCALAR_FIELD(old_pktable_oid);
2556  COMPARE_SCALAR_FIELD(skip_validation);
2557  COMPARE_SCALAR_FIELD(initially_valid);
2558 
2559  return true;
2560 }
2561 
2562 static bool
2563 _equalDefElem(const DefElem *a, const DefElem *b)
2564 {
2565  COMPARE_STRING_FIELD(defnamespace);
2566  COMPARE_STRING_FIELD(defname);
2568  COMPARE_SCALAR_FIELD(defaction);
2569  COMPARE_LOCATION_FIELD(location);
2570 
2571  return true;
2572 }
2573 
2574 static bool
2576 {
2577  COMPARE_NODE_FIELD(lockedRels);
2578  COMPARE_SCALAR_FIELD(strength);
2579  COMPARE_SCALAR_FIELD(waitPolicy);
2580  COMPARE_LOCATION_FIELD(location);
2581 
2582  return true;
2583 }
2584 
2585 static bool
2587 {
2588  COMPARE_SCALAR_FIELD(rtekind);
2589  COMPARE_SCALAR_FIELD(relid);
2590  COMPARE_SCALAR_FIELD(relkind);
2591  COMPARE_NODE_FIELD(tablesample);
2592  COMPARE_NODE_FIELD(subquery);
2593  COMPARE_SCALAR_FIELD(security_barrier);
2594  COMPARE_SCALAR_FIELD(jointype);
2595  COMPARE_NODE_FIELD(joinaliasvars);
2597  COMPARE_NODE_FIELD(tablefunc);
2598  COMPARE_SCALAR_FIELD(funcordinality);
2599  COMPARE_NODE_FIELD(values_lists);
2600  COMPARE_STRING_FIELD(ctename);
2601  COMPARE_SCALAR_FIELD(ctelevelsup);
2602  COMPARE_SCALAR_FIELD(self_reference);
2603  COMPARE_NODE_FIELD(coltypes);
2604  COMPARE_NODE_FIELD(coltypmods);
2605  COMPARE_NODE_FIELD(colcollations);
2606  COMPARE_NODE_FIELD(alias);
2607  COMPARE_NODE_FIELD(eref);
2608  COMPARE_SCALAR_FIELD(lateral);
2609  COMPARE_SCALAR_FIELD(inh);
2610  COMPARE_SCALAR_FIELD(inFromCl);
2611  COMPARE_SCALAR_FIELD(requiredPerms);
2612  COMPARE_SCALAR_FIELD(checkAsUser);
2613  COMPARE_BITMAPSET_FIELD(selectedCols);
2614  COMPARE_BITMAPSET_FIELD(insertedCols);
2615  COMPARE_BITMAPSET_FIELD(updatedCols);
2616  COMPARE_NODE_FIELD(securityQuals);
2617 
2618  return true;
2619 }
2620 
2621 static bool
2623 {
2624  COMPARE_NODE_FIELD(funcexpr);
2625  COMPARE_SCALAR_FIELD(funccolcount);
2626  COMPARE_NODE_FIELD(funccolnames);
2627  COMPARE_NODE_FIELD(funccoltypes);
2628  COMPARE_NODE_FIELD(funccoltypmods);
2629  COMPARE_NODE_FIELD(funccolcollations);
2630  COMPARE_BITMAPSET_FIELD(funcparams);
2631 
2632  return true;
2633 }
2634 
2635 static bool
2637 {
2638  COMPARE_SCALAR_FIELD(tsmhandler);
2640  COMPARE_NODE_FIELD(repeatable);
2641 
2642  return true;
2643 }
2644 
2645 static bool
2647 {
2648  COMPARE_SCALAR_FIELD(kind);
2649  COMPARE_STRING_FIELD(relname);
2650  COMPARE_STRING_FIELD(polname);
2651  COMPARE_NODE_FIELD(qual);
2652  COMPARE_SCALAR_FIELD(cascaded);
2653 
2654  return true;
2655 }
2656 
2657 static bool
2659 {
2660  COMPARE_SCALAR_FIELD(tleSortGroupRef);
2661  COMPARE_SCALAR_FIELD(eqop);
2662  COMPARE_SCALAR_FIELD(sortop);
2663  COMPARE_SCALAR_FIELD(nulls_first);
2664  COMPARE_SCALAR_FIELD(hashable);
2665 
2666  return true;
2667 }
2668 
2669 static bool
2671 {
2672  COMPARE_SCALAR_FIELD(kind);
2673  COMPARE_NODE_FIELD(content);
2674  COMPARE_LOCATION_FIELD(location);
2675 
2676  return true;
2677 }
2678 
2679 static bool
2681 {
2683  COMPARE_STRING_FIELD(refname);
2684  COMPARE_NODE_FIELD(partitionClause);
2685  COMPARE_NODE_FIELD(orderClause);
2686  COMPARE_SCALAR_FIELD(frameOptions);
2687  COMPARE_NODE_FIELD(startOffset);
2688  COMPARE_NODE_FIELD(endOffset);
2689  COMPARE_SCALAR_FIELD(winref);
2690  COMPARE_SCALAR_FIELD(copiedOrder);
2691 
2692  return true;
2693 }
2694 
2695 static bool
2697 {
2698  COMPARE_SCALAR_FIELD(rti);
2699  COMPARE_SCALAR_FIELD(strength);
2700  COMPARE_SCALAR_FIELD(waitPolicy);
2701  COMPARE_SCALAR_FIELD(pushedDown);
2702 
2703  return true;
2704 }
2705 
2706 static bool
2708 {
2709  COMPARE_NODE_FIELD(ctes);
2710  COMPARE_SCALAR_FIELD(recursive);
2711  COMPARE_LOCATION_FIELD(location);
2712 
2713  return true;
2714 }
2715 
2716 static bool
2718 {
2719  COMPARE_NODE_FIELD(indexElems);
2720  COMPARE_NODE_FIELD(whereClause);
2721  COMPARE_STRING_FIELD(conname);
2722  COMPARE_LOCATION_FIELD(location);
2723 
2724  return true;
2725 }
2726 
2727 static bool
2729 {
2730  COMPARE_SCALAR_FIELD(action);
2731  COMPARE_NODE_FIELD(infer);
2732  COMPARE_NODE_FIELD(targetList);
2733  COMPARE_NODE_FIELD(whereClause);
2734  COMPARE_LOCATION_FIELD(location);
2735 
2736  return true;
2737 }
2738 
2739 static bool
2741 {
2742  COMPARE_STRING_FIELD(ctename);
2743  COMPARE_NODE_FIELD(aliascolnames);
2744  COMPARE_NODE_FIELD(ctequery);
2745  COMPARE_LOCATION_FIELD(location);
2746  COMPARE_SCALAR_FIELD(cterecursive);
2747  COMPARE_SCALAR_FIELD(cterefcount);
2748  COMPARE_NODE_FIELD(ctecolnames);
2749  COMPARE_NODE_FIELD(ctecoltypes);
2750  COMPARE_NODE_FIELD(ctecoltypmods);
2751  COMPARE_NODE_FIELD(ctecolcollations);
2752 
2753  return true;
2754 }
2755 
2756 static bool
2758 {
2760  COMPARE_NODE_FIELD(expr);
2761  COMPARE_NODE_FIELD(typeName);
2762  COMPARE_LOCATION_FIELD(location);
2763 
2764  return true;
2765 }
2766 
2767 static bool
2768 _equalRoleSpec(const RoleSpec *a, const RoleSpec *b)
2769 {
2770  COMPARE_SCALAR_FIELD(roletype);
2771  COMPARE_STRING_FIELD(rolename);
2772  COMPARE_LOCATION_FIELD(location);
2773 
2774  return true;
2775 }
2776 
2777 static bool
2779 {
2781  COMPARE_SCALAR_FIELD(isNew);
2782  COMPARE_SCALAR_FIELD(isTable);
2783 
2784  return true;
2785 }
2786 
2787 static bool
2789 {
2790  COMPARE_STRING_FIELD(strategy);
2791  COMPARE_NODE_FIELD(partParams);
2792  COMPARE_LOCATION_FIELD(location);
2793 
2794  return true;
2795 }
2796 
2797 static bool
2799 {
2801  COMPARE_NODE_FIELD(expr);
2802  COMPARE_NODE_FIELD(collation);
2803  COMPARE_NODE_FIELD(opclass);
2804  COMPARE_LOCATION_FIELD(location);
2805 
2806  return true;
2807 }
2808 
2809 static bool
2811 {
2812  COMPARE_SCALAR_FIELD(strategy);
2813  COMPARE_NODE_FIELD(listdatums);
2814  COMPARE_NODE_FIELD(lowerdatums);
2815  COMPARE_NODE_FIELD(upperdatums);
2816  COMPARE_LOCATION_FIELD(location);
2817 
2818  return true;
2819 }
2820 
2821 static bool
2823 {
2824  COMPARE_SCALAR_FIELD(infinite);
2826  COMPARE_LOCATION_FIELD(location);
2827 
2828  return true;
2829 }
2830 
2831 static bool
2833 {
2835  COMPARE_NODE_FIELD(bound);
2836 
2837  return true;
2838 }
2839 
2840 /*
2841  * Stuff from pg_list.h
2842  */
2843 
2844 static bool
2845 _equalList(const List *a, const List *b)
2846 {
2847  const ListCell *item_a;
2848  const ListCell *item_b;
2849 
2850  /*
2851  * Try to reject by simple scalar checks before grovelling through all the
2852  * list elements...
2853  */
2854  COMPARE_SCALAR_FIELD(type);
2856 
2857  /*
2858  * We place the switch outside the loop for the sake of efficiency; this
2859  * may not be worth doing...
2860  */
2861  switch (a->type)
2862  {
2863  case T_List:
2864  forboth(item_a, a, item_b, b)
2865  {
2866  if (!equal(lfirst(item_a), lfirst(item_b)))
2867  return false;
2868  }
2869  break;
2870  case T_IntList:
2871  forboth(item_a, a, item_b, b)
2872  {
2873  if (lfirst_int(item_a) != lfirst_int(item_b))
2874  return false;
2875  }
2876  break;
2877  case T_OidList:
2878  forboth(item_a, a, item_b, b)
2879  {
2880  if (lfirst_oid(item_a) != lfirst_oid(item_b))
2881  return false;
2882  }
2883  break;
2884  default:
2885  elog(ERROR, "unrecognized list node type: %d",
2886  (int) a->type);
2887  return false; /* keep compiler quiet */
2888  }
2889 
2890  /*
2891  * If we got here, we should have run out of elements of both lists
2892  */
2893  Assert(item_a == NULL);
2894  Assert(item_b == NULL);
2895 
2896  return true;
2897 }
2898 
2899 /*
2900  * Stuff from value.h
2901  */
2902 
2903 static bool
2904 _equalValue(const Value *a, const Value *b)
2905 {
2906  COMPARE_SCALAR_FIELD(type);
2907 
2908  switch (a->type)
2909  {
2910  case T_Integer:
2911  COMPARE_SCALAR_FIELD(val.ival);
2912  break;
2913  case T_Float:
2914  case T_String:
2915  case T_BitString:
2917  break;
2918  case T_Null:
2919  /* nothing to do */
2920  break;
2921  default:
2922  elog(ERROR, "unrecognized node type: %d", (int) a->type);
2923  break;
2924  }
2925 
2926  return true;
2927 }
2928 
2929 /*
2930  * equal
2931  * returns whether two nodes are equal
2932  */
2933 bool
2934 equal(const void *a, const void *b)
2935 {
2936  bool retval;
2937 
2938  if (a == b)
2939  return true;
2940 
2941  /*
2942  * note that a!=b, so only one of them can be NULL
2943  */
2944  if (a == NULL || b == NULL)
2945  return false;
2946 
2947  /*
2948  * are they the same type of nodes?
2949  */
2950  if (nodeTag(a) != nodeTag(b))
2951  return false;
2952 
2953  switch (nodeTag(a))
2954  {
2955  /*
2956  * PRIMITIVE NODES
2957  */
2958  case T_Alias:
2959  retval = _equalAlias(a, b);
2960  break;
2961  case T_RangeVar:
2962  retval = _equalRangeVar(a, b);
2963  break;
2964  case T_TableFunc:
2965  retval = _equalTableFunc(a, b);
2966  break;
2967  case T_IntoClause:
2968  retval = _equalIntoClause(a, b);
2969  break;
2970  case T_Var:
2971  retval = _equalVar(a, b);
2972  break;
2973  case T_Const:
2974  retval = _equalConst(a, b);
2975  break;
2976  case T_Param:
2977  retval = _equalParam(a, b);
2978  break;
2979  case T_Aggref:
2980  retval = _equalAggref(a, b);
2981  break;
2982  case T_GroupingFunc:
2983  retval = _equalGroupingFunc(a, b);
2984  break;
2985  case T_WindowFunc:
2986  retval = _equalWindowFunc(a, b);
2987  break;
2988  case T_ArrayRef:
2989  retval = _equalArrayRef(a, b);
2990  break;
2991  case T_FuncExpr:
2992  retval = _equalFuncExpr(a, b);
2993  break;
2994  case T_NamedArgExpr:
2995  retval = _equalNamedArgExpr(a, b);
2996  break;
2997  case T_OpExpr:
2998  retval = _equalOpExpr(a, b);
2999  break;
3000  case T_DistinctExpr:
3001  retval = _equalDistinctExpr(a, b);
3002  break;
3003  case T_NullIfExpr:
3004  retval = _equalNullIfExpr(a, b);
3005  break;
3006  case T_ScalarArrayOpExpr:
3007  retval = _equalScalarArrayOpExpr(a, b);
3008  break;
3009  case T_BoolExpr:
3010  retval = _equalBoolExpr(a, b);
3011  break;
3012  case T_SubLink:
3013  retval = _equalSubLink(a, b);
3014  break;
3015  case T_SubPlan:
3016  retval = _equalSubPlan(a, b);
3017  break;
3018  case T_AlternativeSubPlan:
3019  retval = _equalAlternativeSubPlan(a, b);
3020  break;
3021  case T_FieldSelect:
3022  retval = _equalFieldSelect(a, b);
3023  break;
3024  case T_FieldStore:
3025  retval = _equalFieldStore(a, b);
3026  break;
3027  case T_RelabelType:
3028  retval = _equalRelabelType(a, b);
3029  break;
3030  case T_CoerceViaIO:
3031  retval = _equalCoerceViaIO(a, b);
3032  break;
3033  case T_ArrayCoerceExpr:
3034  retval = _equalArrayCoerceExpr(a, b);
3035  break;
3036  case T_ConvertRowtypeExpr:
3037  retval = _equalConvertRowtypeExpr(a, b);
3038  break;
3039  case T_CollateExpr:
3040  retval = _equalCollateExpr(a, b);
3041  break;
3042  case T_CaseExpr:
3043  retval = _equalCaseExpr(a, b);
3044  break;
3045  case T_CaseWhen:
3046  retval = _equalCaseWhen(a, b);
3047  break;
3048  case T_CaseTestExpr:
3049  retval = _equalCaseTestExpr(a, b);
3050  break;
3051  case T_ArrayExpr:
3052  retval = _equalArrayExpr(a, b);
3053  break;
3054  case T_RowExpr:
3055  retval = _equalRowExpr(a, b);
3056  break;
3057  case T_RowCompareExpr:
3058  retval = _equalRowCompareExpr(a, b);
3059  break;
3060  case T_CoalesceExpr:
3061  retval = _equalCoalesceExpr(a, b);
3062  break;
3063  case T_MinMaxExpr:
3064  retval = _equalMinMaxExpr(a, b);
3065  break;
3066  case T_SQLValueFunction:
3067  retval = _equalSQLValueFunction(a, b);
3068  break;
3069  case T_XmlExpr:
3070  retval = _equalXmlExpr(a, b);
3071  break;
3072  case T_NullTest:
3073  retval = _equalNullTest(a, b);
3074  break;
3075  case T_BooleanTest:
3076  retval = _equalBooleanTest(a, b);
3077  break;
3078  case T_CoerceToDomain:
3079  retval = _equalCoerceToDomain(a, b);
3080  break;
3081  case T_CoerceToDomainValue:
3082  retval = _equalCoerceToDomainValue(a, b);
3083  break;
3084  case T_SetToDefault:
3085  retval = _equalSetToDefault(a, b);
3086  break;
3087  case T_CurrentOfExpr:
3088  retval = _equalCurrentOfExpr(a, b);
3089  break;
3090  case T_InferenceElem:
3091  retval = _equalInferenceElem(a, b);
3092  break;
3093  case T_TargetEntry:
3094  retval = _equalTargetEntry(a, b);
3095  break;
3096  case T_RangeTblRef:
3097  retval = _equalRangeTblRef(a, b);
3098  break;
3099  case T_FromExpr:
3100  retval = _equalFromExpr(a, b);
3101  break;
3102  case T_OnConflictExpr:
3103  retval = _equalOnConflictExpr(a, b);
3104  break;
3105  case T_JoinExpr:
3106  retval = _equalJoinExpr(a, b);
3107  break;
3108 
3109  /*
3110  * RELATION NODES
3111  */
3112  case T_PathKey:
3113  retval = _equalPathKey(a, b);
3114  break;
3115  case T_RestrictInfo:
3116  retval = _equalRestrictInfo(a, b);
3117  break;
3118  case T_PlaceHolderVar:
3119  retval = _equalPlaceHolderVar(a, b);
3120  break;
3121  case T_SpecialJoinInfo:
3122  retval = _equalSpecialJoinInfo(a, b);
3123  break;
3124  case T_AppendRelInfo:
3125  retval = _equalAppendRelInfo(a, b);
3126  break;
3128  retval = _equalPartitionedChildRelInfo(a, b);
3129  break;
3130  case T_PlaceHolderInfo:
3131  retval = _equalPlaceHolderInfo(a, b);
3132  break;
3133 
3134  case T_List:
3135  case T_IntList:
3136  case T_OidList:
3137  retval = _equalList(a, b);
3138  break;
3139 
3140  case T_Integer:
3141  case T_Float:
3142  case T_String:
3143  case T_BitString:
3144  case T_Null:
3145  retval = _equalValue(a, b);
3146  break;
3147 
3148  /*
3149  * EXTENSIBLE NODES
3150  */
3151  case T_ExtensibleNode:
3152  retval = _equalExtensibleNode(a, b);
3153  break;
3154 
3155  /*
3156  * PARSE NODES
3157  */
3158  case T_Query:
3159  retval = _equalQuery(a, b);
3160  break;
3161  case T_RawStmt:
3162  retval = _equalRawStmt(a, b);
3163  break;
3164  case T_InsertStmt:
3165  retval = _equalInsertStmt(a, b);
3166  break;
3167  case T_DeleteStmt:
3168  retval = _equalDeleteStmt(a, b);
3169  break;
3170  case T_UpdateStmt:
3171  retval = _equalUpdateStmt(a, b);
3172  break;
3173  case T_SelectStmt:
3174  retval = _equalSelectStmt(a, b);
3175  break;
3176  case T_SetOperationStmt:
3177  retval = _equalSetOperationStmt(a, b);
3178  break;
3179  case T_AlterTableStmt:
3180  retval = _equalAlterTableStmt(a, b);
3181  break;
3182  case T_AlterTableCmd:
3183  retval = _equalAlterTableCmd(a, b);
3184  break;
3185  case T_AlterCollationStmt:
3186  retval = _equalAlterCollationStmt(a, b);
3187  break;
3188  case T_AlterDomainStmt:
3189  retval = _equalAlterDomainStmt(a, b);
3190  break;
3191  case T_GrantStmt:
3192  retval = _equalGrantStmt(a, b);
3193  break;
3194  case T_GrantRoleStmt:
3195  retval = _equalGrantRoleStmt(a, b);
3196  break;
3198  retval = _equalAlterDefaultPrivilegesStmt(a, b);
3199  break;
3200  case T_DeclareCursorStmt:
3201  retval = _equalDeclareCursorStmt(a, b);
3202  break;
3203  case T_ClosePortalStmt:
3204  retval = _equalClosePortalStmt(a, b);
3205  break;
3206  case T_ClusterStmt:
3207  retval = _equalClusterStmt(a, b);
3208  break;
3209  case T_CopyStmt:
3210  retval = _equalCopyStmt(a, b);
3211  break;
3212  case T_CreateStmt:
3213  retval = _equalCreateStmt(a, b);
3214  break;
3215  case T_TableLikeClause:
3216  retval = _equalTableLikeClause(a, b);
3217  break;
3218  case T_DefineStmt:
3219  retval = _equalDefineStmt(a, b);
3220  break;
3221  case T_DropStmt:
3222  retval = _equalDropStmt(a, b);
3223  break;
3224  case T_TruncateStmt:
3225  retval = _equalTruncateStmt(a, b);
3226  break;
3227  case T_CommentStmt:
3228  retval = _equalCommentStmt(a, b);
3229  break;
3230  case T_SecLabelStmt:
3231  retval = _equalSecLabelStmt(a, b);
3232  break;
3233  case T_FetchStmt:
3234  retval = _equalFetchStmt(a, b);
3235  break;
3236  case T_IndexStmt:
3237  retval = _equalIndexStmt(a, b);
3238  break;
3239  case T_CreateFunctionStmt:
3240  retval = _equalCreateFunctionStmt(a, b);
3241  break;
3242  case T_FunctionParameter:
3243  retval = _equalFunctionParameter(a, b);
3244  break;
3245  case T_AlterFunctionStmt:
3246  retval = _equalAlterFunctionStmt(a, b);
3247  break;
3248  case T_DoStmt:
3249  retval = _equalDoStmt(a, b);
3250  break;
3251  case T_RenameStmt:
3252  retval = _equalRenameStmt(a, b);
3253  break;
3255  retval = _equalAlterObjectDependsStmt(a, b);
3256  break;
3258  retval = _equalAlterObjectSchemaStmt(a, b);
3259  break;
3260  case T_AlterOwnerStmt:
3261  retval = _equalAlterOwnerStmt(a, b);
3262  break;
3263  case T_AlterOperatorStmt:
3264  retval = _equalAlterOperatorStmt(a, b);
3265  break;
3266  case T_RuleStmt:
3267  retval = _equalRuleStmt(a, b);
3268  break;
3269  case T_NotifyStmt:
3270  retval = _equalNotifyStmt(a, b);
3271  break;
3272  case T_ListenStmt:
3273  retval = _equalListenStmt(a, b);
3274  break;
3275  case T_UnlistenStmt:
3276  retval = _equalUnlistenStmt(a, b);
3277  break;
3278  case T_TransactionStmt:
3279  retval = _equalTransactionStmt(a, b);
3280  break;
3281  case T_CompositeTypeStmt:
3282  retval = _equalCompositeTypeStmt(a, b);
3283  break;
3284  case T_CreateEnumStmt:
3285  retval = _equalCreateEnumStmt(a, b);
3286  break;
3287  case T_CreateRangeStmt:
3288  retval = _equalCreateRangeStmt(a, b);
3289  break;
3290  case T_AlterEnumStmt:
3291  retval = _equalAlterEnumStmt(a, b);
3292  break;
3293  case T_ViewStmt:
3294  retval = _equalViewStmt(a, b);
3295  break;
3296  case T_LoadStmt:
3297  retval = _equalLoadStmt(a, b);
3298  break;
3299  case T_CreateDomainStmt:
3300  retval = _equalCreateDomainStmt(a, b);
3301  break;
3302  case T_CreateOpClassStmt:
3303  retval = _equalCreateOpClassStmt(a, b);
3304  break;
3305  case T_CreateOpClassItem:
3306  retval = _equalCreateOpClassItem(a, b);
3307  break;
3308  case T_CreateOpFamilyStmt:
3309  retval = _equalCreateOpFamilyStmt(a, b);
3310  break;
3311  case T_AlterOpFamilyStmt:
3312  retval = _equalAlterOpFamilyStmt(a, b);
3313  break;
3314  case T_CreatedbStmt:
3315  retval = _equalCreatedbStmt(a, b);
3316  break;
3317  case T_AlterDatabaseStmt:
3318  retval = _equalAlterDatabaseStmt(a, b);
3319  break;
3321  retval = _equalAlterDatabaseSetStmt(a, b);
3322  break;
3323  case T_DropdbStmt:
3324  retval = _equalDropdbStmt(a, b);
3325  break;
3326  case T_VacuumStmt:
3327  retval = _equalVacuumStmt(a, b);
3328  break;
3329  case T_ExplainStmt:
3330  retval = _equalExplainStmt(a, b);
3331  break;
3332  case T_CreateTableAsStmt:
3333  retval = _equalCreateTableAsStmt(a, b);
3334  break;
3335  case T_RefreshMatViewStmt:
3336  retval = _equalRefreshMatViewStmt(a, b);
3337  break;
3338  case T_ReplicaIdentityStmt:
3339  retval = _equalReplicaIdentityStmt(a, b);
3340  break;
3341  case T_AlterSystemStmt:
3342  retval = _equalAlterSystemStmt(a, b);
3343  break;
3344  case T_CreateSeqStmt:
3345  retval = _equalCreateSeqStmt(a, b);
3346  break;
3347  case T_AlterSeqStmt:
3348  retval = _equalAlterSeqStmt(a, b);
3349  break;
3350  case T_VariableSetStmt:
3351  retval = _equalVariableSetStmt(a, b);
3352  break;
3353  case T_VariableShowStmt:
3354  retval = _equalVariableShowStmt(a, b);
3355  break;
3356  case T_DiscardStmt:
3357  retval = _equalDiscardStmt(a, b);
3358  break;
3360  retval = _equalCreateTableSpaceStmt(a, b);
3361  break;
3362  case T_DropTableSpaceStmt:
3363  retval = _equalDropTableSpaceStmt(a, b);
3364  break;
3366  retval = _equalAlterTableSpaceOptionsStmt(a, b);
3367  break;
3369  retval = _equalAlterTableMoveAllStmt(a, b);
3370  break;
3371  case T_CreateExtensionStmt:
3372  retval = _equalCreateExtensionStmt(a, b);
3373  break;
3374  case T_AlterExtensionStmt:
3375  retval = _equalAlterExtensionStmt(a, b);
3376  break;
3378  retval = _equalAlterExtensionContentsStmt(a, b);
3379  break;
3380  case T_CreateFdwStmt:
3381  retval = _equalCreateFdwStmt(a, b);
3382  break;
3383  case T_AlterFdwStmt:
3384  retval = _equalAlterFdwStmt(a, b);
3385  break;
3387  retval = _equalCreateForeignServerStmt(a, b);
3388  break;
3390  retval = _equalAlterForeignServerStmt(a, b);
3391  break;
3393  retval = _equalCreateUserMappingStmt(a, b);
3394  break;
3396  retval = _equalAlterUserMappingStmt(a, b);
3397  break;
3398  case T_DropUserMappingStmt:
3399  retval = _equalDropUserMappingStmt(a, b);
3400  break;
3402  retval = _equalCreateForeignTableStmt(a, b);
3403  break;
3405  retval = _equalImportForeignSchemaStmt(a, b);
3406  break;
3407  case T_CreateTransformStmt:
3408  retval = _equalCreateTransformStmt(a, b);
3409  break;
3410  case T_CreateAmStmt:
3411  retval = _equalCreateAmStmt(a, b);
3412  break;
3413  case T_CreateTrigStmt:
3414  retval = _equalCreateTrigStmt(a, b);
3415  break;
3416  case T_CreateEventTrigStmt:
3417  retval = _equalCreateEventTrigStmt(a, b);
3418  break;
3419  case T_AlterEventTrigStmt:
3420  retval = _equalAlterEventTrigStmt(a, b);
3421  break;
3422  case T_CreatePLangStmt:
3423  retval = _equalCreatePLangStmt(a, b);
3424  break;
3425  case T_CreateRoleStmt:
3426  retval = _equalCreateRoleStmt(a, b);
3427  break;
3428  case T_AlterRoleStmt:
3429  retval = _equalAlterRoleStmt(a, b);
3430  break;
3431  case T_AlterRoleSetStmt:
3432  retval = _equalAlterRoleSetStmt(a, b);
3433  break;
3434  case T_DropRoleStmt:
3435  retval = _equalDropRoleStmt(a, b);
3436  break;
3437  case T_LockStmt:
3438  retval = _equalLockStmt(a, b);
3439  break;
3440  case T_ConstraintsSetStmt:
3441  retval = _equalConstraintsSetStmt(a, b);
3442  break;
3443  case T_ReindexStmt:
3444  retval = _equalReindexStmt(a, b);
3445  break;
3446  case T_CheckPointStmt:
3447  retval = true;
3448  break;
3449  case T_CreateSchemaStmt:
3450  retval = _equalCreateSchemaStmt(a, b);
3451  break;
3453  retval = _equalCreateConversionStmt(a, b);
3454  break;
3455  case T_CreateCastStmt:
3456  retval = _equalCreateCastStmt(a, b);
3457  break;
3458  case T_PrepareStmt:
3459  retval = _equalPrepareStmt(a, b);
3460  break;
3461  case T_ExecuteStmt:
3462  retval = _equalExecuteStmt(a, b);
3463  break;
3464  case T_DeallocateStmt:
3465  retval = _equalDeallocateStmt(a, b);
3466  break;
3467  case T_DropOwnedStmt:
3468  retval = _equalDropOwnedStmt(a, b);
3469  break;
3470  case T_ReassignOwnedStmt:
3471  retval = _equalReassignOwnedStmt(a, b);
3472  break;
3474  retval = _equalAlterTSDictionaryStmt(a, b);
3475  break;
3477  retval = _equalAlterTSConfigurationStmt(a, b);
3478  break;
3479  case T_CreatePolicyStmt:
3480  retval = _equalCreatePolicyStmt(a, b);
3481  break;
3482  case T_AlterPolicyStmt:
3483  retval = _equalAlterPolicyStmt(a, b);
3484  break;
3486  retval = _equalCreatePublicationStmt(a, b);
3487  break;
3489  retval = _equalAlterPublicationStmt(a, b);
3490  break;
3492  retval = _equalCreateSubscriptionStmt(a, b);
3493  break;
3495  retval = _equalAlterSubscriptionStmt(a, b);
3496  break;
3498  retval = _equalDropSubscriptionStmt(a, b);
3499  break;
3500  case T_A_Expr:
3501  retval = _equalAExpr(a, b);
3502  break;
3503  case T_ColumnRef:
3504  retval = _equalColumnRef(a, b);
3505  break;
3506  case T_ParamRef:
3507  retval = _equalParamRef(a, b);
3508  break;
3509  case T_A_Const:
3510  retval = _equalAConst(a, b);
3511  break;
3512  case T_FuncCall:
3513  retval = _equalFuncCall(a, b);
3514  break;
3515  case T_A_Star:
3516  retval = _equalAStar(a, b);
3517  break;
3518  case T_A_Indices:
3519  retval = _equalAIndices(a, b);
3520  break;
3521  case T_A_Indirection:
3522  retval = _equalA_Indirection(a, b);
3523  break;
3524  case T_A_ArrayExpr:
3525  retval = _equalA_ArrayExpr(a, b);
3526  break;
3527  case T_ResTarget:
3528  retval = _equalResTarget(a, b);
3529  break;
3530  case T_MultiAssignRef:
3531  retval = _equalMultiAssignRef(a, b);
3532  break;
3533  case T_TypeCast:
3534  retval = _equalTypeCast(a, b);
3535  break;
3536  case T_CollateClause:
3537  retval = _equalCollateClause(a, b);
3538  break;
3539  case T_SortBy:
3540  retval = _equalSortBy(a, b);
3541  break;
3542  case T_WindowDef:
3543  retval = _equalWindowDef(a, b);
3544  break;
3545  case T_RangeSubselect:
3546  retval = _equalRangeSubselect(a, b);
3547  break;
3548  case T_RangeFunction:
3549  retval = _equalRangeFunction(a, b);
3550  break;
3551  case T_RangeTableSample:
3552  retval = _equalRangeTableSample(a, b);
3553  break;
3554  case T_RangeTableFunc:
3555  retval = _equalRangeTableFunc(a, b);
3556  break;
3557  case T_RangeTableFuncCol:
3558  retval = _equalRangeTableFuncCol(a, b);
3559  break;
3560  case T_TypeName:
3561  retval = _equalTypeName(a, b);
3562  break;
3563  case T_IndexElem:
3564  retval = _equalIndexElem(a, b);
3565  break;
3566  case T_ColumnDef:
3567  retval = _equalColumnDef(a, b);
3568  break;
3569  case T_Constraint:
3570  retval = _equalConstraint(a, b);
3571  break;
3572  case T_DefElem:
3573  retval = _equalDefElem(a, b);
3574  break;
3575  case T_LockingClause:
3576  retval = _equalLockingClause(a, b);
3577  break;
3578  case T_RangeTblEntry:
3579  retval = _equalRangeTblEntry(a, b);
3580  break;
3581  case T_RangeTblFunction:
3582  retval = _equalRangeTblFunction(a, b);
3583  break;
3584  case T_TableSampleClause:
3585  retval = _equalTableSampleClause(a, b);
3586  break;
3587  case T_WithCheckOption:
3588  retval = _equalWithCheckOption(a, b);
3589  break;
3590  case T_SortGroupClause:
3591  retval = _equalSortGroupClause(a, b);
3592  break;
3593  case T_GroupingSet:
3594  retval = _equalGroupingSet(a, b);
3595  break;
3596  case T_WindowClause:
3597  retval = _equalWindowClause(a, b);
3598  break;
3599  case T_RowMarkClause:
3600  retval = _equalRowMarkClause(a, b);
3601  break;
3602  case T_WithClause:
3603  retval = _equalWithClause(a, b);
3604  break;
3605  case T_InferClause:
3606  retval = _equalInferClause(a, b);
3607  break;
3608  case T_OnConflictClause:
3609  retval = _equalOnConflictClause(a, b);
3610  break;
3611  case T_CommonTableExpr:
3612  retval = _equalCommonTableExpr(a, b);
3613  break;
3614  case T_ObjectWithArgs:
3615  retval = _equalObjectWithArgs(a, b);
3616  break;
3617  case T_AccessPriv:
3618  retval = _equalAccessPriv(a, b);
3619  break;
3620  case T_XmlSerialize:
3621  retval = _equalXmlSerialize(a, b);
3622  break;
3623  case T_RoleSpec:
3624  retval = _equalRoleSpec(a, b);
3625  break;
3626  case T_TriggerTransition:
3627  retval = _equalTriggerTransition(a, b);
3628  break;
3629  case T_PartitionSpec:
3630  retval = _equalPartitionSpec(a, b);
3631  break;
3632  case T_PartitionElem:
3633  retval = _equalPartitionElem(a, b);
3634  break;
3635  case T_PartitionBoundSpec:
3636  retval = _equalPartitionBoundSpec(a, b);
3637  break;
3638  case T_PartitionRangeDatum:
3639  retval = _equalPartitionRangeDatum(a, b);
3640  break;
3641  case T_PartitionCmd:
3642  retval = _equalPartitionCmd(a, b);
3643  break;
3644 
3645  default:
3646  elog(ERROR, "unrecognized node type: %d",
3647  (int) nodeTag(a));
3648  retval = false; /* keep compiler quiet */
3649  break;
3650  }
3651 
3652  return retval;
3653 }
static bool _equalDropUserMappingStmt(const DropUserMappingStmt *a, const DropUserMappingStmt *b)
Definition: equalfuncs.c:1886
Datum constvalue
Definition: primnodes.h:196
static bool _equalWindowDef(const WindowDef *a, const WindowDef *b)
Definition: equalfuncs.c:2416
static bool _equalDiscardStmt(const DiscardStmt *a, const DiscardStmt *b)
Definition: equalfuncs.c:1739
static bool _equalAlterFdwStmt(const AlterFdwStmt *a, const AlterFdwStmt *b)
Definition: equalfuncs.c:1831
static bool _equalParamRef(const ParamRef *a, const ParamRef *b)
Definition: equalfuncs.c:2278
static bool _equalListenStmt(const ListenStmt *a, const ListenStmt *b)
Definition: equalfuncs.c:1460
static bool _equalAlterDomainStmt(const AlterDomainStmt *a, const AlterDomainStmt *b)
Definition: equalfuncs.c:1107
static bool _equalConstraintsSetStmt(const ConstraintsSetStmt *a, const ConstraintsSetStmt *b)
Definition: equalfuncs.c:2046
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:1086
Datum boolop(PG_FUNCTION_ARGS)
Definition: _int_bool.c:420
static bool _equalCreateEnumStmt(const CreateEnumStmt *a, const CreateEnumStmt *b)
Definition: equalfuncs.c:1495
static bool _equalCreateTableAsStmt(const CreateTableAsStmt *a, const CreateTableAsStmt *b)
Definition: equalfuncs.c:1659
static bool _equalAlterDatabaseStmt(const AlterDatabaseStmt *a, const AlterDatabaseStmt *b)
Definition: equalfuncs.c:1613
static bool _equalViewStmt(const ViewStmt *a, const ViewStmt *b)
Definition: equalfuncs.c:1526
static bool _equalDropStmt(const DropStmt *a, const DropStmt *b)
Definition: equalfuncs.c:1258
static bool _equalPartitionedChildRelInfo(const PartitionedChildRelInfo *a, const PartitionedChildRelInfo *b)
Definition: equalfuncs.c:899
static bool _equalCollateExpr(const CollateExpr *a, const CollateExpr *b)
Definition: equalfuncs.c:539
#define forboth(cell1, list1, cell2, list2)
Definition: pg_list.h:174
static bool _equalGroupingSet(const GroupingSet *a, const GroupingSet *b)
Definition: equalfuncs.c:2670
static struct @78 value
static bool _equalSortGroupClause(const SortGroupClause *a, const SortGroupClause *b)
Definition: equalfuncs.c:2658
static bool _equalCreateFdwStmt(const CreateFdwStmt *a, const CreateFdwStmt *b)
Definition: equalfuncs.c:1821
static bool _equalTargetEntry(const TargetEntry *a, const TargetEntry *b)
Definition: equalfuncs.c:747
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:2934
#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:2778
static bool _equalCreateAmStmt(const CreateAmStmt *a, const CreateAmStmt *b)
Definition: equalfuncs.c:1933
static bool _equalAccessPriv(const AccessPriv *a, const AccessPriv *b)
Definition: equalfuncs.c:1145
static bool _equalVariableSetStmt(const VariableSetStmt *a, const VariableSetStmt *b)
Definition: equalfuncs.c:1720
static bool _equalDropTableSpaceStmt(const DropTableSpaceStmt *a, const DropTableSpaceStmt *b)
Definition: equalfuncs.c:1758
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:2055
static bool _equalPrepareStmt(const PrepareStmt *a, const PrepareStmt *b)
Definition: equalfuncs.c:2101
static bool _equalTypeName(const TypeName *a, const TypeName *b)
Definition: equalfuncs.c:2369
static bool _equalOnConflictClause(const OnConflictClause *a, const OnConflictClause *b)
Definition: equalfuncs.c:2728
static bool _equalExecuteStmt(const ExecuteStmt *a, const ExecuteStmt *b)
Definition: equalfuncs.c:2111
static bool _equalExtensibleNode(const ExtensibleNode *a, const ExtensibleNode *b)
Definition: equalfuncs.c:924
static bool _equalCommonTableExpr(const CommonTableExpr *a, const CommonTableExpr *b)
Definition: equalfuncs.c:2740
#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:2089
static bool _equalUpdateStmt(const UpdateStmt *a, const UpdateStmt *b)
Definition: equalfuncs.c:1022
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:1943
static bool _equalIndexElem(const IndexElem *a, const IndexElem *b)
Definition: equalfuncs.c:2496
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:1476
static bool _equalReplicaIdentityStmt(const ReplicaIdentityStmt *a, const ReplicaIdentityStmt *b)
Definition: equalfuncs.c:1681
static bool _equalInferClause(const InferClause *a, const InferClause *b)
Definition: equalfuncs.c:2717
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:2768
static bool _equalPathKey(const PathKey *a, const PathKey *b)
Definition: equalfuncs.c:812
static bool _equalDropRoleStmt(const DropRoleStmt *a, const DropRoleStmt *b)
Definition: equalfuncs.c:2027
static bool _equalRangeTableFuncCol(const RangeTableFuncCol *a, const RangeTableFuncCol *b)
Definition: equalfuncs.c:2480
static bool _equalGrantRoleStmt(const GrantRoleStmt *a, const GrantRoleStmt *b)
Definition: equalfuncs.c:1154
static bool _equalAlterFunctionStmt(const AlterFunctionStmt *a, const AlterFunctionStmt *b)
Definition: equalfuncs.c:1362
static bool _equalAlterOpFamilyStmt(const AlterOpFamilyStmt *a, const AlterOpFamilyStmt *b)
Definition: equalfuncs.c:1593
static bool _equalCreatedbStmt(const CreatedbStmt *a, const CreatedbStmt *b)
Definition: equalfuncs.c:1604
static bool _equalAppendRelInfo(const AppendRelInfo *a, const AppendRelInfo *b)
Definition: equalfuncs.c:886
Definition: primnodes.h:163
static bool _equalAlterRoleSetStmt(const AlterRoleSetStmt *a, const AlterRoleSetStmt *b)
Definition: equalfuncs.c:2017
static bool _equalReassignOwnedStmt(const ReassignOwnedStmt *a, const ReassignOwnedStmt *b)
Definition: equalfuncs.c:2137
static bool _equalTruncateStmt(const TruncateStmt *a, const TruncateStmt *b)
Definition: equalfuncs.c:1270
static bool _equalSelectStmt(const SelectStmt *a, const SelectStmt *b)
Definition: equalfuncs.c:1035
static bool _equalRangeTblRef(const RangeTblRef *a, const RangeTblRef *b)
Definition: equalfuncs.c:761
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:1468
static bool _equalDropdbStmt(const DropdbStmt *a, const DropdbStmt *b)
Definition: equalfuncs.c:1631
static bool _equalAlterSeqStmt(const AlterSeqStmt *a, const AlterSeqStmt *b)
Definition: equalfuncs.c:1710
static bool _equalAlterObjectSchemaStmt(const AlterObjectSchemaStmt *a, const AlterObjectSchemaStmt *b)
Definition: equalfuncs.c:1405
static bool _equalCreateExtensionStmt(const CreateExtensionStmt *a, const CreateExtensionStmt *b)
Definition: equalfuncs.c:1791
static bool _equalAlterCollationStmt(const AlterCollationStmt *a, const AlterCollationStmt *b)
Definition: equalfuncs.c:1099
static bool _equalAlterOperatorStmt(const AlterOperatorStmt *a, const AlterOperatorStmt *b)
Definition: equalfuncs.c:1428
static bool _equalTableLikeClause(const TableLikeClause *a, const TableLikeClause *b)
Definition: equalfuncs.c:1236
static bool _equalAlterDatabaseSetStmt(const AlterDatabaseSetStmt *a, const AlterDatabaseSetStmt *b)
Definition: equalfuncs.c:1622
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:2563
static bool _equalPartitionBoundSpec(const PartitionBoundSpec *a, const PartitionBoundSpec *b)
Definition: equalfuncs.c:2810
static bool _equalSortBy(const SortBy *a, const SortBy *b)
Definition: equalfuncs.c:2404
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:2146
static bool _equalCollateClause(const CollateClause *a, const CollateClause *b)
Definition: equalfuncs.c:2394
int constlen
Definition: primnodes.h:195
static bool _equalAlterExtensionStmt(const AlterExtensionStmt *a, const AlterExtensionStmt *b)
Definition: equalfuncs.c:1801
static bool _equalCreateOpFamilyStmt(const CreateOpFamilyStmt *a, const CreateOpFamilyStmt *b)
Definition: equalfuncs.c:1584
static bool _equalWithCheckOption(const WithCheckOption *a, const WithCheckOption *b)
Definition: equalfuncs.c:2646
static bool _equalAExpr(const A_Expr *a, const A_Expr *b)
Definition: equalfuncs.c:2257
static bool _equalSecLabelStmt(const SecLabelStmt *a, const SecLabelStmt *b)
Definition: equalfuncs.c:1290
static bool _equalFunctionParameter(const FunctionParameter *a, const FunctionParameter *b)
Definition: equalfuncs.c:1351
static bool _equalAlterExtensionContentsStmt(const AlterExtensionContentsStmt *a, const AlterExtensionContentsStmt *b)
Definition: equalfuncs.c:1810
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:769
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:2622
#define ERROR
Definition: elog.h:43
static bool _equalVariableShowStmt(const VariableShowStmt *a, const VariableShowStmt *b)
Definition: equalfuncs.c:1731
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:2845
static bool _equalAlterObjectDependsStmt(const AlterObjectDependsStmt *a, const AlterObjectDependsStmt *b)
Definition: equalfuncs.c:1394
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:1513
static bool _equalAlterTableStmt(const AlterTableStmt *a, const AlterTableStmt *b)
Definition: equalfuncs.c:1075
static bool _equalPartitionCmd(const PartitionCmd *a, const PartitionCmd *b)
Definition: equalfuncs.c:2832
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:2077
static bool _equalRangeTableSample(const RangeTableSample *a, const RangeTableSample *b)
Definition: equalfuncs.c:2454
static bool _equalCreateFunctionStmt(const CreateFunctionStmt *a, const CreateFunctionStmt *b)
Definition: equalfuncs.c:1338
static bool _equalArrayRef(const ArrayRef *a, const ArrayRef *b)
Definition: equalfuncs.c:267
Definition: nodes.h:140
static bool _equalPartitionSpec(const PartitionSpec *a, const PartitionSpec *b)
Definition: equalfuncs.c:2788
static bool _equalCreatePLangStmt(const CreatePLangStmt *a, const CreatePLangStmt *b)
Definition: equalfuncs.c:1984
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:1854
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:1167
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:2680
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:2297
static bool _equalAlterEventTrigStmt(const AlterEventTrigStmt *a, const AlterEventTrigStmt *b)
Definition: equalfuncs.c:1975
static bool _equalQuery(const Query *a, const Query *b)
Definition: equalfuncs.c:945
static bool _equalConstraint(const Constraint *a, const Constraint *b)
Definition: equalfuncs.c:2531
static bool _equalCreateUserMappingStmt(const CreateUserMappingStmt *a, const CreateUserMappingStmt *b)
Definition: equalfuncs.c:1865
static bool _equalAlterTSConfigurationStmt(const AlterTSConfigurationStmt *a, const AlterTSConfigurationStmt *b)
Definition: equalfuncs.c:2155
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:1539
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:1841
static bool _equalImportForeignSchemaStmt(const ImportForeignSchemaStmt *a, const ImportForeignSchemaStmt *b)
Definition: equalfuncs.c:1908
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:2822
static bool _equalInferenceElem(const InferenceElem *a, const InferenceElem *b)
Definition: equalfuncs.c:737
static bool _equalRangeTableFunc(const RangeTableFunc *a, const RangeTableFunc *b)
Definition: equalfuncs.c:2466
static bool _equalDoStmt(const DoStmt *a, const DoStmt *b)
Definition: equalfuncs.c:1371
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:2207
Definition: nodes.h:303
static bool _equalCreateTableSpaceStmt(const CreateTableSpaceStmt *a, const CreateTableSpaceStmt *b)
Definition: equalfuncs.c:1747
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:843
static bool _equalNotifyStmt(const NotifyStmt *a, const NotifyStmt *b)
Definition: equalfuncs.c:1451
Definition: nodes.h:145
static bool _equalPartitionElem(const PartitionElem *a, const PartitionElem *b)
Definition: equalfuncs.c:2798
static bool _equalRawStmt(const RawStmt *a, const RawStmt *b)
Definition: equalfuncs.c:987
static int verbose
Definition: pg_basebackup.c:84
Definition: nodes.h:144
static bool _equalSpecialJoinInfo(const SpecialJoinInfo *a, const SpecialJoinInfo *b)
Definition: equalfuncs.c:868
static bool _equalAlterRoleStmt(const AlterRoleStmt *a, const AlterRoleStmt *b)
Definition: equalfuncs.c:2007
static bool _equalA_Indirection(const A_Indirection *a, const A_Indirection *b)
Definition: equalfuncs.c:2330
static bool _equalCreateRangeStmt(const CreateRangeStmt *a, const CreateRangeStmt *b)
Definition: equalfuncs.c:1504
Definition: nodes.h:316
static bool _equalCreateRoleStmt(const CreateRoleStmt *a, const CreateRoleStmt *b)
Definition: equalfuncs.c:1997
static bool _equalAlterPolicyStmt(const AlterPolicyStmt *a, const AlterPolicyStmt *b)
Definition: equalfuncs.c:2245
static bool _equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
Definition: equalfuncs.c:1437
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:784
static bool _equalCreateDomainStmt(const CreateDomainStmt *a, const CreateDomainStmt *b)
Definition: equalfuncs.c:1547
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:1650
static bool _equalVacuumStmt(const VacuumStmt *a, const VacuumStmt *b)
Definition: equalfuncs.c:1640
static bool _equalCreatePublicationStmt(const CreatePublicationStmt *a, const CreatePublicationStmt *b)
Definition: equalfuncs.c:2170
static bool _equalCreateTransformStmt(const CreateTransformStmt *a, const CreateTransformStmt *b)
Definition: equalfuncs.c:1921
const char * extnodename
Definition: extensible.h:35
static bool _equalDeleteStmt(const DeleteStmt *a, const DeleteStmt *b)
Definition: equalfuncs.c:1010
static bool _equalSetOperationStmt(const SetOperationStmt *a, const SetOperationStmt *b)
Definition: equalfuncs.c:1060
static bool _equalDeclareCursorStmt(const DeclareCursorStmt *a, const DeclareCursorStmt *b)
Definition: equalfuncs.c:1176
static bool _equalAlterPublicationStmt(const AlterPublicationStmt *a, const AlterPublicationStmt *b)
Definition: equalfuncs.c:2182
static bool _equalLockingClause(const LockingClause *a, const LockingClause *b)
Definition: equalfuncs.c:2575
static bool _equalTypeCast(const TypeCast *a, const TypeCast *b)
Definition: equalfuncs.c:2384
#define NULL
Definition: c.h:229
static bool _equalCreateSeqStmt(const CreateSeqStmt *a, const CreateSeqStmt *b)
Definition: equalfuncs.c:1699
#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:1767
Definition: value.h:42
static bool _equalDropSubscriptionStmt(const DropSubscriptionStmt *a, const DropSubscriptionStmt *b)
Definition: equalfuncs.c:2220
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:908
#define COMPARE_LOCATION_FIELD(fldname)
Definition: equalfuncs.c:84
static bool _equalResTarget(const ResTarget *a, const ResTarget *b)
Definition: equalfuncs.c:2348
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:2231
char * dbname
Definition: streamutil.c:38
static bool _equalDropOwnedStmt(const DropOwnedStmt *a, const DropOwnedStmt *b)
Definition: equalfuncs.c:2128
static bool _equalXmlExpr(const XmlExpr *a, const XmlExpr *b)
Definition: equalfuncs.c:655
static const struct fns functions
Definition: regcomp.c:299
static bool _equalValue(const Value *a, const Value *b)
Definition: equalfuncs.c:2904
static bool _equalAlterUserMappingStmt(const AlterUserMappingStmt *a, const AlterUserMappingStmt *b)
Definition: equalfuncs.c:1876
static bool _equalCompositeTypeStmt(const CompositeTypeStmt *a, const CompositeTypeStmt *b)
Definition: equalfuncs.c:1486
const char * name
Definition: encode.c:521
static bool _equalCreateForeignTableStmt(const CreateForeignTableStmt *a, const CreateForeignTableStmt *b)
Definition: equalfuncs.c:1896
#define nodeTag(nodeptr)
Definition: nodes.h:525
static bool _equalDefineStmt(const DefineStmt *a, const DefineStmt *b)
Definition: equalfuncs.c:1245
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:2314
static bool _equalFuncExpr(const FuncExpr *a, const FuncExpr *b)
Definition: equalfuncs.c:282
Definition: nodes.h:298
#define COMPARE_NODE_FIELD(fldname)
Definition: equalfuncs.c:52
static bool _equalTableSampleClause(const TableSampleClause *a, const TableSampleClause *b)
Definition: equalfuncs.c:2636
Definition: nodes.h:295
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:2359
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:2269
static bool _equalAConst(const A_Const *a, const A_Const *b)
Definition: equalfuncs.c:2287
static bool _equalRangeTblEntry(const RangeTblEntry *a, const RangeTblEntry *b)
Definition: equalfuncs.c:2586
static bool _equalCreateOpClassStmt(const CreateOpClassStmt *a, const CreateOpClassStmt *b)
Definition: equalfuncs.c:1558
static bool _equalRefreshMatViewStmt(const RefreshMatViewStmt *a, const RefreshMatViewStmt *b)
Definition: equalfuncs.c:1671
int xmloption
Definition: xml.c:98
static bool _equalGrantStmt(const GrantStmt *a, const GrantStmt *b)
Definition: equalfuncs.c:1120
static bool _equalAIndices(const A_Indices *a, const A_Indices *b)
Definition: equalfuncs.c:2320
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:2195
static bool _equalOnConflictExpr(const OnConflictExpr *a, const OnConflictExpr *b)
Definition: equalfuncs.c:793
static bool _equalFetchStmt(const FetchStmt *a, const FetchStmt *b)
Definition: equalfuncs.c:1301
void * arg
static bool _equalCreateOpClassItem(const CreateOpClassItem *a, const CreateOpClassItem *b)
Definition: equalfuncs.c:1571
static bool _equalInsertStmt(const InsertStmt *a, const InsertStmt *b)
Definition: equalfuncs.c:997
static bool _equalCopyStmt(const CopyStmt *a, const CopyStmt *b)
Definition: equalfuncs.c:1204
static bool _equalRestrictInfo(const RestrictInfo *a, const RestrictInfo *b)
Definition: equalfuncs.c:824
static bool _equalDeallocateStmt(const DeallocateStmt *a, const DeallocateStmt *b)
Definition: equalfuncs.c:2120
static bool _equalRangeSubselect(const RangeSubselect *a, const RangeSubselect *b)
Definition: equalfuncs.c:2431
#define elog
Definition: elog.h:219
static bool _equalAlterTableMoveAllStmt(const AlterTableMoveAllStmt *a, const AlterTableMoveAllStmt *b)
Definition: equalfuncs.c:1778
static bool _equalGroupingFunc(const GroupingFunc *a, const GroupingFunc *b)
Definition: equalfuncs.c:235
static bool _equalWithClause(const WithClause *a, const WithClause *b)
Definition: equalfuncs.c:2707
static bool _equalCommentStmt(const CommentStmt *a, const CommentStmt *b)
Definition: equalfuncs.c:1280
static bool _equalA_ArrayExpr(const A_ArrayExpr *a, const A_ArrayExpr *b)
Definition: equalfuncs.c:2339
static bool _equalCreateSchemaStmt(const CreateSchemaStmt *a, const CreateSchemaStmt *b)
Definition: equalfuncs.c:2066
Value val
Definition: parsenodes.h:279
Definition: pg_list.h:45
static bool _equalCreateStmt(const CreateStmt *a, const CreateStmt *b)
Definition: equalfuncs.c:1218
static bool _equalRenameStmt(const RenameStmt *a, const RenameStmt *b)
Definition: equalfuncs.c:1379
static bool _equalClusterStmt(const ClusterStmt *a, const ClusterStmt *b)
Definition: equalfuncs.c:1194
long val
Definition: informix.c:689
static bool _equalAlterOwnerStmt(const AlterOwnerStmt *a, const AlterOwnerStmt *b)
Definition: equalfuncs.c:1417
static bool _equalAlterSystemStmt(const AlterSystemStmt *a, const AlterSystemStmt *b)
Definition: equalfuncs.c:1690
static bool _equalClosePortalStmt(const ClosePortalStmt *a, const ClosePortalStmt *b)
Definition: equalfuncs.c:1186
static bool _equalXmlSerialize(const XmlSerialize *a, const XmlSerialize *b)
Definition: equalfuncs.c:2757
bool constisnull
Definition: primnodes.h:197
static bool _equalIndexStmt(const IndexStmt *a, const IndexStmt *b)
Definition: equalfuncs.c:1312
static bool _equalObjectWithArgs(const ObjectWithArgs *a, const ObjectWithArgs *b)
Definition: equalfuncs.c:1135
static bool _equalLockStmt(const LockStmt *a, const LockStmt *b)
Definition: equalfuncs.c:2036
#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:2441
static bool _equalCreateEventTrigStmt(const CreateEventTrigStmt *a, const CreateEventTrigStmt *b)
Definition: equalfuncs.c:1964
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:2696
Definition: nodes.h:146
static bool _equalColumnDef(const ColumnDef *a, const ColumnDef *b)
Definition: equalfuncs.c:2510