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