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