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