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);
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(phid);
910  COMPARE_NODE_FIELD(ph_var); /* should be redundant */
911  COMPARE_BITMAPSET_FIELD(ph_eval_at);
912  COMPARE_BITMAPSET_FIELD(ph_lateral);
913  COMPARE_BITMAPSET_FIELD(ph_needed);
914  COMPARE_SCALAR_FIELD(ph_width);
915 
916  return true;
917 }
918 
919 /*
920  * Stuff from extensible.h
921  */
922 static bool
924 {
925  const ExtensibleNodeMethods *methods;
926 
927  COMPARE_STRING_FIELD(extnodename);
928 
929  /* At this point, we know extnodename is the same for both nodes. */
930  methods = GetExtensibleNodeMethods(a->extnodename, false);
931 
932  /* compare the private fields */
933  if (!methods->nodeEqual(a, b))
934  return false;
935 
936  return true;
937 }
938 
939 /*
940  * Stuff from parsenodes.h
941  */
942 
943 static bool
944 _equalQuery(const Query *a, const Query *b)
945 {
946  COMPARE_SCALAR_FIELD(commandType);
947  COMPARE_SCALAR_FIELD(querySource);
948  /* we intentionally ignore queryId, since it might not be set */
949  COMPARE_SCALAR_FIELD(canSetTag);
950  COMPARE_NODE_FIELD(utilityStmt);
951  COMPARE_SCALAR_FIELD(resultRelation);
952  COMPARE_SCALAR_FIELD(hasAggs);
953  COMPARE_SCALAR_FIELD(hasWindowFuncs);
954  COMPARE_SCALAR_FIELD(hasTargetSRFs);
955  COMPARE_SCALAR_FIELD(hasSubLinks);
956  COMPARE_SCALAR_FIELD(hasDistinctOn);
957  COMPARE_SCALAR_FIELD(hasRecursive);
958  COMPARE_SCALAR_FIELD(hasModifyingCTE);
959  COMPARE_SCALAR_FIELD(hasForUpdate);
960  COMPARE_SCALAR_FIELD(hasRowSecurity);
961  COMPARE_NODE_FIELD(cteList);
962  COMPARE_NODE_FIELD(rtable);
963  COMPARE_NODE_FIELD(jointree);
964  COMPARE_NODE_FIELD(targetList);
965  COMPARE_SCALAR_FIELD(override);
966  COMPARE_NODE_FIELD(onConflict);
967  COMPARE_NODE_FIELD(returningList);
968  COMPARE_NODE_FIELD(groupClause);
969  COMPARE_NODE_FIELD(groupingSets);
970  COMPARE_NODE_FIELD(havingQual);
971  COMPARE_NODE_FIELD(windowClause);
972  COMPARE_NODE_FIELD(distinctClause);
973  COMPARE_NODE_FIELD(sortClause);
974  COMPARE_NODE_FIELD(limitOffset);
975  COMPARE_NODE_FIELD(limitCount);
976  COMPARE_NODE_FIELD(rowMarks);
977  COMPARE_NODE_FIELD(setOperations);
978  COMPARE_NODE_FIELD(constraintDeps);
979  COMPARE_NODE_FIELD(withCheckOptions);
980  COMPARE_LOCATION_FIELD(stmt_location);
981  COMPARE_LOCATION_FIELD(stmt_len);
982 
983  return true;
984 }
985 
986 static bool
987 _equalRawStmt(const RawStmt *a, const RawStmt *b)
988 {
989  COMPARE_NODE_FIELD(stmt);
990  COMPARE_LOCATION_FIELD(stmt_location);
991  COMPARE_LOCATION_FIELD(stmt_len);
992 
993  return true;
994 }
995 
996 static bool
998 {
999  COMPARE_NODE_FIELD(relation);
1000  COMPARE_NODE_FIELD(cols);
1001  COMPARE_NODE_FIELD(selectStmt);
1002  COMPARE_NODE_FIELD(onConflictClause);
1003  COMPARE_NODE_FIELD(returningList);
1004  COMPARE_NODE_FIELD(withClause);
1005  COMPARE_SCALAR_FIELD(override);
1006 
1007  return true;
1008 }
1009 
1010 static bool
1012 {
1013  COMPARE_NODE_FIELD(relation);
1014  COMPARE_NODE_FIELD(usingClause);
1015  COMPARE_NODE_FIELD(whereClause);
1016  COMPARE_NODE_FIELD(returningList);
1017  COMPARE_NODE_FIELD(withClause);
1018 
1019  return true;
1020 }
1021 
1022 static bool
1024 {
1025  COMPARE_NODE_FIELD(relation);
1026  COMPARE_NODE_FIELD(targetList);
1027  COMPARE_NODE_FIELD(whereClause);
1028  COMPARE_NODE_FIELD(fromClause);
1029  COMPARE_NODE_FIELD(returningList);
1030  COMPARE_NODE_FIELD(withClause);
1031 
1032  return true;
1033 }
1034 
1035 static bool
1037 {
1038  COMPARE_NODE_FIELD(distinctClause);
1039  COMPARE_NODE_FIELD(intoClause);
1040  COMPARE_NODE_FIELD(targetList);
1041  COMPARE_NODE_FIELD(fromClause);
1042  COMPARE_NODE_FIELD(whereClause);
1043  COMPARE_NODE_FIELD(groupClause);
1044  COMPARE_NODE_FIELD(havingClause);
1045  COMPARE_NODE_FIELD(windowClause);
1046  COMPARE_NODE_FIELD(valuesLists);
1047  COMPARE_NODE_FIELD(sortClause);
1048  COMPARE_NODE_FIELD(limitOffset);
1049  COMPARE_NODE_FIELD(limitCount);
1050  COMPARE_NODE_FIELD(lockingClause);
1051  COMPARE_NODE_FIELD(withClause);
1053  COMPARE_SCALAR_FIELD(all);
1054  COMPARE_NODE_FIELD(larg);
1055  COMPARE_NODE_FIELD(rarg);
1056 
1057  return true;
1058 }
1059 
1060 static bool
1062 {
1064  COMPARE_SCALAR_FIELD(all);
1065  COMPARE_NODE_FIELD(larg);
1066  COMPARE_NODE_FIELD(rarg);
1067  COMPARE_NODE_FIELD(colTypes);
1068  COMPARE_NODE_FIELD(colTypmods);
1069  COMPARE_NODE_FIELD(colCollations);
1070  COMPARE_NODE_FIELD(groupClauses);
1071 
1072  return true;
1073 }
1074 
1075 static bool
1077 {
1078  COMPARE_NODE_FIELD(relation);
1079  COMPARE_NODE_FIELD(cmds);
1081  COMPARE_SCALAR_FIELD(missing_ok);
1082 
1083  return true;
1084 }
1085 
1086 static bool
1088 {
1089  COMPARE_SCALAR_FIELD(subtype);
1091  COMPARE_SCALAR_FIELD(num);
1092  COMPARE_NODE_FIELD(newowner);
1093  COMPARE_NODE_FIELD(def);
1094  COMPARE_SCALAR_FIELD(behavior);
1095  COMPARE_SCALAR_FIELD(missing_ok);
1096 
1097  return true;
1098 }
1099 
1100 static bool
1102 {
1103  COMPARE_NODE_FIELD(collname);
1104 
1105  return true;
1106 }
1107 
1108 static bool
1110 {
1111  COMPARE_SCALAR_FIELD(subtype);
1112  COMPARE_NODE_FIELD(typeName);
1114  COMPARE_NODE_FIELD(def);
1115  COMPARE_SCALAR_FIELD(behavior);
1116  COMPARE_SCALAR_FIELD(missing_ok);
1117 
1118  return true;
1119 }
1120 
1121 static bool
1123 {
1124  COMPARE_SCALAR_FIELD(is_grant);
1125  COMPARE_SCALAR_FIELD(targtype);
1126  COMPARE_SCALAR_FIELD(objtype);
1127  COMPARE_NODE_FIELD(objects);
1128  COMPARE_NODE_FIELD(privileges);
1129  COMPARE_NODE_FIELD(grantees);
1130  COMPARE_SCALAR_FIELD(grant_option);
1131  COMPARE_SCALAR_FIELD(behavior);
1132 
1133  return true;
1134 }
1135 
1136 static bool
1138 {
1139  COMPARE_NODE_FIELD(objname);
1140  COMPARE_NODE_FIELD(objargs);
1141  COMPARE_SCALAR_FIELD(args_unspecified);
1142 
1143  return true;
1144 }
1145 
1146 static bool
1148 {
1149  COMPARE_STRING_FIELD(priv_name);
1150  COMPARE_NODE_FIELD(cols);
1151 
1152  return true;
1153 }
1154 
1155 static bool
1157 {
1158  COMPARE_NODE_FIELD(granted_roles);
1159  COMPARE_NODE_FIELD(grantee_roles);
1160  COMPARE_SCALAR_FIELD(is_grant);
1161  COMPARE_SCALAR_FIELD(admin_opt);
1163  COMPARE_SCALAR_FIELD(behavior);
1164 
1165  return true;
1166 }
1167 
1168 static bool
1170 {
1173 
1174  return true;
1175 }
1176 
1177 static bool
1179 {
1180  COMPARE_STRING_FIELD(portalname);
1182  COMPARE_NODE_FIELD(query);
1183 
1184  return true;
1185 }
1186 
1187 static bool
1189 {
1190  COMPARE_STRING_FIELD(portalname);
1191 
1192  return true;
1193 }
1194 
1195 static bool
1196 _equalCallStmt(const CallStmt *a, const CallStmt *b)
1197 {
1198  COMPARE_NODE_FIELD(funccall);
1199  COMPARE_NODE_FIELD(funcexpr);
1200 
1201  return true;
1202 }
1203 
1204 static bool
1206 {
1207  COMPARE_NODE_FIELD(relation);
1208  COMPARE_STRING_FIELD(indexname);
1210 
1211  return true;
1212 }
1213 
1214 static bool
1215 _equalCopyStmt(const CopyStmt *a, const CopyStmt *b)
1216 {
1217  COMPARE_NODE_FIELD(relation);
1218  COMPARE_NODE_FIELD(query);
1219  COMPARE_NODE_FIELD(attlist);
1220  COMPARE_SCALAR_FIELD(is_from);
1221  COMPARE_SCALAR_FIELD(is_program);
1224 
1225  return true;
1226 }
1227 
1228 static bool
1230 {
1231  COMPARE_NODE_FIELD(relation);
1232  COMPARE_NODE_FIELD(tableElts);
1233  COMPARE_NODE_FIELD(inhRelations);
1234  COMPARE_NODE_FIELD(partbound);
1235  COMPARE_NODE_FIELD(partspec);
1236  COMPARE_NODE_FIELD(ofTypename);
1237  COMPARE_NODE_FIELD(constraints);
1239  COMPARE_SCALAR_FIELD(oncommit);
1240  COMPARE_STRING_FIELD(tablespacename);
1241  COMPARE_SCALAR_FIELD(if_not_exists);
1242 
1243  return true;
1244 }
1245 
1246 static bool
1248 {
1249  COMPARE_NODE_FIELD(relation);
1251 
1252  return true;
1253 }
1254 
1255 static bool
1257 {
1258  COMPARE_SCALAR_FIELD(kind);
1259  COMPARE_SCALAR_FIELD(oldstyle);
1260  COMPARE_NODE_FIELD(defnames);
1262  COMPARE_NODE_FIELD(definition);
1263  COMPARE_SCALAR_FIELD(if_not_exists);
1264 
1265  return true;
1266 }
1267 
1268 static bool
1269 _equalDropStmt(const DropStmt *a, const DropStmt *b)
1270 {
1271  COMPARE_NODE_FIELD(objects);
1272  COMPARE_SCALAR_FIELD(removeType);
1273  COMPARE_SCALAR_FIELD(behavior);
1274  COMPARE_SCALAR_FIELD(missing_ok);
1275  COMPARE_SCALAR_FIELD(concurrent);
1276 
1277  return true;
1278 }
1279 
1280 static bool
1282 {
1283  COMPARE_NODE_FIELD(relations);
1284  COMPARE_SCALAR_FIELD(restart_seqs);
1285  COMPARE_SCALAR_FIELD(behavior);
1286 
1287  return true;
1288 }
1289 
1290 static bool
1292 {
1293  COMPARE_SCALAR_FIELD(objtype);
1294  COMPARE_NODE_FIELD(object);
1295  COMPARE_STRING_FIELD(comment);
1296 
1297  return true;
1298 }
1299 
1300 static bool
1302 {
1303  COMPARE_SCALAR_FIELD(objtype);
1304  COMPARE_NODE_FIELD(object);
1307 
1308  return true;
1309 }
1310 
1311 static bool
1313 {
1314  COMPARE_SCALAR_FIELD(direction);
1315  COMPARE_SCALAR_FIELD(howMany);
1316  COMPARE_STRING_FIELD(portalname);
1317  COMPARE_SCALAR_FIELD(ismove);
1318 
1319  return true;
1320 }
1321 
1322 static bool
1324 {
1325  COMPARE_STRING_FIELD(idxname);
1326  COMPARE_NODE_FIELD(relation);
1327  COMPARE_SCALAR_FIELD(relationId);
1328  COMPARE_STRING_FIELD(accessMethod);
1329  COMPARE_STRING_FIELD(tableSpace);
1330  COMPARE_NODE_FIELD(indexParams);
1331  COMPARE_NODE_FIELD(indexIncludingParams);
1333  COMPARE_NODE_FIELD(whereClause);
1334  COMPARE_NODE_FIELD(excludeOpNames);
1335  COMPARE_STRING_FIELD(idxcomment);
1336  COMPARE_SCALAR_FIELD(indexOid);
1337  COMPARE_SCALAR_FIELD(oldNode);
1338  COMPARE_SCALAR_FIELD(unique);
1339  COMPARE_SCALAR_FIELD(primary);
1340  COMPARE_SCALAR_FIELD(isconstraint);
1341  COMPARE_SCALAR_FIELD(deferrable);
1342  COMPARE_SCALAR_FIELD(initdeferred);
1343  COMPARE_SCALAR_FIELD(transformed);
1344  COMPARE_SCALAR_FIELD(concurrent);
1345  COMPARE_SCALAR_FIELD(if_not_exists);
1346 
1347  return true;
1348 }
1349 
1350 static bool
1352 {
1353  COMPARE_NODE_FIELD(defnames);
1354  COMPARE_NODE_FIELD(stat_types);
1355  COMPARE_NODE_FIELD(exprs);
1356  COMPARE_NODE_FIELD(relations);
1357  COMPARE_STRING_FIELD(stxcomment);
1358  COMPARE_SCALAR_FIELD(if_not_exists);
1359 
1360  return true;
1361 }
1362 
1363 static bool
1365 {
1366  COMPARE_SCALAR_FIELD(is_procedure);
1367  COMPARE_SCALAR_FIELD(replace);
1368  COMPARE_NODE_FIELD(funcname);
1369  COMPARE_NODE_FIELD(parameters);
1370  COMPARE_NODE_FIELD(returnType);
1372 
1373  return true;
1374 }
1375 
1376 static bool
1378 {
1380  COMPARE_NODE_FIELD(argType);
1381  COMPARE_SCALAR_FIELD(mode);
1382  COMPARE_NODE_FIELD(defexpr);
1383 
1384  return true;
1385 }
1386 
1387 static bool
1389 {
1390  COMPARE_SCALAR_FIELD(objtype);
1391  COMPARE_NODE_FIELD(func);
1392  COMPARE_NODE_FIELD(actions);
1393 
1394  return true;
1395 }
1396 
1397 static bool
1398 _equalDoStmt(const DoStmt *a, const DoStmt *b)
1399 {
1401 
1402  return true;
1403 }
1404 
1405 static bool
1407 {
1408  COMPARE_SCALAR_FIELD(renameType);
1409  COMPARE_SCALAR_FIELD(relationType);
1410  COMPARE_NODE_FIELD(relation);
1411  COMPARE_NODE_FIELD(object);
1413  COMPARE_STRING_FIELD(newname);
1414  COMPARE_SCALAR_FIELD(behavior);
1415  COMPARE_SCALAR_FIELD(missing_ok);
1416 
1417  return true;
1418 }
1419 
1420 static bool
1422 {
1423  COMPARE_SCALAR_FIELD(objectType);
1424  COMPARE_NODE_FIELD(relation);
1425  COMPARE_NODE_FIELD(object);
1426  COMPARE_NODE_FIELD(extname);
1427 
1428  return true;
1429 }
1430 
1431 static bool
1433 {
1434  COMPARE_SCALAR_FIELD(objectType);
1435  COMPARE_NODE_FIELD(relation);
1436  COMPARE_NODE_FIELD(object);
1437  COMPARE_STRING_FIELD(newschema);
1438  COMPARE_SCALAR_FIELD(missing_ok);
1439 
1440  return true;
1441 }
1442 
1443 static bool
1445 {
1446  COMPARE_SCALAR_FIELD(objectType);
1447  COMPARE_NODE_FIELD(relation);
1448  COMPARE_NODE_FIELD(object);
1449  COMPARE_NODE_FIELD(newowner);
1450 
1451  return true;
1452 }
1453 
1454 static bool
1456 {
1457  COMPARE_NODE_FIELD(opername);
1459 
1460  return true;
1461 }
1462 
1463 static bool
1464 _equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
1465 {
1466  COMPARE_NODE_FIELD(relation);
1467  COMPARE_STRING_FIELD(rulename);
1468  COMPARE_NODE_FIELD(whereClause);
1469  COMPARE_SCALAR_FIELD(event);
1470  COMPARE_SCALAR_FIELD(instead);
1471  COMPARE_NODE_FIELD(actions);
1472  COMPARE_SCALAR_FIELD(replace);
1473 
1474  return true;
1475 }
1476 
1477 static bool
1479 {
1480  COMPARE_STRING_FIELD(conditionname);
1481  COMPARE_STRING_FIELD(payload);
1482 
1483  return true;
1484 }
1485 
1486 static bool
1488 {
1489  COMPARE_STRING_FIELD(conditionname);
1490 
1491  return true;
1492 }
1493 
1494 static bool
1496 {
1497  COMPARE_STRING_FIELD(conditionname);
1498 
1499  return true;
1500 }
1501 
1502 static bool
1504 {
1505  COMPARE_SCALAR_FIELD(kind);
1507  COMPARE_STRING_FIELD(savepoint_name);
1508  COMPARE_STRING_FIELD(gid);
1509 
1510  return true;
1511 }
1512 
1513 static bool
1515 {
1516  COMPARE_NODE_FIELD(typevar);
1517  COMPARE_NODE_FIELD(coldeflist);
1518 
1519  return true;
1520 }
1521 
1522 static bool
1524 {
1525  COMPARE_NODE_FIELD(typeName);
1526  COMPARE_NODE_FIELD(vals);
1527 
1528  return true;
1529 }
1530 
1531 static bool
1533 {
1534  COMPARE_NODE_FIELD(typeName);
1535  COMPARE_NODE_FIELD(params);
1536 
1537  return true;
1538 }
1539 
1540 static bool
1542 {
1543  COMPARE_NODE_FIELD(typeName);
1544  COMPARE_STRING_FIELD(oldVal);
1545  COMPARE_STRING_FIELD(newVal);
1546  COMPARE_STRING_FIELD(newValNeighbor);
1547  COMPARE_SCALAR_FIELD(newValIsAfter);
1548  COMPARE_SCALAR_FIELD(skipIfNewValExists);
1549 
1550  return true;
1551 }
1552 
1553 static bool
1554 _equalViewStmt(const ViewStmt *a, const ViewStmt *b)
1555 {
1556  COMPARE_NODE_FIELD(view);
1557  COMPARE_NODE_FIELD(aliases);
1558  COMPARE_NODE_FIELD(query);
1559  COMPARE_SCALAR_FIELD(replace);
1561  COMPARE_SCALAR_FIELD(withCheckOption);
1562 
1563  return true;
1564 }
1565 
1566 static bool
1567 _equalLoadStmt(const LoadStmt *a, const LoadStmt *b)
1568 {
1570 
1571  return true;
1572 }
1573 
1574 static bool
1576 {
1577  COMPARE_NODE_FIELD(domainname);
1578  COMPARE_NODE_FIELD(typeName);
1579  COMPARE_NODE_FIELD(collClause);
1580  COMPARE_NODE_FIELD(constraints);
1581 
1582  return true;
1583 }
1584 
1585 static bool
1587 {
1588  COMPARE_NODE_FIELD(opclassname);
1589  COMPARE_NODE_FIELD(opfamilyname);
1590  COMPARE_STRING_FIELD(amname);
1591  COMPARE_NODE_FIELD(datatype);
1592  COMPARE_NODE_FIELD(items);
1593  COMPARE_SCALAR_FIELD(isDefault);
1594 
1595  return true;
1596 }
1597 
1598 static bool
1600 {
1601  COMPARE_SCALAR_FIELD(itemtype);
1603  COMPARE_SCALAR_FIELD(number);
1604  COMPARE_NODE_FIELD(order_family);
1605  COMPARE_NODE_FIELD(class_args);
1606  COMPARE_NODE_FIELD(storedtype);
1607 
1608  return true;
1609 }
1610 
1611 static bool
1613 {
1614  COMPARE_NODE_FIELD(opfamilyname);
1615  COMPARE_STRING_FIELD(amname);
1616 
1617  return true;
1618 }
1619 
1620 static bool
1622 {
1623  COMPARE_NODE_FIELD(opfamilyname);
1624  COMPARE_STRING_FIELD(amname);
1625  COMPARE_SCALAR_FIELD(isDrop);
1626  COMPARE_NODE_FIELD(items);
1627 
1628  return true;
1629 }
1630 
1631 static bool
1633 {
1636 
1637  return true;
1638 }
1639 
1640 static bool
1642 {
1645 
1646  return true;
1647 }
1648 
1649 static bool
1651 {
1653  COMPARE_NODE_FIELD(setstmt);
1654 
1655  return true;
1656 }
1657 
1658 static bool
1660 {
1662  COMPARE_SCALAR_FIELD(missing_ok);
1663 
1664  return true;
1665 }
1666 
1667 static bool
1669 {
1671  COMPARE_NODE_FIELD(rels);
1672 
1673  return true;
1674 }
1675 
1676 static bool
1678 {
1679  COMPARE_NODE_FIELD(relation);
1680  COMPARE_SCALAR_FIELD(oid);
1681  COMPARE_NODE_FIELD(va_cols);
1682 
1683  return true;
1684 }
1685 
1686 static bool
1688 {
1689  COMPARE_NODE_FIELD(query);
1691 
1692  return true;
1693 }
1694 
1695 static bool
1697 {
1698  COMPARE_NODE_FIELD(query);
1699  COMPARE_NODE_FIELD(into);
1701  COMPARE_SCALAR_FIELD(is_select_into);
1702  COMPARE_SCALAR_FIELD(if_not_exists);
1703 
1704  return true;
1705 }
1706 
1707 static bool
1709 {
1710  COMPARE_SCALAR_FIELD(concurrent);
1711  COMPARE_SCALAR_FIELD(skipData);
1712  COMPARE_NODE_FIELD(relation);
1713 
1714  return true;
1715 }
1716 
1717 static bool
1719 {
1720  COMPARE_SCALAR_FIELD(identity_type);
1722 
1723  return true;
1724 }
1725 
1726 static bool
1728 {
1729  COMPARE_NODE_FIELD(setstmt);
1730 
1731  return true;
1732 }
1733 
1734 
1735 static bool
1737 {
1738  COMPARE_NODE_FIELD(sequence);
1740  COMPARE_SCALAR_FIELD(ownerId);
1741  COMPARE_SCALAR_FIELD(for_identity);
1742  COMPARE_SCALAR_FIELD(if_not_exists);
1743 
1744  return true;
1745 }
1746 
1747 static bool
1749 {
1750  COMPARE_NODE_FIELD(sequence);
1752  COMPARE_SCALAR_FIELD(for_identity);
1753  COMPARE_SCALAR_FIELD(missing_ok);
1754 
1755  return true;
1756 }
1757 
1758 static bool
1760 {
1761  COMPARE_SCALAR_FIELD(kind);
1764  COMPARE_SCALAR_FIELD(is_local);
1765 
1766  return true;
1767 }
1768 
1769 static bool
1771 {
1773 
1774  return true;
1775 }
1776 
1777 static bool
1779 {
1780  COMPARE_SCALAR_FIELD(target);
1781 
1782  return true;
1783 }
1784 
1785 static bool
1787 {
1788  COMPARE_STRING_FIELD(tablespacename);
1789  COMPARE_NODE_FIELD(owner);
1790  COMPARE_STRING_FIELD(location);
1792 
1793  return true;
1794 }
1795 
1796 static bool
1798 {
1799  COMPARE_STRING_FIELD(tablespacename);
1800  COMPARE_SCALAR_FIELD(missing_ok);
1801 
1802  return true;
1803 }
1804 
1805 static bool
1807  const AlterTableSpaceOptionsStmt *b)
1808 {
1809  COMPARE_STRING_FIELD(tablespacename);
1811  COMPARE_SCALAR_FIELD(isReset);
1812 
1813  return true;
1814 }
1815 
1816 static bool
1818  const AlterTableMoveAllStmt *b)
1819 {
1820  COMPARE_STRING_FIELD(orig_tablespacename);
1821  COMPARE_SCALAR_FIELD(objtype);
1822  COMPARE_NODE_FIELD(roles);
1823  COMPARE_STRING_FIELD(new_tablespacename);
1824  COMPARE_SCALAR_FIELD(nowait);
1825 
1826  return true;
1827 }
1828 
1829 static bool
1831 {
1832  COMPARE_STRING_FIELD(extname);
1833  COMPARE_SCALAR_FIELD(if_not_exists);
1835 
1836  return true;
1837 }
1838 
1839 static bool
1841 {
1842  COMPARE_STRING_FIELD(extname);
1844 
1845  return true;
1846 }
1847 
1848 static bool
1850 {
1851  COMPARE_STRING_FIELD(extname);
1853  COMPARE_SCALAR_FIELD(objtype);
1854  COMPARE_NODE_FIELD(object);
1855 
1856  return true;
1857 }
1858 
1859 static bool
1861 {
1862  COMPARE_STRING_FIELD(fdwname);
1863  COMPARE_NODE_FIELD(func_options);
1865 
1866  return true;
1867 }
1868 
1869 static bool
1871 {
1872  COMPARE_STRING_FIELD(fdwname);
1873  COMPARE_NODE_FIELD(func_options);
1875 
1876  return true;
1877 }
1878 
1879 static bool
1881 {
1882  COMPARE_STRING_FIELD(servername);
1883  COMPARE_STRING_FIELD(servertype);
1884  COMPARE_STRING_FIELD(version);
1885  COMPARE_STRING_FIELD(fdwname);
1886  COMPARE_SCALAR_FIELD(if_not_exists);
1888 
1889  return true;
1890 }
1891 
1892 static bool
1894 {
1895  COMPARE_STRING_FIELD(servername);
1896  COMPARE_STRING_FIELD(version);
1898  COMPARE_SCALAR_FIELD(has_version);
1899 
1900  return true;
1901 }
1902 
1903 static bool
1905 {
1907  COMPARE_STRING_FIELD(servername);
1908  COMPARE_SCALAR_FIELD(if_not_exists);
1910 
1911  return true;
1912 }
1913 
1914 static bool
1916 {
1918  COMPARE_STRING_FIELD(servername);
1920 
1921  return true;
1922 }
1923 
1924 static bool
1926 {
1928  COMPARE_STRING_FIELD(servername);
1929  COMPARE_SCALAR_FIELD(missing_ok);
1930 
1931  return true;
1932 }
1933 
1934 static bool
1936 {
1937  if (!_equalCreateStmt(&a->base, &b->base))
1938  return false;
1939 
1940  COMPARE_STRING_FIELD(servername);
1942 
1943  return true;
1944 }
1945 
1946 static bool
1948 {
1949  COMPARE_STRING_FIELD(server_name);
1950  COMPARE_STRING_FIELD(remote_schema);
1951  COMPARE_STRING_FIELD(local_schema);
1952  COMPARE_SCALAR_FIELD(list_type);
1953  COMPARE_NODE_FIELD(table_list);
1955 
1956  return true;
1957 }
1958 
1959 static bool
1961 {
1962  COMPARE_SCALAR_FIELD(replace);
1963  COMPARE_NODE_FIELD(type_name);
1964  COMPARE_STRING_FIELD(lang);
1965  COMPARE_NODE_FIELD(fromsql);
1966  COMPARE_NODE_FIELD(tosql);
1967 
1968  return true;
1969 }
1970 
1971 static bool
1973 {
1974  COMPARE_STRING_FIELD(amname);
1975  COMPARE_NODE_FIELD(handler_name);
1976  COMPARE_SCALAR_FIELD(amtype);
1977 
1978  return true;
1979 }
1980 
1981 static bool
1983 {
1984  COMPARE_STRING_FIELD(trigname);
1985  COMPARE_NODE_FIELD(relation);
1986  COMPARE_NODE_FIELD(funcname);
1988  COMPARE_SCALAR_FIELD(row);
1989  COMPARE_SCALAR_FIELD(timing);
1990  COMPARE_SCALAR_FIELD(events);
1991  COMPARE_NODE_FIELD(columns);
1992  COMPARE_NODE_FIELD(whenClause);
1993  COMPARE_SCALAR_FIELD(isconstraint);
1994  COMPARE_NODE_FIELD(transitionRels);
1995  COMPARE_SCALAR_FIELD(deferrable);
1996  COMPARE_SCALAR_FIELD(initdeferred);
1997  COMPARE_NODE_FIELD(constrrel);
1998 
1999  return true;
2000 }
2001 
2002 static bool
2004 {
2005  COMPARE_STRING_FIELD(trigname);
2006  COMPARE_STRING_FIELD(eventname);
2007  COMPARE_NODE_FIELD(whenclause);
2008  COMPARE_NODE_FIELD(funcname);
2009 
2010  return true;
2011 }
2012 
2013 static bool
2015 {
2016  COMPARE_STRING_FIELD(trigname);
2017  COMPARE_SCALAR_FIELD(tgenabled);
2018 
2019  return true;
2020 }
2021 
2022 static bool
2024 {
2025  COMPARE_SCALAR_FIELD(replace);
2026  COMPARE_STRING_FIELD(plname);
2027  COMPARE_NODE_FIELD(plhandler);
2028  COMPARE_NODE_FIELD(plinline);
2029  COMPARE_NODE_FIELD(plvalidator);
2030  COMPARE_SCALAR_FIELD(pltrusted);
2031 
2032  return true;
2033 }
2034 
2035 static bool
2037 {
2038  COMPARE_SCALAR_FIELD(stmt_type);
2039  COMPARE_STRING_FIELD(role);
2041 
2042  return true;
2043 }
2044 
2045 static bool
2047 {
2048  COMPARE_NODE_FIELD(role);
2051 
2052  return true;
2053 }
2054 
2055 static bool
2057 {
2058  COMPARE_NODE_FIELD(role);
2059  COMPARE_STRING_FIELD(database);
2060  COMPARE_NODE_FIELD(setstmt);
2061 
2062  return true;
2063 }
2064 
2065 static bool
2067 {
2068  COMPARE_NODE_FIELD(roles);
2069  COMPARE_SCALAR_FIELD(missing_ok);
2070 
2071  return true;
2072 }
2073 
2074 static bool
2075 _equalLockStmt(const LockStmt *a, const LockStmt *b)
2076 {
2077  COMPARE_NODE_FIELD(relations);
2078  COMPARE_SCALAR_FIELD(mode);
2079  COMPARE_SCALAR_FIELD(nowait);
2080 
2081  return true;
2082 }
2083 
2084 static bool
2086 {
2087  COMPARE_NODE_FIELD(constraints);
2088  COMPARE_SCALAR_FIELD(deferred);
2089 
2090  return true;
2091 }
2092 
2093 static bool
2095 {
2096  COMPARE_SCALAR_FIELD(kind);
2097  COMPARE_NODE_FIELD(relation);
2100 
2101  return true;
2102 }
2103 
2104 static bool
2106 {
2107  COMPARE_STRING_FIELD(schemaname);
2108  COMPARE_NODE_FIELD(authrole);
2109  COMPARE_NODE_FIELD(schemaElts);
2110  COMPARE_SCALAR_FIELD(if_not_exists);
2111 
2112  return true;
2113 }
2114 
2115 static bool
2117 {
2118  COMPARE_NODE_FIELD(conversion_name);
2119  COMPARE_STRING_FIELD(for_encoding_name);
2120  COMPARE_STRING_FIELD(to_encoding_name);
2121  COMPARE_NODE_FIELD(func_name);
2122  COMPARE_SCALAR_FIELD(def);
2123 
2124  return true;
2125 }
2126 
2127 static bool
2129 {
2130  COMPARE_NODE_FIELD(sourcetype);
2131  COMPARE_NODE_FIELD(targettype);
2132  COMPARE_NODE_FIELD(func);
2133  COMPARE_SCALAR_FIELD(context);
2134  COMPARE_SCALAR_FIELD(inout);
2135 
2136  return true;
2137 }
2138 
2139 static bool
2141 {
2143  COMPARE_NODE_FIELD(argtypes);
2144  COMPARE_NODE_FIELD(query);
2145 
2146  return true;
2147 }
2148 
2149 static bool
2151 {
2153  COMPARE_NODE_FIELD(params);
2154 
2155  return true;
2156 }
2157 
2158 static bool
2160 {
2162 
2163  return true;
2164 }
2165 
2166 static bool
2168 {
2169  COMPARE_NODE_FIELD(roles);
2170  COMPARE_SCALAR_FIELD(behavior);
2171 
2172  return true;
2173 }
2174 
2175 static bool
2177 {
2178  COMPARE_NODE_FIELD(roles);
2179  COMPARE_NODE_FIELD(newrole);
2180 
2181  return true;
2182 }
2183 
2184 static bool
2186 {
2187  COMPARE_NODE_FIELD(dictname);
2189 
2190  return true;
2191 }
2192 
2193 static bool
2195  const AlterTSConfigurationStmt *b)
2196 {
2197  COMPARE_SCALAR_FIELD(kind);
2198  COMPARE_NODE_FIELD(cfgname);
2199  COMPARE_NODE_FIELD(tokentype);
2200  COMPARE_NODE_FIELD(dicts);
2201  COMPARE_SCALAR_FIELD(override);
2202  COMPARE_SCALAR_FIELD(replace);
2203  COMPARE_SCALAR_FIELD(missing_ok);
2204 
2205  return true;
2206 }
2207 
2208 static bool
2210  const CreatePublicationStmt *b)
2211 {
2212  COMPARE_STRING_FIELD(pubname);
2214  COMPARE_NODE_FIELD(tables);
2215  COMPARE_SCALAR_FIELD(for_all_tables);
2216 
2217  return true;
2218 }
2219 
2220 static bool
2222  const AlterPublicationStmt *b)
2223 {
2224  COMPARE_STRING_FIELD(pubname);
2226  COMPARE_NODE_FIELD(tables);
2227  COMPARE_SCALAR_FIELD(for_all_tables);
2228  COMPARE_SCALAR_FIELD(tableAction);
2229 
2230  return true;
2231 }
2232 
2233 static bool
2235  const CreateSubscriptionStmt *b)
2236 {
2238  COMPARE_STRING_FIELD(conninfo);
2239  COMPARE_NODE_FIELD(publication);
2241 
2242  return true;
2243 }
2244 
2245 static bool
2247  const AlterSubscriptionStmt *b)
2248 {
2249  COMPARE_SCALAR_FIELD(kind);
2251  COMPARE_STRING_FIELD(conninfo);
2252  COMPARE_NODE_FIELD(publication);
2254 
2255  return true;
2256 }
2257 
2258 static bool
2260  const DropSubscriptionStmt *b)
2261 {
2263  COMPARE_SCALAR_FIELD(missing_ok);
2264  COMPARE_SCALAR_FIELD(behavior);
2265 
2266  return true;
2267 }
2268 
2269 static bool
2271 {
2272  COMPARE_STRING_FIELD(policy_name);
2273  COMPARE_NODE_FIELD(table);
2274  COMPARE_STRING_FIELD(cmd_name);
2275  COMPARE_SCALAR_FIELD(permissive);
2276  COMPARE_NODE_FIELD(roles);
2277  COMPARE_NODE_FIELD(qual);
2278  COMPARE_NODE_FIELD(with_check);
2279 
2280  return true;
2281 }
2282 
2283 static bool
2285 {
2286  COMPARE_STRING_FIELD(policy_name);
2287  COMPARE_NODE_FIELD(table);
2288  COMPARE_NODE_FIELD(roles);
2289  COMPARE_NODE_FIELD(qual);
2290  COMPARE_NODE_FIELD(with_check);
2291 
2292  return true;
2293 }
2294 
2295 static bool
2296 _equalAExpr(const A_Expr *a, const A_Expr *b)
2297 {
2298  COMPARE_SCALAR_FIELD(kind);
2300  COMPARE_NODE_FIELD(lexpr);
2301  COMPARE_NODE_FIELD(rexpr);
2302  COMPARE_LOCATION_FIELD(location);
2303 
2304  return true;
2305 }
2306 
2307 static bool
2309 {
2310  COMPARE_NODE_FIELD(fields);
2311  COMPARE_LOCATION_FIELD(location);
2312 
2313  return true;
2314 }
2315 
2316 static bool
2317 _equalParamRef(const ParamRef *a, const ParamRef *b)
2318 {
2319  COMPARE_SCALAR_FIELD(number);
2320  COMPARE_LOCATION_FIELD(location);
2321 
2322  return true;
2323 }
2324 
2325 static bool
2326 _equalAConst(const A_Const *a, const A_Const *b)
2327 {
2328  if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
2329  return false;
2330  COMPARE_LOCATION_FIELD(location);
2331 
2332  return true;
2333 }
2334 
2335 static bool
2336 _equalFuncCall(const FuncCall *a, const FuncCall *b)
2337 {
2338  COMPARE_NODE_FIELD(funcname);
2340  COMPARE_NODE_FIELD(agg_order);
2341  COMPARE_NODE_FIELD(agg_filter);
2342  COMPARE_SCALAR_FIELD(agg_within_group);
2343  COMPARE_SCALAR_FIELD(agg_star);
2344  COMPARE_SCALAR_FIELD(agg_distinct);
2345  COMPARE_SCALAR_FIELD(func_variadic);
2346  COMPARE_NODE_FIELD(over);
2347  COMPARE_LOCATION_FIELD(location);
2348 
2349  return true;
2350 }
2351 
2352 static bool
2353 _equalAStar(const A_Star *a, const A_Star *b)
2354 {
2355  return true;
2356 }
2357 
2358 static bool
2360 {
2361  COMPARE_SCALAR_FIELD(is_slice);
2362  COMPARE_NODE_FIELD(lidx);
2363  COMPARE_NODE_FIELD(uidx);
2364 
2365  return true;
2366 }
2367 
2368 static bool
2370 {
2372  COMPARE_NODE_FIELD(indirection);
2373 
2374  return true;
2375 }
2376 
2377 static bool
2379 {
2380  COMPARE_NODE_FIELD(elements);
2381  COMPARE_LOCATION_FIELD(location);
2382 
2383  return true;
2384 }
2385 
2386 static bool
2388 {
2390  COMPARE_NODE_FIELD(indirection);
2392  COMPARE_LOCATION_FIELD(location);
2393 
2394  return true;
2395 }
2396 
2397 static bool
2399 {
2400  COMPARE_NODE_FIELD(source);
2401  COMPARE_SCALAR_FIELD(colno);
2402  COMPARE_SCALAR_FIELD(ncolumns);
2403 
2404  return true;
2405 }
2406 
2407 static bool
2408 _equalTypeName(const TypeName *a, const TypeName *b)
2409 {
2410  COMPARE_NODE_FIELD(names);
2411  COMPARE_SCALAR_FIELD(typeOid);
2412  COMPARE_SCALAR_FIELD(setof);
2413  COMPARE_SCALAR_FIELD(pct_type);
2414  COMPARE_NODE_FIELD(typmods);
2415  COMPARE_SCALAR_FIELD(typemod);
2416  COMPARE_NODE_FIELD(arrayBounds);
2417  COMPARE_LOCATION_FIELD(location);
2418 
2419  return true;
2420 }
2421 
2422 static bool
2423 _equalTypeCast(const TypeCast *a, const TypeCast *b)
2424 {
2426  COMPARE_NODE_FIELD(typeName);
2427  COMPARE_LOCATION_FIELD(location);
2428 
2429  return true;
2430 }
2431 
2432 static bool
2434 {
2436  COMPARE_NODE_FIELD(collname);
2437  COMPARE_LOCATION_FIELD(location);
2438 
2439  return true;
2440 }
2441 
2442 static bool
2443 _equalSortBy(const SortBy *a, const SortBy *b)
2444 {
2445  COMPARE_NODE_FIELD(node);
2446  COMPARE_SCALAR_FIELD(sortby_dir);
2447  COMPARE_SCALAR_FIELD(sortby_nulls);
2448  COMPARE_NODE_FIELD(useOp);
2449  COMPARE_LOCATION_FIELD(location);
2450 
2451  return true;
2452 }
2453 
2454 static bool
2456 {
2458  COMPARE_STRING_FIELD(refname);
2459  COMPARE_NODE_FIELD(partitionClause);
2460  COMPARE_NODE_FIELD(orderClause);
2461  COMPARE_SCALAR_FIELD(frameOptions);
2462  COMPARE_NODE_FIELD(startOffset);
2463  COMPARE_NODE_FIELD(endOffset);
2464  COMPARE_LOCATION_FIELD(location);
2465 
2466  return true;
2467 }
2468 
2469 static bool
2471 {
2472  COMPARE_SCALAR_FIELD(lateral);
2473  COMPARE_NODE_FIELD(subquery);
2474  COMPARE_NODE_FIELD(alias);
2475 
2476  return true;
2477 }
2478 
2479 static bool
2481 {
2482  COMPARE_SCALAR_FIELD(lateral);
2483  COMPARE_SCALAR_FIELD(ordinality);
2484  COMPARE_SCALAR_FIELD(is_rowsfrom);
2486  COMPARE_NODE_FIELD(alias);
2487  COMPARE_NODE_FIELD(coldeflist);
2488 
2489  return true;
2490 }
2491 
2492 static bool
2494 {
2495  COMPARE_NODE_FIELD(relation);
2496  COMPARE_NODE_FIELD(method);
2498  COMPARE_NODE_FIELD(repeatable);
2499  COMPARE_LOCATION_FIELD(location);
2500 
2501  return true;
2502 }
2503 
2504 static bool
2506 {
2507  COMPARE_SCALAR_FIELD(lateral);
2508  COMPARE_NODE_FIELD(docexpr);
2509  COMPARE_NODE_FIELD(rowexpr);
2510  COMPARE_NODE_FIELD(namespaces);
2511  COMPARE_NODE_FIELD(columns);
2512  COMPARE_NODE_FIELD(alias);
2513  COMPARE_LOCATION_FIELD(location);
2514 
2515  return true;
2516 }
2517 
2518 static bool
2520 {
2521  COMPARE_STRING_FIELD(colname);
2522  COMPARE_NODE_FIELD(typeName);
2523  COMPARE_SCALAR_FIELD(for_ordinality);
2524  COMPARE_SCALAR_FIELD(is_not_null);
2525  COMPARE_NODE_FIELD(colexpr);
2526  COMPARE_NODE_FIELD(coldefexpr);
2527  COMPARE_LOCATION_FIELD(location);
2528 
2529  return true;
2530 }
2531 
2532 
2533 static bool
2535 {
2537  COMPARE_NODE_FIELD(expr);
2538  COMPARE_STRING_FIELD(indexcolname);
2539  COMPARE_NODE_FIELD(collation);
2540  COMPARE_NODE_FIELD(opclass);
2541  COMPARE_SCALAR_FIELD(ordering);
2542  COMPARE_SCALAR_FIELD(nulls_ordering);
2543 
2544  return true;
2545 }
2546 
2547 static bool
2549 {
2550  COMPARE_STRING_FIELD(colname);
2551  COMPARE_NODE_FIELD(typeName);
2552  COMPARE_SCALAR_FIELD(inhcount);
2553  COMPARE_SCALAR_FIELD(is_local);
2554  COMPARE_SCALAR_FIELD(is_not_null);
2555  COMPARE_SCALAR_FIELD(is_from_type);
2556  COMPARE_SCALAR_FIELD(is_from_parent);
2557  COMPARE_SCALAR_FIELD(storage);
2558  COMPARE_NODE_FIELD(raw_default);
2559  COMPARE_NODE_FIELD(cooked_default);
2560  COMPARE_SCALAR_FIELD(identity);
2561  COMPARE_NODE_FIELD(identitySequence);
2562  COMPARE_NODE_FIELD(collClause);
2563  COMPARE_SCALAR_FIELD(collOid);
2564  COMPARE_NODE_FIELD(constraints);
2565  COMPARE_NODE_FIELD(fdwoptions);
2566  COMPARE_LOCATION_FIELD(location);
2567 
2568  return true;
2569 }
2570 
2571 static bool
2573 {
2574  COMPARE_SCALAR_FIELD(contype);
2575  COMPARE_STRING_FIELD(conname);
2576  COMPARE_SCALAR_FIELD(deferrable);
2577  COMPARE_SCALAR_FIELD(initdeferred);
2578  COMPARE_LOCATION_FIELD(location);
2579  COMPARE_SCALAR_FIELD(is_no_inherit);
2580  COMPARE_NODE_FIELD(raw_expr);
2581  COMPARE_STRING_FIELD(cooked_expr);
2582  COMPARE_SCALAR_FIELD(generated_when);
2583  COMPARE_NODE_FIELD(keys);
2584  COMPARE_NODE_FIELD(including);
2585  COMPARE_NODE_FIELD(exclusions);
2587  COMPARE_STRING_FIELD(indexname);
2588  COMPARE_STRING_FIELD(indexspace);
2589  COMPARE_STRING_FIELD(access_method);
2590  COMPARE_NODE_FIELD(where_clause);
2591  COMPARE_NODE_FIELD(pktable);
2592  COMPARE_NODE_FIELD(fk_attrs);
2593  COMPARE_NODE_FIELD(pk_attrs);
2594  COMPARE_SCALAR_FIELD(fk_matchtype);
2595  COMPARE_SCALAR_FIELD(fk_upd_action);
2596  COMPARE_SCALAR_FIELD(fk_del_action);
2597  COMPARE_NODE_FIELD(old_conpfeqop);
2598  COMPARE_SCALAR_FIELD(old_pktable_oid);
2599  COMPARE_SCALAR_FIELD(skip_validation);
2600  COMPARE_SCALAR_FIELD(initially_valid);
2601 
2602  return true;
2603 }
2604 
2605 static bool
2606 _equalDefElem(const DefElem *a, const DefElem *b)
2607 {
2608  COMPARE_STRING_FIELD(defnamespace);
2609  COMPARE_STRING_FIELD(defname);
2611  COMPARE_SCALAR_FIELD(defaction);
2612  COMPARE_LOCATION_FIELD(location);
2613 
2614  return true;
2615 }
2616 
2617 static bool
2619 {
2620  COMPARE_NODE_FIELD(lockedRels);
2621  COMPARE_SCALAR_FIELD(strength);
2622  COMPARE_SCALAR_FIELD(waitPolicy);
2623 
2624  return true;
2625 }
2626 
2627 static bool
2629 {
2630  COMPARE_SCALAR_FIELD(rtekind);
2631  COMPARE_SCALAR_FIELD(relid);
2633  COMPARE_NODE_FIELD(tablesample);
2634  COMPARE_NODE_FIELD(subquery);
2635  COMPARE_SCALAR_FIELD(security_barrier);
2636  COMPARE_SCALAR_FIELD(jointype);
2637  COMPARE_NODE_FIELD(joinaliasvars);
2639  COMPARE_SCALAR_FIELD(funcordinality);
2640  COMPARE_NODE_FIELD(tablefunc);
2641  COMPARE_NODE_FIELD(values_lists);
2642  COMPARE_STRING_FIELD(ctename);
2643  COMPARE_SCALAR_FIELD(ctelevelsup);
2644  COMPARE_SCALAR_FIELD(self_reference);
2645  COMPARE_NODE_FIELD(coltypes);
2646  COMPARE_NODE_FIELD(coltypmods);
2647  COMPARE_NODE_FIELD(colcollations);
2648  COMPARE_STRING_FIELD(enrname);
2649  COMPARE_SCALAR_FIELD(enrtuples);
2650  COMPARE_NODE_FIELD(alias);
2651  COMPARE_NODE_FIELD(eref);
2652  COMPARE_SCALAR_FIELD(lateral);
2653  COMPARE_SCALAR_FIELD(inh);
2654  COMPARE_SCALAR_FIELD(inFromCl);
2655  COMPARE_SCALAR_FIELD(requiredPerms);
2656  COMPARE_SCALAR_FIELD(checkAsUser);
2657  COMPARE_BITMAPSET_FIELD(selectedCols);
2658  COMPARE_BITMAPSET_FIELD(insertedCols);
2659  COMPARE_BITMAPSET_FIELD(updatedCols);
2660  COMPARE_NODE_FIELD(securityQuals);
2661 
2662  return true;
2663 }
2664 
2665 static bool
2667 {
2668  COMPARE_NODE_FIELD(funcexpr);
2669  COMPARE_SCALAR_FIELD(funccolcount);
2670  COMPARE_NODE_FIELD(funccolnames);
2671  COMPARE_NODE_FIELD(funccoltypes);
2672  COMPARE_NODE_FIELD(funccoltypmods);
2673  COMPARE_NODE_FIELD(funccolcollations);
2674  COMPARE_BITMAPSET_FIELD(funcparams);
2675 
2676  return true;
2677 }
2678 
2679 static bool
2681 {
2682  COMPARE_SCALAR_FIELD(tsmhandler);
2684  COMPARE_NODE_FIELD(repeatable);
2685 
2686  return true;
2687 }
2688 
2689 static bool
2691 {
2692  COMPARE_SCALAR_FIELD(kind);
2693  COMPARE_STRING_FIELD(relname);
2694  COMPARE_STRING_FIELD(polname);
2695  COMPARE_NODE_FIELD(qual);
2696  COMPARE_SCALAR_FIELD(cascaded);
2697 
2698  return true;
2699 }
2700 
2701 static bool
2703 {
2704  COMPARE_SCALAR_FIELD(tleSortGroupRef);
2705  COMPARE_SCALAR_FIELD(eqop);
2706  COMPARE_SCALAR_FIELD(sortop);
2707  COMPARE_SCALAR_FIELD(nulls_first);
2708  COMPARE_SCALAR_FIELD(hashable);
2709 
2710  return true;
2711 }
2712 
2713 static bool
2715 {
2716  COMPARE_SCALAR_FIELD(kind);
2717  COMPARE_NODE_FIELD(content);
2718  COMPARE_LOCATION_FIELD(location);
2719 
2720  return true;
2721 }
2722 
2723 static bool
2725 {
2727  COMPARE_STRING_FIELD(refname);
2728  COMPARE_NODE_FIELD(partitionClause);
2729  COMPARE_NODE_FIELD(orderClause);
2730  COMPARE_SCALAR_FIELD(frameOptions);
2731  COMPARE_NODE_FIELD(startOffset);
2732  COMPARE_NODE_FIELD(endOffset);
2733  COMPARE_SCALAR_FIELD(startInRangeFunc);
2734  COMPARE_SCALAR_FIELD(endInRangeFunc);
2735  COMPARE_SCALAR_FIELD(inRangeColl);
2736  COMPARE_SCALAR_FIELD(inRangeAsc);
2737  COMPARE_SCALAR_FIELD(inRangeNullsFirst);
2738  COMPARE_SCALAR_FIELD(winref);
2739  COMPARE_SCALAR_FIELD(copiedOrder);
2740 
2741  return true;
2742 }
2743 
2744 static bool
2746 {
2747  COMPARE_SCALAR_FIELD(rti);
2748  COMPARE_SCALAR_FIELD(strength);
2749  COMPARE_SCALAR_FIELD(waitPolicy);
2750  COMPARE_SCALAR_FIELD(pushedDown);
2751 
2752  return true;
2753 }
2754 
2755 static bool
2757 {
2758  COMPARE_NODE_FIELD(ctes);
2759  COMPARE_SCALAR_FIELD(recursive);
2760  COMPARE_LOCATION_FIELD(location);
2761 
2762  return true;
2763 }
2764 
2765 static bool
2767 {
2768  COMPARE_NODE_FIELD(indexElems);
2769  COMPARE_NODE_FIELD(whereClause);
2770  COMPARE_STRING_FIELD(conname);
2771  COMPARE_LOCATION_FIELD(location);
2772 
2773  return true;
2774 }
2775 
2776 static bool
2778 {
2780  COMPARE_NODE_FIELD(infer);
2781  COMPARE_NODE_FIELD(targetList);
2782  COMPARE_NODE_FIELD(whereClause);
2783  COMPARE_LOCATION_FIELD(location);
2784 
2785  return true;
2786 }
2787 
2788 static bool
2790 {
2791  COMPARE_STRING_FIELD(ctename);
2792  COMPARE_NODE_FIELD(aliascolnames);
2793  COMPARE_NODE_FIELD(ctequery);
2794  COMPARE_LOCATION_FIELD(location);
2795  COMPARE_SCALAR_FIELD(cterecursive);
2796  COMPARE_SCALAR_FIELD(cterefcount);
2797  COMPARE_NODE_FIELD(ctecolnames);
2798  COMPARE_NODE_FIELD(ctecoltypes);
2799  COMPARE_NODE_FIELD(ctecoltypmods);
2800  COMPARE_NODE_FIELD(ctecolcollations);
2801 
2802  return true;
2803 }
2804 
2805 static bool
2807 {
2809  COMPARE_NODE_FIELD(expr);
2810  COMPARE_NODE_FIELD(typeName);
2811  COMPARE_LOCATION_FIELD(location);
2812 
2813  return true;
2814 }
2815 
2816 static bool
2817 _equalRoleSpec(const RoleSpec *a, const RoleSpec *b)
2818 {
2819  COMPARE_SCALAR_FIELD(roletype);
2820  COMPARE_STRING_FIELD(rolename);
2821  COMPARE_LOCATION_FIELD(location);
2822 
2823  return true;
2824 }
2825 
2826 static bool
2828 {
2830  COMPARE_SCALAR_FIELD(isNew);
2831  COMPARE_SCALAR_FIELD(isTable);
2832 
2833  return true;
2834 }
2835 
2836 static bool
2838 {
2840  COMPARE_NODE_FIELD(expr);
2841  COMPARE_NODE_FIELD(collation);
2842  COMPARE_NODE_FIELD(opclass);
2843  COMPARE_LOCATION_FIELD(location);
2844 
2845  return true;
2846 }
2847 
2848 static bool
2850 {
2851  COMPARE_STRING_FIELD(strategy);
2852  COMPARE_NODE_FIELD(partParams);
2853  COMPARE_LOCATION_FIELD(location);
2854 
2855  return true;
2856 }
2857 
2858 static bool
2860 {
2861  COMPARE_SCALAR_FIELD(strategy);
2862  COMPARE_SCALAR_FIELD(is_default);
2863  COMPARE_SCALAR_FIELD(modulus);
2864  COMPARE_SCALAR_FIELD(remainder);
2865  COMPARE_NODE_FIELD(listdatums);
2866  COMPARE_NODE_FIELD(lowerdatums);
2867  COMPARE_NODE_FIELD(upperdatums);
2868  COMPARE_LOCATION_FIELD(location);
2869 
2870  return true;
2871 }
2872 
2873 static bool
2875 {
2876  COMPARE_SCALAR_FIELD(kind);
2878  COMPARE_LOCATION_FIELD(location);
2879 
2880  return true;
2881 }
2882 
2883 static bool
2885 {
2887  COMPARE_NODE_FIELD(bound);
2888 
2889  return true;
2890 }
2891 
2892 /*
2893  * Stuff from pg_list.h
2894  */
2895 
2896 static bool
2897 _equalList(const List *a, const List *b)
2898 {
2899  const ListCell *item_a;
2900  const ListCell *item_b;
2901 
2902  /*
2903  * Try to reject by simple scalar checks before grovelling through all the
2904  * list elements...
2905  */
2908 
2909  /*
2910  * We place the switch outside the loop for the sake of efficiency; this
2911  * may not be worth doing...
2912  */
2913  switch (a->type)
2914  {
2915  case T_List:
2916  forboth(item_a, a, item_b, b)
2917  {
2918  if (!equal(lfirst(item_a), lfirst(item_b)))
2919  return false;
2920  }
2921  break;
2922  case T_IntList:
2923  forboth(item_a, a, item_b, b)
2924  {
2925  if (lfirst_int(item_a) != lfirst_int(item_b))
2926  return false;
2927  }
2928  break;
2929  case T_OidList:
2930  forboth(item_a, a, item_b, b)
2931  {
2932  if (lfirst_oid(item_a) != lfirst_oid(item_b))
2933  return false;
2934  }
2935  break;
2936  default:
2937  elog(ERROR, "unrecognized list node type: %d",
2938  (int) a->type);
2939  return false; /* keep compiler quiet */
2940  }
2941 
2942  /*
2943  * If we got here, we should have run out of elements of both lists
2944  */
2945  Assert(item_a == NULL);
2946  Assert(item_b == NULL);
2947 
2948  return true;
2949 }
2950 
2951 /*
2952  * Stuff from value.h
2953  */
2954 
2955 static bool
2956 _equalValue(const Value *a, const Value *b)
2957 {
2959 
2960  switch (a->type)
2961  {
2962  case T_Integer:
2963  COMPARE_SCALAR_FIELD(val.ival);
2964  break;
2965  case T_Float:
2966  case T_String:
2967  case T_BitString:
2969  break;
2970  case T_Null:
2971  /* nothing to do */
2972  break;
2973  default:
2974  elog(ERROR, "unrecognized node type: %d", (int) a->type);
2975  break;
2976  }
2977 
2978  return true;
2979 }
2980 
2981 /*
2982  * equal
2983  * returns whether two nodes are equal
2984  */
2985 bool
2986 equal(const void *a, const void *b)
2987 {
2988  bool retval;
2989 
2990  if (a == b)
2991  return true;
2992 
2993  /*
2994  * note that a!=b, so only one of them can be NULL
2995  */
2996  if (a == NULL || b == NULL)
2997  return false;
2998 
2999  /*
3000  * are they the same type of nodes?
3001  */
3002  if (nodeTag(a) != nodeTag(b))
3003  return false;
3004 
3005  switch (nodeTag(a))
3006  {
3007  /*
3008  * PRIMITIVE NODES
3009  */
3010  case T_Alias:
3011  retval = _equalAlias(a, b);
3012  break;
3013  case T_RangeVar:
3014  retval = _equalRangeVar(a, b);
3015  break;
3016  case T_TableFunc:
3017  retval = _equalTableFunc(a, b);
3018  break;
3019  case T_IntoClause:
3020  retval = _equalIntoClause(a, b);
3021  break;
3022  case T_Var:
3023  retval = _equalVar(a, b);
3024  break;
3025  case T_Const:
3026  retval = _equalConst(a, b);
3027  break;
3028  case T_Param:
3029  retval = _equalParam(a, b);
3030  break;
3031  case T_Aggref:
3032  retval = _equalAggref(a, b);
3033  break;
3034  case T_GroupingFunc:
3035  retval = _equalGroupingFunc(a, b);
3036  break;
3037  case T_WindowFunc:
3038  retval = _equalWindowFunc(a, b);
3039  break;
3040  case T_ArrayRef:
3041  retval = _equalArrayRef(a, b);
3042  break;
3043  case T_FuncExpr:
3044  retval = _equalFuncExpr(a, b);
3045  break;
3046  case T_NamedArgExpr:
3047  retval = _equalNamedArgExpr(a, b);
3048  break;
3049  case T_OpExpr:
3050  retval = _equalOpExpr(a, b);
3051  break;
3052  case T_DistinctExpr:
3053  retval = _equalDistinctExpr(a, b);
3054  break;
3055  case T_NullIfExpr:
3056  retval = _equalNullIfExpr(a, b);
3057  break;
3058  case T_ScalarArrayOpExpr:
3059  retval = _equalScalarArrayOpExpr(a, b);
3060  break;
3061  case T_BoolExpr:
3062  retval = _equalBoolExpr(a, b);
3063  break;
3064  case T_SubLink:
3065  retval = _equalSubLink(a, b);
3066  break;
3067  case T_SubPlan:
3068  retval = _equalSubPlan(a, b);
3069  break;
3070  case T_AlternativeSubPlan:
3071  retval = _equalAlternativeSubPlan(a, b);
3072  break;
3073  case T_FieldSelect:
3074  retval = _equalFieldSelect(a, b);
3075  break;
3076  case T_FieldStore:
3077  retval = _equalFieldStore(a, b);
3078  break;
3079  case T_RelabelType:
3080  retval = _equalRelabelType(a, b);
3081  break;
3082  case T_CoerceViaIO:
3083  retval = _equalCoerceViaIO(a, b);
3084  break;
3085  case T_ArrayCoerceExpr:
3086  retval = _equalArrayCoerceExpr(a, b);
3087  break;
3088  case T_ConvertRowtypeExpr:
3089  retval = _equalConvertRowtypeExpr(a, b);
3090  break;
3091  case T_CollateExpr:
3092  retval = _equalCollateExpr(a, b);
3093  break;
3094  case T_CaseExpr:
3095  retval = _equalCaseExpr(a, b);
3096  break;
3097  case T_CaseWhen:
3098  retval = _equalCaseWhen(a, b);
3099  break;
3100  case T_CaseTestExpr:
3101  retval = _equalCaseTestExpr(a, b);
3102  break;
3103  case T_ArrayExpr:
3104  retval = _equalArrayExpr(a, b);
3105  break;
3106  case T_RowExpr:
3107  retval = _equalRowExpr(a, b);
3108  break;
3109  case T_RowCompareExpr:
3110  retval = _equalRowCompareExpr(a, b);
3111  break;
3112  case T_CoalesceExpr:
3113  retval = _equalCoalesceExpr(a, b);
3114  break;
3115  case T_MinMaxExpr:
3116  retval = _equalMinMaxExpr(a, b);
3117  break;
3118  case T_SQLValueFunction:
3119  retval = _equalSQLValueFunction(a, b);
3120  break;
3121  case T_XmlExpr:
3122  retval = _equalXmlExpr(a, b);
3123  break;
3124  case T_NullTest:
3125  retval = _equalNullTest(a, b);
3126  break;
3127  case T_BooleanTest:
3128  retval = _equalBooleanTest(a, b);
3129  break;
3130  case T_CoerceToDomain:
3131  retval = _equalCoerceToDomain(a, b);
3132  break;
3133  case T_CoerceToDomainValue:
3134  retval = _equalCoerceToDomainValue(a, b);
3135  break;
3136  case T_SetToDefault:
3137  retval = _equalSetToDefault(a, b);
3138  break;
3139  case T_CurrentOfExpr:
3140  retval = _equalCurrentOfExpr(a, b);
3141  break;
3142  case T_NextValueExpr:
3143  retval = _equalNextValueExpr(a, b);
3144  break;
3145  case T_InferenceElem:
3146  retval = _equalInferenceElem(a, b);
3147  break;
3148  case T_TargetEntry:
3149  retval = _equalTargetEntry(a, b);
3150  break;
3151  case T_RangeTblRef:
3152  retval = _equalRangeTblRef(a, b);
3153  break;
3154  case T_FromExpr:
3155  retval = _equalFromExpr(a, b);
3156  break;
3157  case T_OnConflictExpr:
3158  retval = _equalOnConflictExpr(a, b);
3159  break;
3160  case T_JoinExpr:
3161  retval = _equalJoinExpr(a, b);
3162  break;
3163 
3164  /*
3165  * RELATION NODES
3166  */
3167  case T_PathKey:
3168  retval = _equalPathKey(a, b);
3169  break;
3170  case T_RestrictInfo:
3171  retval = _equalRestrictInfo(a, b);
3172  break;
3173  case T_PlaceHolderVar:
3174  retval = _equalPlaceHolderVar(a, b);
3175  break;
3176  case T_SpecialJoinInfo:
3177  retval = _equalSpecialJoinInfo(a, b);
3178  break;
3179  case T_AppendRelInfo:
3180  retval = _equalAppendRelInfo(a, b);
3181  break;
3182  case T_PlaceHolderInfo:
3183  retval = _equalPlaceHolderInfo(a, b);
3184  break;
3185 
3186  case T_List:
3187  case T_IntList:
3188  case T_OidList:
3189  retval = _equalList(a, b);
3190  break;
3191 
3192  case T_Integer:
3193  case T_Float:
3194  case T_String:
3195  case T_BitString:
3196  case T_Null:
3197  retval = _equalValue(a, b);
3198  break;
3199 
3200  /*
3201  * EXTENSIBLE NODES
3202  */
3203  case T_ExtensibleNode:
3204  retval = _equalExtensibleNode(a, b);
3205  break;
3206 
3207  /*
3208  * PARSE NODES
3209  */
3210  case T_Query:
3211  retval = _equalQuery(a, b);
3212  break;
3213  case T_RawStmt:
3214  retval = _equalRawStmt(a, b);
3215  break;
3216  case T_InsertStmt:
3217  retval = _equalInsertStmt(a, b);
3218  break;
3219  case T_DeleteStmt:
3220  retval = _equalDeleteStmt(a, b);
3221  break;
3222  case T_UpdateStmt:
3223  retval = _equalUpdateStmt(a, b);
3224  break;
3225  case T_SelectStmt:
3226  retval = _equalSelectStmt(a, b);
3227  break;
3228  case T_SetOperationStmt:
3229  retval = _equalSetOperationStmt(a, b);
3230  break;
3231  case T_AlterTableStmt:
3232  retval = _equalAlterTableStmt(a, b);
3233  break;
3234  case T_AlterTableCmd:
3235  retval = _equalAlterTableCmd(a, b);
3236  break;
3237  case T_AlterCollationStmt:
3238  retval = _equalAlterCollationStmt(a, b);
3239  break;
3240  case T_AlterDomainStmt:
3241  retval = _equalAlterDomainStmt(a, b);
3242  break;
3243  case T_GrantStmt:
3244  retval = _equalGrantStmt(a, b);
3245  break;
3246  case T_GrantRoleStmt:
3247  retval = _equalGrantRoleStmt(a, b);
3248  break;
3250  retval = _equalAlterDefaultPrivilegesStmt(a, b);
3251  break;
3252  case T_DeclareCursorStmt:
3253  retval = _equalDeclareCursorStmt(a, b);
3254  break;
3255  case T_ClosePortalStmt:
3256  retval = _equalClosePortalStmt(a, b);
3257  break;
3258  case T_CallStmt:
3259  retval = _equalCallStmt(a, b);
3260  break;
3261  case T_ClusterStmt:
3262  retval = _equalClusterStmt(a, b);
3263  break;
3264  case T_CopyStmt:
3265  retval = _equalCopyStmt(a, b);
3266  break;
3267  case T_CreateStmt:
3268  retval = _equalCreateStmt(a, b);
3269  break;
3270  case T_TableLikeClause:
3271  retval = _equalTableLikeClause(a, b);
3272  break;
3273  case T_DefineStmt:
3274  retval = _equalDefineStmt(a, b);
3275  break;
3276  case T_DropStmt:
3277  retval = _equalDropStmt(a, b);
3278  break;
3279  case T_TruncateStmt:
3280  retval = _equalTruncateStmt(a, b);
3281  break;
3282  case T_CommentStmt:
3283  retval = _equalCommentStmt(a, b);
3284  break;
3285  case T_SecLabelStmt:
3286  retval = _equalSecLabelStmt(a, b);
3287  break;
3288  case T_FetchStmt:
3289  retval = _equalFetchStmt(a, b);
3290  break;
3291  case T_IndexStmt:
3292  retval = _equalIndexStmt(a, b);
3293  break;
3294  case T_CreateStatsStmt:
3295  retval = _equalCreateStatsStmt(a, b);
3296  break;
3297  case T_CreateFunctionStmt:
3298  retval = _equalCreateFunctionStmt(a, b);
3299  break;
3300  case T_FunctionParameter:
3301  retval = _equalFunctionParameter(a, b);
3302  break;
3303  case T_AlterFunctionStmt:
3304  retval = _equalAlterFunctionStmt(a, b);
3305  break;
3306  case T_DoStmt:
3307  retval = _equalDoStmt(a, b);
3308  break;
3309  case T_RenameStmt:
3310  retval = _equalRenameStmt(a, b);
3311  break;
3313  retval = _equalAlterObjectDependsStmt(a, b);
3314  break;
3316  retval = _equalAlterObjectSchemaStmt(a, b);
3317  break;
3318  case T_AlterOwnerStmt:
3319  retval = _equalAlterOwnerStmt(a, b);
3320  break;
3321  case T_AlterOperatorStmt:
3322  retval = _equalAlterOperatorStmt(a, b);
3323  break;
3324  case T_RuleStmt:
3325  retval = _equalRuleStmt(a, b);
3326  break;
3327  case T_NotifyStmt:
3328  retval = _equalNotifyStmt(a, b);
3329  break;
3330  case T_ListenStmt:
3331  retval = _equalListenStmt(a, b);
3332  break;
3333  case T_UnlistenStmt:
3334  retval = _equalUnlistenStmt(a, b);
3335  break;
3336  case T_TransactionStmt:
3337  retval = _equalTransactionStmt(a, b);
3338  break;
3339  case T_CompositeTypeStmt:
3340  retval = _equalCompositeTypeStmt(a, b);
3341  break;
3342  case T_CreateEnumStmt:
3343  retval = _equalCreateEnumStmt(a, b);
3344  break;
3345  case T_CreateRangeStmt:
3346  retval = _equalCreateRangeStmt(a, b);
3347  break;
3348  case T_AlterEnumStmt:
3349  retval = _equalAlterEnumStmt(a, b);
3350  break;
3351  case T_ViewStmt:
3352  retval = _equalViewStmt(a, b);
3353  break;
3354  case T_LoadStmt:
3355  retval = _equalLoadStmt(a, b);
3356  break;
3357  case T_CreateDomainStmt:
3358  retval = _equalCreateDomainStmt(a, b);
3359  break;
3360  case T_CreateOpClassStmt:
3361  retval = _equalCreateOpClassStmt(a, b);
3362  break;
3363  case T_CreateOpClassItem:
3364  retval = _equalCreateOpClassItem(a, b);
3365  break;
3366  case T_CreateOpFamilyStmt:
3367  retval = _equalCreateOpFamilyStmt(a, b);
3368  break;
3369  case T_AlterOpFamilyStmt:
3370  retval = _equalAlterOpFamilyStmt(a, b);
3371  break;
3372  case T_CreatedbStmt:
3373  retval = _equalCreatedbStmt(a, b);
3374  break;
3375  case T_AlterDatabaseStmt:
3376  retval = _equalAlterDatabaseStmt(a, b);
3377  break;
3379  retval = _equalAlterDatabaseSetStmt(a, b);
3380  break;
3381  case T_DropdbStmt:
3382  retval = _equalDropdbStmt(a, b);
3383  break;
3384  case T_VacuumStmt:
3385  retval = _equalVacuumStmt(a, b);
3386  break;
3387  case T_VacuumRelation:
3388  retval = _equalVacuumRelation(a, b);
3389  break;
3390  case T_ExplainStmt:
3391  retval = _equalExplainStmt(a, b);
3392  break;
3393  case T_CreateTableAsStmt:
3394  retval = _equalCreateTableAsStmt(a, b);
3395  break;
3396  case T_RefreshMatViewStmt:
3397  retval = _equalRefreshMatViewStmt(a, b);
3398  break;
3399  case T_ReplicaIdentityStmt:
3400  retval = _equalReplicaIdentityStmt(a, b);
3401  break;
3402  case T_AlterSystemStmt:
3403  retval = _equalAlterSystemStmt(a, b);
3404  break;
3405  case T_CreateSeqStmt:
3406  retval = _equalCreateSeqStmt(a, b);
3407  break;
3408  case T_AlterSeqStmt:
3409  retval = _equalAlterSeqStmt(a, b);
3410  break;
3411  case T_VariableSetStmt:
3412  retval = _equalVariableSetStmt(a, b);
3413  break;
3414  case T_VariableShowStmt:
3415  retval = _equalVariableShowStmt(a, b);
3416  break;
3417  case T_DiscardStmt:
3418  retval = _equalDiscardStmt(a, b);
3419  break;
3421  retval = _equalCreateTableSpaceStmt(a, b);
3422  break;
3423  case T_DropTableSpaceStmt:
3424  retval = _equalDropTableSpaceStmt(a, b);
3425  break;
3427  retval = _equalAlterTableSpaceOptionsStmt(a, b);
3428  break;
3430  retval = _equalAlterTableMoveAllStmt(a, b);
3431  break;
3432  case T_CreateExtensionStmt:
3433  retval = _equalCreateExtensionStmt(a, b);
3434  break;
3435  case T_AlterExtensionStmt:
3436  retval = _equalAlterExtensionStmt(a, b);
3437  break;
3439  retval = _equalAlterExtensionContentsStmt(a, b);
3440  break;
3441  case T_CreateFdwStmt:
3442  retval = _equalCreateFdwStmt(a, b);
3443  break;
3444  case T_AlterFdwStmt:
3445  retval = _equalAlterFdwStmt(a, b);
3446  break;
3448  retval = _equalCreateForeignServerStmt(a, b);
3449  break;
3451  retval = _equalAlterForeignServerStmt(a, b);
3452  break;
3454  retval = _equalCreateUserMappingStmt(a, b);
3455  break;
3457  retval = _equalAlterUserMappingStmt(a, b);
3458  break;
3459  case T_DropUserMappingStmt:
3460  retval = _equalDropUserMappingStmt(a, b);
3461  break;
3463  retval = _equalCreateForeignTableStmt(a, b);
3464  break;
3466  retval = _equalImportForeignSchemaStmt(a, b);
3467  break;
3468  case T_CreateTransformStmt:
3469  retval = _equalCreateTransformStmt(a, b);
3470  break;
3471  case T_CreateAmStmt:
3472  retval = _equalCreateAmStmt(a, b);
3473  break;
3474  case T_CreateTrigStmt:
3475  retval = _equalCreateTrigStmt(a, b);
3476  break;
3477  case T_CreateEventTrigStmt:
3478  retval = _equalCreateEventTrigStmt(a, b);
3479  break;
3480  case T_AlterEventTrigStmt:
3481  retval = _equalAlterEventTrigStmt(a, b);
3482  break;
3483  case T_CreatePLangStmt:
3484  retval = _equalCreatePLangStmt(a, b);
3485  break;
3486  case T_CreateRoleStmt:
3487  retval = _equalCreateRoleStmt(a, b);
3488  break;
3489  case T_AlterRoleStmt:
3490  retval = _equalAlterRoleStmt(a, b);
3491  break;
3492  case T_AlterRoleSetStmt:
3493  retval = _equalAlterRoleSetStmt(a, b);
3494  break;
3495  case T_DropRoleStmt:
3496  retval = _equalDropRoleStmt(a, b);
3497  break;
3498  case T_LockStmt:
3499  retval = _equalLockStmt(a, b);
3500  break;
3501  case T_ConstraintsSetStmt:
3502  retval = _equalConstraintsSetStmt(a, b);
3503  break;
3504  case T_ReindexStmt:
3505  retval = _equalReindexStmt(a, b);
3506  break;
3507  case T_CheckPointStmt:
3508  retval = true;
3509  break;
3510  case T_CreateSchemaStmt:
3511  retval = _equalCreateSchemaStmt(a, b);
3512  break;
3514  retval = _equalCreateConversionStmt(a, b);
3515  break;
3516  case T_CreateCastStmt:
3517  retval = _equalCreateCastStmt(a, b);
3518  break;
3519  case T_PrepareStmt:
3520  retval = _equalPrepareStmt(a, b);
3521  break;
3522  case T_ExecuteStmt:
3523  retval = _equalExecuteStmt(a, b);
3524  break;
3525  case T_DeallocateStmt:
3526  retval = _equalDeallocateStmt(a, b);
3527  break;
3528  case T_DropOwnedStmt:
3529  retval = _equalDropOwnedStmt(a, b);
3530  break;
3531  case T_ReassignOwnedStmt:
3532  retval = _equalReassignOwnedStmt(a, b);
3533  break;
3535  retval = _equalAlterTSDictionaryStmt(a, b);
3536  break;
3538  retval = _equalAlterTSConfigurationStmt(a, b);
3539  break;
3540  case T_CreatePolicyStmt:
3541  retval = _equalCreatePolicyStmt(a, b);
3542  break;
3543  case T_AlterPolicyStmt:
3544  retval = _equalAlterPolicyStmt(a, b);
3545  break;
3547  retval = _equalCreatePublicationStmt(a, b);
3548  break;
3550  retval = _equalAlterPublicationStmt(a, b);
3551  break;
3553  retval = _equalCreateSubscriptionStmt(a, b);
3554  break;
3556  retval = _equalAlterSubscriptionStmt(a, b);
3557  break;
3559  retval = _equalDropSubscriptionStmt(a, b);
3560  break;
3561  case T_A_Expr:
3562  retval = _equalAExpr(a, b);
3563  break;
3564  case T_ColumnRef:
3565  retval = _equalColumnRef(a, b);
3566  break;
3567  case T_ParamRef:
3568  retval = _equalParamRef(a, b);
3569  break;
3570  case T_A_Const:
3571  retval = _equalAConst(a, b);
3572  break;
3573  case T_FuncCall:
3574  retval = _equalFuncCall(a, b);
3575  break;
3576  case T_A_Star:
3577  retval = _equalAStar(a, b);
3578  break;
3579  case T_A_Indices:
3580  retval = _equalAIndices(a, b);
3581  break;
3582  case T_A_Indirection:
3583  retval = _equalA_Indirection(a, b);
3584  break;
3585  case T_A_ArrayExpr:
3586  retval = _equalA_ArrayExpr(a, b);
3587  break;
3588  case T_ResTarget:
3589  retval = _equalResTarget(a, b);
3590  break;
3591  case T_MultiAssignRef:
3592  retval = _equalMultiAssignRef(a, b);
3593  break;
3594  case T_TypeCast:
3595  retval = _equalTypeCast(a, b);
3596  break;
3597  case T_CollateClause:
3598  retval = _equalCollateClause(a, b);
3599  break;
3600  case T_SortBy:
3601  retval = _equalSortBy(a, b);
3602  break;
3603  case T_WindowDef:
3604  retval = _equalWindowDef(a, b);
3605  break;
3606  case T_RangeSubselect:
3607  retval = _equalRangeSubselect(a, b);
3608  break;
3609  case T_RangeFunction:
3610  retval = _equalRangeFunction(a, b);
3611  break;
3612  case T_RangeTableSample:
3613  retval = _equalRangeTableSample(a, b);
3614  break;
3615  case T_RangeTableFunc:
3616  retval = _equalRangeTableFunc(a, b);
3617  break;
3618  case T_RangeTableFuncCol:
3619  retval = _equalRangeTableFuncCol(a, b);
3620  break;
3621  case T_TypeName:
3622  retval = _equalTypeName(a, b);
3623  break;
3624  case T_IndexElem:
3625  retval = _equalIndexElem(a, b);
3626  break;
3627  case T_ColumnDef:
3628  retval = _equalColumnDef(a, b);
3629  break;
3630  case T_Constraint:
3631  retval = _equalConstraint(a, b);
3632  break;
3633  case T_DefElem:
3634  retval = _equalDefElem(a, b);
3635  break;
3636  case T_LockingClause:
3637  retval = _equalLockingClause(a, b);
3638  break;
3639  case T_RangeTblEntry:
3640  retval = _equalRangeTblEntry(a, b);
3641  break;
3642  case T_RangeTblFunction:
3643  retval = _equalRangeTblFunction(a, b);
3644  break;
3645  case T_TableSampleClause:
3646  retval = _equalTableSampleClause(a, b);
3647  break;
3648  case T_WithCheckOption:
3649  retval = _equalWithCheckOption(a, b);
3650  break;
3651  case T_SortGroupClause:
3652  retval = _equalSortGroupClause(a, b);
3653  break;
3654  case T_GroupingSet:
3655  retval = _equalGroupingSet(a, b);
3656  break;
3657  case T_WindowClause:
3658  retval = _equalWindowClause(a, b);
3659  break;
3660  case T_RowMarkClause:
3661  retval = _equalRowMarkClause(a, b);
3662  break;
3663  case T_WithClause:
3664  retval = _equalWithClause(a, b);
3665  break;
3666  case T_InferClause:
3667  retval = _equalInferClause(a, b);
3668  break;
3669  case T_OnConflictClause:
3670  retval = _equalOnConflictClause(a, b);
3671  break;
3672  case T_CommonTableExpr:
3673  retval = _equalCommonTableExpr(a, b);
3674  break;
3675  case T_ObjectWithArgs:
3676  retval = _equalObjectWithArgs(a, b);
3677  break;
3678  case T_AccessPriv:
3679  retval = _equalAccessPriv(a, b);
3680  break;
3681  case T_XmlSerialize:
3682  retval = _equalXmlSerialize(a, b);
3683  break;
3684  case T_RoleSpec:
3685  retval = _equalRoleSpec(a, b);
3686  break;
3687  case T_TriggerTransition:
3688  retval = _equalTriggerTransition(a, b);
3689  break;
3690  case T_PartitionElem:
3691  retval = _equalPartitionElem(a, b);
3692  break;
3693  case T_PartitionSpec:
3694  retval = _equalPartitionSpec(a, b);
3695  break;
3696  case T_PartitionBoundSpec:
3697  retval = _equalPartitionBoundSpec(a, b);
3698  break;
3699  case T_PartitionRangeDatum:
3700  retval = _equalPartitionRangeDatum(a, b);
3701  break;
3702  case T_PartitionCmd:
3703  retval = _equalPartitionCmd(a, b);
3704  break;
3705 
3706  default:
3707  elog(ERROR, "unrecognized node type: %d",
3708  (int) nodeTag(a));
3709  retval = false; /* keep compiler quiet */
3710  break;
3711  }
3712 
3713  return retval;
3714 }
static bool _equalDropUserMappingStmt(const DropUserMappingStmt *a, const DropUserMappingStmt *b)
Definition: equalfuncs.c:1925
Datum constvalue
Definition: primnodes.h:197
static bool _equalWindowDef(const WindowDef *a, const WindowDef *b)
Definition: equalfuncs.c:2455
static bool _equalDiscardStmt(const DiscardStmt *a, const DiscardStmt *b)
Definition: equalfuncs.c:1778
static bool _equalAlterFdwStmt(const AlterFdwStmt *a, const AlterFdwStmt *b)
Definition: equalfuncs.c:1870
static bool _equalParamRef(const ParamRef *a, const ParamRef *b)
Definition: equalfuncs.c:2317
static bool _equalListenStmt(const ListenStmt *a, const ListenStmt *b)
Definition: equalfuncs.c:1487
static bool _equalAlterDomainStmt(const AlterDomainStmt *a, const AlterDomainStmt *b)
Definition: equalfuncs.c:1109
static bool _equalConstraintsSetStmt(const ConstraintsSetStmt *a, const ConstraintsSetStmt *b)
Definition: equalfuncs.c:2085
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:1087
Datum boolop(PG_FUNCTION_ARGS)
Definition: _int_bool.c:420
static bool _equalCreateEnumStmt(const CreateEnumStmt *a, const CreateEnumStmt *b)
Definition: equalfuncs.c:1523
static bool _equalCreateTableAsStmt(const CreateTableAsStmt *a, const CreateTableAsStmt *b)
Definition: equalfuncs.c:1696
static bool _equalAlterDatabaseStmt(const AlterDatabaseStmt *a, const AlterDatabaseStmt *b)
Definition: equalfuncs.c:1641
static bool _equalViewStmt(const ViewStmt *a, const ViewStmt *b)
Definition: equalfuncs.c:1554
static bool _equalDropStmt(const DropStmt *a, const DropStmt *b)
Definition: equalfuncs.c:1269
static bool _equalVacuumRelation(const VacuumRelation *a, const VacuumRelation *b)
Definition: equalfuncs.c:1677
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:2714
static bool _equalSortGroupClause(const SortGroupClause *a, const SortGroupClause *b)
Definition: equalfuncs.c:2702
static bool _equalCreateFdwStmt(const CreateFdwStmt *a, const CreateFdwStmt *b)
Definition: equalfuncs.c:1860
static bool _equalTargetEntry(const TargetEntry *a, const TargetEntry *b)
Definition: equalfuncs.c:755
bool constbyval
Definition: primnodes.h:200
static bool _equalBooleanTest(const BooleanTest *a, const BooleanTest *b)
Definition: equalfuncs.c:681
bool equal(const void *a, const void *b)
Definition: equalfuncs.c:2986
#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:2827
static bool _equalCreateAmStmt(const CreateAmStmt *a, const CreateAmStmt *b)
Definition: equalfuncs.c:1972
static bool _equalAccessPriv(const AccessPriv *a, const AccessPriv *b)
Definition: equalfuncs.c:1147
static bool _equalVariableSetStmt(const VariableSetStmt *a, const VariableSetStmt *b)
Definition: equalfuncs.c:1759
static bool _equalDropTableSpaceStmt(const DropTableSpaceStmt *a, const DropTableSpaceStmt *b)
Definition: equalfuncs.c:1797
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:2094
static bool _equalPrepareStmt(const PrepareStmt *a, const PrepareStmt *b)
Definition: equalfuncs.c:2140
static bool _equalTypeName(const TypeName *a, const TypeName *b)
Definition: equalfuncs.c:2408
static bool _equalOnConflictClause(const OnConflictClause *a, const OnConflictClause *b)
Definition: equalfuncs.c:2777
static bool _equalExecuteStmt(const ExecuteStmt *a, const ExecuteStmt *b)
Definition: equalfuncs.c:2150
static bool _equalExtensibleNode(const ExtensibleNode *a, const ExtensibleNode *b)
Definition: equalfuncs.c:923
static bool _equalCommonTableExpr(const CommonTableExpr *a, const CommonTableExpr *b)
Definition: equalfuncs.c:2789
#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:2128
static bool _equalUpdateStmt(const UpdateStmt *a, const UpdateStmt *b)
Definition: equalfuncs.c:1023
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:1982
static bool _equalIndexElem(const IndexElem *a, const IndexElem *b)
Definition: equalfuncs.c:2534
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:1503
static bool _equalReplicaIdentityStmt(const ReplicaIdentityStmt *a, const ReplicaIdentityStmt *b)
Definition: equalfuncs.c:1718
static bool _equalInferClause(const InferClause *a, const InferClause *b)
Definition: equalfuncs.c:2766
#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:2817
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:2066
static bool _equalRangeTableFuncCol(const RangeTableFuncCol *a, const RangeTableFuncCol *b)
Definition: equalfuncs.c:2519
static bool _equalGrantRoleStmt(const GrantRoleStmt *a, const GrantRoleStmt *b)
Definition: equalfuncs.c:1156
static bool _equalAlterFunctionStmt(const AlterFunctionStmt *a, const AlterFunctionStmt *b)
Definition: equalfuncs.c:1388
static bool _equalCallStmt(const CallStmt *a, const CallStmt *b)
Definition: equalfuncs.c:1196
static bool _equalAlterOpFamilyStmt(const AlterOpFamilyStmt *a, const AlterOpFamilyStmt *b)
Definition: equalfuncs.c:1621
static bool _equalCreatedbStmt(const CreatedbStmt *a, const CreatedbStmt *b)
Definition: equalfuncs.c:1632
static bool _equalAppendRelInfo(const AppendRelInfo *a, const AppendRelInfo *b)
Definition: equalfuncs.c:894
Definition: primnodes.h:164
NameData subname
static bool _equalAlterRoleSetStmt(const AlterRoleSetStmt *a, const AlterRoleSetStmt *b)
Definition: equalfuncs.c:2056
static bool _equalReassignOwnedStmt(const ReassignOwnedStmt *a, const ReassignOwnedStmt *b)
Definition: equalfuncs.c:2176
static bool _equalTruncateStmt(const TruncateStmt *a, const TruncateStmt *b)
Definition: equalfuncs.c:1281
static bool _equalSelectStmt(const SelectStmt *a, const SelectStmt *b)
Definition: equalfuncs.c:1036
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:1495
static bool _equalDropdbStmt(const DropdbStmt *a, const DropdbStmt *b)
Definition: equalfuncs.c:1659
static bool _equalAlterSeqStmt(const AlterSeqStmt *a, const AlterSeqStmt *b)
Definition: equalfuncs.c:1748
char relkind
Definition: pg_class.h:51
static bool _equalAlterObjectSchemaStmt(const AlterObjectSchemaStmt *a, const AlterObjectSchemaStmt *b)
Definition: equalfuncs.c:1432
static bool _equalCreateExtensionStmt(const CreateExtensionStmt *a, const CreateExtensionStmt *b)
Definition: equalfuncs.c:1830
static bool _equalAlterCollationStmt(const AlterCollationStmt *a, const AlterCollationStmt *b)
Definition: equalfuncs.c:1101
static bool _equalAlterOperatorStmt(const AlterOperatorStmt *a, const AlterOperatorStmt *b)
Definition: equalfuncs.c:1455
static bool _equalTableLikeClause(const TableLikeClause *a, const TableLikeClause *b)
Definition: equalfuncs.c:1247
static bool _equalAlterDatabaseSetStmt(const AlterDatabaseSetStmt *a, const AlterDatabaseSetStmt *b)
Definition: equalfuncs.c:1650
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:2606
static bool _equalPartitionBoundSpec(const PartitionBoundSpec *a, const PartitionBoundSpec *b)
Definition: equalfuncs.c:2859
static bool _equalSortBy(const SortBy *a, const SortBy *b)
Definition: equalfuncs.c:2443
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:2185
static bool _equalCollateClause(const CollateClause *a, const CollateClause *b)
Definition: equalfuncs.c:2433
int constlen
Definition: primnodes.h:196
static bool _equalAlterExtensionStmt(const AlterExtensionStmt *a, const AlterExtensionStmt *b)
Definition: equalfuncs.c:1840
Oid grantor
static bool _equalCreateOpFamilyStmt(const CreateOpFamilyStmt *a, const CreateOpFamilyStmt *b)
Definition: equalfuncs.c:1612
static bool _equalWithCheckOption(const WithCheckOption *a, const WithCheckOption *b)
Definition: equalfuncs.c:2690
static bool _equalAExpr(const A_Expr *a, const A_Expr *b)
Definition: equalfuncs.c:2296
static bool _equalSecLabelStmt(const SecLabelStmt *a, const SecLabelStmt *b)
Definition: equalfuncs.c:1301
static bool _equalFunctionParameter(const FunctionParameter *a, const FunctionParameter *b)
Definition: equalfuncs.c:1377
static bool _equalAlterExtensionContentsStmt(const AlterExtensionContentsStmt *a, const AlterExtensionContentsStmt *b)
Definition: equalfuncs.c:1849
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:2666
static bool _equalCreateStatsStmt(const CreateStatsStmt *a, const CreateStatsStmt *b)
Definition: equalfuncs.c:1351
#define ERROR
Definition: elog.h:43
static bool _equalVariableShowStmt(const VariableShowStmt *a, const VariableShowStmt *b)
Definition: equalfuncs.c:1770
static bool _equalCaseExpr(const CaseExpr *a, const CaseExpr *b)
Definition: equalfuncs.c:548
char relpersistence
Definition: pg_class.h:50
#define lfirst_int(lc)
Definition: pg_list.h:107
static bool _equalList(const List *a, const List *b)
Definition: equalfuncs.c:2897
static bool _equalAlterObjectDependsStmt(const AlterObjectDependsStmt *a, const AlterObjectDependsStmt *b)
Definition: equalfuncs.c:1421
static JitProviderCallbacks provider
Definition: jit.c:46
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:1541
static bool _equalAlterTableStmt(const AlterTableStmt *a, const AlterTableStmt *b)
Definition: equalfuncs.c:1076
static bool _equalPartitionCmd(const PartitionCmd *a, const PartitionCmd *b)
Definition: equalfuncs.c:2884
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:2116
static bool _equalRangeTableSample(const RangeTableSample *a, const RangeTableSample *b)
Definition: equalfuncs.c:2493
static bool _equalCreateFunctionStmt(const CreateFunctionStmt *a, const CreateFunctionStmt *b)
Definition: equalfuncs.c:1364
static bool _equalArrayRef(const ArrayRef *a, const ArrayRef *b)
Definition: equalfuncs.c:267
Definition: nodes.h:143
static bool _equalPartitionSpec(const PartitionSpec *a, const PartitionSpec *b)
Definition: equalfuncs.c:2849
static bool _equalCreatePLangStmt(const CreatePLangStmt *a, const CreatePLangStmt *b)
Definition: equalfuncs.c:2023
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:1893
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:1169
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:2724
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:2336
static bool _equalAlterEventTrigStmt(const AlterEventTrigStmt *a, const AlterEventTrigStmt *b)
Definition: equalfuncs.c:2014
static bool _equalQuery(const Query *a, const Query *b)
Definition: equalfuncs.c:944
static bool _equalConstraint(const Constraint *a, const Constraint *b)
Definition: equalfuncs.c:2572
static bool _equalCreateUserMappingStmt(const CreateUserMappingStmt *a, const CreateUserMappingStmt *b)
Definition: equalfuncs.c:1904
static bool _equalAlterTSConfigurationStmt(const AlterTSConfigurationStmt *a, const AlterTSConfigurationStmt *b)
Definition: equalfuncs.c:2194
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:1567
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:1880
static bool _equalImportForeignSchemaStmt(const ImportForeignSchemaStmt *a, const ImportForeignSchemaStmt *b)
Definition: equalfuncs.c:1947
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:2874
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:2505
static bool _equalDoStmt(const DoStmt *a, const DoStmt *b)
Definition: equalfuncs.c:1398
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:2246
Definition: nodes.h:296
static bool _equalCreateTableSpaceStmt(const CreateTableSpaceStmt *a, const CreateTableSpaceStmt *b)
Definition: equalfuncs.c:1786
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:1478
Definition: nodes.h:148
static bool _equalPartitionElem(const PartitionElem *a, const PartitionElem *b)
Definition: equalfuncs.c:2837
static bool _equalRawStmt(const RawStmt *a, const RawStmt *b)
Definition: equalfuncs.c:987
static int verbose
Definition: pg_basebackup.c:88
Definition: nodes.h:147
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:2046
static bool _equalA_Indirection(const A_Indirection *a, const A_Indirection *b)
Definition: equalfuncs.c:2369
static bool _equalCreateRangeStmt(const CreateRangeStmt *a, const CreateRangeStmt *b)
Definition: equalfuncs.c:1532
Definition: nodes.h:309
static bool _equalCreateRoleStmt(const CreateRoleStmt *a, const CreateRoleStmt *b)
Definition: equalfuncs.c:2036
static bool _equalAlterPolicyStmt(const AlterPolicyStmt *a, const AlterPolicyStmt *b)
Definition: equalfuncs.c:2284
static bool _equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
Definition: equalfuncs.c:1464
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:1575
Oid opfuncid
Definition: primnodes.h:498
static char * label
Definition: pg_basebackup.c:84
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:1687
static bool _equalVacuumStmt(const VacuumStmt *a, const VacuumStmt *b)
Definition: equalfuncs.c:1668
static bool _equalCreatePublicationStmt(const CreatePublicationStmt *a, const CreatePublicationStmt *b)
Definition: equalfuncs.c:2209
static struct @131 value
static bool _equalCreateTransformStmt(const CreateTransformStmt *a, const CreateTransformStmt *b)
Definition: equalfuncs.c:1960
const char * extnodename
Definition: extensible.h:35
static bool _equalDeleteStmt(const DeleteStmt *a, const DeleteStmt *b)
Definition: equalfuncs.c:1011
static bool _equalSetOperationStmt(const SetOperationStmt *a, const SetOperationStmt *b)
Definition: equalfuncs.c:1061
static bool _equalDeclareCursorStmt(const DeclareCursorStmt *a, const DeclareCursorStmt *b)
Definition: equalfuncs.c:1178
static bool _equalAlterPublicationStmt(const AlterPublicationStmt *a, const AlterPublicationStmt *b)
Definition: equalfuncs.c:2221
static bool _equalLockingClause(const LockingClause *a, const LockingClause *b)
Definition: equalfuncs.c:2618
static bool _equalTypeCast(const TypeCast *a, const TypeCast *b)
Definition: equalfuncs.c:2423
static bool _equalCreateSeqStmt(const CreateSeqStmt *a, const CreateSeqStmt *b)
Definition: equalfuncs.c:1736
#define Assert(condition)
Definition: c.h:699
#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:1806
Definition: value.h:42
static bool _equalDropSubscriptionStmt(const DropSubscriptionStmt *a, const DropSubscriptionStmt *b)
Definition: equalfuncs.c:2259
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:907
#define COMPARE_LOCATION_FIELD(fldname)
Definition: equalfuncs.c:84
static bool _equalResTarget(const ResTarget *a, const ResTarget *b)
Definition: equalfuncs.c:2387
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:2270
char * dbname
Definition: streamutil.c:51
static bool _equalDropOwnedStmt(const DropOwnedStmt *a, const DropOwnedStmt *b)
Definition: equalfuncs.c:2167
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:2956
static bool _equalAlterUserMappingStmt(const AlterUserMappingStmt *a, const AlterUserMappingStmt *b)
Definition: equalfuncs.c:1915
static bool _equalCompositeTypeStmt(const CompositeTypeStmt *a, const CompositeTypeStmt *b)
Definition: equalfuncs.c:1514
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:1935
#define nodeTag(nodeptr)
Definition: nodes.h:522
static bool _equalDefineStmt(const DefineStmt *a, const DefineStmt *b)
Definition: equalfuncs.c:1256
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:2353
static bool _equalFuncExpr(const FuncExpr *a, const FuncExpr *b)
Definition: equalfuncs.c:282
Definition: nodes.h:291
#define COMPARE_NODE_FIELD(fldname)
Definition: equalfuncs.c:52
static bool _equalTableSampleClause(const TableSampleClause *a, const TableSampleClause *b)
Definition: equalfuncs.c:2680
Definition: nodes.h:288
static char * filename
Definition: pg_dumpall.c:87
NodeTag type
Definition: pg_list.h:47
static bool _equalMultiAssignRef(const MultiAssignRef *a, const MultiAssignRef *b)
Definition: equalfuncs.c:2398
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:2308
static bool _equalAConst(const A_Const *a, const A_Const *b)
Definition: equalfuncs.c:2326
static bool _equalRangeTblEntry(const RangeTblEntry *a, const RangeTblEntry *b)
Definition: equalfuncs.c:2628
static bool _equalCreateOpClassStmt(const CreateOpClassStmt *a, const CreateOpClassStmt *b)
Definition: equalfuncs.c:1586
static bool _equalRefreshMatViewStmt(const RefreshMatViewStmt *a, const RefreshMatViewStmt *b)
Definition: equalfuncs.c:1708
int xmloption
Definition: xml.c:97
static bool _equalGrantStmt(const GrantStmt *a, const GrantStmt *b)
Definition: equalfuncs.c:1122
static bool _equalAIndices(const A_Indices *a, const A_Indices *b)
Definition: equalfuncs.c:2359
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:2234
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:1312
void * arg
static bool _equalCreateOpClassItem(const CreateOpClassItem *a, const CreateOpClassItem *b)
Definition: equalfuncs.c:1599
static bool _equalInsertStmt(const InsertStmt *a, const InsertStmt *b)
Definition: equalfuncs.c:997
static bool _equalCopyStmt(const CopyStmt *a, const CopyStmt *b)
Definition: equalfuncs.c:1215
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:2159
static bool _equalRangeSubselect(const RangeSubselect *a, const RangeSubselect *b)
Definition: equalfuncs.c:2470
#define elog
Definition: elog.h:219
static bool _equalAlterTableMoveAllStmt(const AlterTableMoveAllStmt *a, const AlterTableMoveAllStmt *b)
Definition: equalfuncs.c:1817
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:2756
static bool _equalCommentStmt(const CommentStmt *a, const CommentStmt *b)
Definition: equalfuncs.c:1291
static bool _equalA_ArrayExpr(const A_ArrayExpr *a, const A_ArrayExpr *b)
Definition: equalfuncs.c:2378
static bool _equalCreateSchemaStmt(const CreateSchemaStmt *a, const CreateSchemaStmt *b)
Definition: equalfuncs.c:2105
Value val
Definition: parsenodes.h:289
Definition: pg_list.h:45
static bool _equalCreateStmt(const CreateStmt *a, const CreateStmt *b)
Definition: equalfuncs.c:1229
static bool _equalRenameStmt(const RenameStmt *a, const RenameStmt *b)
Definition: equalfuncs.c:1406
static bool _equalClusterStmt(const ClusterStmt *a, const ClusterStmt *b)
Definition: equalfuncs.c:1205
long val
Definition: informix.c:689
static bool _equalAlterOwnerStmt(const AlterOwnerStmt *a, const AlterOwnerStmt *b)
Definition: equalfuncs.c:1444
static bool _equalAlterSystemStmt(const AlterSystemStmt *a, const AlterSystemStmt *b)
Definition: equalfuncs.c:1727
static bool _equalClosePortalStmt(const ClosePortalStmt *a, const ClosePortalStmt *b)
Definition: equalfuncs.c:1188
static bool _equalXmlSerialize(const XmlSerialize *a, const XmlSerialize *b)
Definition: equalfuncs.c:2806
bool constisnull
Definition: primnodes.h:198
static bool _equalIndexStmt(const IndexStmt *a, const IndexStmt *b)
Definition: equalfuncs.c:1323
static bool _equalObjectWithArgs(const ObjectWithArgs *a, const ObjectWithArgs *b)
Definition: equalfuncs.c:1137
static bool _equalLockStmt(const LockStmt *a, const LockStmt *b)
Definition: equalfuncs.c:2075
#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:2480
static bool _equalCreateEventTrigStmt(const CreateEventTrigStmt *a, const CreateEventTrigStmt *b)
Definition: equalfuncs.c:2003
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:2745
Definition: nodes.h:149
static bool _equalColumnDef(const ColumnDef *a, const ColumnDef *b)
Definition: equalfuncs.c:2548