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_SCALAR_FIELD(elemfuncid);
517  COMPARE_SCALAR_FIELD(resulttype);
518  COMPARE_SCALAR_FIELD(resulttypmod);
519  COMPARE_SCALAR_FIELD(resultcollid);
520  COMPARE_SCALAR_FIELD(isExplicit);
521  COMPARE_COERCIONFORM_FIELD(coerceformat);
522  COMPARE_LOCATION_FIELD(location);
523 
524  return true;
525 }
526 
527 static bool
529 {
531  COMPARE_SCALAR_FIELD(resulttype);
532  COMPARE_COERCIONFORM_FIELD(convertformat);
533  COMPARE_LOCATION_FIELD(location);
534 
535  return true;
536 }
537 
538 static bool
540 {
542  COMPARE_SCALAR_FIELD(collOid);
543  COMPARE_LOCATION_FIELD(location);
544 
545  return true;
546 }
547 
548 static bool
549 _equalCaseExpr(const CaseExpr *a, const CaseExpr *b)
550 {
551  COMPARE_SCALAR_FIELD(casetype);
552  COMPARE_SCALAR_FIELD(casecollid);
555  COMPARE_NODE_FIELD(defresult);
556  COMPARE_LOCATION_FIELD(location);
557 
558  return true;
559 }
560 
561 static bool
562 _equalCaseWhen(const CaseWhen *a, const CaseWhen *b)
563 {
564  COMPARE_NODE_FIELD(expr);
566  COMPARE_LOCATION_FIELD(location);
567 
568  return true;
569 }
570 
571 static bool
573 {
574  COMPARE_SCALAR_FIELD(typeId);
575  COMPARE_SCALAR_FIELD(typeMod);
576  COMPARE_SCALAR_FIELD(collation);
577 
578  return true;
579 }
580 
581 static bool
583 {
584  COMPARE_SCALAR_FIELD(array_typeid);
585  COMPARE_SCALAR_FIELD(array_collid);
586  COMPARE_SCALAR_FIELD(element_typeid);
587  COMPARE_NODE_FIELD(elements);
588  COMPARE_SCALAR_FIELD(multidims);
589  COMPARE_LOCATION_FIELD(location);
590 
591  return true;
592 }
593 
594 static bool
595 _equalRowExpr(const RowExpr *a, const RowExpr *b)
596 {
598  COMPARE_SCALAR_FIELD(row_typeid);
599  COMPARE_COERCIONFORM_FIELD(row_format);
600  COMPARE_NODE_FIELD(colnames);
601  COMPARE_LOCATION_FIELD(location);
602 
603  return true;
604 }
605 
606 static bool
608 {
609  COMPARE_SCALAR_FIELD(rctype);
610  COMPARE_NODE_FIELD(opnos);
611  COMPARE_NODE_FIELD(opfamilies);
612  COMPARE_NODE_FIELD(inputcollids);
613  COMPARE_NODE_FIELD(largs);
614  COMPARE_NODE_FIELD(rargs);
615 
616  return true;
617 }
618 
619 static bool
621 {
622  COMPARE_SCALAR_FIELD(coalescetype);
623  COMPARE_SCALAR_FIELD(coalescecollid);
625  COMPARE_LOCATION_FIELD(location);
626 
627  return true;
628 }
629 
630 static bool
632 {
633  COMPARE_SCALAR_FIELD(minmaxtype);
634  COMPARE_SCALAR_FIELD(minmaxcollid);
635  COMPARE_SCALAR_FIELD(inputcollid);
638  COMPARE_LOCATION_FIELD(location);
639 
640  return true;
641 }
642 
643 static bool
645 {
647  COMPARE_SCALAR_FIELD(type);
648  COMPARE_SCALAR_FIELD(typmod);
649  COMPARE_LOCATION_FIELD(location);
650 
651  return true;
652 }
653 
654 static bool
655 _equalXmlExpr(const XmlExpr *a, const XmlExpr *b)
656 {
659  COMPARE_NODE_FIELD(named_args);
660  COMPARE_NODE_FIELD(arg_names);
663  COMPARE_SCALAR_FIELD(type);
664  COMPARE_SCALAR_FIELD(typmod);
665  COMPARE_LOCATION_FIELD(location);
666 
667  return true;
668 }
669 
670 static bool
671 _equalNullTest(const NullTest *a, const NullTest *b)
672 {
674  COMPARE_SCALAR_FIELD(nulltesttype);
675  COMPARE_SCALAR_FIELD(argisrow);
676  COMPARE_LOCATION_FIELD(location);
677 
678  return true;
679 }
680 
681 static bool
683 {
685  COMPARE_SCALAR_FIELD(booltesttype);
686  COMPARE_LOCATION_FIELD(location);
687 
688  return true;
689 }
690 
691 static bool
693 {
695  COMPARE_SCALAR_FIELD(resulttype);
696  COMPARE_SCALAR_FIELD(resulttypmod);
697  COMPARE_SCALAR_FIELD(resultcollid);
698  COMPARE_COERCIONFORM_FIELD(coercionformat);
699  COMPARE_LOCATION_FIELD(location);
700 
701  return true;
702 }
703 
704 static bool
706 {
707  COMPARE_SCALAR_FIELD(typeId);
708  COMPARE_SCALAR_FIELD(typeMod);
709  COMPARE_SCALAR_FIELD(collation);
710  COMPARE_LOCATION_FIELD(location);
711 
712  return true;
713 }
714 
715 static bool
717 {
718  COMPARE_SCALAR_FIELD(typeId);
719  COMPARE_SCALAR_FIELD(typeMod);
720  COMPARE_SCALAR_FIELD(collation);
721  COMPARE_LOCATION_FIELD(location);
722 
723  return true;
724 }
725 
726 static bool
728 {
729  COMPARE_SCALAR_FIELD(cvarno);
730  COMPARE_STRING_FIELD(cursor_name);
731  COMPARE_SCALAR_FIELD(cursor_param);
732 
733  return true;
734 }
735 
736 static bool
738 {
739  COMPARE_SCALAR_FIELD(seqid);
740  COMPARE_SCALAR_FIELD(typeId);
741 
742  return true;
743 }
744 
745 static bool
747 {
748  COMPARE_NODE_FIELD(expr);
749  COMPARE_SCALAR_FIELD(infercollid);
750  COMPARE_SCALAR_FIELD(inferopclass);
751 
752  return true;
753 }
754 
755 static bool
757 {
758  COMPARE_NODE_FIELD(expr);
759  COMPARE_SCALAR_FIELD(resno);
760  COMPARE_STRING_FIELD(resname);
761  COMPARE_SCALAR_FIELD(ressortgroupref);
762  COMPARE_SCALAR_FIELD(resorigtbl);
763  COMPARE_SCALAR_FIELD(resorigcol);
764  COMPARE_SCALAR_FIELD(resjunk);
765 
766  return true;
767 }
768 
769 static bool
771 {
772  COMPARE_SCALAR_FIELD(rtindex);
773 
774  return true;
775 }
776 
777 static bool
778 _equalJoinExpr(const JoinExpr *a, const JoinExpr *b)
779 {
780  COMPARE_SCALAR_FIELD(jointype);
781  COMPARE_SCALAR_FIELD(isNatural);
782  COMPARE_NODE_FIELD(larg);
783  COMPARE_NODE_FIELD(rarg);
784  COMPARE_NODE_FIELD(usingClause);
785  COMPARE_NODE_FIELD(quals);
786  COMPARE_NODE_FIELD(alias);
787  COMPARE_SCALAR_FIELD(rtindex);
788 
789  return true;
790 }
791 
792 static bool
793 _equalFromExpr(const FromExpr *a, const FromExpr *b)
794 {
795  COMPARE_NODE_FIELD(fromlist);
796  COMPARE_NODE_FIELD(quals);
797 
798  return true;
799 }
800 
801 static bool
803 {
804  COMPARE_SCALAR_FIELD(action);
805  COMPARE_NODE_FIELD(arbiterElems);
806  COMPARE_NODE_FIELD(arbiterWhere);
807  COMPARE_SCALAR_FIELD(constraint);
808  COMPARE_NODE_FIELD(onConflictSet);
809  COMPARE_NODE_FIELD(onConflictWhere);
810  COMPARE_SCALAR_FIELD(exclRelIndex);
811  COMPARE_NODE_FIELD(exclRelTlist);
812 
813  return true;
814 }
815 
816 /*
817  * Stuff from relation.h
818  */
819 
820 static bool
821 _equalPathKey(const PathKey *a, const PathKey *b)
822 {
823  /* We assume pointer equality is sufficient to compare the eclasses */
824  COMPARE_SCALAR_FIELD(pk_eclass);
825  COMPARE_SCALAR_FIELD(pk_opfamily);
826  COMPARE_SCALAR_FIELD(pk_strategy);
827  COMPARE_SCALAR_FIELD(pk_nulls_first);
828 
829  return true;
830 }
831 
832 static bool
834 {
835  COMPARE_NODE_FIELD(clause);
836  COMPARE_SCALAR_FIELD(is_pushed_down);
837  COMPARE_SCALAR_FIELD(outerjoin_delayed);
838  COMPARE_SCALAR_FIELD(security_level);
839  COMPARE_BITMAPSET_FIELD(required_relids);
840  COMPARE_BITMAPSET_FIELD(outer_relids);
841  COMPARE_BITMAPSET_FIELD(nullable_relids);
842 
843  /*
844  * We ignore all the remaining fields, since they may not be set yet, and
845  * should be derivable from the clause anyway.
846  */
847 
848  return true;
849 }
850 
851 static bool
853 {
854  /*
855  * We intentionally do not compare phexpr. Two PlaceHolderVars with the
856  * same ID and levelsup should be considered equal even if the contained
857  * expressions have managed to mutate to different states. This will
858  * happen during final plan construction when there are nested PHVs, since
859  * the inner PHV will get replaced by a Param in some copies of the outer
860  * PHV. Another way in which it can happen is that initplan sublinks
861  * could get replaced by differently-numbered Params when sublink folding
862  * is done. (The end result of such a situation would be some
863  * unreferenced initplans, which is annoying but not really a problem.) On
864  * the same reasoning, there is no need to examine phrels.
865  *
866  * COMPARE_NODE_FIELD(phexpr);
867  *
868  * COMPARE_BITMAPSET_FIELD(phrels);
869  */
870  COMPARE_SCALAR_FIELD(phid);
871  COMPARE_SCALAR_FIELD(phlevelsup);
872 
873  return true;
874 }
875 
876 static bool
878 {
879  COMPARE_BITMAPSET_FIELD(min_lefthand);
880  COMPARE_BITMAPSET_FIELD(min_righthand);
881  COMPARE_BITMAPSET_FIELD(syn_lefthand);
882  COMPARE_BITMAPSET_FIELD(syn_righthand);
883  COMPARE_SCALAR_FIELD(jointype);
884  COMPARE_SCALAR_FIELD(lhs_strict);
885  COMPARE_SCALAR_FIELD(delay_upper_joins);
886  COMPARE_SCALAR_FIELD(semi_can_btree);
887  COMPARE_SCALAR_FIELD(semi_can_hash);
888  COMPARE_NODE_FIELD(semi_operators);
889  COMPARE_NODE_FIELD(semi_rhs_exprs);
890 
891  return true;
892 }
893 
894 static bool
896 {
897  COMPARE_SCALAR_FIELD(parent_relid);
898  COMPARE_SCALAR_FIELD(child_relid);
899  COMPARE_SCALAR_FIELD(parent_reltype);
900  COMPARE_SCALAR_FIELD(child_reltype);
901  COMPARE_NODE_FIELD(translated_vars);
902  COMPARE_SCALAR_FIELD(parent_reloid);
903 
904  return true;
905 }
906 
907 static bool
909 {
910  COMPARE_SCALAR_FIELD(parent_relid);
911  COMPARE_NODE_FIELD(child_rels);
912 
913  return true;
914 }
915 
916 static bool
918 {
919  COMPARE_SCALAR_FIELD(phid);
920  COMPARE_NODE_FIELD(ph_var); /* should be redundant */
921  COMPARE_BITMAPSET_FIELD(ph_eval_at);
922  COMPARE_BITMAPSET_FIELD(ph_lateral);
923  COMPARE_BITMAPSET_FIELD(ph_needed);
924  COMPARE_SCALAR_FIELD(ph_width);
925 
926  return true;
927 }
928 
929 /*
930  * Stuff from extensible.h
931  */
932 static bool
934 {
935  const ExtensibleNodeMethods *methods;
936 
937  COMPARE_STRING_FIELD(extnodename);
938 
939  /* At this point, we know extnodename is the same for both nodes. */
940  methods = GetExtensibleNodeMethods(a->extnodename, false);
941 
942  /* compare the private fields */
943  if (!methods->nodeEqual(a, b))
944  return false;
945 
946  return true;
947 }
948 
949 /*
950  * Stuff from parsenodes.h
951  */
952 
953 static bool
954 _equalQuery(const Query *a, const Query *b)
955 {
956  COMPARE_SCALAR_FIELD(commandType);
957  COMPARE_SCALAR_FIELD(querySource);
958  /* we intentionally ignore queryId, since it might not be set */
959  COMPARE_SCALAR_FIELD(canSetTag);
960  COMPARE_NODE_FIELD(utilityStmt);
961  COMPARE_SCALAR_FIELD(resultRelation);
962  COMPARE_SCALAR_FIELD(hasAggs);
963  COMPARE_SCALAR_FIELD(hasWindowFuncs);
964  COMPARE_SCALAR_FIELD(hasTargetSRFs);
965  COMPARE_SCALAR_FIELD(hasSubLinks);
966  COMPARE_SCALAR_FIELD(hasDistinctOn);
967  COMPARE_SCALAR_FIELD(hasRecursive);
968  COMPARE_SCALAR_FIELD(hasModifyingCTE);
969  COMPARE_SCALAR_FIELD(hasForUpdate);
970  COMPARE_SCALAR_FIELD(hasRowSecurity);
971  COMPARE_NODE_FIELD(cteList);
972  COMPARE_NODE_FIELD(rtable);
973  COMPARE_NODE_FIELD(jointree);
974  COMPARE_NODE_FIELD(targetList);
975  COMPARE_SCALAR_FIELD(override);
976  COMPARE_NODE_FIELD(onConflict);
977  COMPARE_NODE_FIELD(returningList);
978  COMPARE_NODE_FIELD(groupClause);
979  COMPARE_NODE_FIELD(groupingSets);
980  COMPARE_NODE_FIELD(havingQual);
981  COMPARE_NODE_FIELD(windowClause);
982  COMPARE_NODE_FIELD(distinctClause);
983  COMPARE_NODE_FIELD(sortClause);
984  COMPARE_NODE_FIELD(limitOffset);
985  COMPARE_NODE_FIELD(limitCount);
986  COMPARE_NODE_FIELD(rowMarks);
987  COMPARE_NODE_FIELD(setOperations);
988  COMPARE_NODE_FIELD(constraintDeps);
989  COMPARE_NODE_FIELD(withCheckOptions);
990  COMPARE_LOCATION_FIELD(stmt_location);
991  COMPARE_LOCATION_FIELD(stmt_len);
992 
993  return true;
994 }
995 
996 static bool
997 _equalRawStmt(const RawStmt *a, const RawStmt *b)
998 {
999  COMPARE_NODE_FIELD(stmt);
1000  COMPARE_LOCATION_FIELD(stmt_location);
1001  COMPARE_LOCATION_FIELD(stmt_len);
1002 
1003  return true;
1004 }
1005 
1006 static bool
1008 {
1009  COMPARE_NODE_FIELD(relation);
1010  COMPARE_NODE_FIELD(cols);
1011  COMPARE_NODE_FIELD(selectStmt);
1012  COMPARE_NODE_FIELD(onConflictClause);
1013  COMPARE_NODE_FIELD(returningList);
1014  COMPARE_NODE_FIELD(withClause);
1015  COMPARE_SCALAR_FIELD(override);
1016 
1017  return true;
1018 }
1019 
1020 static bool
1022 {
1023  COMPARE_NODE_FIELD(relation);
1024  COMPARE_NODE_FIELD(usingClause);
1025  COMPARE_NODE_FIELD(whereClause);
1026  COMPARE_NODE_FIELD(returningList);
1027  COMPARE_NODE_FIELD(withClause);
1028 
1029  return true;
1030 }
1031 
1032 static bool
1034 {
1035  COMPARE_NODE_FIELD(relation);
1036  COMPARE_NODE_FIELD(targetList);
1037  COMPARE_NODE_FIELD(whereClause);
1038  COMPARE_NODE_FIELD(fromClause);
1039  COMPARE_NODE_FIELD(returningList);
1040  COMPARE_NODE_FIELD(withClause);
1041 
1042  return true;
1043 }
1044 
1045 static bool
1047 {
1048  COMPARE_NODE_FIELD(distinctClause);
1049  COMPARE_NODE_FIELD(intoClause);
1050  COMPARE_NODE_FIELD(targetList);
1051  COMPARE_NODE_FIELD(fromClause);
1052  COMPARE_NODE_FIELD(whereClause);
1053  COMPARE_NODE_FIELD(groupClause);
1054  COMPARE_NODE_FIELD(havingClause);
1055  COMPARE_NODE_FIELD(windowClause);
1056  COMPARE_NODE_FIELD(valuesLists);
1057  COMPARE_NODE_FIELD(sortClause);
1058  COMPARE_NODE_FIELD(limitOffset);
1059  COMPARE_NODE_FIELD(limitCount);
1060  COMPARE_NODE_FIELD(lockingClause);
1061  COMPARE_NODE_FIELD(withClause);
1063  COMPARE_SCALAR_FIELD(all);
1064  COMPARE_NODE_FIELD(larg);
1065  COMPARE_NODE_FIELD(rarg);
1066 
1067  return true;
1068 }
1069 
1070 static bool
1072 {
1074  COMPARE_SCALAR_FIELD(all);
1075  COMPARE_NODE_FIELD(larg);
1076  COMPARE_NODE_FIELD(rarg);
1077  COMPARE_NODE_FIELD(colTypes);
1078  COMPARE_NODE_FIELD(colTypmods);
1079  COMPARE_NODE_FIELD(colCollations);
1080  COMPARE_NODE_FIELD(groupClauses);
1081 
1082  return true;
1083 }
1084 
1085 static bool
1087 {
1088  COMPARE_NODE_FIELD(relation);
1089  COMPARE_NODE_FIELD(cmds);
1090  COMPARE_SCALAR_FIELD(relkind);
1091  COMPARE_SCALAR_FIELD(missing_ok);
1092 
1093  return true;
1094 }
1095 
1096 static bool
1098 {
1099  COMPARE_SCALAR_FIELD(subtype);
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(relation);
1667  COMPARE_NODE_FIELD(va_cols);
1668 
1669  return true;
1670 }
1671 
1672 static bool
1674 {
1675  COMPARE_NODE_FIELD(query);
1677 
1678  return true;
1679 }
1680 
1681 static bool
1683 {
1684  COMPARE_NODE_FIELD(query);
1685  COMPARE_NODE_FIELD(into);
1686  COMPARE_SCALAR_FIELD(relkind);
1687  COMPARE_SCALAR_FIELD(is_select_into);
1688  COMPARE_SCALAR_FIELD(if_not_exists);
1689 
1690  return true;
1691 }
1692 
1693 static bool
1695 {
1696  COMPARE_SCALAR_FIELD(concurrent);
1697  COMPARE_SCALAR_FIELD(skipData);
1698  COMPARE_NODE_FIELD(relation);
1699 
1700  return true;
1701 }
1702 
1703 static bool
1705 {
1706  COMPARE_SCALAR_FIELD(identity_type);
1708 
1709  return true;
1710 }
1711 
1712 static bool
1714 {
1715  COMPARE_NODE_FIELD(setstmt);
1716 
1717  return true;
1718 }
1719 
1720 
1721 static bool
1723 {
1724  COMPARE_NODE_FIELD(sequence);
1726  COMPARE_SCALAR_FIELD(ownerId);
1727  COMPARE_SCALAR_FIELD(for_identity);
1728  COMPARE_SCALAR_FIELD(if_not_exists);
1729 
1730  return true;
1731 }
1732 
1733 static bool
1735 {
1736  COMPARE_NODE_FIELD(sequence);
1738  COMPARE_SCALAR_FIELD(for_identity);
1739  COMPARE_SCALAR_FIELD(missing_ok);
1740 
1741  return true;
1742 }
1743 
1744 static bool
1746 {
1747  COMPARE_SCALAR_FIELD(kind);
1750  COMPARE_SCALAR_FIELD(is_local);
1751 
1752  return true;
1753 }
1754 
1755 static bool
1757 {
1759 
1760  return true;
1761 }
1762 
1763 static bool
1765 {
1766  COMPARE_SCALAR_FIELD(target);
1767 
1768  return true;
1769 }
1770 
1771 static bool
1773 {
1774  COMPARE_STRING_FIELD(tablespacename);
1775  COMPARE_NODE_FIELD(owner);
1776  COMPARE_STRING_FIELD(location);
1778 
1779  return true;
1780 }
1781 
1782 static bool
1784 {
1785  COMPARE_STRING_FIELD(tablespacename);
1786  COMPARE_SCALAR_FIELD(missing_ok);
1787 
1788  return true;
1789 }
1790 
1791 static bool
1793  const AlterTableSpaceOptionsStmt *b)
1794 {
1795  COMPARE_STRING_FIELD(tablespacename);
1797  COMPARE_SCALAR_FIELD(isReset);
1798 
1799  return true;
1800 }
1801 
1802 static bool
1804  const AlterTableMoveAllStmt *b)
1805 {
1806  COMPARE_STRING_FIELD(orig_tablespacename);
1807  COMPARE_SCALAR_FIELD(objtype);
1808  COMPARE_NODE_FIELD(roles);
1809  COMPARE_STRING_FIELD(new_tablespacename);
1810  COMPARE_SCALAR_FIELD(nowait);
1811 
1812  return true;
1813 }
1814 
1815 static bool
1817 {
1818  COMPARE_STRING_FIELD(extname);
1819  COMPARE_SCALAR_FIELD(if_not_exists);
1821 
1822  return true;
1823 }
1824 
1825 static bool
1827 {
1828  COMPARE_STRING_FIELD(extname);
1830 
1831  return true;
1832 }
1833 
1834 static bool
1836 {
1837  COMPARE_STRING_FIELD(extname);
1838  COMPARE_SCALAR_FIELD(action);
1839  COMPARE_SCALAR_FIELD(objtype);
1840  COMPARE_NODE_FIELD(object);
1841 
1842  return true;
1843 }
1844 
1845 static bool
1847 {
1848  COMPARE_STRING_FIELD(fdwname);
1849  COMPARE_NODE_FIELD(func_options);
1851 
1852  return true;
1853 }
1854 
1855 static bool
1857 {
1858  COMPARE_STRING_FIELD(fdwname);
1859  COMPARE_NODE_FIELD(func_options);
1861 
1862  return true;
1863 }
1864 
1865 static bool
1867 {
1868  COMPARE_STRING_FIELD(servername);
1869  COMPARE_STRING_FIELD(servertype);
1870  COMPARE_STRING_FIELD(version);
1871  COMPARE_STRING_FIELD(fdwname);
1872  COMPARE_SCALAR_FIELD(if_not_exists);
1874 
1875  return true;
1876 }
1877 
1878 static bool
1880 {
1881  COMPARE_STRING_FIELD(servername);
1882  COMPARE_STRING_FIELD(version);
1884  COMPARE_SCALAR_FIELD(has_version);
1885 
1886  return true;
1887 }
1888 
1889 static bool
1891 {
1893  COMPARE_STRING_FIELD(servername);
1894  COMPARE_SCALAR_FIELD(if_not_exists);
1896 
1897  return true;
1898 }
1899 
1900 static bool
1902 {
1904  COMPARE_STRING_FIELD(servername);
1906 
1907  return true;
1908 }
1909 
1910 static bool
1912 {
1914  COMPARE_STRING_FIELD(servername);
1915  COMPARE_SCALAR_FIELD(missing_ok);
1916 
1917  return true;
1918 }
1919 
1920 static bool
1922 {
1923  if (!_equalCreateStmt(&a->base, &b->base))
1924  return false;
1925 
1926  COMPARE_STRING_FIELD(servername);
1928 
1929  return true;
1930 }
1931 
1932 static bool
1934 {
1935  COMPARE_STRING_FIELD(server_name);
1936  COMPARE_STRING_FIELD(remote_schema);
1937  COMPARE_STRING_FIELD(local_schema);
1938  COMPARE_SCALAR_FIELD(list_type);
1939  COMPARE_NODE_FIELD(table_list);
1941 
1942  return true;
1943 }
1944 
1945 static bool
1947 {
1948  COMPARE_SCALAR_FIELD(replace);
1949  COMPARE_NODE_FIELD(type_name);
1950  COMPARE_STRING_FIELD(lang);
1951  COMPARE_NODE_FIELD(fromsql);
1952  COMPARE_NODE_FIELD(tosql);
1953 
1954  return true;
1955 }
1956 
1957 static bool
1959 {
1960  COMPARE_STRING_FIELD(amname);
1961  COMPARE_NODE_FIELD(handler_name);
1962  COMPARE_SCALAR_FIELD(amtype);
1963 
1964  return true;
1965 }
1966 
1967 static bool
1969 {
1970  COMPARE_STRING_FIELD(trigname);
1971  COMPARE_NODE_FIELD(relation);
1972  COMPARE_NODE_FIELD(funcname);
1974  COMPARE_SCALAR_FIELD(row);
1975  COMPARE_SCALAR_FIELD(timing);
1976  COMPARE_SCALAR_FIELD(events);
1977  COMPARE_NODE_FIELD(columns);
1978  COMPARE_NODE_FIELD(whenClause);
1979  COMPARE_SCALAR_FIELD(isconstraint);
1980  COMPARE_NODE_FIELD(transitionRels);
1981  COMPARE_SCALAR_FIELD(deferrable);
1982  COMPARE_SCALAR_FIELD(initdeferred);
1983  COMPARE_NODE_FIELD(constrrel);
1984 
1985  return true;
1986 }
1987 
1988 static bool
1990 {
1991  COMPARE_STRING_FIELD(trigname);
1992  COMPARE_STRING_FIELD(eventname);
1993  COMPARE_NODE_FIELD(whenclause);
1994  COMPARE_NODE_FIELD(funcname);
1995 
1996  return true;
1997 }
1998 
1999 static bool
2001 {
2002  COMPARE_STRING_FIELD(trigname);
2003  COMPARE_SCALAR_FIELD(tgenabled);
2004 
2005  return true;
2006 }
2007 
2008 static bool
2010 {
2011  COMPARE_SCALAR_FIELD(replace);
2012  COMPARE_STRING_FIELD(plname);
2013  COMPARE_NODE_FIELD(plhandler);
2014  COMPARE_NODE_FIELD(plinline);
2015  COMPARE_NODE_FIELD(plvalidator);
2016  COMPARE_SCALAR_FIELD(pltrusted);
2017 
2018  return true;
2019 }
2020 
2021 static bool
2023 {
2024  COMPARE_SCALAR_FIELD(stmt_type);
2025  COMPARE_STRING_FIELD(role);
2027 
2028  return true;
2029 }
2030 
2031 static bool
2033 {
2034  COMPARE_NODE_FIELD(role);
2036  COMPARE_SCALAR_FIELD(action);
2037 
2038  return true;
2039 }
2040 
2041 static bool
2043 {
2044  COMPARE_NODE_FIELD(role);
2045  COMPARE_STRING_FIELD(database);
2046  COMPARE_NODE_FIELD(setstmt);
2047 
2048  return true;
2049 }
2050 
2051 static bool
2053 {
2054  COMPARE_NODE_FIELD(roles);
2055  COMPARE_SCALAR_FIELD(missing_ok);
2056 
2057  return true;
2058 }
2059 
2060 static bool
2061 _equalLockStmt(const LockStmt *a, const LockStmt *b)
2062 {
2063  COMPARE_NODE_FIELD(relations);
2064  COMPARE_SCALAR_FIELD(mode);
2065  COMPARE_SCALAR_FIELD(nowait);
2066 
2067  return true;
2068 }
2069 
2070 static bool
2072 {
2073  COMPARE_NODE_FIELD(constraints);
2074  COMPARE_SCALAR_FIELD(deferred);
2075 
2076  return true;
2077 }
2078 
2079 static bool
2081 {
2082  COMPARE_SCALAR_FIELD(kind);
2083  COMPARE_NODE_FIELD(relation);
2086 
2087  return true;
2088 }
2089 
2090 static bool
2092 {
2093  COMPARE_STRING_FIELD(schemaname);
2094  COMPARE_NODE_FIELD(authrole);
2095  COMPARE_NODE_FIELD(schemaElts);
2096  COMPARE_SCALAR_FIELD(if_not_exists);
2097 
2098  return true;
2099 }
2100 
2101 static bool
2103 {
2104  COMPARE_NODE_FIELD(conversion_name);
2105  COMPARE_STRING_FIELD(for_encoding_name);
2106  COMPARE_STRING_FIELD(to_encoding_name);
2107  COMPARE_NODE_FIELD(func_name);
2108  COMPARE_SCALAR_FIELD(def);
2109 
2110  return true;
2111 }
2112 
2113 static bool
2115 {
2116  COMPARE_NODE_FIELD(sourcetype);
2117  COMPARE_NODE_FIELD(targettype);
2118  COMPARE_NODE_FIELD(func);
2119  COMPARE_SCALAR_FIELD(context);
2120  COMPARE_SCALAR_FIELD(inout);
2121 
2122  return true;
2123 }
2124 
2125 static bool
2127 {
2129  COMPARE_NODE_FIELD(argtypes);
2130  COMPARE_NODE_FIELD(query);
2131 
2132  return true;
2133 }
2134 
2135 static bool
2137 {
2139  COMPARE_NODE_FIELD(params);
2140 
2141  return true;
2142 }
2143 
2144 static bool
2146 {
2148 
2149  return true;
2150 }
2151 
2152 static bool
2154 {
2155  COMPARE_NODE_FIELD(roles);
2156  COMPARE_SCALAR_FIELD(behavior);
2157 
2158  return true;
2159 }
2160 
2161 static bool
2163 {
2164  COMPARE_NODE_FIELD(roles);
2165  COMPARE_NODE_FIELD(newrole);
2166 
2167  return true;
2168 }
2169 
2170 static bool
2172 {
2173  COMPARE_NODE_FIELD(dictname);
2175 
2176  return true;
2177 }
2178 
2179 static bool
2181  const AlterTSConfigurationStmt *b)
2182 {
2183  COMPARE_SCALAR_FIELD(kind);
2184  COMPARE_NODE_FIELD(cfgname);
2185  COMPARE_NODE_FIELD(tokentype);
2186  COMPARE_NODE_FIELD(dicts);
2187  COMPARE_SCALAR_FIELD(override);
2188  COMPARE_SCALAR_FIELD(replace);
2189  COMPARE_SCALAR_FIELD(missing_ok);
2190 
2191  return true;
2192 }
2193 
2194 static bool
2196  const CreatePublicationStmt *b)
2197 {
2198  COMPARE_STRING_FIELD(pubname);
2200  COMPARE_NODE_FIELD(tables);
2201  COMPARE_SCALAR_FIELD(for_all_tables);
2202 
2203  return true;
2204 }
2205 
2206 static bool
2208  const AlterPublicationStmt *b)
2209 {
2210  COMPARE_STRING_FIELD(pubname);
2212  COMPARE_NODE_FIELD(tables);
2213  COMPARE_SCALAR_FIELD(for_all_tables);
2214  COMPARE_SCALAR_FIELD(tableAction);
2215 
2216  return true;
2217 }
2218 
2219 static bool
2221  const CreateSubscriptionStmt *b)
2222 {
2223  COMPARE_STRING_FIELD(subname);
2224  COMPARE_STRING_FIELD(conninfo);
2225  COMPARE_NODE_FIELD(publication);
2227 
2228  return true;
2229 }
2230 
2231 static bool
2233  const AlterSubscriptionStmt *b)
2234 {
2235  COMPARE_SCALAR_FIELD(kind);
2236  COMPARE_STRING_FIELD(subname);
2237  COMPARE_STRING_FIELD(conninfo);
2238  COMPARE_NODE_FIELD(publication);
2240 
2241  return true;
2242 }
2243 
2244 static bool
2246  const DropSubscriptionStmt *b)
2247 {
2248  COMPARE_STRING_FIELD(subname);
2249  COMPARE_SCALAR_FIELD(missing_ok);
2250  COMPARE_SCALAR_FIELD(behavior);
2251 
2252  return true;
2253 }
2254 
2255 static bool
2257 {
2258  COMPARE_STRING_FIELD(policy_name);
2259  COMPARE_NODE_FIELD(table);
2260  COMPARE_STRING_FIELD(cmd_name);
2261  COMPARE_SCALAR_FIELD(permissive);
2262  COMPARE_NODE_FIELD(roles);
2263  COMPARE_NODE_FIELD(qual);
2264  COMPARE_NODE_FIELD(with_check);
2265 
2266  return true;
2267 }
2268 
2269 static bool
2271 {
2272  COMPARE_STRING_FIELD(policy_name);
2273  COMPARE_NODE_FIELD(table);
2274  COMPARE_NODE_FIELD(roles);
2275  COMPARE_NODE_FIELD(qual);
2276  COMPARE_NODE_FIELD(with_check);
2277 
2278  return true;
2279 }
2280 
2281 static bool
2282 _equalAExpr(const A_Expr *a, const A_Expr *b)
2283 {
2284  COMPARE_SCALAR_FIELD(kind);
2286  COMPARE_NODE_FIELD(lexpr);
2287  COMPARE_NODE_FIELD(rexpr);
2288  COMPARE_LOCATION_FIELD(location);
2289 
2290  return true;
2291 }
2292 
2293 static bool
2295 {
2296  COMPARE_NODE_FIELD(fields);
2297  COMPARE_LOCATION_FIELD(location);
2298 
2299  return true;
2300 }
2301 
2302 static bool
2303 _equalParamRef(const ParamRef *a, const ParamRef *b)
2304 {
2305  COMPARE_SCALAR_FIELD(number);
2306  COMPARE_LOCATION_FIELD(location);
2307 
2308  return true;
2309 }
2310 
2311 static bool
2312 _equalAConst(const A_Const *a, const A_Const *b)
2313 {
2314  if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
2315  return false;
2316  COMPARE_LOCATION_FIELD(location);
2317 
2318  return true;
2319 }
2320 
2321 static bool
2322 _equalFuncCall(const FuncCall *a, const FuncCall *b)
2323 {
2324  COMPARE_NODE_FIELD(funcname);
2326  COMPARE_NODE_FIELD(agg_order);
2327  COMPARE_NODE_FIELD(agg_filter);
2328  COMPARE_SCALAR_FIELD(agg_within_group);
2329  COMPARE_SCALAR_FIELD(agg_star);
2330  COMPARE_SCALAR_FIELD(agg_distinct);
2331  COMPARE_SCALAR_FIELD(func_variadic);
2332  COMPARE_NODE_FIELD(over);
2333  COMPARE_LOCATION_FIELD(location);
2334 
2335  return true;
2336 }
2337 
2338 static bool
2339 _equalAStar(const A_Star *a, const A_Star *b)
2340 {
2341  return true;
2342 }
2343 
2344 static bool
2346 {
2347  COMPARE_SCALAR_FIELD(is_slice);
2348  COMPARE_NODE_FIELD(lidx);
2349  COMPARE_NODE_FIELD(uidx);
2350 
2351  return true;
2352 }
2353 
2354 static bool
2356 {
2358  COMPARE_NODE_FIELD(indirection);
2359 
2360  return true;
2361 }
2362 
2363 static bool
2365 {
2366  COMPARE_NODE_FIELD(elements);
2367  COMPARE_LOCATION_FIELD(location);
2368 
2369  return true;
2370 }
2371 
2372 static bool
2374 {
2376  COMPARE_NODE_FIELD(indirection);
2378  COMPARE_LOCATION_FIELD(location);
2379 
2380  return true;
2381 }
2382 
2383 static bool
2385 {
2386  COMPARE_NODE_FIELD(source);
2387  COMPARE_SCALAR_FIELD(colno);
2388  COMPARE_SCALAR_FIELD(ncolumns);
2389 
2390  return true;
2391 }
2392 
2393 static bool
2394 _equalTypeName(const TypeName *a, const TypeName *b)
2395 {
2396  COMPARE_NODE_FIELD(names);
2397  COMPARE_SCALAR_FIELD(typeOid);
2398  COMPARE_SCALAR_FIELD(setof);
2399  COMPARE_SCALAR_FIELD(pct_type);
2400  COMPARE_NODE_FIELD(typmods);
2401  COMPARE_SCALAR_FIELD(typemod);
2402  COMPARE_NODE_FIELD(arrayBounds);
2403  COMPARE_LOCATION_FIELD(location);
2404 
2405  return true;
2406 }
2407 
2408 static bool
2409 _equalTypeCast(const TypeCast *a, const TypeCast *b)
2410 {
2412  COMPARE_NODE_FIELD(typeName);
2413  COMPARE_LOCATION_FIELD(location);
2414 
2415  return true;
2416 }
2417 
2418 static bool
2420 {
2422  COMPARE_NODE_FIELD(collname);
2423  COMPARE_LOCATION_FIELD(location);
2424 
2425  return true;
2426 }
2427 
2428 static bool
2429 _equalSortBy(const SortBy *a, const SortBy *b)
2430 {
2431  COMPARE_NODE_FIELD(node);
2432  COMPARE_SCALAR_FIELD(sortby_dir);
2433  COMPARE_SCALAR_FIELD(sortby_nulls);
2434  COMPARE_NODE_FIELD(useOp);
2435  COMPARE_LOCATION_FIELD(location);
2436 
2437  return true;
2438 }
2439 
2440 static bool
2442 {
2444  COMPARE_STRING_FIELD(refname);
2445  COMPARE_NODE_FIELD(partitionClause);
2446  COMPARE_NODE_FIELD(orderClause);
2447  COMPARE_SCALAR_FIELD(frameOptions);
2448  COMPARE_NODE_FIELD(startOffset);
2449  COMPARE_NODE_FIELD(endOffset);
2450  COMPARE_LOCATION_FIELD(location);
2451 
2452  return true;
2453 }
2454 
2455 static bool
2457 {
2458  COMPARE_SCALAR_FIELD(lateral);
2459  COMPARE_NODE_FIELD(subquery);
2460  COMPARE_NODE_FIELD(alias);
2461 
2462  return true;
2463 }
2464 
2465 static bool
2467 {
2468  COMPARE_SCALAR_FIELD(lateral);
2469  COMPARE_SCALAR_FIELD(ordinality);
2470  COMPARE_SCALAR_FIELD(is_rowsfrom);
2472  COMPARE_NODE_FIELD(alias);
2473  COMPARE_NODE_FIELD(coldeflist);
2474 
2475  return true;
2476 }
2477 
2478 static bool
2480 {
2481  COMPARE_NODE_FIELD(relation);
2482  COMPARE_NODE_FIELD(method);
2484  COMPARE_NODE_FIELD(repeatable);
2485  COMPARE_LOCATION_FIELD(location);
2486 
2487  return true;
2488 }
2489 
2490 static bool
2492 {
2493  COMPARE_SCALAR_FIELD(lateral);
2494  COMPARE_NODE_FIELD(docexpr);
2495  COMPARE_NODE_FIELD(rowexpr);
2496  COMPARE_NODE_FIELD(namespaces);
2497  COMPARE_NODE_FIELD(columns);
2498  COMPARE_NODE_FIELD(alias);
2499  COMPARE_LOCATION_FIELD(location);
2500 
2501  return true;
2502 }
2503 
2504 static bool
2506 {
2507  COMPARE_STRING_FIELD(colname);
2508  COMPARE_NODE_FIELD(typeName);
2509  COMPARE_SCALAR_FIELD(for_ordinality);
2510  COMPARE_SCALAR_FIELD(is_not_null);
2511  COMPARE_NODE_FIELD(colexpr);
2512  COMPARE_NODE_FIELD(coldefexpr);
2513  COMPARE_LOCATION_FIELD(location);
2514 
2515  return true;
2516 }
2517 
2518 
2519 static bool
2521 {
2523  COMPARE_NODE_FIELD(expr);
2524  COMPARE_STRING_FIELD(indexcolname);
2525  COMPARE_NODE_FIELD(collation);
2526  COMPARE_NODE_FIELD(opclass);
2527  COMPARE_SCALAR_FIELD(ordering);
2528  COMPARE_SCALAR_FIELD(nulls_ordering);
2529 
2530  return true;
2531 }
2532 
2533 static bool
2535 {
2536  COMPARE_STRING_FIELD(colname);
2537  COMPARE_NODE_FIELD(typeName);
2538  COMPARE_SCALAR_FIELD(inhcount);
2539  COMPARE_SCALAR_FIELD(is_local);
2540  COMPARE_SCALAR_FIELD(is_not_null);
2541  COMPARE_SCALAR_FIELD(is_from_type);
2542  COMPARE_SCALAR_FIELD(is_from_parent);
2543  COMPARE_SCALAR_FIELD(storage);
2544  COMPARE_NODE_FIELD(raw_default);
2545  COMPARE_NODE_FIELD(cooked_default);
2546  COMPARE_SCALAR_FIELD(identity);
2547  COMPARE_NODE_FIELD(collClause);
2548  COMPARE_SCALAR_FIELD(collOid);
2549  COMPARE_NODE_FIELD(constraints);
2550  COMPARE_NODE_FIELD(fdwoptions);
2551  COMPARE_LOCATION_FIELD(location);
2552 
2553  return true;
2554 }
2555 
2556 static bool
2558 {
2559  COMPARE_SCALAR_FIELD(contype);
2560  COMPARE_STRING_FIELD(conname);
2561  COMPARE_SCALAR_FIELD(deferrable);
2562  COMPARE_SCALAR_FIELD(initdeferred);
2563  COMPARE_LOCATION_FIELD(location);
2564  COMPARE_SCALAR_FIELD(is_no_inherit);
2565  COMPARE_NODE_FIELD(raw_expr);
2566  COMPARE_STRING_FIELD(cooked_expr);
2567  COMPARE_SCALAR_FIELD(generated_when);
2568  COMPARE_NODE_FIELD(keys);
2569  COMPARE_NODE_FIELD(exclusions);
2571  COMPARE_STRING_FIELD(indexname);
2572  COMPARE_STRING_FIELD(indexspace);
2573  COMPARE_STRING_FIELD(access_method);
2574  COMPARE_NODE_FIELD(where_clause);
2575  COMPARE_NODE_FIELD(pktable);
2576  COMPARE_NODE_FIELD(fk_attrs);
2577  COMPARE_NODE_FIELD(pk_attrs);
2578  COMPARE_SCALAR_FIELD(fk_matchtype);
2579  COMPARE_SCALAR_FIELD(fk_upd_action);
2580  COMPARE_SCALAR_FIELD(fk_del_action);
2581  COMPARE_NODE_FIELD(old_conpfeqop);
2582  COMPARE_SCALAR_FIELD(old_pktable_oid);
2583  COMPARE_SCALAR_FIELD(skip_validation);
2584  COMPARE_SCALAR_FIELD(initially_valid);
2585 
2586  return true;
2587 }
2588 
2589 static bool
2590 _equalDefElem(const DefElem *a, const DefElem *b)
2591 {
2592  COMPARE_STRING_FIELD(defnamespace);
2593  COMPARE_STRING_FIELD(defname);
2595  COMPARE_SCALAR_FIELD(defaction);
2596  COMPARE_LOCATION_FIELD(location);
2597 
2598  return true;
2599 }
2600 
2601 static bool
2603 {
2604  COMPARE_NODE_FIELD(lockedRels);
2605  COMPARE_SCALAR_FIELD(strength);
2606  COMPARE_SCALAR_FIELD(waitPolicy);
2607 
2608  return true;
2609 }
2610 
2611 static bool
2613 {
2614  COMPARE_SCALAR_FIELD(rtekind);
2615  COMPARE_SCALAR_FIELD(relid);
2616  COMPARE_SCALAR_FIELD(relkind);
2617  COMPARE_NODE_FIELD(tablesample);
2618  COMPARE_NODE_FIELD(subquery);
2619  COMPARE_SCALAR_FIELD(security_barrier);
2620  COMPARE_SCALAR_FIELD(jointype);
2621  COMPARE_NODE_FIELD(joinaliasvars);
2623  COMPARE_SCALAR_FIELD(funcordinality);
2624  COMPARE_NODE_FIELD(tablefunc);
2625  COMPARE_NODE_FIELD(values_lists);
2626  COMPARE_STRING_FIELD(ctename);
2627  COMPARE_SCALAR_FIELD(ctelevelsup);
2628  COMPARE_SCALAR_FIELD(self_reference);
2629  COMPARE_NODE_FIELD(coltypes);
2630  COMPARE_NODE_FIELD(coltypmods);
2631  COMPARE_NODE_FIELD(colcollations);
2632  COMPARE_STRING_FIELD(enrname);
2633  COMPARE_SCALAR_FIELD(enrtuples);
2634  COMPARE_NODE_FIELD(alias);
2635  COMPARE_NODE_FIELD(eref);
2636  COMPARE_SCALAR_FIELD(lateral);
2637  COMPARE_SCALAR_FIELD(inh);
2638  COMPARE_SCALAR_FIELD(inFromCl);
2639  COMPARE_SCALAR_FIELD(requiredPerms);
2640  COMPARE_SCALAR_FIELD(checkAsUser);
2641  COMPARE_BITMAPSET_FIELD(selectedCols);
2642  COMPARE_BITMAPSET_FIELD(insertedCols);
2643  COMPARE_BITMAPSET_FIELD(updatedCols);
2644  COMPARE_NODE_FIELD(securityQuals);
2645 
2646  return true;
2647 }
2648 
2649 static bool
2651 {
2652  COMPARE_NODE_FIELD(funcexpr);
2653  COMPARE_SCALAR_FIELD(funccolcount);
2654  COMPARE_NODE_FIELD(funccolnames);
2655  COMPARE_NODE_FIELD(funccoltypes);
2656  COMPARE_NODE_FIELD(funccoltypmods);
2657  COMPARE_NODE_FIELD(funccolcollations);
2658  COMPARE_BITMAPSET_FIELD(funcparams);
2659 
2660  return true;
2661 }
2662 
2663 static bool
2665 {
2666  COMPARE_SCALAR_FIELD(tsmhandler);
2668  COMPARE_NODE_FIELD(repeatable);
2669 
2670  return true;
2671 }
2672 
2673 static bool
2675 {
2676  COMPARE_SCALAR_FIELD(kind);
2677  COMPARE_STRING_FIELD(relname);
2678  COMPARE_STRING_FIELD(polname);
2679  COMPARE_NODE_FIELD(qual);
2680  COMPARE_SCALAR_FIELD(cascaded);
2681 
2682  return true;
2683 }
2684 
2685 static bool
2687 {
2688  COMPARE_SCALAR_FIELD(tleSortGroupRef);
2689  COMPARE_SCALAR_FIELD(eqop);
2690  COMPARE_SCALAR_FIELD(sortop);
2691  COMPARE_SCALAR_FIELD(nulls_first);
2692  COMPARE_SCALAR_FIELD(hashable);
2693 
2694  return true;
2695 }
2696 
2697 static bool
2699 {
2700  COMPARE_SCALAR_FIELD(kind);
2701  COMPARE_NODE_FIELD(content);
2702  COMPARE_LOCATION_FIELD(location);
2703 
2704  return true;
2705 }
2706 
2707 static bool
2709 {
2711  COMPARE_STRING_FIELD(refname);
2712  COMPARE_NODE_FIELD(partitionClause);
2713  COMPARE_NODE_FIELD(orderClause);
2714  COMPARE_SCALAR_FIELD(frameOptions);
2715  COMPARE_NODE_FIELD(startOffset);
2716  COMPARE_NODE_FIELD(endOffset);
2717  COMPARE_SCALAR_FIELD(winref);
2718  COMPARE_SCALAR_FIELD(copiedOrder);
2719 
2720  return true;
2721 }
2722 
2723 static bool
2725 {
2726  COMPARE_SCALAR_FIELD(rti);
2727  COMPARE_SCALAR_FIELD(strength);
2728  COMPARE_SCALAR_FIELD(waitPolicy);
2729  COMPARE_SCALAR_FIELD(pushedDown);
2730 
2731  return true;
2732 }
2733 
2734 static bool
2736 {
2737  COMPARE_NODE_FIELD(ctes);
2738  COMPARE_SCALAR_FIELD(recursive);
2739  COMPARE_LOCATION_FIELD(location);
2740 
2741  return true;
2742 }
2743 
2744 static bool
2746 {
2747  COMPARE_NODE_FIELD(indexElems);
2748  COMPARE_NODE_FIELD(whereClause);
2749  COMPARE_STRING_FIELD(conname);
2750  COMPARE_LOCATION_FIELD(location);
2751 
2752  return true;
2753 }
2754 
2755 static bool
2757 {
2758  COMPARE_SCALAR_FIELD(action);
2759  COMPARE_NODE_FIELD(infer);
2760  COMPARE_NODE_FIELD(targetList);
2761  COMPARE_NODE_FIELD(whereClause);
2762  COMPARE_LOCATION_FIELD(location);
2763 
2764  return true;
2765 }
2766 
2767 static bool
2769 {
2770  COMPARE_STRING_FIELD(ctename);
2771  COMPARE_NODE_FIELD(aliascolnames);
2772  COMPARE_NODE_FIELD(ctequery);
2773  COMPARE_LOCATION_FIELD(location);
2774  COMPARE_SCALAR_FIELD(cterecursive);
2775  COMPARE_SCALAR_FIELD(cterefcount);
2776  COMPARE_NODE_FIELD(ctecolnames);
2777  COMPARE_NODE_FIELD(ctecoltypes);
2778  COMPARE_NODE_FIELD(ctecoltypmods);
2779  COMPARE_NODE_FIELD(ctecolcollations);
2780 
2781  return true;
2782 }
2783 
2784 static bool
2786 {
2788  COMPARE_NODE_FIELD(expr);
2789  COMPARE_NODE_FIELD(typeName);
2790  COMPARE_LOCATION_FIELD(location);
2791 
2792  return true;
2793 }
2794 
2795 static bool
2796 _equalRoleSpec(const RoleSpec *a, const RoleSpec *b)
2797 {
2798  COMPARE_SCALAR_FIELD(roletype);
2799  COMPARE_STRING_FIELD(rolename);
2800  COMPARE_LOCATION_FIELD(location);
2801 
2802  return true;
2803 }
2804 
2805 static bool
2807 {
2809  COMPARE_SCALAR_FIELD(isNew);
2810  COMPARE_SCALAR_FIELD(isTable);
2811 
2812  return true;
2813 }
2814 
2815 static bool
2817 {
2819  COMPARE_NODE_FIELD(expr);
2820  COMPARE_NODE_FIELD(collation);
2821  COMPARE_NODE_FIELD(opclass);
2822  COMPARE_LOCATION_FIELD(location);
2823 
2824  return true;
2825 }
2826 
2827 static bool
2829 {
2830  COMPARE_STRING_FIELD(strategy);
2831  COMPARE_NODE_FIELD(partParams);
2832  COMPARE_LOCATION_FIELD(location);
2833 
2834  return true;
2835 }
2836 
2837 static bool
2839 {
2840  COMPARE_SCALAR_FIELD(strategy);
2841  COMPARE_NODE_FIELD(listdatums);
2842  COMPARE_NODE_FIELD(lowerdatums);
2843  COMPARE_NODE_FIELD(upperdatums);
2844  COMPARE_LOCATION_FIELD(location);
2845 
2846  return true;
2847 }
2848 
2849 static bool
2851 {
2852  COMPARE_SCALAR_FIELD(kind);
2854  COMPARE_LOCATION_FIELD(location);
2855 
2856  return true;
2857 }
2858 
2859 static bool
2861 {
2863  COMPARE_NODE_FIELD(bound);
2864 
2865  return true;
2866 }
2867 
2868 /*
2869  * Stuff from pg_list.h
2870  */
2871 
2872 static bool
2873 _equalList(const List *a, const List *b)
2874 {
2875  const ListCell *item_a;
2876  const ListCell *item_b;
2877 
2878  /*
2879  * Try to reject by simple scalar checks before grovelling through all the
2880  * list elements...
2881  */
2882  COMPARE_SCALAR_FIELD(type);
2884 
2885  /*
2886  * We place the switch outside the loop for the sake of efficiency; this
2887  * may not be worth doing...
2888  */
2889  switch (a->type)
2890  {
2891  case T_List:
2892  forboth(item_a, a, item_b, b)
2893  {
2894  if (!equal(lfirst(item_a), lfirst(item_b)))
2895  return false;
2896  }
2897  break;
2898  case T_IntList:
2899  forboth(item_a, a, item_b, b)
2900  {
2901  if (lfirst_int(item_a) != lfirst_int(item_b))
2902  return false;
2903  }
2904  break;
2905  case T_OidList:
2906  forboth(item_a, a, item_b, b)
2907  {
2908  if (lfirst_oid(item_a) != lfirst_oid(item_b))
2909  return false;
2910  }
2911  break;
2912  default:
2913  elog(ERROR, "unrecognized list node type: %d",
2914  (int) a->type);
2915  return false; /* keep compiler quiet */
2916  }
2917 
2918  /*
2919  * If we got here, we should have run out of elements of both lists
2920  */
2921  Assert(item_a == NULL);
2922  Assert(item_b == NULL);
2923 
2924  return true;
2925 }
2926 
2927 /*
2928  * Stuff from value.h
2929  */
2930 
2931 static bool
2932 _equalValue(const Value *a, const Value *b)
2933 {
2934  COMPARE_SCALAR_FIELD(type);
2935 
2936  switch (a->type)
2937  {
2938  case T_Integer:
2939  COMPARE_SCALAR_FIELD(val.ival);
2940  break;
2941  case T_Float:
2942  case T_String:
2943  case T_BitString:
2945  break;
2946  case T_Null:
2947  /* nothing to do */
2948  break;
2949  default:
2950  elog(ERROR, "unrecognized node type: %d", (int) a->type);
2951  break;
2952  }
2953 
2954  return true;
2955 }
2956 
2957 /*
2958  * equal
2959  * returns whether two nodes are equal
2960  */
2961 bool
2962 equal(const void *a, const void *b)
2963 {
2964  bool retval;
2965 
2966  if (a == b)
2967  return true;
2968 
2969  /*
2970  * note that a!=b, so only one of them can be NULL
2971  */
2972  if (a == NULL || b == NULL)
2973  return false;
2974 
2975  /*
2976  * are they the same type of nodes?
2977  */
2978  if (nodeTag(a) != nodeTag(b))
2979  return false;
2980 
2981  switch (nodeTag(a))
2982  {
2983  /*
2984  * PRIMITIVE NODES
2985  */
2986  case T_Alias:
2987  retval = _equalAlias(a, b);
2988  break;
2989  case T_RangeVar:
2990  retval = _equalRangeVar(a, b);
2991  break;
2992  case T_TableFunc:
2993  retval = _equalTableFunc(a, b);
2994  break;
2995  case T_IntoClause:
2996  retval = _equalIntoClause(a, b);
2997  break;
2998  case T_Var:
2999  retval = _equalVar(a, b);
3000  break;
3001  case T_Const:
3002  retval = _equalConst(a, b);
3003  break;
3004  case T_Param:
3005  retval = _equalParam(a, b);
3006  break;
3007  case T_Aggref:
3008  retval = _equalAggref(a, b);
3009  break;
3010  case T_GroupingFunc:
3011  retval = _equalGroupingFunc(a, b);
3012  break;
3013  case T_WindowFunc:
3014  retval = _equalWindowFunc(a, b);
3015  break;
3016  case T_ArrayRef:
3017  retval = _equalArrayRef(a, b);
3018  break;
3019  case T_FuncExpr:
3020  retval = _equalFuncExpr(a, b);
3021  break;
3022  case T_NamedArgExpr:
3023  retval = _equalNamedArgExpr(a, b);
3024  break;
3025  case T_OpExpr:
3026  retval = _equalOpExpr(a, b);
3027  break;
3028  case T_DistinctExpr:
3029  retval = _equalDistinctExpr(a, b);
3030  break;
3031  case T_NullIfExpr:
3032  retval = _equalNullIfExpr(a, b);
3033  break;
3034  case T_ScalarArrayOpExpr:
3035  retval = _equalScalarArrayOpExpr(a, b);
3036  break;
3037  case T_BoolExpr:
3038  retval = _equalBoolExpr(a, b);
3039  break;
3040  case T_SubLink:
3041  retval = _equalSubLink(a, b);
3042  break;
3043  case T_SubPlan:
3044  retval = _equalSubPlan(a, b);
3045  break;
3046  case T_AlternativeSubPlan:
3047  retval = _equalAlternativeSubPlan(a, b);
3048  break;
3049  case T_FieldSelect:
3050  retval = _equalFieldSelect(a, b);
3051  break;
3052  case T_FieldStore:
3053  retval = _equalFieldStore(a, b);
3054  break;
3055  case T_RelabelType:
3056  retval = _equalRelabelType(a, b);
3057  break;
3058  case T_CoerceViaIO:
3059  retval = _equalCoerceViaIO(a, b);
3060  break;
3061  case T_ArrayCoerceExpr:
3062  retval = _equalArrayCoerceExpr(a, b);
3063  break;
3064  case T_ConvertRowtypeExpr:
3065  retval = _equalConvertRowtypeExpr(a, b);
3066  break;
3067  case T_CollateExpr:
3068  retval = _equalCollateExpr(a, b);
3069  break;
3070  case T_CaseExpr:
3071  retval = _equalCaseExpr(a, b);
3072  break;
3073  case T_CaseWhen:
3074  retval = _equalCaseWhen(a, b);
3075  break;
3076  case T_CaseTestExpr:
3077  retval = _equalCaseTestExpr(a, b);
3078  break;
3079  case T_ArrayExpr:
3080  retval = _equalArrayExpr(a, b);
3081  break;
3082  case T_RowExpr:
3083  retval = _equalRowExpr(a, b);
3084  break;
3085  case T_RowCompareExpr:
3086  retval = _equalRowCompareExpr(a, b);
3087  break;
3088  case T_CoalesceExpr:
3089  retval = _equalCoalesceExpr(a, b);
3090  break;
3091  case T_MinMaxExpr:
3092  retval = _equalMinMaxExpr(a, b);
3093  break;
3094  case T_SQLValueFunction:
3095  retval = _equalSQLValueFunction(a, b);
3096  break;
3097  case T_XmlExpr:
3098  retval = _equalXmlExpr(a, b);
3099  break;
3100  case T_NullTest:
3101  retval = _equalNullTest(a, b);
3102  break;
3103  case T_BooleanTest:
3104  retval = _equalBooleanTest(a, b);
3105  break;
3106  case T_CoerceToDomain:
3107  retval = _equalCoerceToDomain(a, b);
3108  break;
3109  case T_CoerceToDomainValue:
3110  retval = _equalCoerceToDomainValue(a, b);
3111  break;
3112  case T_SetToDefault:
3113  retval = _equalSetToDefault(a, b);
3114  break;
3115  case T_CurrentOfExpr:
3116  retval = _equalCurrentOfExpr(a, b);
3117  break;
3118  case T_NextValueExpr:
3119  retval = _equalNextValueExpr(a, b);
3120  break;
3121  case T_InferenceElem:
3122  retval = _equalInferenceElem(a, b);
3123  break;
3124  case T_TargetEntry:
3125  retval = _equalTargetEntry(a, b);
3126  break;
3127  case T_RangeTblRef:
3128  retval = _equalRangeTblRef(a, b);
3129  break;
3130  case T_FromExpr:
3131  retval = _equalFromExpr(a, b);
3132  break;
3133  case T_OnConflictExpr:
3134  retval = _equalOnConflictExpr(a, b);
3135  break;
3136  case T_JoinExpr:
3137  retval = _equalJoinExpr(a, b);
3138  break;
3139 
3140  /*
3141  * RELATION NODES
3142  */
3143  case T_PathKey:
3144  retval = _equalPathKey(a, b);
3145  break;
3146  case T_RestrictInfo:
3147  retval = _equalRestrictInfo(a, b);
3148  break;
3149  case T_PlaceHolderVar:
3150  retval = _equalPlaceHolderVar(a, b);
3151  break;
3152  case T_SpecialJoinInfo:
3153  retval = _equalSpecialJoinInfo(a, b);
3154  break;
3155  case T_AppendRelInfo:
3156  retval = _equalAppendRelInfo(a, b);
3157  break;
3159  retval = _equalPartitionedChildRelInfo(a, b);
3160  break;
3161  case T_PlaceHolderInfo:
3162  retval = _equalPlaceHolderInfo(a, b);
3163  break;
3164 
3165  case T_List:
3166  case T_IntList:
3167  case T_OidList:
3168  retval = _equalList(a, b);
3169  break;
3170 
3171  case T_Integer:
3172  case T_Float:
3173  case T_String:
3174  case T_BitString:
3175  case T_Null:
3176  retval = _equalValue(a, b);
3177  break;
3178 
3179  /*
3180  * EXTENSIBLE NODES
3181  */
3182  case T_ExtensibleNode:
3183  retval = _equalExtensibleNode(a, b);
3184  break;
3185 
3186  /*
3187  * PARSE NODES
3188  */
3189  case T_Query:
3190  retval = _equalQuery(a, b);
3191  break;
3192  case T_RawStmt:
3193  retval = _equalRawStmt(a, b);
3194  break;
3195  case T_InsertStmt:
3196  retval = _equalInsertStmt(a, b);
3197  break;
3198  case T_DeleteStmt:
3199  retval = _equalDeleteStmt(a, b);
3200  break;
3201  case T_UpdateStmt:
3202  retval = _equalUpdateStmt(a, b);
3203  break;
3204  case T_SelectStmt:
3205  retval = _equalSelectStmt(a, b);
3206  break;
3207  case T_SetOperationStmt:
3208  retval = _equalSetOperationStmt(a, b);
3209  break;
3210  case T_AlterTableStmt:
3211  retval = _equalAlterTableStmt(a, b);
3212  break;
3213  case T_AlterTableCmd:
3214  retval = _equalAlterTableCmd(a, b);
3215  break;
3216  case T_AlterCollationStmt:
3217  retval = _equalAlterCollationStmt(a, b);
3218  break;
3219  case T_AlterDomainStmt:
3220  retval = _equalAlterDomainStmt(a, b);
3221  break;
3222  case T_GrantStmt:
3223  retval = _equalGrantStmt(a, b);
3224  break;
3225  case T_GrantRoleStmt:
3226  retval = _equalGrantRoleStmt(a, b);
3227  break;
3229  retval = _equalAlterDefaultPrivilegesStmt(a, b);
3230  break;
3231  case T_DeclareCursorStmt:
3232  retval = _equalDeclareCursorStmt(a, b);
3233  break;
3234  case T_ClosePortalStmt:
3235  retval = _equalClosePortalStmt(a, b);
3236  break;
3237  case T_ClusterStmt:
3238  retval = _equalClusterStmt(a, b);
3239  break;
3240  case T_CopyStmt:
3241  retval = _equalCopyStmt(a, b);
3242  break;
3243  case T_CreateStmt:
3244  retval = _equalCreateStmt(a, b);
3245  break;
3246  case T_TableLikeClause:
3247  retval = _equalTableLikeClause(a, b);
3248  break;
3249  case T_DefineStmt:
3250  retval = _equalDefineStmt(a, b);
3251  break;
3252  case T_DropStmt:
3253  retval = _equalDropStmt(a, b);
3254  break;
3255  case T_TruncateStmt:
3256  retval = _equalTruncateStmt(a, b);
3257  break;
3258  case T_CommentStmt:
3259  retval = _equalCommentStmt(a, b);
3260  break;
3261  case T_SecLabelStmt:
3262  retval = _equalSecLabelStmt(a, b);
3263  break;
3264  case T_FetchStmt:
3265  retval = _equalFetchStmt(a, b);
3266  break;
3267  case T_IndexStmt:
3268  retval = _equalIndexStmt(a, b);
3269  break;
3270  case T_CreateStatsStmt:
3271  retval = _equalCreateStatsStmt(a, b);
3272  break;
3273  case T_CreateFunctionStmt:
3274  retval = _equalCreateFunctionStmt(a, b);
3275  break;
3276  case T_FunctionParameter:
3277  retval = _equalFunctionParameter(a, b);
3278  break;
3279  case T_AlterFunctionStmt:
3280  retval = _equalAlterFunctionStmt(a, b);
3281  break;
3282  case T_DoStmt:
3283  retval = _equalDoStmt(a, b);
3284  break;
3285  case T_RenameStmt:
3286  retval = _equalRenameStmt(a, b);
3287  break;
3289  retval = _equalAlterObjectDependsStmt(a, b);
3290  break;
3292  retval = _equalAlterObjectSchemaStmt(a, b);
3293  break;
3294  case T_AlterOwnerStmt:
3295  retval = _equalAlterOwnerStmt(a, b);
3296  break;
3297  case T_AlterOperatorStmt:
3298  retval = _equalAlterOperatorStmt(a, b);
3299  break;
3300  case T_RuleStmt:
3301  retval = _equalRuleStmt(a, b);
3302  break;
3303  case T_NotifyStmt:
3304  retval = _equalNotifyStmt(a, b);
3305  break;
3306  case T_ListenStmt:
3307  retval = _equalListenStmt(a, b);
3308  break;
3309  case T_UnlistenStmt:
3310  retval = _equalUnlistenStmt(a, b);
3311  break;
3312  case T_TransactionStmt:
3313  retval = _equalTransactionStmt(a, b);
3314  break;
3315  case T_CompositeTypeStmt:
3316  retval = _equalCompositeTypeStmt(a, b);
3317  break;
3318  case T_CreateEnumStmt:
3319  retval = _equalCreateEnumStmt(a, b);
3320  break;
3321  case T_CreateRangeStmt:
3322  retval = _equalCreateRangeStmt(a, b);
3323  break;
3324  case T_AlterEnumStmt:
3325  retval = _equalAlterEnumStmt(a, b);
3326  break;
3327  case T_ViewStmt:
3328  retval = _equalViewStmt(a, b);
3329  break;
3330  case T_LoadStmt:
3331  retval = _equalLoadStmt(a, b);
3332  break;
3333  case T_CreateDomainStmt:
3334  retval = _equalCreateDomainStmt(a, b);
3335  break;
3336  case T_CreateOpClassStmt:
3337  retval = _equalCreateOpClassStmt(a, b);
3338  break;
3339  case T_CreateOpClassItem:
3340  retval = _equalCreateOpClassItem(a, b);
3341  break;
3342  case T_CreateOpFamilyStmt:
3343  retval = _equalCreateOpFamilyStmt(a, b);
3344  break;
3345  case T_AlterOpFamilyStmt:
3346  retval = _equalAlterOpFamilyStmt(a, b);
3347  break;
3348  case T_CreatedbStmt:
3349  retval = _equalCreatedbStmt(a, b);
3350  break;
3351  case T_AlterDatabaseStmt:
3352  retval = _equalAlterDatabaseStmt(a, b);
3353  break;
3355  retval = _equalAlterDatabaseSetStmt(a, b);
3356  break;
3357  case T_DropdbStmt:
3358  retval = _equalDropdbStmt(a, b);
3359  break;
3360  case T_VacuumStmt:
3361  retval = _equalVacuumStmt(a, b);
3362  break;
3363  case T_ExplainStmt:
3364  retval = _equalExplainStmt(a, b);
3365  break;
3366  case T_CreateTableAsStmt:
3367  retval = _equalCreateTableAsStmt(a, b);
3368  break;
3369  case T_RefreshMatViewStmt:
3370  retval = _equalRefreshMatViewStmt(a, b);
3371  break;
3372  case T_ReplicaIdentityStmt:
3373  retval = _equalReplicaIdentityStmt(a, b);
3374  break;
3375  case T_AlterSystemStmt:
3376  retval = _equalAlterSystemStmt(a, b);
3377  break;
3378  case T_CreateSeqStmt:
3379  retval = _equalCreateSeqStmt(a, b);
3380  break;
3381  case T_AlterSeqStmt:
3382  retval = _equalAlterSeqStmt(a, b);
3383  break;
3384  case T_VariableSetStmt:
3385  retval = _equalVariableSetStmt(a, b);
3386  break;
3387  case T_VariableShowStmt:
3388  retval = _equalVariableShowStmt(a, b);
3389  break;
3390  case T_DiscardStmt:
3391  retval = _equalDiscardStmt(a, b);
3392  break;
3394  retval = _equalCreateTableSpaceStmt(a, b);
3395  break;
3396  case T_DropTableSpaceStmt:
3397  retval = _equalDropTableSpaceStmt(a, b);
3398  break;
3400  retval = _equalAlterTableSpaceOptionsStmt(a, b);
3401  break;
3403  retval = _equalAlterTableMoveAllStmt(a, b);
3404  break;
3405  case T_CreateExtensionStmt:
3406  retval = _equalCreateExtensionStmt(a, b);
3407  break;
3408  case T_AlterExtensionStmt:
3409  retval = _equalAlterExtensionStmt(a, b);
3410  break;
3412  retval = _equalAlterExtensionContentsStmt(a, b);
3413  break;
3414  case T_CreateFdwStmt:
3415  retval = _equalCreateFdwStmt(a, b);
3416  break;
3417  case T_AlterFdwStmt:
3418  retval = _equalAlterFdwStmt(a, b);
3419  break;
3421  retval = _equalCreateForeignServerStmt(a, b);
3422  break;
3424  retval = _equalAlterForeignServerStmt(a, b);
3425  break;
3427  retval = _equalCreateUserMappingStmt(a, b);
3428  break;
3430  retval = _equalAlterUserMappingStmt(a, b);
3431  break;
3432  case T_DropUserMappingStmt:
3433  retval = _equalDropUserMappingStmt(a, b);
3434  break;
3436  retval = _equalCreateForeignTableStmt(a, b);
3437  break;
3439  retval = _equalImportForeignSchemaStmt(a, b);
3440  break;
3441  case T_CreateTransformStmt:
3442  retval = _equalCreateTransformStmt(a, b);
3443  break;
3444  case T_CreateAmStmt:
3445  retval = _equalCreateAmStmt(a, b);
3446  break;
3447  case T_CreateTrigStmt:
3448  retval = _equalCreateTrigStmt(a, b);
3449  break;
3450  case T_CreateEventTrigStmt:
3451  retval = _equalCreateEventTrigStmt(a, b);
3452  break;
3453  case T_AlterEventTrigStmt:
3454  retval = _equalAlterEventTrigStmt(a, b);
3455  break;
3456  case T_CreatePLangStmt:
3457  retval = _equalCreatePLangStmt(a, b);
3458  break;
3459  case T_CreateRoleStmt:
3460  retval = _equalCreateRoleStmt(a, b);
3461  break;
3462  case T_AlterRoleStmt:
3463  retval = _equalAlterRoleStmt(a, b);
3464  break;
3465  case T_AlterRoleSetStmt:
3466  retval = _equalAlterRoleSetStmt(a, b);
3467  break;
3468  case T_DropRoleStmt:
3469  retval = _equalDropRoleStmt(a, b);
3470  break;
3471  case T_LockStmt:
3472  retval = _equalLockStmt(a, b);
3473  break;
3474  case T_ConstraintsSetStmt:
3475  retval = _equalConstraintsSetStmt(a, b);
3476  break;
3477  case T_ReindexStmt:
3478  retval = _equalReindexStmt(a, b);
3479  break;
3480  case T_CheckPointStmt:
3481  retval = true;
3482  break;
3483  case T_CreateSchemaStmt:
3484  retval = _equalCreateSchemaStmt(a, b);
3485  break;
3487  retval = _equalCreateConversionStmt(a, b);
3488  break;
3489  case T_CreateCastStmt:
3490  retval = _equalCreateCastStmt(a, b);
3491  break;
3492  case T_PrepareStmt:
3493  retval = _equalPrepareStmt(a, b);
3494  break;
3495  case T_ExecuteStmt:
3496  retval = _equalExecuteStmt(a, b);
3497  break;
3498  case T_DeallocateStmt:
3499  retval = _equalDeallocateStmt(a, b);
3500  break;
3501  case T_DropOwnedStmt:
3502  retval = _equalDropOwnedStmt(a, b);
3503  break;
3504  case T_ReassignOwnedStmt:
3505  retval = _equalReassignOwnedStmt(a, b);
3506  break;
3508  retval = _equalAlterTSDictionaryStmt(a, b);
3509  break;
3511  retval = _equalAlterTSConfigurationStmt(a, b);
3512  break;
3513  case T_CreatePolicyStmt:
3514  retval = _equalCreatePolicyStmt(a, b);
3515  break;
3516  case T_AlterPolicyStmt:
3517  retval = _equalAlterPolicyStmt(a, b);
3518  break;
3520  retval = _equalCreatePublicationStmt(a, b);
3521  break;
3523  retval = _equalAlterPublicationStmt(a, b);
3524  break;
3526  retval = _equalCreateSubscriptionStmt(a, b);
3527  break;
3529  retval = _equalAlterSubscriptionStmt(a, b);
3530  break;
3532  retval = _equalDropSubscriptionStmt(a, b);
3533  break;
3534  case T_A_Expr:
3535  retval = _equalAExpr(a, b);
3536  break;
3537  case T_ColumnRef:
3538  retval = _equalColumnRef(a, b);
3539  break;
3540  case T_ParamRef:
3541  retval = _equalParamRef(a, b);
3542  break;
3543  case T_A_Const:
3544  retval = _equalAConst(a, b);
3545  break;
3546  case T_FuncCall:
3547  retval = _equalFuncCall(a, b);
3548  break;
3549  case T_A_Star:
3550  retval = _equalAStar(a, b);
3551  break;
3552  case T_A_Indices:
3553  retval = _equalAIndices(a, b);
3554  break;
3555  case T_A_Indirection:
3556  retval = _equalA_Indirection(a, b);
3557  break;
3558  case T_A_ArrayExpr:
3559  retval = _equalA_ArrayExpr(a, b);
3560  break;
3561  case T_ResTarget:
3562  retval = _equalResTarget(a, b);
3563  break;
3564  case T_MultiAssignRef:
3565  retval = _equalMultiAssignRef(a, b);
3566  break;
3567  case T_TypeCast:
3568  retval = _equalTypeCast(a, b);
3569  break;
3570  case T_CollateClause:
3571  retval = _equalCollateClause(a, b);
3572  break;
3573  case T_SortBy:
3574  retval = _equalSortBy(a, b);
3575  break;
3576  case T_WindowDef:
3577  retval = _equalWindowDef(a, b);
3578  break;
3579  case T_RangeSubselect:
3580  retval = _equalRangeSubselect(a, b);
3581  break;
3582  case T_RangeFunction:
3583  retval = _equalRangeFunction(a, b);
3584  break;
3585  case T_RangeTableSample:
3586  retval = _equalRangeTableSample(a, b);
3587  break;
3588  case T_RangeTableFunc:
3589  retval = _equalRangeTableFunc(a, b);
3590  break;
3591  case T_RangeTableFuncCol:
3592  retval = _equalRangeTableFuncCol(a, b);
3593  break;
3594  case T_TypeName:
3595  retval = _equalTypeName(a, b);
3596  break;
3597  case T_IndexElem:
3598  retval = _equalIndexElem(a, b);
3599  break;
3600  case T_ColumnDef:
3601  retval = _equalColumnDef(a, b);
3602  break;
3603  case T_Constraint:
3604  retval = _equalConstraint(a, b);
3605  break;
3606  case T_DefElem:
3607  retval = _equalDefElem(a, b);
3608  break;
3609  case T_LockingClause:
3610  retval = _equalLockingClause(a, b);
3611  break;
3612  case T_RangeTblEntry:
3613  retval = _equalRangeTblEntry(a, b);
3614  break;
3615  case T_RangeTblFunction:
3616  retval = _equalRangeTblFunction(a, b);
3617  break;
3618  case T_TableSampleClause:
3619  retval = _equalTableSampleClause(a, b);
3620  break;
3621  case T_WithCheckOption:
3622  retval = _equalWithCheckOption(a, b);
3623  break;
3624  case T_SortGroupClause:
3625  retval = _equalSortGroupClause(a, b);
3626  break;
3627  case T_GroupingSet:
3628  retval = _equalGroupingSet(a, b);
3629  break;
3630  case T_WindowClause:
3631  retval = _equalWindowClause(a, b);
3632  break;
3633  case T_RowMarkClause:
3634  retval = _equalRowMarkClause(a, b);
3635  break;
3636  case T_WithClause:
3637  retval = _equalWithClause(a, b);
3638  break;
3639  case T_InferClause:
3640  retval = _equalInferClause(a, b);
3641  break;
3642  case T_OnConflictClause:
3643  retval = _equalOnConflictClause(a, b);
3644  break;
3645  case T_CommonTableExpr:
3646  retval = _equalCommonTableExpr(a, b);
3647  break;
3648  case T_ObjectWithArgs:
3649  retval = _equalObjectWithArgs(a, b);
3650  break;
3651  case T_AccessPriv:
3652  retval = _equalAccessPriv(a, b);
3653  break;
3654  case T_XmlSerialize:
3655  retval = _equalXmlSerialize(a, b);
3656  break;
3657  case T_RoleSpec:
3658  retval = _equalRoleSpec(a, b);
3659  break;
3660  case T_TriggerTransition:
3661  retval = _equalTriggerTransition(a, b);
3662  break;
3663  case T_PartitionElem:
3664  retval = _equalPartitionElem(a, b);
3665  break;
3666  case T_PartitionSpec:
3667  retval = _equalPartitionSpec(a, b);
3668  break;
3669  case T_PartitionBoundSpec:
3670  retval = _equalPartitionBoundSpec(a, b);
3671  break;
3672  case T_PartitionRangeDatum:
3673  retval = _equalPartitionRangeDatum(a, b);
3674  break;
3675  case T_PartitionCmd:
3676  retval = _equalPartitionCmd(a, b);
3677  break;
3678 
3679  default:
3680  elog(ERROR, "unrecognized node type: %d",
3681  (int) nodeTag(a));
3682  retval = false; /* keep compiler quiet */
3683  break;
3684  }
3685 
3686  return retval;
3687 }
static bool _equalDropUserMappingStmt(const DropUserMappingStmt *a, const DropUserMappingStmt *b)
Definition: equalfuncs.c:1911
Datum constvalue
Definition: primnodes.h:196
static bool _equalWindowDef(const WindowDef *a, const WindowDef *b)
Definition: equalfuncs.c:2441
static bool _equalDiscardStmt(const DiscardStmt *a, const DiscardStmt *b)
Definition: equalfuncs.c:1764
static bool _equalAlterFdwStmt(const AlterFdwStmt *a, const AlterFdwStmt *b)
Definition: equalfuncs.c:1856
static bool _equalParamRef(const ParamRef *a, const ParamRef *b)
Definition: equalfuncs.c:2303
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:2071
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:1097
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:1682
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:908
static bool _equalCollateExpr(const CollateExpr *a, const CollateExpr *b)
Definition: equalfuncs.c:539
#define forboth(cell1, list1, cell2, list2)
Definition: pg_list.h:180
static bool _equalGroupingSet(const GroupingSet *a, const GroupingSet *b)
Definition: equalfuncs.c:2698
static bool _equalSortGroupClause(const SortGroupClause *a, const SortGroupClause *b)
Definition: equalfuncs.c:2686
static bool _equalCreateFdwStmt(const CreateFdwStmt *a, const CreateFdwStmt *b)
Definition: equalfuncs.c:1846
static bool _equalTargetEntry(const TargetEntry *a, const TargetEntry *b)
Definition: equalfuncs.c:756
bool constbyval
Definition: primnodes.h:199
static bool _equalBooleanTest(const BooleanTest *a, const BooleanTest *b)
Definition: equalfuncs.c:682
bool equal(const void *a, const void *b)
Definition: equalfuncs.c:2962
#define COMPARE_STRING_FIELD(fldname)
Definition: equalfuncs.c:66
static bool _equalMinMaxExpr(const MinMaxExpr *a, const MinMaxExpr *b)
Definition: equalfuncs.c:631
static bool _equalTriggerTransition(const TriggerTransition *a, const TriggerTransition *b)
Definition: equalfuncs.c:2806
static bool _equalCreateAmStmt(const CreateAmStmt *a, const CreateAmStmt *b)
Definition: equalfuncs.c:1958
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:1745
static bool _equalDropTableSpaceStmt(const DropTableSpaceStmt *a, const DropTableSpaceStmt *b)
Definition: equalfuncs.c:1783
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:595
static bool _equalReindexStmt(const ReindexStmt *a, const ReindexStmt *b)
Definition: equalfuncs.c:2080
static bool _equalPrepareStmt(const PrepareStmt *a, const PrepareStmt *b)
Definition: equalfuncs.c:2126
static bool _equalTypeName(const TypeName *a, const TypeName *b)
Definition: equalfuncs.c:2394
static bool _equalOnConflictClause(const OnConflictClause *a, const OnConflictClause *b)
Definition: equalfuncs.c:2756
static bool _equalExecuteStmt(const ExecuteStmt *a, const ExecuteStmt *b)
Definition: equalfuncs.c:2136
static bool _equalExtensibleNode(const ExtensibleNode *a, const ExtensibleNode *b)
Definition: equalfuncs.c:933
static bool _equalCommonTableExpr(const CommonTableExpr *a, const CommonTableExpr *b)
Definition: equalfuncs.c:2768
#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:2114
static bool _equalUpdateStmt(const UpdateStmt *a, const UpdateStmt *b)
Definition: equalfuncs.c:1033
static bool _equalArrayExpr(const ArrayExpr *a, const ArrayExpr *b)
Definition: equalfuncs.c:582
static bool _equalCreateTrigStmt(const CreateTrigStmt *a, const CreateTrigStmt *b)
Definition: equalfuncs.c:1968
static bool _equalIndexElem(const IndexElem *a, const IndexElem *b)
Definition: equalfuncs.c:2520
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:1704
static bool _equalInferClause(const InferClause *a, const InferClause *b)
Definition: equalfuncs.c:2745
return result
Definition: formatting.c:1633
#define COMPARE_COERCIONFORM_FIELD(fldname)
Definition: equalfuncs.c:88
static bool _equalCaseWhen(const CaseWhen *a, const CaseWhen *b)
Definition: equalfuncs.c:562
static bool _equalRoleSpec(const RoleSpec *a, const RoleSpec *b)
Definition: equalfuncs.c:2796
static bool _equalPathKey(const PathKey *a, const PathKey *b)
Definition: equalfuncs.c:821
static bool _equalDropRoleStmt(const DropRoleStmt *a, const DropRoleStmt *b)
Definition: equalfuncs.c:2052
static bool _equalRangeTableFuncCol(const RangeTableFuncCol *a, const RangeTableFuncCol *b)
Definition: equalfuncs.c:2505
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:895
Definition: primnodes.h:163
static bool _equalAlterRoleSetStmt(const AlterRoleSetStmt *a, const AlterRoleSetStmt *b)
Definition: equalfuncs.c:2042
static bool _equalReassignOwnedStmt(const ReassignOwnedStmt *a, const ReassignOwnedStmt *b)
Definition: equalfuncs.c:2162
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:1046
static bool _equalRangeTblRef(const RangeTblRef *a, const RangeTblRef *b)
Definition: equalfuncs.c:770
static bool _equalCoerceToDomain(const CoerceToDomain *a, const CoerceToDomain *b)
Definition: equalfuncs.c:692
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:1734
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:1816
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:2590
static bool _equalPartitionBoundSpec(const PartitionBoundSpec *a, const PartitionBoundSpec *b)
Definition: equalfuncs.c:2838
static bool _equalSortBy(const SortBy *a, const SortBy *b)
Definition: equalfuncs.c:2429
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:2171
static bool _equalCollateClause(const CollateClause *a, const CollateClause *b)
Definition: equalfuncs.c:2419
int constlen
Definition: primnodes.h:195
static bool _equalAlterExtensionStmt(const AlterExtensionStmt *a, const AlterExtensionStmt *b)
Definition: equalfuncs.c:1826
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:2674
static bool _equalAExpr(const A_Expr *a, const A_Expr *b)
Definition: equalfuncs.c:2282
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:1835
static bool _equalCoalesceExpr(const CoalesceExpr *a, const CoalesceExpr *b)
Definition: equalfuncs.c:620
static bool _equalJoinExpr(const JoinExpr *a, const JoinExpr *b)
Definition: equalfuncs.c:778
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:2650
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:1756
static bool _equalCaseExpr(const CaseExpr *a, const CaseExpr *b)
Definition: equalfuncs.c:549
#define lfirst_int(lc)
Definition: pg_list.h:107
static bool _equalList(const List *a, const List *b)
Definition: equalfuncs.c:2873
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:1086
static bool _equalPartitionCmd(const PartitionCmd *a, const PartitionCmd *b)
Definition: equalfuncs.c:2860
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:2102
static bool _equalRangeTableSample(const RangeTableSample *a, const RangeTableSample *b)
Definition: equalfuncs.c:2479
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:2828
static bool _equalCreatePLangStmt(const CreatePLangStmt *a, const CreatePLangStmt *b)
Definition: equalfuncs.c:2009
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:607
static bool _equalAlterForeignServerStmt(const AlterForeignServerStmt *a, const AlterForeignServerStmt *b)
Definition: equalfuncs.c:1879
static bool _equalCoerceToDomainValue(const CoerceToDomainValue *a, const CoerceToDomainValue *b)
Definition: equalfuncs.c:705
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:2708
static bool _equalCurrentOfExpr(const CurrentOfExpr *a, const CurrentOfExpr *b)
Definition: equalfuncs.c:727
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:716
static bool _equalFuncCall(const FuncCall *a, const FuncCall *b)
Definition: equalfuncs.c:2322
static bool _equalAlterEventTrigStmt(const AlterEventTrigStmt *a, const AlterEventTrigStmt *b)
Definition: equalfuncs.c:2000
static bool _equalQuery(const Query *a, const Query *b)
Definition: equalfuncs.c:954
static bool _equalConstraint(const Constraint *a, const Constraint *b)
Definition: equalfuncs.c:2557
static bool _equalCreateUserMappingStmt(const CreateUserMappingStmt *a, const CreateUserMappingStmt *b)
Definition: equalfuncs.c:1890
static bool _equalAlterTSConfigurationStmt(const AlterTSConfigurationStmt *a, const AlterTSConfigurationStmt *b)
Definition: equalfuncs.c:2180
static bool _equalCaseTestExpr(const CaseTestExpr *a, const CaseTestExpr *b)
Definition: equalfuncs.c:572
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:644
static bool _equalCreateForeignServerStmt(const CreateForeignServerStmt *a, const CreateForeignServerStmt *b)
Definition: equalfuncs.c:1866
static bool _equalImportForeignSchemaStmt(const ImportForeignSchemaStmt *a, const ImportForeignSchemaStmt *b)
Definition: equalfuncs.c:1933
static bool _equalNullTest(const NullTest *a, const NullTest *b)
Definition: equalfuncs.c:671
static bool _equalPartitionRangeDatum(const PartitionRangeDatum *a, const PartitionRangeDatum *b)
Definition: equalfuncs.c:2850
static bool _equalInferenceElem(const InferenceElem *a, const InferenceElem *b)
Definition: equalfuncs.c:746
static bool _equalRangeTableFunc(const RangeTableFunc *a, const RangeTableFunc *b)
Definition: equalfuncs.c:2491
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:2232
Definition: nodes.h:291
static bool _equalCreateTableSpaceStmt(const CreateTableSpaceStmt *a, const CreateTableSpaceStmt *b)
Definition: equalfuncs.c:1772
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:852
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:2816
static bool _equalRawStmt(const RawStmt *a, const RawStmt *b)
Definition: equalfuncs.c:997
static int verbose
Definition: pg_basebackup.c:84
Definition: nodes.h:146
static bool _equalSpecialJoinInfo(const SpecialJoinInfo *a, const SpecialJoinInfo *b)
Definition: equalfuncs.c:877
static bool _equalAlterRoleStmt(const AlterRoleStmt *a, const AlterRoleStmt *b)
Definition: equalfuncs.c:2032
static bool _equalA_Indirection(const A_Indirection *a, const A_Indirection *b)
Definition: equalfuncs.c:2355
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:2022
static bool _equalAlterPolicyStmt(const AlterPolicyStmt *a, const AlterPolicyStmt *b)
Definition: equalfuncs.c:2270
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:793
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:81
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:1673
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:2195
static bool _equalCreateTransformStmt(const CreateTransformStmt *a, const CreateTransformStmt *b)
Definition: equalfuncs.c:1946
const char * extnodename
Definition: extensible.h:35
static bool _equalDeleteStmt(const DeleteStmt *a, const DeleteStmt *b)
Definition: equalfuncs.c:1021
static bool _equalSetOperationStmt(const SetOperationStmt *a, const SetOperationStmt *b)
Definition: equalfuncs.c:1071
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:2207
static bool _equalLockingClause(const LockingClause *a, const LockingClause *b)
Definition: equalfuncs.c:2602
static bool _equalTypeCast(const TypeCast *a, const TypeCast *b)
Definition: equalfuncs.c:2409
#define NULL
Definition: c.h:229
static bool _equalCreateSeqStmt(const CreateSeqStmt *a, const CreateSeqStmt *b)
Definition: equalfuncs.c:1722
#define Assert(condition)
Definition: c.h:676
#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:1792
Definition: value.h:42
static bool _equalDropSubscriptionStmt(const DropSubscriptionStmt *a, const DropSubscriptionStmt *b)
Definition: equalfuncs.c:2245
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:917
#define COMPARE_LOCATION_FIELD(fldname)
Definition: equalfuncs.c:84
static bool _equalResTarget(const ResTarget *a, const ResTarget *b)
Definition: equalfuncs.c:2373
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:2256
char * dbname
Definition: streamutil.c:39
static bool _equalDropOwnedStmt(const DropOwnedStmt *a, const DropOwnedStmt *b)
Definition: equalfuncs.c:2153
static bool _equalXmlExpr(const XmlExpr *a, const XmlExpr *b)
Definition: equalfuncs.c:655
static const struct fns functions
Definition: regcomp.c:299
static bool _equalNextValueExpr(const NextValueExpr *a, const NextValueExpr *b)
Definition: equalfuncs.c:737
static bool _equalValue(const Value *a, const Value *b)
Definition: equalfuncs.c:2932
static bool _equalAlterUserMappingStmt(const AlterUserMappingStmt *a, const AlterUserMappingStmt *b)
Definition: equalfuncs.c:1901
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:1921
#define nodeTag(nodeptr)
Definition: nodes.h:514
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:2339
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:2664
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:2384
static char * user
Definition: pg_regress.c:92
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:2294
static bool _equalAConst(const A_Const *a, const A_Const *b)
Definition: equalfuncs.c:2312
static bool _equalRangeTblEntry(const RangeTblEntry *a, const RangeTblEntry *b)
Definition: equalfuncs.c:2612
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:1694
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:2345
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:2220
static bool _equalOnConflictExpr(const OnConflictExpr *a, const OnConflictExpr *b)
Definition: equalfuncs.c:802
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:1007
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:833
static bool _equalDeallocateStmt(const DeallocateStmt *a, const DeallocateStmt *b)
Definition: equalfuncs.c:2145
static bool _equalRangeSubselect(const RangeSubselect *a, const RangeSubselect *b)
Definition: equalfuncs.c:2456
#define elog
Definition: elog.h:219
static bool _equalAlterTableMoveAllStmt(const AlterTableMoveAllStmt *a, const AlterTableMoveAllStmt *b)
Definition: equalfuncs.c:1803
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:2735
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:2364
static bool _equalCreateSchemaStmt(const CreateSchemaStmt *a, const CreateSchemaStmt *b)
Definition: equalfuncs.c:2091
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:1713
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:2785
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:2061
#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:2466
static bool _equalCreateEventTrigStmt(const CreateEventTrigStmt *a, const CreateEventTrigStmt *b)
Definition: equalfuncs.c:1989
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:528
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:2724
Definition: nodes.h:148
static bool _equalColumnDef(const ColumnDef *a, const ColumnDef *b)
Definition: equalfuncs.c:2534