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