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