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