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