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-2022, 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 an inline array */
78 #define COMPARE_ARRAY_FIELD(fldname) \
79  do { \
80  if (memcmp(a->fldname, b->fldname, sizeof(a->fldname)) != 0) \
81  return false; \
82  } while (0)
83 
84 /* Compare a field that is a pointer to a simple palloc'd object of size sz */
85 #define COMPARE_POINTER_FIELD(fldname, sz) \
86  do { \
87  if (memcmp(a->fldname, b->fldname, (sz)) != 0) \
88  return false; \
89  } while (0)
90 
91 /* Compare a parse location field (this is a no-op, per note above) */
92 #define COMPARE_LOCATION_FIELD(fldname) \
93  ((void) 0)
94 
95 /* Compare a CoercionForm field (also a no-op, per comment in primnodes.h) */
96 #define COMPARE_COERCIONFORM_FIELD(fldname) \
97  ((void) 0)
98 
99 
100 /*
101  * Stuff from primnodes.h
102  */
103 
104 static bool
105 _equalAlias(const Alias *a, const Alias *b)
106 {
107  COMPARE_STRING_FIELD(aliasname);
108  COMPARE_NODE_FIELD(colnames);
109 
110  return true;
111 }
112 
113 static bool
115 {
116  COMPARE_STRING_FIELD(catalogname);
117  COMPARE_STRING_FIELD(schemaname);
120  COMPARE_SCALAR_FIELD(relpersistence);
121  COMPARE_NODE_FIELD(alias);
122  COMPARE_LOCATION_FIELD(location);
123 
124  return true;
125 }
126 
127 static bool
129 {
130  COMPARE_SCALAR_FIELD(functype);
131  COMPARE_NODE_FIELD(ns_uris);
132  COMPARE_NODE_FIELD(ns_names);
133  COMPARE_NODE_FIELD(docexpr);
134  COMPARE_NODE_FIELD(rowexpr);
135  COMPARE_NODE_FIELD(colnames);
136  COMPARE_NODE_FIELD(coltypes);
137  COMPARE_NODE_FIELD(coltypmods);
138  COMPARE_NODE_FIELD(colcollations);
139  COMPARE_NODE_FIELD(colexprs);
140  COMPARE_NODE_FIELD(coldefexprs);
141  COMPARE_NODE_FIELD(colvalexprs);
142  COMPARE_BITMAPSET_FIELD(notnulls);
143  COMPARE_NODE_FIELD(plan);
144  COMPARE_SCALAR_FIELD(ordinalitycol);
145  COMPARE_LOCATION_FIELD(location);
146 
147  return true;
148 }
149 
150 static bool
152 {
153  COMPARE_NODE_FIELD(common);
154  COMPARE_NODE_FIELD(columns);
155  COMPARE_NODE_FIELD(on_error);
156  COMPARE_NODE_FIELD(alias);
157  COMPARE_SCALAR_FIELD(location);
158 
159  return true;
160 }
161 
162 static bool
164 {
165  COMPARE_SCALAR_FIELD(coltype);
167  COMPARE_NODE_FIELD(typeName);
168  COMPARE_STRING_FIELD(pathspec);
170  COMPARE_SCALAR_FIELD(wrapper);
171  COMPARE_SCALAR_FIELD(omit_quotes);
172  COMPARE_NODE_FIELD(columns);
173  COMPARE_NODE_FIELD(on_empty);
174  COMPARE_NODE_FIELD(on_error);
175  COMPARE_SCALAR_FIELD(location);
176 
177  return true;
178 }
179 
180 static bool
182 {
183  COMPARE_NODE_FIELD(path);
185  COMPARE_NODE_FIELD(child);
186  COMPARE_SCALAR_FIELD(outerJoin);
187  COMPARE_SCALAR_FIELD(colMin);
188  COMPARE_SCALAR_FIELD(colMax);
189  COMPARE_SCALAR_FIELD(errorOnError);
190 
191  return true;
192 }
193 
194 static bool
196 {
197  COMPARE_NODE_FIELD(larg);
198  COMPARE_NODE_FIELD(rarg);
199  COMPARE_SCALAR_FIELD(cross);
200 
201  return true;
202 }
203 
204 static bool
206 {
207  COMPARE_NODE_FIELD(rel);
208  COMPARE_NODE_FIELD(colNames);
209  COMPARE_STRING_FIELD(accessMethod);
211  COMPARE_SCALAR_FIELD(onCommit);
212  COMPARE_STRING_FIELD(tableSpaceName);
213  COMPARE_NODE_FIELD(viewQuery);
214  COMPARE_SCALAR_FIELD(skipData);
215 
216  return true;
217 }
218 
219 /*
220  * We don't need an _equalExpr because Expr is an abstract supertype which
221  * should never actually get instantiated. Also, since it has no common
222  * fields except NodeTag, there's no need for a helper routine to factor
223  * out comparing the common fields...
224  */
225 
226 static bool
227 _equalVar(const Var *a, const Var *b)
228 {
229  COMPARE_SCALAR_FIELD(varno);
230  COMPARE_SCALAR_FIELD(varattno);
231  COMPARE_SCALAR_FIELD(vartype);
232  COMPARE_SCALAR_FIELD(vartypmod);
233  COMPARE_SCALAR_FIELD(varcollid);
234  COMPARE_SCALAR_FIELD(varlevelsup);
235 
236  /*
237  * varnosyn/varattnosyn are intentionally ignored here, because Vars with
238  * different syntactic identifiers are semantically the same as long as
239  * their varno/varattno match.
240  */
241  COMPARE_LOCATION_FIELD(location);
242 
243  return true;
244 }
245 
246 static bool
247 _equalConst(const Const *a, const Const *b)
248 {
249  COMPARE_SCALAR_FIELD(consttype);
250  COMPARE_SCALAR_FIELD(consttypmod);
251  COMPARE_SCALAR_FIELD(constcollid);
252  COMPARE_SCALAR_FIELD(constlen);
253  COMPARE_SCALAR_FIELD(constisnull);
254  COMPARE_SCALAR_FIELD(constbyval);
255  COMPARE_LOCATION_FIELD(location);
256 
257  /*
258  * We treat all NULL constants of the same type as equal. Someday this
259  * might need to change? But datumIsEqual doesn't work on nulls, so...
260  */
261  if (a->constisnull)
262  return true;
263  return datumIsEqual(a->constvalue, b->constvalue,
264  a->constbyval, a->constlen);
265 }
266 
267 static bool
268 _equalParam(const Param *a, const Param *b)
269 {
270  COMPARE_SCALAR_FIELD(paramkind);
271  COMPARE_SCALAR_FIELD(paramid);
272  COMPARE_SCALAR_FIELD(paramtype);
273  COMPARE_SCALAR_FIELD(paramtypmod);
274  COMPARE_SCALAR_FIELD(paramcollid);
275  COMPARE_LOCATION_FIELD(location);
276 
277  return true;
278 }
279 
280 static bool
281 _equalAggref(const Aggref *a, const Aggref *b)
282 {
283  COMPARE_SCALAR_FIELD(aggfnoid);
284  COMPARE_SCALAR_FIELD(aggtype);
285  COMPARE_SCALAR_FIELD(aggcollid);
286  COMPARE_SCALAR_FIELD(inputcollid);
287  /* ignore aggtranstype since it might not be set yet */
288  COMPARE_NODE_FIELD(aggargtypes);
289  COMPARE_NODE_FIELD(aggdirectargs);
291  COMPARE_NODE_FIELD(aggorder);
292  COMPARE_NODE_FIELD(aggdistinct);
293  COMPARE_NODE_FIELD(aggfilter);
294  COMPARE_SCALAR_FIELD(aggstar);
295  COMPARE_SCALAR_FIELD(aggvariadic);
296  COMPARE_SCALAR_FIELD(aggkind);
297  COMPARE_SCALAR_FIELD(agglevelsup);
298  COMPARE_SCALAR_FIELD(aggsplit);
299  COMPARE_SCALAR_FIELD(aggno);
300  COMPARE_SCALAR_FIELD(aggtransno);
301  COMPARE_LOCATION_FIELD(location);
302 
303  return true;
304 }
305 
306 static bool
308 {
310 
311  /*
312  * We must not compare the refs or cols field
313  */
314 
315  COMPARE_SCALAR_FIELD(agglevelsup);
316  COMPARE_LOCATION_FIELD(location);
317 
318  return true;
319 }
320 
321 static bool
323 {
324  COMPARE_SCALAR_FIELD(winfnoid);
325  COMPARE_SCALAR_FIELD(wintype);
326  COMPARE_SCALAR_FIELD(wincollid);
327  COMPARE_SCALAR_FIELD(inputcollid);
329  COMPARE_NODE_FIELD(aggfilter);
330  COMPARE_SCALAR_FIELD(winref);
331  COMPARE_SCALAR_FIELD(winstar);
332  COMPARE_SCALAR_FIELD(winagg);
333  COMPARE_LOCATION_FIELD(location);
334 
335  return true;
336 }
337 
338 static bool
340 {
341  COMPARE_SCALAR_FIELD(refcontainertype);
342  COMPARE_SCALAR_FIELD(refelemtype);
343  COMPARE_SCALAR_FIELD(refrestype);
344  COMPARE_SCALAR_FIELD(reftypmod);
345  COMPARE_SCALAR_FIELD(refcollid);
346  COMPARE_NODE_FIELD(refupperindexpr);
347  COMPARE_NODE_FIELD(reflowerindexpr);
348  COMPARE_NODE_FIELD(refexpr);
349  COMPARE_NODE_FIELD(refassgnexpr);
350 
351  return true;
352 }
353 
354 static bool
356 {
357  COMPARE_SCALAR_FIELD(funcid);
358  COMPARE_SCALAR_FIELD(funcresulttype);
359  COMPARE_SCALAR_FIELD(funcretset);
360  COMPARE_SCALAR_FIELD(funcvariadic);
361  COMPARE_COERCIONFORM_FIELD(funcformat);
362  COMPARE_SCALAR_FIELD(funccollid);
363  COMPARE_SCALAR_FIELD(inputcollid);
365  COMPARE_LOCATION_FIELD(location);
366 
367  return true;
368 }
369 
370 static bool
372 {
375  COMPARE_SCALAR_FIELD(argnumber);
376  COMPARE_LOCATION_FIELD(location);
377 
378  return true;
379 }
380 
381 static bool
382 _equalOpExpr(const OpExpr *a, const OpExpr *b)
383 {
384  COMPARE_SCALAR_FIELD(opno);
385 
386  /*
387  * Special-case opfuncid: it is allowable for it to differ if one node
388  * contains zero and the other doesn't. This just means that the one node
389  * isn't as far along in the parse/plan pipeline and hasn't had the
390  * opfuncid cache filled yet.
391  */
392  if (a->opfuncid != b->opfuncid &&
393  a->opfuncid != 0 &&
394  b->opfuncid != 0)
395  return false;
396 
397  COMPARE_SCALAR_FIELD(opresulttype);
398  COMPARE_SCALAR_FIELD(opretset);
399  COMPARE_SCALAR_FIELD(opcollid);
400  COMPARE_SCALAR_FIELD(inputcollid);
402  COMPARE_LOCATION_FIELD(location);
403 
404  return true;
405 }
406 
407 static bool
409 {
410  COMPARE_SCALAR_FIELD(opno);
411 
412  /*
413  * Special-case opfuncid: it is allowable for it to differ if one node
414  * contains zero and the other doesn't. This just means that the one node
415  * isn't as far along in the parse/plan pipeline and hasn't had the
416  * opfuncid cache filled yet.
417  */
418  if (a->opfuncid != b->opfuncid &&
419  a->opfuncid != 0 &&
420  b->opfuncid != 0)
421  return false;
422 
423  COMPARE_SCALAR_FIELD(opresulttype);
424  COMPARE_SCALAR_FIELD(opretset);
425  COMPARE_SCALAR_FIELD(opcollid);
426  COMPARE_SCALAR_FIELD(inputcollid);
428  COMPARE_LOCATION_FIELD(location);
429 
430  return true;
431 }
432 
433 static bool
435 {
436  COMPARE_SCALAR_FIELD(opno);
437 
438  /*
439  * Special-case opfuncid: it is allowable for it to differ if one node
440  * contains zero and the other doesn't. This just means that the one node
441  * isn't as far along in the parse/plan pipeline and hasn't had the
442  * opfuncid cache filled yet.
443  */
444  if (a->opfuncid != b->opfuncid &&
445  a->opfuncid != 0 &&
446  b->opfuncid != 0)
447  return false;
448 
449  COMPARE_SCALAR_FIELD(opresulttype);
450  COMPARE_SCALAR_FIELD(opretset);
451  COMPARE_SCALAR_FIELD(opcollid);
452  COMPARE_SCALAR_FIELD(inputcollid);
454  COMPARE_LOCATION_FIELD(location);
455 
456  return true;
457 }
458 
459 static bool
461 {
462  COMPARE_SCALAR_FIELD(opno);
463 
464  /*
465  * Special-case opfuncid: it is allowable for it to differ if one node
466  * contains zero and the other doesn't. This just means that the one node
467  * isn't as far along in the parse/plan pipeline and hasn't had the
468  * opfuncid cache filled yet.
469  */
470  if (a->opfuncid != b->opfuncid &&
471  a->opfuncid != 0 &&
472  b->opfuncid != 0)
473  return false;
474 
475  /* As above, hashfuncid may differ too */
476  if (a->hashfuncid != b->hashfuncid &&
477  a->hashfuncid != 0 &&
478  b->hashfuncid != 0)
479  return false;
480 
481  /* Likewise for the negfuncid */
482  if (a->negfuncid != b->negfuncid &&
483  a->negfuncid != 0 &&
484  b->negfuncid != 0)
485  return false;
486 
487  COMPARE_SCALAR_FIELD(useOr);
488  COMPARE_SCALAR_FIELD(inputcollid);
490  COMPARE_LOCATION_FIELD(location);
491 
492  return true;
493 }
494 
495 static bool
497 {
500  COMPARE_LOCATION_FIELD(location);
501 
502  return true;
503 }
504 
505 static bool
506 _equalSubLink(const SubLink *a, const SubLink *b)
507 {
508  COMPARE_SCALAR_FIELD(subLinkType);
509  COMPARE_SCALAR_FIELD(subLinkId);
510  COMPARE_NODE_FIELD(testexpr);
511  COMPARE_NODE_FIELD(operName);
512  COMPARE_NODE_FIELD(subselect);
513  COMPARE_LOCATION_FIELD(location);
514 
515  return true;
516 }
517 
518 static bool
519 _equalSubPlan(const SubPlan *a, const SubPlan *b)
520 {
521  COMPARE_SCALAR_FIELD(subLinkType);
522  COMPARE_NODE_FIELD(testexpr);
523  COMPARE_NODE_FIELD(paramIds);
524  COMPARE_SCALAR_FIELD(plan_id);
525  COMPARE_STRING_FIELD(plan_name);
526  COMPARE_SCALAR_FIELD(firstColType);
527  COMPARE_SCALAR_FIELD(firstColTypmod);
528  COMPARE_SCALAR_FIELD(firstColCollation);
529  COMPARE_SCALAR_FIELD(useHashTable);
530  COMPARE_SCALAR_FIELD(unknownEqFalse);
531  COMPARE_SCALAR_FIELD(parallel_safe);
532  COMPARE_NODE_FIELD(setParam);
533  COMPARE_NODE_FIELD(parParam);
535  COMPARE_SCALAR_FIELD(startup_cost);
536  COMPARE_SCALAR_FIELD(per_call_cost);
537 
538  return true;
539 }
540 
541 static bool
543 {
544  COMPARE_NODE_FIELD(subplans);
545 
546  return true;
547 }
548 
549 static bool
551 {
553  COMPARE_SCALAR_FIELD(fieldnum);
554  COMPARE_SCALAR_FIELD(resulttype);
555  COMPARE_SCALAR_FIELD(resulttypmod);
556  COMPARE_SCALAR_FIELD(resultcollid);
557 
558  return true;
559 }
560 
561 static bool
563 {
565  COMPARE_NODE_FIELD(newvals);
566  COMPARE_NODE_FIELD(fieldnums);
567  COMPARE_SCALAR_FIELD(resulttype);
568 
569  return true;
570 }
571 
572 static bool
574 {
576  COMPARE_SCALAR_FIELD(resulttype);
577  COMPARE_SCALAR_FIELD(resulttypmod);
578  COMPARE_SCALAR_FIELD(resultcollid);
579  COMPARE_COERCIONFORM_FIELD(relabelformat);
580  COMPARE_LOCATION_FIELD(location);
581 
582  return true;
583 }
584 
585 static bool
587 {
589  COMPARE_SCALAR_FIELD(resulttype);
590  COMPARE_SCALAR_FIELD(resultcollid);
591  COMPARE_COERCIONFORM_FIELD(coerceformat);
592  COMPARE_LOCATION_FIELD(location);
593 
594  return true;
595 }
596 
597 static bool
599 {
601  COMPARE_NODE_FIELD(elemexpr);
602  COMPARE_SCALAR_FIELD(resulttype);
603  COMPARE_SCALAR_FIELD(resulttypmod);
604  COMPARE_SCALAR_FIELD(resultcollid);
605  COMPARE_COERCIONFORM_FIELD(coerceformat);
606  COMPARE_LOCATION_FIELD(location);
607 
608  return true;
609 }
610 
611 static bool
613 {
615  COMPARE_SCALAR_FIELD(resulttype);
616  COMPARE_COERCIONFORM_FIELD(convertformat);
617  COMPARE_LOCATION_FIELD(location);
618 
619  return true;
620 }
621 
622 static bool
624 {
626  COMPARE_SCALAR_FIELD(collOid);
627  COMPARE_LOCATION_FIELD(location);
628 
629  return true;
630 }
631 
632 static bool
634 {
635  COMPARE_SCALAR_FIELD(casetype);
636  COMPARE_SCALAR_FIELD(casecollid);
639  COMPARE_NODE_FIELD(defresult);
640  COMPARE_LOCATION_FIELD(location);
641 
642  return true;
643 }
644 
645 static bool
647 {
648  COMPARE_NODE_FIELD(expr);
649  COMPARE_NODE_FIELD(result);
650  COMPARE_LOCATION_FIELD(location);
651 
652  return true;
653 }
654 
655 static bool
657 {
658  COMPARE_SCALAR_FIELD(typeId);
659  COMPARE_SCALAR_FIELD(typeMod);
660  COMPARE_SCALAR_FIELD(collation);
661 
662  return true;
663 }
664 
665 static bool
667 {
668  COMPARE_SCALAR_FIELD(array_typeid);
669  COMPARE_SCALAR_FIELD(array_collid);
670  COMPARE_SCALAR_FIELD(element_typeid);
671  COMPARE_NODE_FIELD(elements);
672  COMPARE_SCALAR_FIELD(multidims);
673  COMPARE_LOCATION_FIELD(location);
674 
675  return true;
676 }
677 
678 static bool
679 _equalRowExpr(const RowExpr *a, const RowExpr *b)
680 {
682  COMPARE_SCALAR_FIELD(row_typeid);
683  COMPARE_COERCIONFORM_FIELD(row_format);
684  COMPARE_NODE_FIELD(colnames);
685  COMPARE_LOCATION_FIELD(location);
686 
687  return true;
688 }
689 
690 static bool
692 {
693  COMPARE_SCALAR_FIELD(rctype);
694  COMPARE_NODE_FIELD(opnos);
695  COMPARE_NODE_FIELD(opfamilies);
696  COMPARE_NODE_FIELD(inputcollids);
697  COMPARE_NODE_FIELD(largs);
698  COMPARE_NODE_FIELD(rargs);
699 
700  return true;
701 }
702 
703 static bool
705 {
706  COMPARE_SCALAR_FIELD(coalescetype);
707  COMPARE_SCALAR_FIELD(coalescecollid);
709  COMPARE_LOCATION_FIELD(location);
710 
711  return true;
712 }
713 
714 static bool
716 {
717  COMPARE_SCALAR_FIELD(minmaxtype);
718  COMPARE_SCALAR_FIELD(minmaxcollid);
719  COMPARE_SCALAR_FIELD(inputcollid);
722  COMPARE_LOCATION_FIELD(location);
723 
724  return true;
725 }
726 
727 static bool
729 {
732  COMPARE_SCALAR_FIELD(typmod);
733  COMPARE_LOCATION_FIELD(location);
734 
735  return true;
736 }
737 
738 static bool
739 _equalXmlExpr(const XmlExpr *a, const XmlExpr *b)
740 {
743  COMPARE_NODE_FIELD(named_args);
744  COMPARE_NODE_FIELD(arg_names);
748  COMPARE_SCALAR_FIELD(typmod);
749  COMPARE_LOCATION_FIELD(location);
750 
751  return true;
752 }
753 
754 static bool
756 {
758  COMPARE_SCALAR_FIELD(nulltesttype);
759  COMPARE_SCALAR_FIELD(argisrow);
760  COMPARE_LOCATION_FIELD(location);
761 
762  return true;
763 }
764 
765 static bool
767 {
769  COMPARE_SCALAR_FIELD(booltesttype);
770  COMPARE_LOCATION_FIELD(location);
771 
772  return true;
773 }
774 
775 static bool
777 {
779  COMPARE_SCALAR_FIELD(resulttype);
780  COMPARE_SCALAR_FIELD(resulttypmod);
781  COMPARE_SCALAR_FIELD(resultcollid);
782  COMPARE_COERCIONFORM_FIELD(coercionformat);
783  COMPARE_LOCATION_FIELD(location);
784 
785  return true;
786 }
787 
788 static bool
790 {
791  COMPARE_SCALAR_FIELD(typeId);
792  COMPARE_SCALAR_FIELD(typeMod);
793  COMPARE_SCALAR_FIELD(collation);
794  COMPARE_LOCATION_FIELD(location);
795 
796  return true;
797 }
798 
799 static bool
801 {
802  COMPARE_SCALAR_FIELD(typeId);
803  COMPARE_SCALAR_FIELD(typeMod);
804  COMPARE_SCALAR_FIELD(collation);
805  COMPARE_LOCATION_FIELD(location);
806 
807  return true;
808 }
809 
810 static bool
812 {
813  COMPARE_SCALAR_FIELD(cvarno);
814  COMPARE_STRING_FIELD(cursor_name);
815  COMPARE_SCALAR_FIELD(cursor_param);
816 
817  return true;
818 }
819 
820 static bool
822 {
823  COMPARE_SCALAR_FIELD(seqid);
824  COMPARE_SCALAR_FIELD(typeId);
825 
826  return true;
827 }
828 
829 static bool
831 {
832  COMPARE_NODE_FIELD(expr);
833  COMPARE_SCALAR_FIELD(infercollid);
834  COMPARE_SCALAR_FIELD(inferopclass);
835 
836  return true;
837 }
838 
839 static bool
841 {
842  COMPARE_NODE_FIELD(expr);
843  COMPARE_SCALAR_FIELD(resno);
844  COMPARE_STRING_FIELD(resname);
845  COMPARE_SCALAR_FIELD(ressortgroupref);
846  COMPARE_SCALAR_FIELD(resorigtbl);
847  COMPARE_SCALAR_FIELD(resorigcol);
848  COMPARE_SCALAR_FIELD(resjunk);
849 
850  return true;
851 }
852 
853 static bool
855 {
856  COMPARE_SCALAR_FIELD(rtindex);
857 
858  return true;
859 }
860 
861 static bool
863 {
864  COMPARE_SCALAR_FIELD(jointype);
865  COMPARE_SCALAR_FIELD(isNatural);
866  COMPARE_NODE_FIELD(larg);
867  COMPARE_NODE_FIELD(rarg);
868  COMPARE_NODE_FIELD(usingClause);
869  COMPARE_NODE_FIELD(join_using_alias);
870  COMPARE_NODE_FIELD(quals);
871  COMPARE_NODE_FIELD(alias);
872  COMPARE_SCALAR_FIELD(rtindex);
873 
874  return true;
875 }
876 
877 static bool
879 {
880  COMPARE_NODE_FIELD(fromlist);
881  COMPARE_NODE_FIELD(quals);
882 
883  return true;
884 }
885 
886 static bool
888 {
890  COMPARE_NODE_FIELD(arbiterElems);
891  COMPARE_NODE_FIELD(arbiterWhere);
892  COMPARE_SCALAR_FIELD(constraint);
893  COMPARE_NODE_FIELD(onConflictSet);
894  COMPARE_NODE_FIELD(onConflictWhere);
895  COMPARE_SCALAR_FIELD(exclRelIndex);
896  COMPARE_NODE_FIELD(exclRelTlist);
897 
898  return true;
899 }
900 
901 static bool
903 {
906  COMPARE_LOCATION_FIELD(location);
907 
908  return true;
909 }
910 
911 static bool
913 {
915  COMPARE_SCALAR_FIELD(typid);
916  COMPARE_SCALAR_FIELD(typmod);
917 
918  return true;
919 }
920 
921 static bool
923 {
924  COMPARE_NODE_FIELD(raw_expr);
925  COMPARE_NODE_FIELD(formatted_expr);
927 
928  return true;
929 }
930 
931 static bool
933 {
934  COMPARE_NODE_FIELD(expr);
936  COMPARE_SCALAR_FIELD(unique_keys);
937  COMPARE_LOCATION_FIELD(location);
938 
939  return true;
940 }
941 
942 static bool
944 {
945  COMPARE_NODE_FIELD(expr);
947  COMPARE_LOCATION_FIELD(location);
948 
949  return true;
950 }
951 
952 static bool
954 {
955  COMPARE_NODE_FIELD(expr);
957  COMPARE_LOCATION_FIELD(location);
958 
959  return true;
960 }
961 
962 static bool
964 {
967  COMPARE_NODE_FIELD(func);
968  COMPARE_NODE_FIELD(coercion);
969  COMPARE_NODE_FIELD(returning);
970  COMPARE_SCALAR_FIELD(absent_on_null);
971  COMPARE_SCALAR_FIELD(unique);
972  COMPARE_LOCATION_FIELD(location);
973 
974  return true;
975 }
976 
977 static bool
979 {
982 
983  return true;
984 }
985 
986 static bool
988  const JsonObjectConstructor *b)
989 {
990  COMPARE_NODE_FIELD(exprs);
992  COMPARE_SCALAR_FIELD(absent_on_null);
993  COMPARE_SCALAR_FIELD(unique);
994  COMPARE_LOCATION_FIELD(location);
995 
996  return true;
997 }
998 
999 static bool
1001  const JsonAggConstructor *b)
1002 {
1004  COMPARE_NODE_FIELD(agg_filter);
1005  COMPARE_NODE_FIELD(agg_order);
1006  COMPARE_NODE_FIELD(over);
1007  COMPARE_LOCATION_FIELD(location);
1008 
1009  return true;
1010 }
1011 
1012 static bool
1014 {
1015  COMPARE_NODE_FIELD(constructor);
1017  COMPARE_SCALAR_FIELD(absent_on_null);
1018  COMPARE_SCALAR_FIELD(unique);
1019 
1020  return true;
1021 }
1022 
1023 static bool
1025 {
1026  COMPARE_NODE_FIELD(typeName);
1027  COMPARE_NODE_FIELD(returning);
1028 
1029  return true;
1030 }
1031 
1032 static bool
1034  const JsonArrayConstructor *b)
1035 {
1036  COMPARE_NODE_FIELD(exprs);
1038  COMPARE_SCALAR_FIELD(absent_on_null);
1039  COMPARE_LOCATION_FIELD(location);
1040 
1041  return true;
1042 }
1043 
1044 static bool
1046 {
1047  COMPARE_NODE_FIELD(constructor);
1049  COMPARE_SCALAR_FIELD(absent_on_null);
1050 
1051  return true;
1052 }
1053 
1054 static bool
1057 {
1058  COMPARE_NODE_FIELD(query);
1061  COMPARE_SCALAR_FIELD(absent_on_null);
1062  COMPARE_LOCATION_FIELD(location);
1063 
1064  return true;
1065 }
1066 
1067 static bool
1069 {
1071  COMPARE_NODE_FIELD(common);
1073  COMPARE_NODE_FIELD(on_empty);
1074  COMPARE_NODE_FIELD(on_error);
1075  COMPARE_SCALAR_FIELD(wrapper);
1076  COMPARE_SCALAR_FIELD(omit_quotes);
1077  COMPARE_LOCATION_FIELD(location);
1078 
1079  return true;
1080 }
1081 
1082 static bool
1084 {
1085  COMPARE_NODE_FIELD(expr);
1086  COMPARE_NODE_FIELD(pathspec);
1087  COMPARE_STRING_FIELD(pathname);
1088  COMPARE_NODE_FIELD(passing);
1089  COMPARE_LOCATION_FIELD(location);
1090 
1091  return true;
1092 }
1093 
1094 static bool
1096 {
1099 
1100  return true;
1101 }
1102 
1103 static bool
1105  const JsonIsPredicate *b)
1106 {
1107  COMPARE_NODE_FIELD(expr);
1109  COMPARE_SCALAR_FIELD(item_type);
1110  COMPARE_SCALAR_FIELD(unique_keys);
1111  COMPARE_LOCATION_FIELD(location);
1112 
1113  return true;
1114 }
1115 
1116 /*
1117  * _equalJsonBehavior
1118  */
1119 static bool
1121 {
1122  COMPARE_SCALAR_FIELD(btype);
1123  COMPARE_NODE_FIELD(default_expr);
1124 
1125  return true;
1126 }
1127 
1128 /*
1129  * _equalJsonExpr
1130  */
1131 static bool
1133 {
1135  COMPARE_NODE_FIELD(formatted_expr);
1136  COMPARE_NODE_FIELD(result_coercion);
1138  COMPARE_NODE_FIELD(path_spec);
1139  COMPARE_NODE_FIELD(passing_names);
1140  COMPARE_NODE_FIELD(passing_values);
1141  COMPARE_NODE_FIELD(returning);
1142  COMPARE_NODE_FIELD(on_empty);
1143  COMPARE_NODE_FIELD(on_error);
1144  COMPARE_NODE_FIELD(coercions);
1145  COMPARE_SCALAR_FIELD(wrapper);
1146  COMPARE_SCALAR_FIELD(omit_quotes);
1147  COMPARE_LOCATION_FIELD(location);
1148 
1149  return true;
1150 }
1151 
1152 /*
1153  * _equalJsonCoercion
1154  */
1155 static bool
1157 {
1158  COMPARE_NODE_FIELD(expr);
1159  COMPARE_SCALAR_FIELD(via_populate);
1160  COMPARE_SCALAR_FIELD(via_io);
1161  COMPARE_SCALAR_FIELD(collation);
1162 
1163  return true;
1164 }
1165 
1166 /*
1167  * _equalJsonItemCoercions
1168  */
1169 static bool
1171 {
1172  COMPARE_NODE_FIELD(null);
1173  COMPARE_NODE_FIELD(string);
1175  COMPARE_NODE_FIELD(boolean);
1177  COMPARE_NODE_FIELD(time);
1178  COMPARE_NODE_FIELD(timetz);
1180  COMPARE_NODE_FIELD(timestamptz);
1181  COMPARE_NODE_FIELD(composite);
1182 
1183  return true;
1184 }
1185 
1186 /*
1187  * Stuff from pathnodes.h
1188  */
1189 
1190 static bool
1192 {
1193  /* We assume pointer equality is sufficient to compare the eclasses */
1194  COMPARE_SCALAR_FIELD(pk_eclass);
1195  COMPARE_SCALAR_FIELD(pk_opfamily);
1196  COMPARE_SCALAR_FIELD(pk_strategy);
1197  COMPARE_SCALAR_FIELD(pk_nulls_first);
1198 
1199  return true;
1200 }
1201 
1202 static bool
1204 {
1205  COMPARE_NODE_FIELD(clause);
1206  COMPARE_SCALAR_FIELD(is_pushed_down);
1207  COMPARE_SCALAR_FIELD(outerjoin_delayed);
1208  COMPARE_SCALAR_FIELD(security_level);
1209  COMPARE_BITMAPSET_FIELD(required_relids);
1210  COMPARE_BITMAPSET_FIELD(outer_relids);
1211  COMPARE_BITMAPSET_FIELD(nullable_relids);
1212 
1213  /*
1214  * We ignore all the remaining fields, since they may not be set yet, and
1215  * should be derivable from the clause anyway.
1216  */
1217 
1218  return true;
1219 }
1220 
1221 static bool
1223 {
1224  /*
1225  * We intentionally do not compare phexpr. Two PlaceHolderVars with the
1226  * same ID and levelsup should be considered equal even if the contained
1227  * expressions have managed to mutate to different states. This will
1228  * happen during final plan construction when there are nested PHVs, since
1229  * the inner PHV will get replaced by a Param in some copies of the outer
1230  * PHV. Another way in which it can happen is that initplan sublinks
1231  * could get replaced by differently-numbered Params when sublink folding
1232  * is done. (The end result of such a situation would be some
1233  * unreferenced initplans, which is annoying but not really a problem.) On
1234  * the same reasoning, there is no need to examine phrels.
1235  *
1236  * COMPARE_NODE_FIELD(phexpr);
1237  *
1238  * COMPARE_BITMAPSET_FIELD(phrels);
1239  */
1240  COMPARE_SCALAR_FIELD(phid);
1241  COMPARE_SCALAR_FIELD(phlevelsup);
1242 
1243  return true;
1244 }
1245 
1246 static bool
1248 {
1249  COMPARE_BITMAPSET_FIELD(min_lefthand);
1250  COMPARE_BITMAPSET_FIELD(min_righthand);
1251  COMPARE_BITMAPSET_FIELD(syn_lefthand);
1252  COMPARE_BITMAPSET_FIELD(syn_righthand);
1253  COMPARE_SCALAR_FIELD(jointype);
1254  COMPARE_SCALAR_FIELD(lhs_strict);
1255  COMPARE_SCALAR_FIELD(delay_upper_joins);
1256  COMPARE_SCALAR_FIELD(semi_can_btree);
1257  COMPARE_SCALAR_FIELD(semi_can_hash);
1258  COMPARE_NODE_FIELD(semi_operators);
1259  COMPARE_NODE_FIELD(semi_rhs_exprs);
1260 
1261  return true;
1262 }
1263 
1264 static bool
1266 {
1267  COMPARE_SCALAR_FIELD(parent_relid);
1268  COMPARE_SCALAR_FIELD(child_relid);
1269  COMPARE_SCALAR_FIELD(parent_reltype);
1270  COMPARE_SCALAR_FIELD(child_reltype);
1271  COMPARE_NODE_FIELD(translated_vars);
1272  COMPARE_SCALAR_FIELD(num_child_cols);
1273  COMPARE_POINTER_FIELD(parent_colnos, a->num_child_cols * sizeof(AttrNumber));
1274  COMPARE_SCALAR_FIELD(parent_reloid);
1275 
1276  return true;
1277 }
1278 
1279 static bool
1281 {
1282  COMPARE_SCALAR_FIELD(phid);
1283  COMPARE_NODE_FIELD(ph_var); /* should be redundant */
1284  COMPARE_BITMAPSET_FIELD(ph_eval_at);
1285  COMPARE_BITMAPSET_FIELD(ph_lateral);
1286  COMPARE_BITMAPSET_FIELD(ph_needed);
1287  COMPARE_SCALAR_FIELD(ph_width);
1288 
1289  return true;
1290 }
1291 
1292 /*
1293  * Stuff from extensible.h
1294  */
1295 static bool
1297 {
1298  const ExtensibleNodeMethods *methods;
1299 
1300  COMPARE_STRING_FIELD(extnodename);
1301 
1302  /* At this point, we know extnodename is the same for both nodes. */
1303  methods = GetExtensibleNodeMethods(a->extnodename, false);
1304 
1305  /* compare the private fields */
1306  if (!methods->nodeEqual(a, b))
1307  return false;
1308 
1309  return true;
1310 }
1311 
1312 /*
1313  * Stuff from parsenodes.h
1314  */
1315 
1316 static bool
1317 _equalQuery(const Query *a, const Query *b)
1318 {
1319  COMPARE_SCALAR_FIELD(commandType);
1320  COMPARE_SCALAR_FIELD(querySource);
1321  /* we intentionally ignore queryId, since it might not be set */
1322  COMPARE_SCALAR_FIELD(canSetTag);
1323  COMPARE_NODE_FIELD(utilityStmt);
1324  COMPARE_SCALAR_FIELD(resultRelation);
1325  COMPARE_SCALAR_FIELD(hasAggs);
1326  COMPARE_SCALAR_FIELD(hasWindowFuncs);
1327  COMPARE_SCALAR_FIELD(hasTargetSRFs);
1328  COMPARE_SCALAR_FIELD(hasSubLinks);
1329  COMPARE_SCALAR_FIELD(hasDistinctOn);
1330  COMPARE_SCALAR_FIELD(hasRecursive);
1331  COMPARE_SCALAR_FIELD(hasModifyingCTE);
1332  COMPARE_SCALAR_FIELD(hasForUpdate);
1333  COMPARE_SCALAR_FIELD(hasRowSecurity);
1334  COMPARE_SCALAR_FIELD(isReturn);
1335  COMPARE_NODE_FIELD(cteList);
1336  COMPARE_NODE_FIELD(rtable);
1337  COMPARE_NODE_FIELD(jointree);
1338  COMPARE_NODE_FIELD(targetList);
1339  COMPARE_SCALAR_FIELD(override);
1340  COMPARE_NODE_FIELD(onConflict);
1341  COMPARE_NODE_FIELD(returningList);
1342  COMPARE_NODE_FIELD(groupClause);
1343  COMPARE_SCALAR_FIELD(groupDistinct);
1344  COMPARE_NODE_FIELD(groupingSets);
1345  COMPARE_NODE_FIELD(havingQual);
1346  COMPARE_NODE_FIELD(windowClause);
1347  COMPARE_NODE_FIELD(distinctClause);
1348  COMPARE_NODE_FIELD(sortClause);
1349  COMPARE_NODE_FIELD(limitOffset);
1350  COMPARE_NODE_FIELD(limitCount);
1351  COMPARE_SCALAR_FIELD(limitOption);
1352  COMPARE_NODE_FIELD(rowMarks);
1353  COMPARE_NODE_FIELD(setOperations);
1354  COMPARE_NODE_FIELD(constraintDeps);
1355  COMPARE_NODE_FIELD(withCheckOptions);
1356  COMPARE_NODE_FIELD(mergeActionList);
1357  COMPARE_SCALAR_FIELD(mergeUseOuterJoin);
1358  COMPARE_LOCATION_FIELD(stmt_location);
1359  COMPARE_SCALAR_FIELD(stmt_len);
1360 
1361  return true;
1362 }
1363 
1364 static bool
1366 {
1367  COMPARE_NODE_FIELD(stmt);
1368  COMPARE_LOCATION_FIELD(stmt_location);
1369  COMPARE_SCALAR_FIELD(stmt_len);
1370 
1371  return true;
1372 }
1373 
1374 static bool
1376 {
1377  COMPARE_NODE_FIELD(relation);
1378  COMPARE_NODE_FIELD(cols);
1379  COMPARE_NODE_FIELD(selectStmt);
1380  COMPARE_NODE_FIELD(onConflictClause);
1381  COMPARE_NODE_FIELD(returningList);
1382  COMPARE_NODE_FIELD(withClause);
1383  COMPARE_SCALAR_FIELD(override);
1384 
1385  return true;
1386 }
1387 
1388 static bool
1390 {
1391  COMPARE_NODE_FIELD(relation);
1392  COMPARE_NODE_FIELD(usingClause);
1393  COMPARE_NODE_FIELD(whereClause);
1394  COMPARE_NODE_FIELD(returningList);
1395  COMPARE_NODE_FIELD(withClause);
1396 
1397  return true;
1398 }
1399 
1400 static bool
1402 {
1403  COMPARE_NODE_FIELD(relation);
1404  COMPARE_NODE_FIELD(targetList);
1405  COMPARE_NODE_FIELD(whereClause);
1406  COMPARE_NODE_FIELD(fromClause);
1407  COMPARE_NODE_FIELD(returningList);
1408  COMPARE_NODE_FIELD(withClause);
1409 
1410  return true;
1411 }
1412 
1413 static bool
1415 {
1416  COMPARE_NODE_FIELD(relation);
1417  COMPARE_NODE_FIELD(sourceRelation);
1418  COMPARE_NODE_FIELD(joinCondition);
1419  COMPARE_NODE_FIELD(mergeWhenClauses);
1420  COMPARE_NODE_FIELD(withClause);
1421 
1422  return true;
1423 }
1424 
1425 static bool
1427 {
1428  COMPARE_NODE_FIELD(distinctClause);
1429  COMPARE_NODE_FIELD(intoClause);
1430  COMPARE_NODE_FIELD(targetList);
1431  COMPARE_NODE_FIELD(fromClause);
1432  COMPARE_NODE_FIELD(whereClause);
1433  COMPARE_NODE_FIELD(groupClause);
1434  COMPARE_SCALAR_FIELD(groupDistinct);
1435  COMPARE_NODE_FIELD(havingClause);
1436  COMPARE_NODE_FIELD(windowClause);
1437  COMPARE_NODE_FIELD(valuesLists);
1438  COMPARE_NODE_FIELD(sortClause);
1439  COMPARE_NODE_FIELD(limitOffset);
1440  COMPARE_NODE_FIELD(limitCount);
1441  COMPARE_SCALAR_FIELD(limitOption);
1442  COMPARE_NODE_FIELD(lockingClause);
1443  COMPARE_NODE_FIELD(withClause);
1445  COMPARE_SCALAR_FIELD(all);
1446  COMPARE_NODE_FIELD(larg);
1447  COMPARE_NODE_FIELD(rarg);
1448 
1449  return true;
1450 }
1451 
1452 static bool
1454 {
1456  COMPARE_SCALAR_FIELD(all);
1457  COMPARE_NODE_FIELD(larg);
1458  COMPARE_NODE_FIELD(rarg);
1459  COMPARE_NODE_FIELD(colTypes);
1460  COMPARE_NODE_FIELD(colTypmods);
1461  COMPARE_NODE_FIELD(colCollations);
1462  COMPARE_NODE_FIELD(groupClauses);
1463 
1464  return true;
1465 }
1466 
1467 static bool
1469 {
1470  COMPARE_NODE_FIELD(returnval);
1471 
1472  return true;
1473 }
1474 
1475 static bool
1477 {
1479  COMPARE_NODE_FIELD(indirection);
1480  COMPARE_SCALAR_FIELD(nnames);
1482  COMPARE_LOCATION_FIELD(location);
1483 
1484  return true;
1485 }
1486 
1487 static bool
1489 {
1490  COMPARE_NODE_FIELD(relation);
1491  COMPARE_NODE_FIELD(cmds);
1492  COMPARE_SCALAR_FIELD(objtype);
1493  COMPARE_SCALAR_FIELD(missing_ok);
1494 
1495  return true;
1496 }
1497 
1498 static bool
1500 {
1501  COMPARE_SCALAR_FIELD(subtype);
1503  COMPARE_SCALAR_FIELD(num);
1504  COMPARE_NODE_FIELD(newowner);
1505  COMPARE_NODE_FIELD(def);
1506  COMPARE_SCALAR_FIELD(behavior);
1507  COMPARE_SCALAR_FIELD(missing_ok);
1508 
1509  return true;
1510 }
1511 
1512 static bool
1514 {
1515  COMPARE_NODE_FIELD(collname);
1516 
1517  return true;
1518 }
1519 
1520 static bool
1522 {
1523  COMPARE_SCALAR_FIELD(subtype);
1524  COMPARE_NODE_FIELD(typeName);
1526  COMPARE_NODE_FIELD(def);
1527  COMPARE_SCALAR_FIELD(behavior);
1528  COMPARE_SCALAR_FIELD(missing_ok);
1529 
1530  return true;
1531 }
1532 
1533 static bool
1535 {
1536  COMPARE_SCALAR_FIELD(is_grant);
1537  COMPARE_SCALAR_FIELD(targtype);
1538  COMPARE_SCALAR_FIELD(objtype);
1539  COMPARE_NODE_FIELD(objects);
1540  COMPARE_NODE_FIELD(privileges);
1541  COMPARE_NODE_FIELD(grantees);
1542  COMPARE_SCALAR_FIELD(grant_option);
1543  COMPARE_NODE_FIELD(grantor);
1544  COMPARE_SCALAR_FIELD(behavior);
1545 
1546  return true;
1547 }
1548 
1549 static bool
1551 {
1552  COMPARE_NODE_FIELD(objname);
1553  COMPARE_NODE_FIELD(objargs);
1554  COMPARE_NODE_FIELD(objfuncargs);
1555  COMPARE_SCALAR_FIELD(args_unspecified);
1556 
1557  return true;
1558 }
1559 
1560 static bool
1562 {
1563  COMPARE_STRING_FIELD(priv_name);
1564  COMPARE_NODE_FIELD(cols);
1565 
1566  return true;
1567 }
1568 
1569 static bool
1571 {
1572  COMPARE_NODE_FIELD(granted_roles);
1573  COMPARE_NODE_FIELD(grantee_roles);
1574  COMPARE_SCALAR_FIELD(is_grant);
1575  COMPARE_SCALAR_FIELD(admin_opt);
1576  COMPARE_NODE_FIELD(grantor);
1577  COMPARE_SCALAR_FIELD(behavior);
1578 
1579  return true;
1580 }
1581 
1582 static bool
1584 {
1587 
1588  return true;
1589 }
1590 
1591 static bool
1593 {
1594  COMPARE_STRING_FIELD(portalname);
1596  COMPARE_NODE_FIELD(query);
1597 
1598  return true;
1599 }
1600 
1601 static bool
1603 {
1604  COMPARE_STRING_FIELD(portalname);
1605 
1606  return true;
1607 }
1608 
1609 static bool
1611 {
1612  COMPARE_NODE_FIELD(funccall);
1613  COMPARE_NODE_FIELD(funcexpr);
1614  COMPARE_NODE_FIELD(outargs);
1615 
1616  return true;
1617 }
1618 
1619 static bool
1621 {
1622  COMPARE_NODE_FIELD(relation);
1623  COMPARE_STRING_FIELD(indexname);
1624  COMPARE_NODE_FIELD(params);
1625 
1626  return true;
1627 }
1628 
1629 static bool
1631 {
1632  COMPARE_NODE_FIELD(relation);
1633  COMPARE_NODE_FIELD(query);
1634  COMPARE_NODE_FIELD(attlist);
1635  COMPARE_SCALAR_FIELD(is_from);
1636  COMPARE_SCALAR_FIELD(is_program);
1639  COMPARE_NODE_FIELD(whereClause);
1640 
1641  return true;
1642 }
1643 
1644 static bool
1646 {
1647  COMPARE_NODE_FIELD(relation);
1648  COMPARE_NODE_FIELD(tableElts);
1649  COMPARE_NODE_FIELD(inhRelations);
1650  COMPARE_NODE_FIELD(partbound);
1651  COMPARE_NODE_FIELD(partspec);
1652  COMPARE_NODE_FIELD(ofTypename);
1653  COMPARE_NODE_FIELD(constraints);
1655  COMPARE_SCALAR_FIELD(oncommit);
1656  COMPARE_STRING_FIELD(tablespacename);
1657  COMPARE_STRING_FIELD(accessMethod);
1658  COMPARE_SCALAR_FIELD(if_not_exists);
1659 
1660  return true;
1661 }
1662 
1663 static bool
1665 {
1666  COMPARE_NODE_FIELD(relation);
1668  COMPARE_SCALAR_FIELD(relationOid);
1669 
1670  return true;
1671 }
1672 
1673 static bool
1675 {
1676  COMPARE_SCALAR_FIELD(kind);
1677  COMPARE_SCALAR_FIELD(oldstyle);
1678  COMPARE_NODE_FIELD(defnames);
1680  COMPARE_NODE_FIELD(definition);
1681  COMPARE_SCALAR_FIELD(if_not_exists);
1682  COMPARE_SCALAR_FIELD(replace);
1683 
1684  return true;
1685 }
1686 
1687 static bool
1689 {
1690  COMPARE_NODE_FIELD(objects);
1691  COMPARE_SCALAR_FIELD(removeType);
1692  COMPARE_SCALAR_FIELD(behavior);
1693  COMPARE_SCALAR_FIELD(missing_ok);
1694  COMPARE_SCALAR_FIELD(concurrent);
1695 
1696  return true;
1697 }
1698 
1699 static bool
1701 {
1702  COMPARE_NODE_FIELD(relations);
1703  COMPARE_SCALAR_FIELD(restart_seqs);
1704  COMPARE_SCALAR_FIELD(behavior);
1705 
1706  return true;
1707 }
1708 
1709 static bool
1711 {
1712  COMPARE_SCALAR_FIELD(objtype);
1713  COMPARE_NODE_FIELD(object);
1714  COMPARE_STRING_FIELD(comment);
1715 
1716  return true;
1717 }
1718 
1719 static bool
1721 {
1722  COMPARE_SCALAR_FIELD(objtype);
1723  COMPARE_NODE_FIELD(object);
1726 
1727  return true;
1728 }
1729 
1730 static bool
1732 {
1733  COMPARE_SCALAR_FIELD(direction);
1734  COMPARE_SCALAR_FIELD(howMany);
1735  COMPARE_STRING_FIELD(portalname);
1736  COMPARE_SCALAR_FIELD(ismove);
1737 
1738  return true;
1739 }
1740 
1741 static bool
1743 {
1744  COMPARE_STRING_FIELD(idxname);
1745  COMPARE_NODE_FIELD(relation);
1746  COMPARE_STRING_FIELD(accessMethod);
1747  COMPARE_STRING_FIELD(tableSpace);
1748  COMPARE_NODE_FIELD(indexParams);
1749  COMPARE_NODE_FIELD(indexIncludingParams);
1751  COMPARE_NODE_FIELD(whereClause);
1752  COMPARE_NODE_FIELD(excludeOpNames);
1753  COMPARE_STRING_FIELD(idxcomment);
1754  COMPARE_SCALAR_FIELD(indexOid);
1755  COMPARE_SCALAR_FIELD(oldNode);
1756  COMPARE_SCALAR_FIELD(oldCreateSubid);
1757  COMPARE_SCALAR_FIELD(oldFirstRelfilenodeSubid);
1758  COMPARE_SCALAR_FIELD(unique);
1759  COMPARE_SCALAR_FIELD(nulls_not_distinct);
1760  COMPARE_SCALAR_FIELD(primary);
1761  COMPARE_SCALAR_FIELD(isconstraint);
1762  COMPARE_SCALAR_FIELD(deferrable);
1763  COMPARE_SCALAR_FIELD(initdeferred);
1764  COMPARE_SCALAR_FIELD(transformed);
1765  COMPARE_SCALAR_FIELD(concurrent);
1766  COMPARE_SCALAR_FIELD(if_not_exists);
1767  COMPARE_SCALAR_FIELD(reset_default_tblspc);
1768 
1769  return true;
1770 }
1771 
1772 static bool
1774 {
1775  COMPARE_NODE_FIELD(defnames);
1776  COMPARE_NODE_FIELD(stat_types);
1777  COMPARE_NODE_FIELD(exprs);
1778  COMPARE_NODE_FIELD(relations);
1779  COMPARE_STRING_FIELD(stxcomment);
1780  COMPARE_SCALAR_FIELD(transformed);
1781  COMPARE_SCALAR_FIELD(if_not_exists);
1782 
1783  return true;
1784 }
1785 
1786 static bool
1788 {
1789  COMPARE_NODE_FIELD(defnames);
1790  COMPARE_SCALAR_FIELD(stxstattarget);
1791  COMPARE_SCALAR_FIELD(missing_ok);
1792 
1793  return true;
1794 }
1795 
1796 static bool
1798 {
1799  COMPARE_SCALAR_FIELD(is_procedure);
1800  COMPARE_SCALAR_FIELD(replace);
1801  COMPARE_NODE_FIELD(funcname);
1802  COMPARE_NODE_FIELD(parameters);
1803  COMPARE_NODE_FIELD(returnType);
1805  COMPARE_NODE_FIELD(sql_body);
1806 
1807  return true;
1808 }
1809 
1810 static bool
1812 {
1814  COMPARE_NODE_FIELD(argType);
1816  COMPARE_NODE_FIELD(defexpr);
1817 
1818  return true;
1819 }
1820 
1821 static bool
1823 {
1824  COMPARE_SCALAR_FIELD(objtype);
1825  COMPARE_NODE_FIELD(func);
1826  COMPARE_NODE_FIELD(actions);
1827 
1828  return true;
1829 }
1830 
1831 static bool
1832 _equalDoStmt(const DoStmt *a, const DoStmt *b)
1833 {
1835 
1836  return true;
1837 }
1838 
1839 static bool
1841 {
1842  COMPARE_SCALAR_FIELD(renameType);
1843  COMPARE_SCALAR_FIELD(relationType);
1844  COMPARE_NODE_FIELD(relation);
1845  COMPARE_NODE_FIELD(object);
1847  COMPARE_STRING_FIELD(newname);
1848  COMPARE_SCALAR_FIELD(behavior);
1849  COMPARE_SCALAR_FIELD(missing_ok);
1850 
1851  return true;
1852 }
1853 
1854 static bool
1856 {
1857  COMPARE_SCALAR_FIELD(objectType);
1858  COMPARE_NODE_FIELD(relation);
1859  COMPARE_NODE_FIELD(object);
1860  COMPARE_NODE_FIELD(extname);
1861  COMPARE_SCALAR_FIELD(remove);
1862 
1863  return true;
1864 }
1865 
1866 static bool
1868 {
1869  COMPARE_SCALAR_FIELD(objectType);
1870  COMPARE_NODE_FIELD(relation);
1871  COMPARE_NODE_FIELD(object);
1872  COMPARE_STRING_FIELD(newschema);
1873  COMPARE_SCALAR_FIELD(missing_ok);
1874 
1875  return true;
1876 }
1877 
1878 static bool
1880 {
1881  COMPARE_SCALAR_FIELD(objectType);
1882  COMPARE_NODE_FIELD(relation);
1883  COMPARE_NODE_FIELD(object);
1884  COMPARE_NODE_FIELD(newowner);
1885 
1886  return true;
1887 }
1888 
1889 static bool
1891 {
1892  COMPARE_NODE_FIELD(opername);
1894 
1895  return true;
1896 }
1897 
1898 static bool
1900 {
1901  COMPARE_NODE_FIELD(typeName);
1903 
1904  return true;
1905 }
1906 
1907 static bool
1909 {
1910  COMPARE_NODE_FIELD(relation);
1911  COMPARE_STRING_FIELD(rulename);
1912  COMPARE_NODE_FIELD(whereClause);
1913  COMPARE_SCALAR_FIELD(event);
1914  COMPARE_SCALAR_FIELD(instead);
1915  COMPARE_NODE_FIELD(actions);
1916  COMPARE_SCALAR_FIELD(replace);
1917 
1918  return true;
1919 }
1920 
1921 static bool
1923 {
1924  COMPARE_STRING_FIELD(conditionname);
1925  COMPARE_STRING_FIELD(payload);
1926 
1927  return true;
1928 }
1929 
1930 static bool
1932 {
1933  COMPARE_STRING_FIELD(conditionname);
1934 
1935  return true;
1936 }
1937 
1938 static bool
1940 {
1941  COMPARE_STRING_FIELD(conditionname);
1942 
1943  return true;
1944 }
1945 
1946 static bool
1948 {
1949  COMPARE_SCALAR_FIELD(kind);
1951  COMPARE_STRING_FIELD(savepoint_name);
1952  COMPARE_STRING_FIELD(gid);
1953  COMPARE_SCALAR_FIELD(chain);
1954 
1955  return true;
1956 }
1957 
1958 static bool
1960 {
1961  COMPARE_NODE_FIELD(typevar);
1962  COMPARE_NODE_FIELD(coldeflist);
1963 
1964  return true;
1965 }
1966 
1967 static bool
1969 {
1970  COMPARE_NODE_FIELD(typeName);
1971  COMPARE_NODE_FIELD(vals);
1972 
1973  return true;
1974 }
1975 
1976 static bool
1978 {
1979  COMPARE_NODE_FIELD(typeName);
1980  COMPARE_NODE_FIELD(params);
1981 
1982  return true;
1983 }
1984 
1985 static bool
1987 {
1988  COMPARE_NODE_FIELD(typeName);
1989  COMPARE_STRING_FIELD(oldVal);
1990  COMPARE_STRING_FIELD(newVal);
1991  COMPARE_STRING_FIELD(newValNeighbor);
1992  COMPARE_SCALAR_FIELD(newValIsAfter);
1993  COMPARE_SCALAR_FIELD(skipIfNewValExists);
1994 
1995  return true;
1996 }
1997 
1998 static bool
2000 {
2001  COMPARE_NODE_FIELD(view);
2002  COMPARE_NODE_FIELD(aliases);
2003  COMPARE_NODE_FIELD(query);
2004  COMPARE_SCALAR_FIELD(replace);
2006  COMPARE_SCALAR_FIELD(withCheckOption);
2007 
2008  return true;
2009 }
2010 
2011 static bool
2013 {
2015 
2016  return true;
2017 }
2018 
2019 static bool
2021 {
2022  COMPARE_NODE_FIELD(domainname);
2023  COMPARE_NODE_FIELD(typeName);
2024  COMPARE_NODE_FIELD(collClause);
2025  COMPARE_NODE_FIELD(constraints);
2026 
2027  return true;
2028 }
2029 
2030 static bool
2032 {
2033  COMPARE_NODE_FIELD(opclassname);
2034  COMPARE_NODE_FIELD(opfamilyname);
2035  COMPARE_STRING_FIELD(amname);
2036  COMPARE_NODE_FIELD(datatype);
2037  COMPARE_NODE_FIELD(items);
2038  COMPARE_SCALAR_FIELD(isDefault);
2039 
2040  return true;
2041 }
2042 
2043 static bool
2045 {
2046  COMPARE_SCALAR_FIELD(itemtype);
2048  COMPARE_SCALAR_FIELD(number);
2049  COMPARE_NODE_FIELD(order_family);
2050  COMPARE_NODE_FIELD(class_args);
2051  COMPARE_NODE_FIELD(storedtype);
2052 
2053  return true;
2054 }
2055 
2056 static bool
2058 {
2059  COMPARE_NODE_FIELD(opfamilyname);
2060  COMPARE_STRING_FIELD(amname);
2061 
2062  return true;
2063 }
2064 
2065 static bool
2067 {
2068  COMPARE_NODE_FIELD(opfamilyname);
2069  COMPARE_STRING_FIELD(amname);
2070  COMPARE_SCALAR_FIELD(isDrop);
2071  COMPARE_NODE_FIELD(items);
2072 
2073  return true;
2074 }
2075 
2076 static bool
2078 {
2081 
2082  return true;
2083 }
2084 
2085 static bool
2087 {
2090 
2091  return true;
2092 }
2093 
2094 static bool
2096 {
2098 
2099  return true;
2100 }
2101 
2102 static bool
2104 {
2106  COMPARE_NODE_FIELD(setstmt);
2107 
2108  return true;
2109 }
2110 
2111 static bool
2113 {
2115  COMPARE_SCALAR_FIELD(missing_ok);
2117 
2118  return true;
2119 }
2120 
2121 static bool
2123 {
2125  COMPARE_NODE_FIELD(rels);
2126  COMPARE_SCALAR_FIELD(is_vacuumcmd);
2127 
2128  return true;
2129 }
2130 
2131 static bool
2133 {
2134  COMPARE_NODE_FIELD(relation);
2135  COMPARE_SCALAR_FIELD(oid);
2136  COMPARE_NODE_FIELD(va_cols);
2137 
2138  return true;
2139 }
2140 
2141 static bool
2143 {
2144  COMPARE_NODE_FIELD(query);
2146 
2147  return true;
2148 }
2149 
2150 static bool
2152 {
2153  COMPARE_NODE_FIELD(query);
2154  COMPARE_NODE_FIELD(into);
2155  COMPARE_SCALAR_FIELD(objtype);
2156  COMPARE_SCALAR_FIELD(is_select_into);
2157  COMPARE_SCALAR_FIELD(if_not_exists);
2158 
2159  return true;
2160 }
2161 
2162 static bool
2164 {
2165  COMPARE_SCALAR_FIELD(concurrent);
2166  COMPARE_SCALAR_FIELD(skipData);
2167  COMPARE_NODE_FIELD(relation);
2168 
2169  return true;
2170 }
2171 
2172 static bool
2174 {
2175  COMPARE_SCALAR_FIELD(identity_type);
2177 
2178  return true;
2179 }
2180 
2181 static bool
2183 {
2184  COMPARE_NODE_FIELD(setstmt);
2185 
2186  return true;
2187 }
2188 
2189 
2190 static bool
2192 {
2193  COMPARE_NODE_FIELD(sequence);
2195  COMPARE_SCALAR_FIELD(ownerId);
2196  COMPARE_SCALAR_FIELD(for_identity);
2197  COMPARE_SCALAR_FIELD(if_not_exists);
2198 
2199  return true;
2200 }
2201 
2202 static bool
2204 {
2205  COMPARE_NODE_FIELD(sequence);
2207  COMPARE_SCALAR_FIELD(for_identity);
2208  COMPARE_SCALAR_FIELD(missing_ok);
2209 
2210  return true;
2211 }
2212 
2213 static bool
2215 {
2216  COMPARE_SCALAR_FIELD(kind);
2219  COMPARE_SCALAR_FIELD(is_local);
2220 
2221  return true;
2222 }
2223 
2224 static bool
2226 {
2228 
2229  return true;
2230 }
2231 
2232 static bool
2234 {
2235  COMPARE_SCALAR_FIELD(target);
2236 
2237  return true;
2238 }
2239 
2240 static bool
2242 {
2243  COMPARE_STRING_FIELD(tablespacename);
2244  COMPARE_NODE_FIELD(owner);
2245  COMPARE_STRING_FIELD(location);
2247 
2248  return true;
2249 }
2250 
2251 static bool
2253 {
2254  COMPARE_STRING_FIELD(tablespacename);
2255  COMPARE_SCALAR_FIELD(missing_ok);
2256 
2257  return true;
2258 }
2259 
2260 static bool
2263 {
2264  COMPARE_STRING_FIELD(tablespacename);
2266  COMPARE_SCALAR_FIELD(isReset);
2267 
2268  return true;
2269 }
2270 
2271 static bool
2273  const AlterTableMoveAllStmt *b)
2274 {
2275  COMPARE_STRING_FIELD(orig_tablespacename);
2276  COMPARE_SCALAR_FIELD(objtype);
2277  COMPARE_NODE_FIELD(roles);
2278  COMPARE_STRING_FIELD(new_tablespacename);
2279  COMPARE_SCALAR_FIELD(nowait);
2280 
2281  return true;
2282 }
2283 
2284 static bool
2286 {
2287  COMPARE_STRING_FIELD(extname);
2288  COMPARE_SCALAR_FIELD(if_not_exists);
2290 
2291  return true;
2292 }
2293 
2294 static bool
2296 {
2297  COMPARE_STRING_FIELD(extname);
2299 
2300  return true;
2301 }
2302 
2303 static bool
2305 {
2306  COMPARE_STRING_FIELD(extname);
2308  COMPARE_SCALAR_FIELD(objtype);
2309  COMPARE_NODE_FIELD(object);
2310 
2311  return true;
2312 }
2313 
2314 static bool
2316 {
2317  COMPARE_STRING_FIELD(fdwname);
2318  COMPARE_NODE_FIELD(func_options);
2320 
2321  return true;
2322 }
2323 
2324 static bool
2326 {
2327  COMPARE_STRING_FIELD(fdwname);
2328  COMPARE_NODE_FIELD(func_options);
2330 
2331  return true;
2332 }
2333 
2334 static bool
2336 {
2337  COMPARE_STRING_FIELD(servername);
2338  COMPARE_STRING_FIELD(servertype);
2339  COMPARE_STRING_FIELD(version);
2340  COMPARE_STRING_FIELD(fdwname);
2341  COMPARE_SCALAR_FIELD(if_not_exists);
2343 
2344  return true;
2345 }
2346 
2347 static bool
2349 {
2350  COMPARE_STRING_FIELD(servername);
2351  COMPARE_STRING_FIELD(version);
2353  COMPARE_SCALAR_FIELD(has_version);
2354 
2355  return true;
2356 }
2357 
2358 static bool
2360 {
2362  COMPARE_STRING_FIELD(servername);
2363  COMPARE_SCALAR_FIELD(if_not_exists);
2365 
2366  return true;
2367 }
2368 
2369 static bool
2371 {
2373  COMPARE_STRING_FIELD(servername);
2375 
2376  return true;
2377 }
2378 
2379 static bool
2381 {
2383  COMPARE_STRING_FIELD(servername);
2384  COMPARE_SCALAR_FIELD(missing_ok);
2385 
2386  return true;
2387 }
2388 
2389 static bool
2391 {
2392  if (!_equalCreateStmt(&a->base, &b->base))
2393  return false;
2394 
2395  COMPARE_STRING_FIELD(servername);
2397 
2398  return true;
2399 }
2400 
2401 static bool
2403 {
2404  COMPARE_STRING_FIELD(server_name);
2405  COMPARE_STRING_FIELD(remote_schema);
2406  COMPARE_STRING_FIELD(local_schema);
2407  COMPARE_SCALAR_FIELD(list_type);
2408  COMPARE_NODE_FIELD(table_list);
2410 
2411  return true;
2412 }
2413 
2414 static bool
2416 {
2417  COMPARE_SCALAR_FIELD(replace);
2418  COMPARE_NODE_FIELD(type_name);
2419  COMPARE_STRING_FIELD(lang);
2420  COMPARE_NODE_FIELD(fromsql);
2421  COMPARE_NODE_FIELD(tosql);
2422 
2423  return true;
2424 }
2425 
2426 static bool
2428 {
2429  COMPARE_STRING_FIELD(amname);
2430  COMPARE_NODE_FIELD(handler_name);
2431  COMPARE_SCALAR_FIELD(amtype);
2432 
2433  return true;
2434 }
2435 
2436 static bool
2438 {
2439  COMPARE_SCALAR_FIELD(replace);
2440  COMPARE_SCALAR_FIELD(isconstraint);
2441  COMPARE_STRING_FIELD(trigname);
2442  COMPARE_NODE_FIELD(relation);
2443  COMPARE_NODE_FIELD(funcname);
2445  COMPARE_SCALAR_FIELD(row);
2446  COMPARE_SCALAR_FIELD(timing);
2447  COMPARE_SCALAR_FIELD(events);
2448  COMPARE_NODE_FIELD(columns);
2449  COMPARE_NODE_FIELD(whenClause);
2450  COMPARE_NODE_FIELD(transitionRels);
2451  COMPARE_SCALAR_FIELD(deferrable);
2452  COMPARE_SCALAR_FIELD(initdeferred);
2453  COMPARE_NODE_FIELD(constrrel);
2454 
2455  return true;
2456 }
2457 
2458 static bool
2460 {
2461  COMPARE_STRING_FIELD(trigname);
2462  COMPARE_STRING_FIELD(eventname);
2463  COMPARE_NODE_FIELD(whenclause);
2464  COMPARE_NODE_FIELD(funcname);
2465 
2466  return true;
2467 }
2468 
2469 static bool
2471 {
2472  COMPARE_STRING_FIELD(trigname);
2473  COMPARE_SCALAR_FIELD(tgenabled);
2474 
2475  return true;
2476 }
2477 
2478 static bool
2480 {
2481  COMPARE_SCALAR_FIELD(replace);
2482  COMPARE_STRING_FIELD(plname);
2483  COMPARE_NODE_FIELD(plhandler);
2484  COMPARE_NODE_FIELD(plinline);
2485  COMPARE_NODE_FIELD(plvalidator);
2486  COMPARE_SCALAR_FIELD(pltrusted);
2487 
2488  return true;
2489 }
2490 
2491 static bool
2493 {
2494  COMPARE_SCALAR_FIELD(stmt_type);
2495  COMPARE_STRING_FIELD(role);
2497 
2498  return true;
2499 }
2500 
2501 static bool
2503 {
2504  COMPARE_NODE_FIELD(role);
2507 
2508  return true;
2509 }
2510 
2511 static bool
2513 {
2514  COMPARE_NODE_FIELD(role);
2515  COMPARE_STRING_FIELD(database);
2516  COMPARE_NODE_FIELD(setstmt);
2517 
2518  return true;
2519 }
2520 
2521 static bool
2523 {
2524  COMPARE_NODE_FIELD(roles);
2525  COMPARE_SCALAR_FIELD(missing_ok);
2526 
2527  return true;
2528 }
2529 
2530 static bool
2532 {
2533  COMPARE_NODE_FIELD(relations);
2535  COMPARE_SCALAR_FIELD(nowait);
2536 
2537  return true;
2538 }
2539 
2540 static bool
2542 {
2543  COMPARE_NODE_FIELD(constraints);
2544  COMPARE_SCALAR_FIELD(deferred);
2545 
2546  return true;
2547 }
2548 
2549 static bool
2551 {
2552  COMPARE_SCALAR_FIELD(kind);
2553  COMPARE_NODE_FIELD(relation);
2555  COMPARE_NODE_FIELD(params);
2556 
2557  return true;
2558 }
2559 
2560 static bool
2562 {
2563  COMPARE_STRING_FIELD(schemaname);
2564  COMPARE_NODE_FIELD(authrole);
2565  COMPARE_NODE_FIELD(schemaElts);
2566  COMPARE_SCALAR_FIELD(if_not_exists);
2567 
2568  return true;
2569 }
2570 
2571 static bool
2573 {
2574  COMPARE_NODE_FIELD(conversion_name);
2575  COMPARE_STRING_FIELD(for_encoding_name);
2576  COMPARE_STRING_FIELD(to_encoding_name);
2577  COMPARE_NODE_FIELD(func_name);
2578  COMPARE_SCALAR_FIELD(def);
2579 
2580  return true;
2581 }
2582 
2583 static bool
2585 {
2586  COMPARE_NODE_FIELD(sourcetype);
2587  COMPARE_NODE_FIELD(targettype);
2588  COMPARE_NODE_FIELD(func);
2589  COMPARE_SCALAR_FIELD(context);
2590  COMPARE_SCALAR_FIELD(inout);
2591 
2592  return true;
2593 }
2594 
2595 static bool
2597 {
2599  COMPARE_NODE_FIELD(argtypes);
2600  COMPARE_NODE_FIELD(query);
2601 
2602  return true;
2603 }
2604 
2605 static bool
2607 {
2609  COMPARE_NODE_FIELD(params);
2610 
2611  return true;
2612 }
2613 
2614 static bool
2616 {
2618 
2619  return true;
2620 }
2621 
2622 static bool
2624 {
2625  COMPARE_NODE_FIELD(roles);
2626  COMPARE_SCALAR_FIELD(behavior);
2627 
2628  return true;
2629 }
2630 
2631 static bool
2633 {
2634  COMPARE_NODE_FIELD(roles);
2635  COMPARE_NODE_FIELD(newrole);
2636 
2637  return true;
2638 }
2639 
2640 static bool
2642 {
2643  COMPARE_NODE_FIELD(dictname);
2645 
2646  return true;
2647 }
2648 
2649 static bool
2651  const AlterTSConfigurationStmt *b)
2652 {
2653  COMPARE_SCALAR_FIELD(kind);
2654  COMPARE_NODE_FIELD(cfgname);
2655  COMPARE_NODE_FIELD(tokentype);
2656  COMPARE_NODE_FIELD(dicts);
2657  COMPARE_SCALAR_FIELD(override);
2658  COMPARE_SCALAR_FIELD(replace);
2659  COMPARE_SCALAR_FIELD(missing_ok);
2660 
2661  return true;
2662 }
2663 
2664 static bool
2666  const PublicationObjSpec *b)
2667 {
2668  COMPARE_SCALAR_FIELD(pubobjtype);
2670  COMPARE_NODE_FIELD(pubtable);
2671  COMPARE_LOCATION_FIELD(location);
2672 
2673  return true;
2674 }
2675 
2676 static bool
2678 {
2679  COMPARE_NODE_FIELD(relation);
2680  COMPARE_NODE_FIELD(whereClause);
2681  COMPARE_NODE_FIELD(columns);
2682 
2683  return true;
2684 }
2685 
2686 static bool
2688  const CreatePublicationStmt *b)
2689 {
2690  COMPARE_STRING_FIELD(pubname);
2692  COMPARE_NODE_FIELD(pubobjects);
2693  COMPARE_SCALAR_FIELD(for_all_tables);
2694 
2695  return true;
2696 }
2697 
2698 static bool
2700  const AlterPublicationStmt *b)
2701 {
2702  COMPARE_STRING_FIELD(pubname);
2704  COMPARE_NODE_FIELD(pubobjects);
2705  COMPARE_SCALAR_FIELD(for_all_tables);
2707 
2708  return true;
2709 }
2710 
2711 static bool
2713  const CreateSubscriptionStmt *b)
2714 {
2716  COMPARE_STRING_FIELD(conninfo);
2717  COMPARE_NODE_FIELD(publication);
2719 
2720  return true;
2721 }
2722 
2723 static bool
2725  const AlterSubscriptionStmt *b)
2726 {
2727  COMPARE_SCALAR_FIELD(kind);
2729  COMPARE_STRING_FIELD(conninfo);
2730  COMPARE_NODE_FIELD(publication);
2732 
2733  return true;
2734 }
2735 
2736 static bool
2738  const DropSubscriptionStmt *b)
2739 {
2741  COMPARE_SCALAR_FIELD(missing_ok);
2742  COMPARE_SCALAR_FIELD(behavior);
2743 
2744  return true;
2745 }
2746 
2747 static bool
2749 {
2750  COMPARE_STRING_FIELD(policy_name);
2751  COMPARE_NODE_FIELD(table);
2752  COMPARE_STRING_FIELD(cmd_name);
2753  COMPARE_SCALAR_FIELD(permissive);
2754  COMPARE_NODE_FIELD(roles);
2755  COMPARE_NODE_FIELD(qual);
2756  COMPARE_NODE_FIELD(with_check);
2757 
2758  return true;
2759 }
2760 
2761 static bool
2763 {
2764  COMPARE_STRING_FIELD(policy_name);
2765  COMPARE_NODE_FIELD(table);
2766  COMPARE_NODE_FIELD(roles);
2767  COMPARE_NODE_FIELD(qual);
2768  COMPARE_NODE_FIELD(with_check);
2769 
2770  return true;
2771 }
2772 
2773 static bool
2774 _equalA_Expr(const A_Expr *a, const A_Expr *b)
2775 {
2776  COMPARE_SCALAR_FIELD(kind);
2778  COMPARE_NODE_FIELD(lexpr);
2779  COMPARE_NODE_FIELD(rexpr);
2780  COMPARE_LOCATION_FIELD(location);
2781 
2782  return true;
2783 }
2784 
2785 static bool
2787 {
2788  COMPARE_NODE_FIELD(fields);
2789  COMPARE_LOCATION_FIELD(location);
2790 
2791  return true;
2792 }
2793 
2794 static bool
2796 {
2797  COMPARE_SCALAR_FIELD(number);
2798  COMPARE_LOCATION_FIELD(location);
2799 
2800  return true;
2801 }
2802 
2803 static bool
2805 {
2806  /*
2807  * Hack for in-line val field. Also val is not valid is isnull is true.
2808  */
2809  if (!a->isnull && !b->isnull &&
2810  !equal(&a->val, &b->val))
2811  return false;
2812  COMPARE_SCALAR_FIELD(isnull);
2813  COMPARE_LOCATION_FIELD(location);
2814 
2815  return true;
2816 }
2817 
2818 static bool
2820 {
2821  COMPARE_NODE_FIELD(funcname);
2823  COMPARE_NODE_FIELD(agg_order);
2824  COMPARE_NODE_FIELD(agg_filter);
2825  COMPARE_NODE_FIELD(over);
2826  COMPARE_SCALAR_FIELD(agg_within_group);
2827  COMPARE_SCALAR_FIELD(agg_star);
2828  COMPARE_SCALAR_FIELD(agg_distinct);
2829  COMPARE_SCALAR_FIELD(func_variadic);
2830  COMPARE_COERCIONFORM_FIELD(funcformat);
2831  COMPARE_LOCATION_FIELD(location);
2832 
2833  return true;
2834 }
2835 
2836 static bool
2837 _equalA_Star(const A_Star *a, const A_Star *b)
2838 {
2839  return true;
2840 }
2841 
2842 static bool
2844 {
2845  COMPARE_SCALAR_FIELD(is_slice);
2846  COMPARE_NODE_FIELD(lidx);
2847  COMPARE_NODE_FIELD(uidx);
2848 
2849  return true;
2850 }
2851 
2852 static bool
2854 {
2856  COMPARE_NODE_FIELD(indirection);
2857 
2858  return true;
2859 }
2860 
2861 static bool
2863 {
2864  COMPARE_NODE_FIELD(elements);
2865  COMPARE_LOCATION_FIELD(location);
2866 
2867  return true;
2868 }
2869 
2870 static bool
2872 {
2874  COMPARE_NODE_FIELD(indirection);
2876  COMPARE_LOCATION_FIELD(location);
2877 
2878  return true;
2879 }
2880 
2881 static bool
2883 {
2885  COMPARE_SCALAR_FIELD(colno);
2886  COMPARE_SCALAR_FIELD(ncolumns);
2887 
2888  return true;
2889 }
2890 
2891 static bool
2893 {
2894  COMPARE_NODE_FIELD(names);
2895  COMPARE_SCALAR_FIELD(typeOid);
2896  COMPARE_SCALAR_FIELD(setof);
2897  COMPARE_SCALAR_FIELD(pct_type);
2898  COMPARE_NODE_FIELD(typmods);
2899  COMPARE_SCALAR_FIELD(typemod);
2900  COMPARE_NODE_FIELD(arrayBounds);
2901  COMPARE_LOCATION_FIELD(location);
2902 
2903  return true;
2904 }
2905 
2906 static bool
2908 {
2910  COMPARE_NODE_FIELD(typeName);
2911  COMPARE_LOCATION_FIELD(location);
2912 
2913  return true;
2914 }
2915 
2916 static bool
2918 {
2920  COMPARE_NODE_FIELD(collname);
2921  COMPARE_LOCATION_FIELD(location);
2922 
2923  return true;
2924 }
2925 
2926 static bool
2927 _equalSortBy(const SortBy *a, const SortBy *b)
2928 {
2929  COMPARE_NODE_FIELD(node);
2930  COMPARE_SCALAR_FIELD(sortby_dir);
2931  COMPARE_SCALAR_FIELD(sortby_nulls);
2932  COMPARE_NODE_FIELD(useOp);
2933  COMPARE_LOCATION_FIELD(location);
2934 
2935  return true;
2936 }
2937 
2938 static bool
2940 {
2942  COMPARE_STRING_FIELD(refname);
2943  COMPARE_NODE_FIELD(partitionClause);
2944  COMPARE_NODE_FIELD(orderClause);
2945  COMPARE_SCALAR_FIELD(frameOptions);
2946  COMPARE_NODE_FIELD(startOffset);
2947  COMPARE_NODE_FIELD(endOffset);
2948  COMPARE_LOCATION_FIELD(location);
2949 
2950  return true;
2951 }
2952 
2953 static bool
2955 {
2956  COMPARE_SCALAR_FIELD(lateral);
2957  COMPARE_NODE_FIELD(subquery);
2958  COMPARE_NODE_FIELD(alias);
2959 
2960  return true;
2961 }
2962 
2963 static bool
2965 {
2966  COMPARE_SCALAR_FIELD(lateral);
2967  COMPARE_SCALAR_FIELD(ordinality);
2968  COMPARE_SCALAR_FIELD(is_rowsfrom);
2970  COMPARE_NODE_FIELD(alias);
2971  COMPARE_NODE_FIELD(coldeflist);
2972 
2973  return true;
2974 }
2975 
2976 static bool
2978 {
2979  COMPARE_NODE_FIELD(relation);
2980  COMPARE_NODE_FIELD(method);
2982  COMPARE_NODE_FIELD(repeatable);
2983  COMPARE_LOCATION_FIELD(location);
2984 
2985  return true;
2986 }
2987 
2988 static bool
2990 {
2991  COMPARE_SCALAR_FIELD(lateral);
2992  COMPARE_NODE_FIELD(docexpr);
2993  COMPARE_NODE_FIELD(rowexpr);
2994  COMPARE_NODE_FIELD(namespaces);
2995  COMPARE_NODE_FIELD(columns);
2996  COMPARE_NODE_FIELD(alias);
2997  COMPARE_LOCATION_FIELD(location);
2998 
2999  return true;
3000 }
3001 
3002 static bool
3004 {
3005  COMPARE_STRING_FIELD(colname);
3006  COMPARE_NODE_FIELD(typeName);
3007  COMPARE_SCALAR_FIELD(for_ordinality);
3008  COMPARE_SCALAR_FIELD(is_not_null);
3009  COMPARE_NODE_FIELD(colexpr);
3010  COMPARE_NODE_FIELD(coldefexpr);
3011  COMPARE_LOCATION_FIELD(location);
3012 
3013  return true;
3014 }
3015 
3016 
3017 static bool
3019 {
3021  COMPARE_NODE_FIELD(expr);
3022  COMPARE_STRING_FIELD(indexcolname);
3023  COMPARE_NODE_FIELD(collation);
3024  COMPARE_NODE_FIELD(opclass);
3025  COMPARE_NODE_FIELD(opclassopts);
3026  COMPARE_SCALAR_FIELD(ordering);
3027  COMPARE_SCALAR_FIELD(nulls_ordering);
3028 
3029  return true;
3030 }
3031 
3032 
3033 static bool
3035 {
3037  COMPARE_NODE_FIELD(expr);
3038 
3039  return true;
3040 }
3041 
3042 static bool
3044 {
3045  COMPARE_STRING_FIELD(colname);
3046  COMPARE_NODE_FIELD(typeName);
3047  COMPARE_STRING_FIELD(compression);
3048  COMPARE_SCALAR_FIELD(inhcount);
3049  COMPARE_SCALAR_FIELD(is_local);
3050  COMPARE_SCALAR_FIELD(is_not_null);
3051  COMPARE_SCALAR_FIELD(is_from_type);
3052  COMPARE_SCALAR_FIELD(storage);
3053  COMPARE_NODE_FIELD(raw_default);
3054  COMPARE_NODE_FIELD(cooked_default);
3055  COMPARE_SCALAR_FIELD(identity);
3056  COMPARE_NODE_FIELD(identitySequence);
3057  COMPARE_SCALAR_FIELD(generated);
3058  COMPARE_NODE_FIELD(collClause);
3059  COMPARE_SCALAR_FIELD(collOid);
3060  COMPARE_NODE_FIELD(constraints);
3061  COMPARE_NODE_FIELD(fdwoptions);
3062  COMPARE_LOCATION_FIELD(location);
3063 
3064  return true;
3065 }
3066 
3067 static bool
3069 {
3070  COMPARE_SCALAR_FIELD(contype);
3071  COMPARE_STRING_FIELD(conname);
3072  COMPARE_SCALAR_FIELD(deferrable);
3073  COMPARE_SCALAR_FIELD(initdeferred);
3074  COMPARE_LOCATION_FIELD(location);
3075  COMPARE_SCALAR_FIELD(is_no_inherit);
3076  COMPARE_NODE_FIELD(raw_expr);
3077  COMPARE_STRING_FIELD(cooked_expr);
3078  COMPARE_SCALAR_FIELD(generated_when);
3079  COMPARE_SCALAR_FIELD(nulls_not_distinct);
3080  COMPARE_NODE_FIELD(keys);
3081  COMPARE_NODE_FIELD(including);
3082  COMPARE_NODE_FIELD(exclusions);
3084  COMPARE_STRING_FIELD(indexname);
3085  COMPARE_STRING_FIELD(indexspace);
3086  COMPARE_SCALAR_FIELD(reset_default_tblspc);
3087  COMPARE_STRING_FIELD(access_method);
3088  COMPARE_NODE_FIELD(where_clause);
3089  COMPARE_NODE_FIELD(pktable);
3090  COMPARE_NODE_FIELD(fk_attrs);
3091  COMPARE_NODE_FIELD(pk_attrs);
3092  COMPARE_SCALAR_FIELD(fk_matchtype);
3093  COMPARE_SCALAR_FIELD(fk_upd_action);
3094  COMPARE_SCALAR_FIELD(fk_del_action);
3095  COMPARE_NODE_FIELD(fk_del_set_cols);
3096  COMPARE_NODE_FIELD(old_conpfeqop);
3097  COMPARE_SCALAR_FIELD(old_pktable_oid);
3098  COMPARE_SCALAR_FIELD(skip_validation);
3099  COMPARE_SCALAR_FIELD(initially_valid);
3100 
3101  return true;
3102 }
3103 
3104 static bool
3106 {
3107  COMPARE_STRING_FIELD(defnamespace);
3108  COMPARE_STRING_FIELD(defname);
3110  COMPARE_SCALAR_FIELD(defaction);
3111  COMPARE_LOCATION_FIELD(location);
3112 
3113  return true;
3114 }
3115 
3116 static bool
3118 {
3119  COMPARE_NODE_FIELD(lockedRels);
3120  COMPARE_SCALAR_FIELD(strength);
3121  COMPARE_SCALAR_FIELD(waitPolicy);
3122 
3123  return true;
3124 }
3125 
3126 static bool
3128 {
3129  COMPARE_SCALAR_FIELD(rtekind);
3130  COMPARE_SCALAR_FIELD(relid);
3131  COMPARE_SCALAR_FIELD(relkind);
3132  COMPARE_SCALAR_FIELD(rellockmode);
3133  COMPARE_NODE_FIELD(tablesample);
3134  COMPARE_NODE_FIELD(subquery);
3135  COMPARE_SCALAR_FIELD(security_barrier);
3136  COMPARE_SCALAR_FIELD(jointype);
3137  COMPARE_SCALAR_FIELD(joinmergedcols);
3138  COMPARE_NODE_FIELD(joinaliasvars);
3139  COMPARE_NODE_FIELD(joinleftcols);
3140  COMPARE_NODE_FIELD(joinrightcols);
3141  COMPARE_NODE_FIELD(join_using_alias);
3143  COMPARE_SCALAR_FIELD(funcordinality);
3144  COMPARE_NODE_FIELD(tablefunc);
3145  COMPARE_NODE_FIELD(values_lists);
3146  COMPARE_STRING_FIELD(ctename);
3147  COMPARE_SCALAR_FIELD(ctelevelsup);
3148  COMPARE_SCALAR_FIELD(self_reference);
3149  COMPARE_NODE_FIELD(coltypes);
3150  COMPARE_NODE_FIELD(coltypmods);
3151  COMPARE_NODE_FIELD(colcollations);
3152  COMPARE_STRING_FIELD(enrname);
3153  COMPARE_SCALAR_FIELD(enrtuples);
3154  COMPARE_NODE_FIELD(alias);
3155  COMPARE_NODE_FIELD(eref);
3156  COMPARE_SCALAR_FIELD(lateral);
3157  COMPARE_SCALAR_FIELD(inh);
3158  COMPARE_SCALAR_FIELD(inFromCl);
3159  COMPARE_SCALAR_FIELD(requiredPerms);
3160  COMPARE_SCALAR_FIELD(checkAsUser);
3161  COMPARE_BITMAPSET_FIELD(selectedCols);
3162  COMPARE_BITMAPSET_FIELD(insertedCols);
3163  COMPARE_BITMAPSET_FIELD(updatedCols);
3164  COMPARE_BITMAPSET_FIELD(extraUpdatedCols);
3165  COMPARE_NODE_FIELD(securityQuals);
3166 
3167  return true;
3168 }
3169 
3170 static bool
3172 {
3173  COMPARE_NODE_FIELD(funcexpr);
3174  COMPARE_SCALAR_FIELD(funccolcount);
3175  COMPARE_NODE_FIELD(funccolnames);
3176  COMPARE_NODE_FIELD(funccoltypes);
3177  COMPARE_NODE_FIELD(funccoltypmods);
3178  COMPARE_NODE_FIELD(funccolcollations);
3179  COMPARE_BITMAPSET_FIELD(funcparams);
3180 
3181  return true;
3182 }
3183 
3184 static bool
3186 {
3187  COMPARE_SCALAR_FIELD(tsmhandler);
3189  COMPARE_NODE_FIELD(repeatable);
3190 
3191  return true;
3192 }
3193 
3194 static bool
3196 {
3197  COMPARE_SCALAR_FIELD(kind);
3199  COMPARE_STRING_FIELD(polname);
3200  COMPARE_NODE_FIELD(qual);
3201  COMPARE_SCALAR_FIELD(cascaded);
3202 
3203  return true;
3204 }
3205 
3206 static bool
3208 {
3209  COMPARE_SCALAR_FIELD(tleSortGroupRef);
3210  COMPARE_SCALAR_FIELD(eqop);
3211  COMPARE_SCALAR_FIELD(sortop);
3212  COMPARE_SCALAR_FIELD(nulls_first);
3213  COMPARE_SCALAR_FIELD(hashable);
3214 
3215  return true;
3216 }
3217 
3218 static bool
3220 {
3221  COMPARE_SCALAR_FIELD(kind);
3222  COMPARE_NODE_FIELD(content);
3223  COMPARE_LOCATION_FIELD(location);
3224 
3225  return true;
3226 }
3227 
3228 static bool
3230 {
3232  COMPARE_STRING_FIELD(refname);
3233  COMPARE_NODE_FIELD(partitionClause);
3234  COMPARE_NODE_FIELD(orderClause);
3235  COMPARE_SCALAR_FIELD(frameOptions);
3236  COMPARE_NODE_FIELD(startOffset);
3237  COMPARE_NODE_FIELD(endOffset);
3238  COMPARE_NODE_FIELD(runCondition);
3239  COMPARE_SCALAR_FIELD(startInRangeFunc);
3240  COMPARE_SCALAR_FIELD(endInRangeFunc);
3241  COMPARE_SCALAR_FIELD(inRangeColl);
3242  COMPARE_SCALAR_FIELD(inRangeAsc);
3243  COMPARE_SCALAR_FIELD(inRangeNullsFirst);
3244  COMPARE_SCALAR_FIELD(winref);
3245  COMPARE_SCALAR_FIELD(copiedOrder);
3246 
3247  return true;
3248 }
3249 
3250 static bool
3252 {
3253  COMPARE_SCALAR_FIELD(rti);
3254  COMPARE_SCALAR_FIELD(strength);
3255  COMPARE_SCALAR_FIELD(waitPolicy);
3256  COMPARE_SCALAR_FIELD(pushedDown);
3257 
3258  return true;
3259 }
3260 
3261 static bool
3263 {
3264  COMPARE_NODE_FIELD(ctes);
3265  COMPARE_SCALAR_FIELD(recursive);
3266  COMPARE_LOCATION_FIELD(location);
3267 
3268  return true;
3269 }
3270 
3271 static bool
3273 {
3274  COMPARE_NODE_FIELD(indexElems);
3275  COMPARE_NODE_FIELD(whereClause);
3276  COMPARE_STRING_FIELD(conname);
3277  COMPARE_LOCATION_FIELD(location);
3278 
3279  return true;
3280 }
3281 
3282 static bool
3284 {
3286  COMPARE_NODE_FIELD(infer);
3287  COMPARE_NODE_FIELD(targetList);
3288  COMPARE_NODE_FIELD(whereClause);
3289  COMPARE_LOCATION_FIELD(location);
3290 
3291  return true;
3292 }
3293 
3294 static bool
3296 {
3297  COMPARE_NODE_FIELD(search_col_list);
3298  COMPARE_SCALAR_FIELD(search_breadth_first);
3299  COMPARE_STRING_FIELD(search_seq_column);
3300  COMPARE_LOCATION_FIELD(location);
3301 
3302  return true;
3303 }
3304 
3305 static bool
3307 {
3308  COMPARE_NODE_FIELD(cycle_col_list);
3309  COMPARE_STRING_FIELD(cycle_mark_column);
3310  COMPARE_NODE_FIELD(cycle_mark_value);
3311  COMPARE_NODE_FIELD(cycle_mark_default);
3312  COMPARE_STRING_FIELD(cycle_path_column);
3313  COMPARE_LOCATION_FIELD(location);
3314  COMPARE_SCALAR_FIELD(cycle_mark_type);
3315  COMPARE_SCALAR_FIELD(cycle_mark_typmod);
3316  COMPARE_SCALAR_FIELD(cycle_mark_collation);
3317  COMPARE_SCALAR_FIELD(cycle_mark_neop);
3318 
3319  return true;
3320 }
3321 
3322 static bool
3324 {
3325  COMPARE_STRING_FIELD(ctename);
3326  COMPARE_NODE_FIELD(aliascolnames);
3327  COMPARE_SCALAR_FIELD(ctematerialized);
3328  COMPARE_NODE_FIELD(ctequery);
3329  COMPARE_NODE_FIELD(search_clause);
3330  COMPARE_NODE_FIELD(cycle_clause);
3331  COMPARE_LOCATION_FIELD(location);
3332  COMPARE_SCALAR_FIELD(cterecursive);
3333  COMPARE_SCALAR_FIELD(cterefcount);
3334  COMPARE_NODE_FIELD(ctecolnames);
3335  COMPARE_NODE_FIELD(ctecoltypes);
3336  COMPARE_NODE_FIELD(ctecoltypmods);
3337  COMPARE_NODE_FIELD(ctecolcollations);
3338 
3339  return true;
3340 }
3341 
3342 static bool
3344 {
3345  COMPARE_SCALAR_FIELD(matched);
3346  COMPARE_SCALAR_FIELD(commandType);
3347  COMPARE_SCALAR_FIELD(override);
3348  COMPARE_NODE_FIELD(condition);
3349  COMPARE_NODE_FIELD(targetList);
3351 
3352  return true;
3353 }
3354 
3355 static bool
3357 {
3358  COMPARE_SCALAR_FIELD(matched);
3359  COMPARE_SCALAR_FIELD(commandType);
3360  COMPARE_SCALAR_FIELD(override);
3361  COMPARE_NODE_FIELD(qual);
3362  COMPARE_NODE_FIELD(targetList);
3363  COMPARE_NODE_FIELD(updateColnos);
3364 
3365  return true;
3366 }
3367 
3368 static bool
3370 {
3372  COMPARE_NODE_FIELD(expr);
3373  COMPARE_NODE_FIELD(typeName);
3374  COMPARE_LOCATION_FIELD(location);
3375 
3376  return true;
3377 }
3378 
3379 static bool
3381 {
3382  COMPARE_SCALAR_FIELD(roletype);
3383  COMPARE_STRING_FIELD(rolename);
3384  COMPARE_LOCATION_FIELD(location);
3385 
3386  return true;
3387 }
3388 
3389 static bool
3391 {
3393  COMPARE_SCALAR_FIELD(isNew);
3394  COMPARE_SCALAR_FIELD(isTable);
3395 
3396  return true;
3397 }
3398 
3399 static bool
3401 {
3403  COMPARE_NODE_FIELD(expr);
3404  COMPARE_NODE_FIELD(collation);
3405  COMPARE_NODE_FIELD(opclass);
3406  COMPARE_LOCATION_FIELD(location);
3407 
3408  return true;
3409 }
3410 
3411 static bool
3413 {
3414  COMPARE_STRING_FIELD(strategy);
3415  COMPARE_NODE_FIELD(partParams);
3416  COMPARE_LOCATION_FIELD(location);
3417 
3418  return true;
3419 }
3420 
3421 static bool
3423 {
3424  COMPARE_SCALAR_FIELD(strategy);
3425  COMPARE_SCALAR_FIELD(is_default);
3426  COMPARE_SCALAR_FIELD(modulus);
3427  COMPARE_SCALAR_FIELD(remainder);
3428  COMPARE_NODE_FIELD(listdatums);
3429  COMPARE_NODE_FIELD(lowerdatums);
3430  COMPARE_NODE_FIELD(upperdatums);
3431  COMPARE_LOCATION_FIELD(location);
3432 
3433  return true;
3434 }
3435 
3436 static bool
3438 {
3439  COMPARE_SCALAR_FIELD(kind);
3441  COMPARE_LOCATION_FIELD(location);
3442 
3443  return true;
3444 }
3445 
3446 static bool
3448 {
3450  COMPARE_NODE_FIELD(bound);
3451  COMPARE_SCALAR_FIELD(concurrent);
3452 
3453  return true;
3454 }
3455 
3456 /*
3457  * Stuff from pg_list.h
3458  */
3459 
3460 static bool
3461 _equalList(const List *a, const List *b)
3462 {
3463  const ListCell *item_a;
3464  const ListCell *item_b;
3465 
3466  /*
3467  * Try to reject by simple scalar checks before grovelling through all the
3468  * list elements...
3469  */
3471  COMPARE_SCALAR_FIELD(length);
3472 
3473  /*
3474  * We place the switch outside the loop for the sake of efficiency; this
3475  * may not be worth doing...
3476  */
3477  switch (a->type)
3478  {
3479  case T_List:
3480  forboth(item_a, a, item_b, b)
3481  {
3482  if (!equal(lfirst(item_a), lfirst(item_b)))
3483  return false;
3484  }
3485  break;
3486  case T_IntList:
3487  forboth(item_a, a, item_b, b)
3488  {
3489  if (lfirst_int(item_a) != lfirst_int(item_b))
3490  return false;
3491  }
3492  break;
3493  case T_OidList:
3494  forboth(item_a, a, item_b, b)
3495  {
3496  if (lfirst_oid(item_a) != lfirst_oid(item_b))
3497  return false;
3498  }
3499  break;
3500  default:
3501  elog(ERROR, "unrecognized list node type: %d",
3502  (int) a->type);
3503  return false; /* keep compiler quiet */
3504  }
3505 
3506  /*
3507  * If we got here, we should have run out of elements of both lists
3508  */
3509  Assert(item_a == NULL);
3510  Assert(item_b == NULL);
3511 
3512  return true;
3513 }
3514 
3515 /*
3516  * Stuff from value.h
3517  */
3518 
3519 static bool
3521 {
3522  COMPARE_SCALAR_FIELD(ival);
3523 
3524  return true;
3525 }
3526 
3527 static bool
3528 _equalFloat(const Float *a, const Float *b)
3529 {
3530  COMPARE_STRING_FIELD(fval);
3531 
3532  return true;
3533 }
3534 
3535 static bool
3537 {
3538  COMPARE_SCALAR_FIELD(boolval);
3539 
3540  return true;
3541 }
3542 
3543 static bool
3544 _equalString(const String *a, const String *b)
3545 {
3546  COMPARE_STRING_FIELD(sval);
3547 
3548  return true;
3549 }
3550 
3551 static bool
3553 {
3554  COMPARE_STRING_FIELD(bsval);
3555 
3556  return true;
3557 }
3558 
3559 /*
3560  * equal
3561  * returns whether two nodes are equal
3562  */
3563 bool
3564 equal(const void *a, const void *b)
3565 {
3566  bool retval;
3567 
3568  if (a == b)
3569  return true;
3570 
3571  /*
3572  * note that a!=b, so only one of them can be NULL
3573  */
3574  if (a == NULL || b == NULL)
3575  return false;
3576 
3577  /*
3578  * are they the same type of nodes?
3579  */
3580  if (nodeTag(a) != nodeTag(b))
3581  return false;
3582 
3583  /* Guard against stack overflow due to overly complex expressions */
3585 
3586  switch (nodeTag(a))
3587  {
3588  /*
3589  * PRIMITIVE NODES
3590  */
3591  case T_Alias:
3592  retval = _equalAlias(a, b);
3593  break;
3594  case T_RangeVar:
3595  retval = _equalRangeVar(a, b);
3596  break;
3597  case T_TableFunc:
3598  retval = _equalTableFunc(a, b);
3599  break;
3600  case T_IntoClause:
3601  retval = _equalIntoClause(a, b);
3602  break;
3603  case T_Var:
3604  retval = _equalVar(a, b);
3605  break;
3606  case T_Const:
3607  retval = _equalConst(a, b);
3608  break;
3609  case T_Param:
3610  retval = _equalParam(a, b);
3611  break;
3612  case T_Aggref:
3613  retval = _equalAggref(a, b);
3614  break;
3615  case T_GroupingFunc:
3616  retval = _equalGroupingFunc(a, b);
3617  break;
3618  case T_WindowFunc:
3619  retval = _equalWindowFunc(a, b);
3620  break;
3621  case T_SubscriptingRef:
3622  retval = _equalSubscriptingRef(a, b);
3623  break;
3624  case T_FuncExpr:
3625  retval = _equalFuncExpr(a, b);
3626  break;
3627  case T_NamedArgExpr:
3628  retval = _equalNamedArgExpr(a, b);
3629  break;
3630  case T_OpExpr:
3631  retval = _equalOpExpr(a, b);
3632  break;
3633  case T_DistinctExpr:
3634  retval = _equalDistinctExpr(a, b);
3635  break;
3636  case T_NullIfExpr:
3637  retval = _equalNullIfExpr(a, b);
3638  break;
3639  case T_ScalarArrayOpExpr:
3640  retval = _equalScalarArrayOpExpr(a, b);
3641  break;
3642  case T_BoolExpr:
3643  retval = _equalBoolExpr(a, b);
3644  break;
3645  case T_SubLink:
3646  retval = _equalSubLink(a, b);
3647  break;
3648  case T_SubPlan:
3649  retval = _equalSubPlan(a, b);
3650  break;
3651  case T_AlternativeSubPlan:
3652  retval = _equalAlternativeSubPlan(a, b);
3653  break;
3654  case T_FieldSelect:
3655  retval = _equalFieldSelect(a, b);
3656  break;
3657  case T_FieldStore:
3658  retval = _equalFieldStore(a, b);
3659  break;
3660  case T_RelabelType:
3661  retval = _equalRelabelType(a, b);
3662  break;
3663  case T_CoerceViaIO:
3664  retval = _equalCoerceViaIO(a, b);
3665  break;
3666  case T_ArrayCoerceExpr:
3667  retval = _equalArrayCoerceExpr(a, b);
3668  break;
3669  case T_ConvertRowtypeExpr:
3670  retval = _equalConvertRowtypeExpr(a, b);
3671  break;
3672  case T_CollateExpr:
3673  retval = _equalCollateExpr(a, b);
3674  break;
3675  case T_CaseExpr:
3676  retval = _equalCaseExpr(a, b);
3677  break;
3678  case T_CaseWhen:
3679  retval = _equalCaseWhen(a, b);
3680  break;
3681  case T_CaseTestExpr:
3682  retval = _equalCaseTestExpr(a, b);
3683  break;
3684  case T_ArrayExpr:
3685  retval = _equalArrayExpr(a, b);
3686  break;
3687  case T_RowExpr:
3688  retval = _equalRowExpr(a, b);
3689  break;
3690  case T_RowCompareExpr:
3691  retval = _equalRowCompareExpr(a, b);
3692  break;
3693  case T_CoalesceExpr:
3694  retval = _equalCoalesceExpr(a, b);
3695  break;
3696  case T_MinMaxExpr:
3697  retval = _equalMinMaxExpr(a, b);
3698  break;
3699  case T_SQLValueFunction:
3700  retval = _equalSQLValueFunction(a, b);
3701  break;
3702  case T_XmlExpr:
3703  retval = _equalXmlExpr(a, b);
3704  break;
3705  case T_NullTest:
3706  retval = _equalNullTest(a, b);
3707  break;
3708  case T_BooleanTest:
3709  retval = _equalBooleanTest(a, b);
3710  break;
3711  case T_CoerceToDomain:
3712  retval = _equalCoerceToDomain(a, b);
3713  break;
3714  case T_CoerceToDomainValue:
3715  retval = _equalCoerceToDomainValue(a, b);
3716  break;
3717  case T_SetToDefault:
3718  retval = _equalSetToDefault(a, b);
3719  break;
3720  case T_CurrentOfExpr:
3721  retval = _equalCurrentOfExpr(a, b);
3722  break;
3723  case T_NextValueExpr:
3724  retval = _equalNextValueExpr(a, b);
3725  break;
3726  case T_InferenceElem:
3727  retval = _equalInferenceElem(a, b);
3728  break;
3729  case T_TargetEntry:
3730  retval = _equalTargetEntry(a, b);
3731  break;
3732  case T_RangeTblRef:
3733  retval = _equalRangeTblRef(a, b);
3734  break;
3735  case T_FromExpr:
3736  retval = _equalFromExpr(a, b);
3737  break;
3738  case T_OnConflictExpr:
3739  retval = _equalOnConflictExpr(a, b);
3740  break;
3741  case T_JoinExpr:
3742  retval = _equalJoinExpr(a, b);
3743  break;
3744  case T_JsonFormat:
3745  retval = _equalJsonFormat(a, b);
3746  break;
3747  case T_JsonReturning:
3748  retval = _equalJsonReturning(a, b);
3749  break;
3750  case T_JsonValueExpr:
3751  retval = _equalJsonValueExpr(a, b);
3752  break;
3753  case T_JsonParseExpr:
3754  retval = _equalJsonParseExpr(a, b);
3755  break;
3756  case T_JsonScalarExpr:
3757  retval = _equalJsonScalarExpr(a, b);
3758  break;
3759  case T_JsonSerializeExpr:
3760  retval = _equalJsonSerializeExpr(a, b);
3761  break;
3762  case T_JsonConstructorExpr:
3763  retval = _equalJsonConstructorExpr(a, b);
3764  break;
3765  case T_JsonIsPredicate:
3766  retval = _equalJsonIsPredicate(a, b);
3767  break;
3768  case T_JsonBehavior:
3769  retval = _equalJsonBehavior(a, b);
3770  break;
3771  case T_JsonExpr:
3772  retval = _equalJsonExpr(a, b);
3773  break;
3774  case T_JsonCoercion:
3775  retval = _equalJsonCoercion(a, b);
3776  break;
3777  case T_JsonItemCoercions:
3778  retval = _equalJsonItemCoercions(a, b);
3779  break;
3780  case T_JsonTableParent:
3781  retval = _equalJsonTableParent(a, b);
3782  break;
3783  case T_JsonTableSibling:
3784  retval = _equalJsonTableSibling(a, b);
3785  break;
3786 
3787  /*
3788  * RELATION NODES
3789  */
3790  case T_PathKey:
3791  retval = _equalPathKey(a, b);
3792  break;
3793  case T_RestrictInfo:
3794  retval = _equalRestrictInfo(a, b);
3795  break;
3796  case T_PlaceHolderVar:
3797  retval = _equalPlaceHolderVar(a, b);
3798  break;
3799  case T_SpecialJoinInfo:
3800  retval = _equalSpecialJoinInfo(a, b);
3801  break;
3802  case T_AppendRelInfo:
3803  retval = _equalAppendRelInfo(a, b);
3804  break;
3805  case T_PlaceHolderInfo:
3806  retval = _equalPlaceHolderInfo(a, b);
3807  break;
3808 
3809  case T_List:
3810  case T_IntList:
3811  case T_OidList:
3812  retval = _equalList(a, b);
3813  break;
3814 
3815  case T_Integer:
3816  retval = _equalInteger(a, b);
3817  break;
3818  case T_Float:
3819  retval = _equalFloat(a, b);
3820  break;
3821  case T_Boolean:
3822  retval = _equalBoolean(a, b);
3823  break;
3824  case T_String:
3825  retval = _equalString(a, b);
3826  break;
3827  case T_BitString:
3828  retval = _equalBitString(a, b);
3829  break;
3830 
3831  /*
3832  * EXTENSIBLE NODES
3833  */
3834  case T_ExtensibleNode:
3835  retval = _equalExtensibleNode(a, b);
3836  break;
3837 
3838  /*
3839  * PARSE NODES
3840  */
3841  case T_Query:
3842  retval = _equalQuery(a, b);
3843  break;
3844  case T_RawStmt:
3845  retval = _equalRawStmt(a, b);
3846  break;
3847  case T_InsertStmt:
3848  retval = _equalInsertStmt(a, b);
3849  break;
3850  case T_DeleteStmt:
3851  retval = _equalDeleteStmt(a, b);
3852  break;
3853  case T_UpdateStmt:
3854  retval = _equalUpdateStmt(a, b);
3855  break;
3856  case T_MergeStmt:
3857  retval = _equalMergeStmt(a, b);
3858  break;
3859  case T_SelectStmt:
3860  retval = _equalSelectStmt(a, b);
3861  break;
3862  case T_SetOperationStmt:
3863  retval = _equalSetOperationStmt(a, b);
3864  break;
3865  case T_ReturnStmt:
3866  retval = _equalReturnStmt(a, b);
3867  break;
3868  case T_PLAssignStmt:
3869  retval = _equalPLAssignStmt(a, b);
3870  break;
3871  case T_AlterTableStmt:
3872  retval = _equalAlterTableStmt(a, b);
3873  break;
3874  case T_AlterTableCmd:
3875  retval = _equalAlterTableCmd(a, b);
3876  break;
3877  case T_AlterCollationStmt:
3878  retval = _equalAlterCollationStmt(a, b);
3879  break;
3880  case T_AlterDomainStmt:
3881  retval = _equalAlterDomainStmt(a, b);
3882  break;
3883  case T_GrantStmt:
3884  retval = _equalGrantStmt(a, b);
3885  break;
3886  case T_GrantRoleStmt:
3887  retval = _equalGrantRoleStmt(a, b);
3888  break;
3891  break;
3892  case T_DeclareCursorStmt:
3893  retval = _equalDeclareCursorStmt(a, b);
3894  break;
3895  case T_ClosePortalStmt:
3896  retval = _equalClosePortalStmt(a, b);
3897  break;
3898  case T_CallStmt:
3899  retval = _equalCallStmt(a, b);
3900  break;
3901  case T_ClusterStmt:
3902  retval = _equalClusterStmt(a, b);
3903  break;
3904  case T_CopyStmt:
3905  retval = _equalCopyStmt(a, b);
3906  break;
3907  case T_CreateStmt:
3908  retval = _equalCreateStmt(a, b);
3909  break;
3910  case T_TableLikeClause:
3911  retval = _equalTableLikeClause(a, b);
3912  break;
3913  case T_DefineStmt:
3914  retval = _equalDefineStmt(a, b);
3915  break;
3916  case T_DropStmt:
3917  retval = _equalDropStmt(a, b);
3918  break;
3919  case T_TruncateStmt:
3920  retval = _equalTruncateStmt(a, b);
3921  break;
3922  case T_CommentStmt:
3923  retval = _equalCommentStmt(a, b);
3924  break;
3925  case T_SecLabelStmt:
3926  retval = _equalSecLabelStmt(a, b);
3927  break;
3928  case T_FetchStmt:
3929  retval = _equalFetchStmt(a, b);
3930  break;
3931  case T_IndexStmt:
3932  retval = _equalIndexStmt(a, b);
3933  break;
3934  case T_CreateStatsStmt:
3935  retval = _equalCreateStatsStmt(a, b);
3936  break;
3937  case T_AlterStatsStmt:
3938  retval = _equalAlterStatsStmt(a, b);
3939  break;
3940  case T_CreateFunctionStmt:
3941  retval = _equalCreateFunctionStmt(a, b);
3942  break;
3943  case T_FunctionParameter:
3944  retval = _equalFunctionParameter(a, b);
3945  break;
3946  case T_AlterFunctionStmt:
3947  retval = _equalAlterFunctionStmt(a, b);
3948  break;
3949  case T_DoStmt:
3950  retval = _equalDoStmt(a, b);
3951  break;
3952  case T_RenameStmt:
3953  retval = _equalRenameStmt(a, b);
3954  break;
3956  retval = _equalAlterObjectDependsStmt(a, b);
3957  break;
3959  retval = _equalAlterObjectSchemaStmt(a, b);
3960  break;
3961  case T_AlterOwnerStmt:
3962  retval = _equalAlterOwnerStmt(a, b);
3963  break;
3964  case T_AlterOperatorStmt:
3965  retval = _equalAlterOperatorStmt(a, b);
3966  break;
3967  case T_AlterTypeStmt:
3968  retval = _equalAlterTypeStmt(a, b);
3969  break;
3970  case T_RuleStmt:
3971  retval = _equalRuleStmt(a, b);
3972  break;
3973  case T_NotifyStmt:
3974  retval = _equalNotifyStmt(a, b);
3975  break;
3976  case T_ListenStmt:
3977  retval = _equalListenStmt(a, b);
3978  break;
3979  case T_UnlistenStmt:
3980  retval = _equalUnlistenStmt(a, b);
3981  break;
3982  case T_TransactionStmt:
3983  retval = _equalTransactionStmt(a, b);
3984  break;
3985  case T_CompositeTypeStmt:
3986  retval = _equalCompositeTypeStmt(a, b);
3987  break;
3988  case T_CreateEnumStmt:
3989  retval = _equalCreateEnumStmt(a, b);
3990  break;
3991  case T_CreateRangeStmt:
3992  retval = _equalCreateRangeStmt(a, b);
3993  break;
3994  case T_AlterEnumStmt:
3995  retval = _equalAlterEnumStmt(a, b);
3996  break;
3997  case T_ViewStmt:
3998  retval = _equalViewStmt(a, b);
3999  break;
4000  case T_LoadStmt:
4001  retval = _equalLoadStmt(a, b);
4002  break;
4003  case T_CreateDomainStmt:
4004  retval = _equalCreateDomainStmt(a, b);
4005  break;
4006  case T_CreateOpClassStmt:
4007  retval = _equalCreateOpClassStmt(a, b);
4008  break;
4009  case T_CreateOpClassItem:
4010  retval = _equalCreateOpClassItem(a, b);
4011  break;
4012  case T_CreateOpFamilyStmt:
4013  retval = _equalCreateOpFamilyStmt(a, b);
4014  break;
4015  case T_AlterOpFamilyStmt:
4016  retval = _equalAlterOpFamilyStmt(a, b);
4017  break;
4018  case T_CreatedbStmt:
4019  retval = _equalCreatedbStmt(a, b);
4020  break;
4021  case T_AlterDatabaseStmt:
4022  retval = _equalAlterDatabaseStmt(a, b);
4023  break;
4026  break;
4028  retval = _equalAlterDatabaseSetStmt(a, b);
4029  break;
4030  case T_DropdbStmt:
4031  retval = _equalDropdbStmt(a, b);
4032  break;
4033  case T_VacuumStmt:
4034  retval = _equalVacuumStmt(a, b);
4035  break;
4036  case T_VacuumRelation:
4037  retval = _equalVacuumRelation(a, b);
4038  break;
4039  case T_ExplainStmt:
4040  retval = _equalExplainStmt(a, b);
4041  break;
4042  case T_CreateTableAsStmt:
4043  retval = _equalCreateTableAsStmt(a, b);
4044  break;
4045  case T_RefreshMatViewStmt:
4046  retval = _equalRefreshMatViewStmt(a, b);
4047  break;
4048  case T_ReplicaIdentityStmt:
4049  retval = _equalReplicaIdentityStmt(a, b);
4050  break;
4051  case T_AlterSystemStmt:
4052  retval = _equalAlterSystemStmt(a, b);
4053  break;
4054  case T_CreateSeqStmt:
4055  retval = _equalCreateSeqStmt(a, b);
4056  break;
4057  case T_AlterSeqStmt:
4058  retval = _equalAlterSeqStmt(a, b);
4059  break;
4060  case T_VariableSetStmt:
4061  retval = _equalVariableSetStmt(a, b);
4062  break;
4063  case T_VariableShowStmt:
4064  retval = _equalVariableShowStmt(a, b);
4065  break;
4066  case T_DiscardStmt:
4067  retval = _equalDiscardStmt(a, b);
4068  break;
4070  retval = _equalCreateTableSpaceStmt(a, b);
4071  break;
4072  case T_DropTableSpaceStmt:
4073  retval = _equalDropTableSpaceStmt(a, b);
4074  break;
4077  break;
4079  retval = _equalAlterTableMoveAllStmt(a, b);
4080  break;
4081  case T_CreateExtensionStmt:
4082  retval = _equalCreateExtensionStmt(a, b);
4083  break;
4084  case T_AlterExtensionStmt:
4085  retval = _equalAlterExtensionStmt(a, b);
4086  break;
4089  break;
4090  case T_CreateFdwStmt:
4091  retval = _equalCreateFdwStmt(a, b);
4092  break;
4093  case T_AlterFdwStmt:
4094  retval = _equalAlterFdwStmt(a, b);
4095  break;
4097  retval = _equalCreateForeignServerStmt(a, b);
4098  break;
4100  retval = _equalAlterForeignServerStmt(a, b);
4101  break;
4103  retval = _equalCreateUserMappingStmt(a, b);
4104  break;
4106  retval = _equalAlterUserMappingStmt(a, b);
4107  break;
4108  case T_DropUserMappingStmt:
4109  retval = _equalDropUserMappingStmt(a, b);
4110  break;
4112  retval = _equalCreateForeignTableStmt(a, b);
4113  break;
4115  retval = _equalImportForeignSchemaStmt(a, b);
4116  break;
4117  case T_CreateTransformStmt:
4118  retval = _equalCreateTransformStmt(a, b);
4119  break;
4120  case T_CreateAmStmt:
4121  retval = _equalCreateAmStmt(a, b);
4122  break;
4123  case T_CreateTrigStmt:
4124  retval = _equalCreateTrigStmt(a, b);
4125  break;
4126  case T_CreateEventTrigStmt:
4127  retval = _equalCreateEventTrigStmt(a, b);
4128  break;
4129  case T_AlterEventTrigStmt:
4130  retval = _equalAlterEventTrigStmt(a, b);
4131  break;
4132  case T_CreatePLangStmt:
4133  retval = _equalCreatePLangStmt(a, b);
4134  break;
4135  case T_CreateRoleStmt:
4136  retval = _equalCreateRoleStmt(a, b);
4137  break;
4138  case T_AlterRoleStmt:
4139  retval = _equalAlterRoleStmt(a, b);
4140  break;
4141  case T_AlterRoleSetStmt:
4142  retval = _equalAlterRoleSetStmt(a, b);
4143  break;
4144  case T_DropRoleStmt:
4145  retval = _equalDropRoleStmt(a, b);
4146  break;
4147  case T_LockStmt:
4148  retval = _equalLockStmt(a, b);
4149  break;
4150  case T_ConstraintsSetStmt:
4151  retval = _equalConstraintsSetStmt(a, b);
4152  break;
4153  case T_ReindexStmt:
4154  retval = _equalReindexStmt(a, b);
4155  break;
4156  case T_CheckPointStmt:
4157  retval = true;
4158  break;
4159  case T_CreateSchemaStmt:
4160  retval = _equalCreateSchemaStmt(a, b);
4161  break;
4163  retval = _equalCreateConversionStmt(a, b);
4164  break;
4165  case T_CreateCastStmt:
4166  retval = _equalCreateCastStmt(a, b);
4167  break;
4168  case T_PrepareStmt:
4169  retval = _equalPrepareStmt(a, b);
4170  break;
4171  case T_ExecuteStmt:
4172  retval = _equalExecuteStmt(a, b);
4173  break;
4174  case T_DeallocateStmt:
4175  retval = _equalDeallocateStmt(a, b);
4176  break;
4177  case T_DropOwnedStmt:
4178  retval = _equalDropOwnedStmt(a, b);
4179  break;
4180  case T_ReassignOwnedStmt:
4181  retval = _equalReassignOwnedStmt(a, b);
4182  break;
4184  retval = _equalAlterTSDictionaryStmt(a, b);
4185  break;
4187  retval = _equalAlterTSConfigurationStmt(a, b);
4188  break;
4189  case T_CreatePolicyStmt:
4190  retval = _equalCreatePolicyStmt(a, b);
4191  break;
4192  case T_AlterPolicyStmt:
4193  retval = _equalAlterPolicyStmt(a, b);
4194  break;
4196  retval = _equalCreatePublicationStmt(a, b);
4197  break;
4199  retval = _equalAlterPublicationStmt(a, b);
4200  break;
4202  retval = _equalCreateSubscriptionStmt(a, b);
4203  break;
4205  retval = _equalAlterSubscriptionStmt(a, b);
4206  break;
4208  retval = _equalDropSubscriptionStmt(a, b);
4209  break;
4210  case T_A_Expr:
4211  retval = _equalA_Expr(a, b);
4212  break;
4213  case T_ColumnRef:
4214  retval = _equalColumnRef(a, b);
4215  break;
4216  case T_ParamRef:
4217  retval = _equalParamRef(a, b);
4218  break;
4219  case T_A_Const:
4220  retval = _equalA_Const(a, b);
4221  break;
4222  case T_FuncCall:
4223  retval = _equalFuncCall(a, b);
4224  break;
4225  case T_A_Star:
4226  retval = _equalA_Star(a, b);
4227  break;
4228  case T_A_Indices:
4229  retval = _equalA_Indices(a, b);
4230  break;
4231  case T_A_Indirection:
4232  retval = _equalA_Indirection(a, b);
4233  break;
4234  case T_A_ArrayExpr:
4235  retval = _equalA_ArrayExpr(a, b);
4236  break;
4237  case T_ResTarget:
4238  retval = _equalResTarget(a, b);
4239  break;
4240  case T_MultiAssignRef:
4241  retval = _equalMultiAssignRef(a, b);
4242  break;
4243  case T_TypeCast:
4244  retval = _equalTypeCast(a, b);
4245  break;
4246  case T_CollateClause:
4247  retval = _equalCollateClause(a, b);
4248  break;
4249  case T_SortBy:
4250  retval = _equalSortBy(a, b);
4251  break;
4252  case T_WindowDef:
4253  retval = _equalWindowDef(a, b);
4254  break;
4255  case T_RangeSubselect:
4256  retval = _equalRangeSubselect(a, b);
4257  break;
4258  case T_RangeFunction:
4259  retval = _equalRangeFunction(a, b);
4260  break;
4261  case T_RangeTableSample:
4262  retval = _equalRangeTableSample(a, b);
4263  break;
4264  case T_RangeTableFunc:
4265  retval = _equalRangeTableFunc(a, b);
4266  break;
4267  case T_RangeTableFuncCol:
4268  retval = _equalRangeTableFuncCol(a, b);
4269  break;
4270  case T_TypeName:
4271  retval = _equalTypeName(a, b);
4272  break;
4273  case T_IndexElem:
4274  retval = _equalIndexElem(a, b);
4275  break;
4276  case T_StatsElem:
4277  retval = _equalStatsElem(a, b);
4278  break;
4279  case T_ColumnDef:
4280  retval = _equalColumnDef(a, b);
4281  break;
4282  case T_Constraint:
4283  retval = _equalConstraint(a, b);
4284  break;
4285  case T_DefElem:
4286  retval = _equalDefElem(a, b);
4287  break;
4288  case T_LockingClause:
4289  retval = _equalLockingClause(a, b);
4290  break;
4291  case T_RangeTblEntry:
4292  retval = _equalRangeTblEntry(a, b);
4293  break;
4294  case T_RangeTblFunction:
4295  retval = _equalRangeTblFunction(a, b);
4296  break;
4297  case T_TableSampleClause:
4298  retval = _equalTableSampleClause(a, b);
4299  break;
4300  case T_WithCheckOption:
4301  retval = _equalWithCheckOption(a, b);
4302  break;
4303  case T_SortGroupClause:
4304  retval = _equalSortGroupClause(a, b);
4305  break;
4306  case T_GroupingSet:
4307  retval = _equalGroupingSet(a, b);
4308  break;
4309  case T_WindowClause:
4310  retval = _equalWindowClause(a, b);
4311  break;
4312  case T_RowMarkClause:
4313  retval = _equalRowMarkClause(a, b);
4314  break;
4315  case T_WithClause:
4316  retval = _equalWithClause(a, b);
4317  break;
4318  case T_InferClause:
4319  retval = _equalInferClause(a, b);
4320  break;
4321  case T_OnConflictClause:
4322  retval = _equalOnConflictClause(a, b);
4323  break;
4324  case T_CTESearchClause:
4325  retval = _equalCTESearchClause(a, b);
4326  break;
4327  case T_CTECycleClause:
4328  retval = _equalCTECycleClause(a, b);
4329  break;
4330  case T_CommonTableExpr:
4331  retval = _equalCommonTableExpr(a, b);
4332  break;
4333  case T_MergeWhenClause:
4334  retval = _equalMergeWhenClause(a, b);
4335  break;
4336  case T_MergeAction:
4337  retval = _equalMergeAction(a, b);
4338  break;
4339  case T_ObjectWithArgs:
4340  retval = _equalObjectWithArgs(a, b);
4341  break;
4342  case T_AccessPriv:
4343  retval = _equalAccessPriv(a, b);
4344  break;
4345  case T_XmlSerialize:
4346  retval = _equalXmlSerialize(a, b);
4347  break;
4348  case T_RoleSpec:
4349  retval = _equalRoleSpec(a, b);
4350  break;
4351  case T_TriggerTransition:
4352  retval = _equalTriggerTransition(a, b);
4353  break;
4354  case T_PartitionElem:
4355  retval = _equalPartitionElem(a, b);
4356  break;
4357  case T_PartitionSpec:
4358  retval = _equalPartitionSpec(a, b);
4359  break;
4360  case T_PartitionBoundSpec:
4361  retval = _equalPartitionBoundSpec(a, b);
4362  break;
4363  case T_PartitionRangeDatum:
4364  retval = _equalPartitionRangeDatum(a, b);
4365  break;
4366  case T_PartitionCmd:
4367  retval = _equalPartitionCmd(a, b);
4368  break;
4369  case T_PublicationObjSpec:
4370  retval = _equalPublicationObject(a, b);
4371  break;
4372  case T_PublicationTable:
4373  retval = _equalPublicationTable(a, b);
4374  break;
4375  case T_JsonKeyValue:
4376  retval = _equalJsonKeyValue(a, b);
4377  break;
4379  retval = _equalJsonObjectConstructor(a, b);
4380  break;
4381  case T_JsonAggConstructor:
4382  retval = _equalJsonAggConstructor(a, b);
4383  break;
4384  case T_JsonObjectAgg:
4385  retval = _equalJsonObjectAgg(a, b);
4386  break;
4387  case T_JsonOutput:
4388  retval = _equalJsonOutput(a, b);
4389  break;
4391  retval = _equalJsonArrayConstructor(a, b);
4392  break;
4394  retval = _equalJsonArrayQueryConstructor(a, b);
4395  break;
4396  case T_JsonArrayAgg:
4397  retval = _equalJsonArrayAgg(a, b);
4398  break;
4399  case T_JsonFuncExpr:
4400  retval = _equalJsonFuncExpr(a, b);
4401  break;
4402  case T_JsonCommon:
4403  retval = _equalJsonCommon(a, b);
4404  break;
4405  case T_JsonArgument:
4406  retval = _equalJsonArgument(a, b);
4407  break;
4408  case T_JsonTable:
4409  retval = _equalJsonTable(a, b);
4410  break;
4411  case T_JsonTableColumn:
4412  retval = _equalJsonTableColumn(a, b);
4413  break;
4414 
4415  default:
4416  elog(ERROR, "unrecognized node type: %d",
4417  (int) nodeTag(a));
4418  retval = false; /* keep compiler quiet */
4419  break;
4420  }
4421 
4422  return retval;
4423 }
Datum boolop(PG_FUNCTION_ARGS)
Definition: _int_bool.c:418
int16 AttrNumber
Definition: attnum.h:21
static Datum values[MAXATTR]
Definition: bootstrap.c:156
bool datumIsEqual(Datum value1, Datum value2, bool typByVal, int typLen)
Definition: datum.c:223
#define ERROR
Definition: elog.h:33
#define elog(elevel,...)
Definition: elog.h:218
const char * name
Definition: encode.c:561
static bool _equalSubPlan(const SubPlan *a, const SubPlan *b)
Definition: equalfuncs.c:519
static bool _equalAlterTableCmd(const AlterTableCmd *a, const AlterTableCmd *b)
Definition: equalfuncs.c:1499
static bool _equalFieldSelect(const FieldSelect *a, const FieldSelect *b)
Definition: equalfuncs.c:550
static bool _equalWithCheckOption(const WithCheckOption *a, const WithCheckOption *b)
Definition: equalfuncs.c:3195
static bool _equalRenameStmt(const RenameStmt *a, const RenameStmt *b)
Definition: equalfuncs.c:1840
static bool _equalAlterTSDictionaryStmt(const AlterTSDictionaryStmt *a, const AlterTSDictionaryStmt *b)
Definition: equalfuncs.c:2641
static bool _equalConvertRowtypeExpr(const ConvertRowtypeExpr *a, const ConvertRowtypeExpr *b)
Definition: equalfuncs.c:612
static bool _equalDistinctExpr(const DistinctExpr *a, const DistinctExpr *b)
Definition: equalfuncs.c:408
static bool _equalWindowFunc(const WindowFunc *a, const WindowFunc *b)
Definition: equalfuncs.c:322
static bool _equalDefineStmt(const DefineStmt *a, const DefineStmt *b)
Definition: equalfuncs.c:1674
static bool _equalAlterObjectSchemaStmt(const AlterObjectSchemaStmt *a, const AlterObjectSchemaStmt *b)
Definition: equalfuncs.c:1867
static bool _equalColumnRef(const ColumnRef *a, const ColumnRef *b)
Definition: equalfuncs.c:2786
static bool _equalAlterTableMoveAllStmt(const AlterTableMoveAllStmt *a, const AlterTableMoveAllStmt *b)
Definition: equalfuncs.c:2272
static bool _equalPartitionBoundSpec(const PartitionBoundSpec *a, const PartitionBoundSpec *b)
Definition: equalfuncs.c:3422
static bool _equalCreatePLangStmt(const CreatePLangStmt *a, const CreatePLangStmt *b)
Definition: equalfuncs.c:2479
static bool _equalTriggerTransition(const TriggerTransition *a, const TriggerTransition *b)
Definition: equalfuncs.c:3390
static bool _equalBitString(const BitString *a, const BitString *b)
Definition: equalfuncs.c:3552
#define COMPARE_BITMAPSET_FIELD(fldname)
Definition: equalfuncs.c:60
static bool _equalViewStmt(const ViewStmt *a, const ViewStmt *b)
Definition: equalfuncs.c:1999
static bool _equalBoolExpr(const BoolExpr *a, const BoolExpr *b)
Definition: equalfuncs.c:496
static bool _equalJsonArrayAgg(const JsonArrayAgg *a, const JsonArrayAgg *b)
Definition: equalfuncs.c:1045
static bool _equalWindowDef(const WindowDef *a, const WindowDef *b)
Definition: equalfuncs.c:2939
static bool _equalJsonBehavior(const JsonBehavior *a, const JsonBehavior *b)
Definition: equalfuncs.c:1120
static bool _equalCreatedbStmt(const CreatedbStmt *a, const CreatedbStmt *b)
Definition: equalfuncs.c:2077
static bool _equalJsonFormat(const JsonFormat *a, const JsonFormat *b)
Definition: equalfuncs.c:902
static bool _equalAlterExtensionContentsStmt(const AlterExtensionContentsStmt *a, const AlterExtensionContentsStmt *b)
Definition: equalfuncs.c:2304
static bool _equalFloat(const Float *a, const Float *b)
Definition: equalfuncs.c:3528
static bool _equalCreateOpClassItem(const CreateOpClassItem *a, const CreateOpClassItem *b)
Definition: equalfuncs.c:2044
static bool _equalJsonArrayConstructor(const JsonArrayConstructor *a, const JsonArrayConstructor *b)
Definition: equalfuncs.c:1033
static bool _equalBooleanTest(const BooleanTest *a, const BooleanTest *b)
Definition: equalfuncs.c:766
static bool _equalQuery(const Query *a, const Query *b)
Definition: equalfuncs.c:1317
static bool _equalJsonExpr(const JsonExpr *a, const JsonExpr *b)
Definition: equalfuncs.c:1132
static bool _equalSortBy(const SortBy *a, const SortBy *b)
Definition: equalfuncs.c:2927
static bool _equalExtensibleNode(const ExtensibleNode *a, const ExtensibleNode *b)
Definition: equalfuncs.c:1296
static bool _equalAlterForeignServerStmt(const AlterForeignServerStmt *a, const AlterForeignServerStmt *b)
Definition: equalfuncs.c:2348
static bool _equalAlterSeqStmt(const AlterSeqStmt *a, const AlterSeqStmt *b)
Definition: equalfuncs.c:2203
static bool _equalJsonTable(const JsonTable *a, const JsonTable *b)
Definition: equalfuncs.c:151
static bool _equalOpExpr(const OpExpr *a, const OpExpr *b)
Definition: equalfuncs.c:382
static bool _equalTableFunc(const TableFunc *a, const TableFunc *b)
Definition: equalfuncs.c:128
static bool _equalFromExpr(const FromExpr *a, const FromExpr *b)
Definition: equalfuncs.c:878
static bool _equalJsonCoercion(const JsonCoercion *a, const JsonCoercion *b)
Definition: equalfuncs.c:1156
static bool _equalLockStmt(const LockStmt *a, const LockStmt *b)
Definition: equalfuncs.c:2531
static bool _equalAlterEventTrigStmt(const AlterEventTrigStmt *a, const AlterEventTrigStmt *b)
Definition: equalfuncs.c:2470
static bool _equalCaseExpr(const CaseExpr *a, const CaseExpr *b)
Definition: equalfuncs.c:633
static bool _equalJsonKeyValue(const JsonKeyValue *a, const JsonKeyValue *b)
Definition: equalfuncs.c:978
static bool _equalTruncateStmt(const TruncateStmt *a, const TruncateStmt *b)
Definition: equalfuncs.c:1700
static bool _equalFuncCall(const FuncCall *a, const FuncCall *b)
Definition: equalfuncs.c:2819
static bool _equalCreateDomainStmt(const CreateDomainStmt *a, const CreateDomainStmt *b)
Definition: equalfuncs.c:2020
static bool _equalSecLabelStmt(const SecLabelStmt *a, const SecLabelStmt *b)
Definition: equalfuncs.c:1720
static bool _equalNextValueExpr(const NextValueExpr *a, const NextValueExpr *b)
Definition: equalfuncs.c:821
static bool _equalClusterStmt(const ClusterStmt *a, const ClusterStmt *b)
Definition: equalfuncs.c:1620
static bool _equalJsonTableSibling(const JsonTableSibling *a, const JsonTableSibling *b)
Definition: equalfuncs.c:195
static bool _equalAlterRoleSetStmt(const AlterRoleSetStmt *a, const AlterRoleSetStmt *b)
Definition: equalfuncs.c:2512
static bool _equalImportForeignSchemaStmt(const ImportForeignSchemaStmt *a, const ImportForeignSchemaStmt *b)
Definition: equalfuncs.c:2402
static bool _equalJsonArgument(const JsonArgument *a, const JsonArgument *b)
Definition: equalfuncs.c:1095
static bool _equalA_Indices(const A_Indices *a, const A_Indices *b)
Definition: equalfuncs.c:2843
static bool _equalCreateUserMappingStmt(const CreateUserMappingStmt *a, const CreateUserMappingStmt *b)
Definition: equalfuncs.c:2359
static bool _equalVacuumStmt(const VacuumStmt *a, const VacuumStmt *b)
Definition: equalfuncs.c:2122
static bool _equalDropdbStmt(const DropdbStmt *a, const DropdbStmt *b)
Definition: equalfuncs.c:2112
static bool _equalCreateStatsStmt(const CreateStatsStmt *a, const CreateStatsStmt *b)
Definition: equalfuncs.c:1773
static bool _equalOnConflictExpr(const OnConflictExpr *a, const OnConflictExpr *b)
Definition: equalfuncs.c:887
static bool _equalRestrictInfo(const RestrictInfo *a, const RestrictInfo *b)
Definition: equalfuncs.c:1203
static bool _equalJsonConstructorExpr(const JsonConstructorExpr *a, const JsonConstructorExpr *b)
Definition: equalfuncs.c:963
static bool _equalAlterSystemStmt(const AlterSystemStmt *a, const AlterSystemStmt *b)
Definition: equalfuncs.c:2182
static bool _equalPLAssignStmt(const PLAssignStmt *a, const PLAssignStmt *b)
Definition: equalfuncs.c:1476
static bool _equalPublicationObject(const PublicationObjSpec *a, const PublicationObjSpec *b)
Definition: equalfuncs.c:2665
static bool _equalCreateTrigStmt(const CreateTrigStmt *a, const CreateTrigStmt *b)
Definition: equalfuncs.c:2437
static bool _equalCreateEnumStmt(const CreateEnumStmt *a, const CreateEnumStmt *b)
Definition: equalfuncs.c:1968
static bool _equalCoalesceExpr(const CoalesceExpr *a, const CoalesceExpr *b)
Definition: equalfuncs.c:704
static bool _equalCreateTableSpaceStmt(const CreateTableSpaceStmt *a, const CreateTableSpaceStmt *b)
Definition: equalfuncs.c:2241
static bool _equalNullIfExpr(const NullIfExpr *a, const NullIfExpr *b)
Definition: equalfuncs.c:434
static bool _equalAlterPublicationStmt(const AlterPublicationStmt *a, const AlterPublicationStmt *b)
Definition: equalfuncs.c:2699
static bool _equalUpdateStmt(const UpdateStmt *a, const UpdateStmt *b)
Definition: equalfuncs.c:1401
static bool _equalCreateSeqStmt(const CreateSeqStmt *a, const CreateSeqStmt *b)
Definition: equalfuncs.c:2191
static bool _equalDropStmt(const DropStmt *a, const DropStmt *b)
Definition: equalfuncs.c:1688
static bool _equalAlterTypeStmt(const AlterTypeStmt *a, const AlterTypeStmt *b)
Definition: equalfuncs.c:1899
static bool _equalJoinExpr(const JoinExpr *a, const JoinExpr *b)
Definition: equalfuncs.c:862
static bool _equalAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *a, const AlterTableSpaceOptionsStmt *b)
Definition: equalfuncs.c:2261
static bool _equalRangeVar(const RangeVar *a, const RangeVar *b)
Definition: equalfuncs.c:114
static bool _equalIndexElem(const IndexElem *a, const IndexElem *b)
Definition: equalfuncs.c:3018
static bool _equalCoerceToDomainValue(const CoerceToDomainValue *a, const CoerceToDomainValue *b)
Definition: equalfuncs.c:789
static bool _equalWindowClause(const WindowClause *a, const WindowClause *b)
Definition: equalfuncs.c:3229
static bool _equalRangeSubselect(const RangeSubselect *a, const RangeSubselect *b)
Definition: equalfuncs.c:2954
static bool _equalPublicationTable(const PublicationTable *a, const PublicationTable *b)
Definition: equalfuncs.c:2677
static bool _equalAlterUserMappingStmt(const AlterUserMappingStmt *a, const AlterUserMappingStmt *b)
Definition: equalfuncs.c:2370
static bool _equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
Definition: equalfuncs.c:1908
static bool _equalDropSubscriptionStmt(const DropSubscriptionStmt *a, const DropSubscriptionStmt *b)
Definition: equalfuncs.c:2737
static bool _equalIndexStmt(const IndexStmt *a, const IndexStmt *b)
Definition: equalfuncs.c:1742
static bool _equalJsonOutput(const JsonOutput *a, const JsonOutput *b)
Definition: equalfuncs.c:1024
static bool _equalTargetEntry(const TargetEntry *a, const TargetEntry *b)
Definition: equalfuncs.c:840
static bool _equalParamRef(const ParamRef *a, const ParamRef *b)
Definition: equalfuncs.c:2795
static bool _equalOnConflictClause(const OnConflictClause *a, const OnConflictClause *b)
Definition: equalfuncs.c:3283
static bool _equalPartitionRangeDatum(const PartitionRangeDatum *a, const PartitionRangeDatum *b)
Definition: equalfuncs.c:3437
static bool _equalInsertStmt(const InsertStmt *a, const InsertStmt *b)
Definition: equalfuncs.c:1375
static bool _equalFunctionParameter(const FunctionParameter *a, const FunctionParameter *b)
Definition: equalfuncs.c:1811
static bool _equalJsonIsPredicate(const JsonIsPredicate *a, const JsonIsPredicate *b)
Definition: equalfuncs.c:1104
static bool _equalJsonParseExpr(const JsonParseExpr *a, const JsonParseExpr *b)
Definition: equalfuncs.c:932
static bool _equalSubscriptingRef(const SubscriptingRef *a, const SubscriptingRef *b)
Definition: equalfuncs.c:339
static bool _equalSubLink(const SubLink *a, const SubLink *b)
Definition: equalfuncs.c:506
#define COMPARE_LOCATION_FIELD(fldname)
Definition: equalfuncs.c:92
static bool _equalTransactionStmt(const TransactionStmt *a, const TransactionStmt *b)
Definition: equalfuncs.c:1947
static bool _equalAlternativeSubPlan(const AlternativeSubPlan *a, const AlternativeSubPlan *b)
Definition: equalfuncs.c:542
static bool _equalJsonScalarExpr(const JsonScalarExpr *a, const JsonScalarExpr *b)
Definition: equalfuncs.c:943
static bool _equalRefreshMatViewStmt(const RefreshMatViewStmt *a, const RefreshMatViewStmt *b)
Definition: equalfuncs.c:2163
static bool _equalLoadStmt(const LoadStmt *a, const LoadStmt *b)
Definition: equalfuncs.c:2012
static bool _equalDeclareCursorStmt(const DeclareCursorStmt *a, const DeclareCursorStmt *b)
Definition: equalfuncs.c:1592
static bool _equalBoolean(const Boolean *a, const Boolean *b)
Definition: equalfuncs.c:3536
static bool _equalAlterFunctionStmt(const AlterFunctionStmt *a, const AlterFunctionStmt *b)
Definition: equalfuncs.c:1822
static bool _equalDeleteStmt(const DeleteStmt *a, const DeleteStmt *b)
Definition: equalfuncs.c:1389
static bool _equalCreateTableAsStmt(const CreateTableAsStmt *a, const CreateTableAsStmt *b)
Definition: equalfuncs.c:2151
static bool _equalXmlSerialize(const XmlSerialize *a, const XmlSerialize *b)
Definition: equalfuncs.c:3369
static bool _equalCaseWhen(const CaseWhen *a, const CaseWhen *b)
Definition: equalfuncs.c:646
static bool _equalCreateEventTrigStmt(const CreateEventTrigStmt *a, const CreateEventTrigStmt *b)
Definition: equalfuncs.c:2459
static bool _equalCreateStmt(const CreateStmt *a, const CreateStmt *b)
Definition: equalfuncs.c:1645
static bool _equalCreateFunctionStmt(const CreateFunctionStmt *a, const CreateFunctionStmt *b)
Definition: equalfuncs.c:1797
static bool _equalUnlistenStmt(const UnlistenStmt *a, const UnlistenStmt *b)
Definition: equalfuncs.c:1939
static bool _equalRangeFunction(const RangeFunction *a, const RangeFunction *b)
Definition: equalfuncs.c:2964
static bool _equalCTESearchClause(const CTESearchClause *a, const CTESearchClause *b)
Definition: equalfuncs.c:3295
static bool _equalAlterCollationStmt(const AlterCollationStmt *a, const AlterCollationStmt *b)
Definition: equalfuncs.c:1513
static bool _equalCallStmt(const CallStmt *a, const CallStmt *b)
Definition: equalfuncs.c:1610
static bool _equalRoleSpec(const RoleSpec *a, const RoleSpec *b)
Definition: equalfuncs.c:3380
static bool _equalA_Expr(const A_Expr *a, const A_Expr *b)
Definition: equalfuncs.c:2774
static bool _equalAlterOperatorStmt(const AlterOperatorStmt *a, const AlterOperatorStmt *b)
Definition: equalfuncs.c:1890
static bool _equalNotifyStmt(const NotifyStmt *a, const NotifyStmt *b)
Definition: equalfuncs.c:1922
static bool _equalVariableShowStmt(const VariableShowStmt *a, const VariableShowStmt *b)
Definition: equalfuncs.c:2225
#define COMPARE_SCALAR_FIELD(fldname)
Definition: equalfuncs.c:46
static bool _equalSetToDefault(const SetToDefault *a, const SetToDefault *b)
Definition: equalfuncs.c:800
static bool _equalRangeTableFunc(const RangeTableFunc *a, const RangeTableFunc *b)
Definition: equalfuncs.c:2989
static bool _equalCreatePolicyStmt(const CreatePolicyStmt *a, const CreatePolicyStmt *b)
Definition: equalfuncs.c:2748
static bool _equalJsonObjectConstructor(const JsonObjectConstructor *a, const JsonObjectConstructor *b)
Definition: equalfuncs.c:987
bool equal(const void *a, const void *b)
Definition: equalfuncs.c:3564
static bool _equalRangeTblFunction(const RangeTblFunction *a, const RangeTblFunction *b)
Definition: equalfuncs.c:3171
static bool _equalStatsElem(const StatsElem *a, const StatsElem *b)
Definition: equalfuncs.c:3034
static bool _equalJsonReturning(const JsonReturning *a, const JsonReturning *b)
Definition: equalfuncs.c:912
static bool _equalJsonArrayQueryConstructor(const JsonArrayQueryConstructor *a, const JsonArrayQueryConstructor *b)
Definition: equalfuncs.c:1055
static bool _equalExplainStmt(const ExplainStmt *a, const ExplainStmt *b)
Definition: equalfuncs.c:2142
static bool _equalNamedArgExpr(const NamedArgExpr *a, const NamedArgExpr *b)
Definition: equalfuncs.c:371
static bool _equalCreateExtensionStmt(const CreateExtensionStmt *a, const CreateExtensionStmt *b)
Definition: equalfuncs.c:2285
static bool _equalPartitionCmd(const PartitionCmd *a, const PartitionCmd *b)
Definition: equalfuncs.c:3447
static bool _equalAlterDomainStmt(const AlterDomainStmt *a, const AlterDomainStmt *b)
Definition: equalfuncs.c:1521
static bool _equalGrantRoleStmt(const GrantRoleStmt *a, const GrantRoleStmt *b)
Definition: equalfuncs.c:1570
static bool _equalDropRoleStmt(const DropRoleStmt *a, const DropRoleStmt *b)
Definition: equalfuncs.c:2522
static bool _equalCreateSchemaStmt(const CreateSchemaStmt *a, const CreateSchemaStmt *b)
Definition: equalfuncs.c:2561
static bool _equalVariableSetStmt(const VariableSetStmt *a, const VariableSetStmt *b)
Definition: equalfuncs.c:2214
static bool _equalAlterOpFamilyStmt(const AlterOpFamilyStmt *a, const AlterOpFamilyStmt *b)
Definition: equalfuncs.c:2066
static bool _equalRelabelType(const RelabelType *a, const RelabelType *b)
Definition: equalfuncs.c:573
static bool _equalSQLValueFunction(const SQLValueFunction *a, const SQLValueFunction *b)
Definition: equalfuncs.c:728
static bool _equalCreateOpFamilyStmt(const CreateOpFamilyStmt *a, const CreateOpFamilyStmt *b)
Definition: equalfuncs.c:2057
static bool _equalIntoClause(const IntoClause *a, const IntoClause *b)
Definition: equalfuncs.c:205
static bool _equalRangeTblEntry(const RangeTblEntry *a, const RangeTblEntry *b)
Definition: equalfuncs.c:3127
static bool _equalJsonAggConstructor(const JsonAggConstructor *a, const JsonAggConstructor *b)
Definition: equalfuncs.c:1000
static bool _equalAccessPriv(const AccessPriv *a, const AccessPriv *b)
Definition: equalfuncs.c:1561
static bool _equalDropOwnedStmt(const DropOwnedStmt *a, const DropOwnedStmt *b)
Definition: equalfuncs.c:2623
static bool _equalConst(const Const *a, const Const *b)
Definition: equalfuncs.c:247
static bool _equalCreateForeignServerStmt(const CreateForeignServerStmt *a, const CreateForeignServerStmt *b)
Definition: equalfuncs.c:2335
static bool _equalCompositeTypeStmt(const CompositeTypeStmt *a, const CompositeTypeStmt *b)
Definition: equalfuncs.c:1959
#define COMPARE_STRING_FIELD(fldname)
Definition: equalfuncs.c:67
static bool _equalRowMarkClause(const RowMarkClause *a, const RowMarkClause *b)
Definition: equalfuncs.c:3251
static bool _equalCreateSubscriptionStmt(const CreateSubscriptionStmt *a, const CreateSubscriptionStmt *b)
Definition: equalfuncs.c:2712
static bool _equalMergeStmt(const MergeStmt *a, const MergeStmt *b)
Definition: equalfuncs.c:1414
static bool _equalReassignOwnedStmt(const ReassignOwnedStmt *a, const ReassignOwnedStmt *b)
Definition: equalfuncs.c:2632
static bool _equalAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *a, const AlterDefaultPrivilegesStmt *b)
Definition: equalfuncs.c:1583
static bool _equalDoStmt(const DoStmt *a, const DoStmt *b)
Definition: equalfuncs.c:1832
static bool _equalJsonItemCoercions(const JsonItemCoercions *a, const JsonItemCoercions *b)
Definition: equalfuncs.c:1170
static bool _equalCreateFdwStmt(const CreateFdwStmt *a, const CreateFdwStmt *b)
Definition: equalfuncs.c:2315
static bool _equalArrayExpr(const ArrayExpr *a, const ArrayExpr *b)
Definition: equalfuncs.c:666
static bool _equalCoerceViaIO(const CoerceViaIO *a, const CoerceViaIO *b)
Definition: equalfuncs.c:586
static bool _equalRawStmt(const RawStmt *a, const RawStmt *b)
Definition: equalfuncs.c:1365
static bool _equalCollateClause(const CollateClause *a, const CollateClause *b)
Definition: equalfuncs.c:2917
static bool _equalCreateRangeStmt(const CreateRangeStmt *a, const CreateRangeStmt *b)
Definition: equalfuncs.c:1977
static bool _equalParam(const Param *a, const Param *b)
Definition: equalfuncs.c:268
static bool _equalDropUserMappingStmt(const DropUserMappingStmt *a, const DropUserMappingStmt *b)
Definition: equalfuncs.c:2380
static bool _equalList(const List *a, const List *b)
Definition: equalfuncs.c:3461
static bool _equalJsonObjectAgg(const JsonObjectAgg *a, const JsonObjectAgg *b)
Definition: equalfuncs.c:1013
static bool _equalPartitionElem(const PartitionElem *a, const PartitionElem *b)
Definition: equalfuncs.c:3400
static bool _equalPlaceHolderInfo(const PlaceHolderInfo *a, const PlaceHolderInfo *b)
Definition: equalfuncs.c:1280
static bool _equalCaseTestExpr(const CaseTestExpr *a, const CaseTestExpr *b)
Definition: equalfuncs.c:656
static bool _equalGroupingFunc(const GroupingFunc *a, const GroupingFunc *b)
Definition: equalfuncs.c:307
static bool _equalRowExpr(const RowExpr *a, const RowExpr *b)
Definition: equalfuncs.c:679
static bool _equalAlterDatabaseSetStmt(const AlterDatabaseSetStmt *a, const AlterDatabaseSetStmt *b)
Definition: equalfuncs.c:2103
static bool _equalCTECycleClause(const CTECycleClause *a, const CTECycleClause *b)
Definition: equalfuncs.c:3306
static bool _equalScalarArrayOpExpr(const ScalarArrayOpExpr *a, const ScalarArrayOpExpr *b)
Definition: equalfuncs.c:460
static bool _equalLockingClause(const LockingClause *a, const LockingClause *b)
Definition: equalfuncs.c:3117
static bool _equalDiscardStmt(const DiscardStmt *a, const DiscardStmt *b)
Definition: equalfuncs.c:2233
#define COMPARE_NODE_FIELD(fldname)
Definition: equalfuncs.c:53
static bool _equalGrantStmt(const GrantStmt *a, const GrantStmt *b)
Definition: equalfuncs.c:1534
static bool _equalAlterTableStmt(const AlterTableStmt *a, const AlterTableStmt *b)
Definition: equalfuncs.c:1488
static bool _equalRangeTblRef(const RangeTblRef *a, const RangeTblRef *b)
Definition: equalfuncs.c:854
#define COMPARE_COERCIONFORM_FIELD(fldname)
Definition: equalfuncs.c:96
static bool _equalGroupingSet(const GroupingSet *a, const GroupingSet *b)
Definition: equalfuncs.c:3219
static bool _equalXmlExpr(const XmlExpr *a, const XmlExpr *b)
Definition: equalfuncs.c:739
static bool _equalAlterObjectDependsStmt(const AlterObjectDependsStmt *a, const AlterObjectDependsStmt *b)
Definition: equalfuncs.c:1855
static bool _equalArrayCoerceExpr(const ArrayCoerceExpr *a, const ArrayCoerceExpr *b)
Definition: equalfuncs.c:598
static bool _equalCoerceToDomain(const CoerceToDomain *a, const CoerceToDomain *b)
Definition: equalfuncs.c:776
static bool _equalJsonSerializeExpr(const JsonSerializeExpr *a, const JsonSerializeExpr *b)
Definition: equalfuncs.c:953
static bool _equalAlterFdwStmt(const AlterFdwStmt *a, const AlterFdwStmt *b)
Definition: equalfuncs.c:2325
static bool _equalReindexStmt(const ReindexStmt *a, const ReindexStmt *b)
Definition: equalfuncs.c:2550
static bool _equalInferClause(const InferClause *a, const InferClause *b)
Definition: equalfuncs.c:3272
static bool _equalRangeTableFuncCol(const RangeTableFuncCol *a, const RangeTableFuncCol *b)
Definition: equalfuncs.c:3003
static bool _equalA_Star(const A_Star *a, const A_Star *b)
Definition: equalfuncs.c:2837
static bool _equalCreatePublicationStmt(const CreatePublicationStmt *a, const CreatePublicationStmt *b)
Definition: equalfuncs.c:2687
static bool _equalJsonFuncExpr(const JsonFuncExpr *a, const JsonFuncExpr *b)
Definition: equalfuncs.c:1068
static bool _equalPartitionSpec(const PartitionSpec *a, const PartitionSpec *b)
Definition: equalfuncs.c:3412
static bool _equalSelectStmt(const SelectStmt *a, const SelectStmt *b)
Definition: equalfuncs.c:1426
static bool _equalAlterEnumStmt(const AlterEnumStmt *a, const AlterEnumStmt *b)
Definition: equalfuncs.c:1986
static bool _equalJsonCommon(const JsonCommon *a, const JsonCommon *b)
Definition: equalfuncs.c:1083
static bool _equalReplicaIdentityStmt(const ReplicaIdentityStmt *a, const ReplicaIdentityStmt *b)
Definition: equalfuncs.c:2173
static bool _equalMinMaxExpr(const MinMaxExpr *a, const MinMaxExpr *b)
Definition: equalfuncs.c:715
static bool _equalListenStmt(const ListenStmt *a, const ListenStmt *b)
Definition: equalfuncs.c:1931
static bool _equalSpecialJoinInfo(const SpecialJoinInfo *a, const SpecialJoinInfo *b)
Definition: equalfuncs.c:1247
static bool _equalSetOperationStmt(const SetOperationStmt *a, const SetOperationStmt *b)
Definition: equalfuncs.c:1453
static bool _equalPlaceHolderVar(const PlaceHolderVar *a, const PlaceHolderVar *b)
Definition: equalfuncs.c:1222
static bool _equalAlterStatsStmt(const AlterStatsStmt *a, const AlterStatsStmt *b)
Definition: equalfuncs.c:1787
static bool _equalTypeName(const TypeName *a, const TypeName *b)
Definition: equalfuncs.c:2892
static bool _equalResTarget(const ResTarget *a, const ResTarget *b)
Definition: equalfuncs.c:2871
static bool _equalConstraint(const Constraint *a, const Constraint *b)
Definition: equalfuncs.c:3068
static bool _equalInferenceElem(const InferenceElem *a, const InferenceElem *b)
Definition: equalfuncs.c:830
static bool _equalDefElem(const DefElem *a, const DefElem *b)
Definition: equalfuncs.c:3105
static bool _equalAlterPolicyStmt(const AlterPolicyStmt *a, const AlterPolicyStmt *b)
Definition: equalfuncs.c:2762
static bool _equalRowCompareExpr(const RowCompareExpr *a, const RowCompareExpr *b)
Definition: equalfuncs.c:691
#define COMPARE_POINTER_FIELD(fldname, sz)
Definition: equalfuncs.c:85
static bool _equalAlterOwnerStmt(const AlterOwnerStmt *a, const AlterOwnerStmt *b)
Definition: equalfuncs.c:1879
static bool _equalPrepareStmt(const PrepareStmt *a, const PrepareStmt *b)
Definition: equalfuncs.c:2596
static bool _equalDropTableSpaceStmt(const DropTableSpaceStmt *a, const DropTableSpaceStmt *b)
Definition: equalfuncs.c:2252
static bool _equalCollateExpr(const CollateExpr *a, const CollateExpr *b)
Definition: equalfuncs.c:623
static bool _equalVacuumRelation(const VacuumRelation *a, const VacuumRelation *b)
Definition: equalfuncs.c:2132
static bool _equalFieldStore(const FieldStore *a, const FieldStore *b)
Definition: equalfuncs.c:562
static bool _equalAggref(const Aggref *a, const Aggref *b)
Definition: equalfuncs.c:281
static bool _equalMergeAction(const MergeAction *a, const MergeAction *b)
Definition: equalfuncs.c:3356
static bool _equalVar(const Var *a, const Var *b)
Definition: equalfuncs.c:227
static bool _equalA_Indirection(const A_Indirection *a, const A_Indirection *b)
Definition: equalfuncs.c:2853
static bool _equalFetchStmt(const FetchStmt *a, const FetchStmt *b)
Definition: equalfuncs.c:1731
static bool _equalCreateTransformStmt(const CreateTransformStmt *a, const CreateTransformStmt *b)
Definition: equalfuncs.c:2415
static bool _equalCommentStmt(const CommentStmt *a, const CommentStmt *b)
Definition: equalfuncs.c:1710
static bool _equalConstraintsSetStmt(const ConstraintsSetStmt *a, const ConstraintsSetStmt *b)
Definition: equalfuncs.c:2541
static bool _equalInteger(const Integer *a, const Integer *b)
Definition: equalfuncs.c:3520
static bool _equalColumnDef(const ColumnDef *a, const ColumnDef *b)
Definition: equalfuncs.c:3043
static bool _equalJsonTableParent(const JsonTableParent *a, const JsonTableParent *b)
Definition: equalfuncs.c:181
static bool _equalPathKey(const PathKey *a, const PathKey *b)
Definition: equalfuncs.c:1191
static bool _equalAlterDatabaseRefreshCollStmt(const AlterDatabaseRefreshCollStmt *a, const AlterDatabaseRefreshCollStmt *b)
Definition: equalfuncs.c:2095
static bool _equalCreateCastStmt(const CreateCastStmt *a, const CreateCastStmt *b)
Definition: equalfuncs.c:2584
static bool _equalCreateAmStmt(const CreateAmStmt *a, const CreateAmStmt *b)
Definition: equalfuncs.c:2427
static bool _equalAlterTSConfigurationStmt(const AlterTSConfigurationStmt *a, const AlterTSConfigurationStmt *b)
Definition: equalfuncs.c:2650
static bool _equalAlterExtensionStmt(const AlterExtensionStmt *a, const AlterExtensionStmt *b)
Definition: equalfuncs.c:2295
static bool _equalJsonTableColumn(const JsonTableColumn *a, const JsonTableColumn *b)
Definition: equalfuncs.c:163
static bool _equalDeallocateStmt(const DeallocateStmt *a, const DeallocateStmt *b)
Definition: equalfuncs.c:2615
static bool _equalCommonTableExpr(const CommonTableExpr *a, const CommonTableExpr *b)
Definition: equalfuncs.c:3323
static bool _equalString(const String *a, const String *b)
Definition: equalfuncs.c:3544
static bool _equalA_Const(const A_Const *a, const A_Const *b)
Definition: equalfuncs.c:2804
static bool _equalAlterDatabaseStmt(const AlterDatabaseStmt *a, const AlterDatabaseStmt *b)
Definition: equalfuncs.c:2086
static bool _equalMergeWhenClause(const MergeWhenClause *a, const MergeWhenClause *b)
Definition: equalfuncs.c:3343
static bool _equalTypeCast(const TypeCast *a, const TypeCast *b)
Definition: equalfuncs.c:2907
static bool _equalExecuteStmt(const ExecuteStmt *a, const ExecuteStmt *b)
Definition: equalfuncs.c:2606
static bool _equalWithClause(const WithClause *a, const WithClause *b)
Definition: equalfuncs.c:3262
static bool _equalReturnStmt(const ReturnStmt *a, const ReturnStmt *b)
Definition: equalfuncs.c:1468
static bool _equalTableLikeClause(const TableLikeClause *a, const TableLikeClause *b)
Definition: equalfuncs.c:1664
static bool _equalRangeTableSample(const RangeTableSample *a, const RangeTableSample *b)
Definition: equalfuncs.c:2977
static bool _equalCopyStmt(const CopyStmt *a, const CopyStmt *b)
Definition: equalfuncs.c:1630
static bool _equalClosePortalStmt(const ClosePortalStmt *a, const ClosePortalStmt *b)
Definition: equalfuncs.c:1602
static bool _equalTableSampleClause(const TableSampleClause *a, const TableSampleClause *b)
Definition: equalfuncs.c:3185
static bool _equalJsonValueExpr(const JsonValueExpr *a, const JsonValueExpr *b)
Definition: equalfuncs.c:922
static bool _equalCreateRoleStmt(const CreateRoleStmt *a, const CreateRoleStmt *b)
Definition: equalfuncs.c:2492
static bool _equalObjectWithArgs(const ObjectWithArgs *a, const ObjectWithArgs *b)
Definition: equalfuncs.c:1550
static bool _equalAlias(const Alias *a, const Alias *b)
Definition: equalfuncs.c:105
static bool _equalCreateOpClassStmt(const CreateOpClassStmt *a, const CreateOpClassStmt *b)
Definition: equalfuncs.c:2031
static bool _equalA_ArrayExpr(const A_ArrayExpr *a, const A_ArrayExpr *b)
Definition: equalfuncs.c:2862
static bool _equalCreateForeignTableStmt(const CreateForeignTableStmt *a, const CreateForeignTableStmt *b)
Definition: equalfuncs.c:2390
static bool _equalAlterSubscriptionStmt(const AlterSubscriptionStmt *a, const AlterSubscriptionStmt *b)
Definition: equalfuncs.c:2724
static bool _equalAppendRelInfo(const AppendRelInfo *a, const AppendRelInfo *b)
Definition: equalfuncs.c:1265
static bool _equalMultiAssignRef(const MultiAssignRef *a, const MultiAssignRef *b)
Definition: equalfuncs.c:2882
static bool _equalSortGroupClause(const SortGroupClause *a, const SortGroupClause *b)
Definition: equalfuncs.c:3207
static bool _equalAlterRoleStmt(const AlterRoleStmt *a, const AlterRoleStmt *b)
Definition: equalfuncs.c:2502
static bool _equalNullTest(const NullTest *a, const NullTest *b)
Definition: equalfuncs.c:755
static bool _equalFuncExpr(const FuncExpr *a, const FuncExpr *b)
Definition: equalfuncs.c:355
static bool _equalCurrentOfExpr(const CurrentOfExpr *a, const CurrentOfExpr *b)
Definition: equalfuncs.c:811
static bool _equalCreateConversionStmt(const CreateConversionStmt *a, const CreateConversionStmt *b)
Definition: equalfuncs.c:2572
const ExtensibleNodeMethods * GetExtensibleNodeMethods(const char *extnodename, bool missing_ok)
Definition: extensible.c:125
Datum format_type(PG_FUNCTION_ARGS)
Definition: format_type.c:60
static struct @151 value
long val
Definition: informix.c:664
int b
Definition: isn.c:70
int a
Definition: isn.c:69
static JitProviderCallbacks provider
Definition: jit.c:43
Assert(fmt[strlen(fmt) - 1] !='\n')
#define nodeTag(nodeptr)
Definition: nodes.h:578
@ T_LockingClause
Definition: nodes.h:491
@ T_BitString
Definition: nodes.h:312
@ T_RangeTblEntry
Definition: nodes.h:479
@ T_FieldStore
Definition: nodes.h:175
@ T_AlterPublicationStmt
Definition: nodes.h:441
@ T_AlternativeSubPlan
Definition: nodes.h:173
@ T_PartitionCmd
Definition: nodes.h:507
@ T_CoalesceExpr
Definition: nodes.h:187
@ T_CreateSchemaStmt
Definition: nodes.h:387
@ T_PathKey
Definition: nodes.h:281
@ T_RuleStmt
Definition: nodes.h:360
@ T_ExtensibleNode
Definition: nodes.h:324
@ T_CreateRoleStmt
Definition: nodes.h:380
@ T_RangeVar
Definition: nodes.h:155
@ T_DoStmt
Definition: nodes.h:358
@ T_RangeTableFunc
Definition: nodes.h:471
@ T_Constraint
Definition: nodes.h:477
@ T_CreateStmt
Definition: nodes.h:349
@ T_RangeFunction
Definition: nodes.h:469
@ T_LoadStmt
Definition: nodes.h:366
@ T_JsonParseExpr
Definition: nodes.h:208
@ T_JsonSerializeExpr
Definition: nodes.h:210
@ T_CreateTrigStmt
Definition: nodes.h:378
@ T_XmlSerialize
Definition: nodes.h:493
@ T_DefElem
Definition: nodes.h:478
@ T_WithCheckOption
Definition: nodes.h:482
@ T_ReindexStmt
Definition: nodes.h:385
@ T_AlterEnumStmt
Definition: nodes.h:413
@ T_List
Definition: nodes.h:317
@ T_ColumnDef
Definition: nodes.h:474
@ T_ExecuteStmt
Definition: nodes.h:398
@ T_CTESearchClause
Definition: nodes.h:497
@ T_OnConflictExpr
Definition: nodes.h:203
@ T_SubLink
Definition: nodes.h:171
@ T_RangeTblRef
Definition: nodes.h:200
@ T_JsonTableColumn
Definition: nodes.h:520
@ T_InferenceElem
Definition: nodes.h:198
@ T_CreateFdwStmt
Definition: nodes.h:416
@ T_RenameStmt
Definition: nodes.h:359
@ T_CreateEventTrigStmt
Definition: nodes.h:431
@ T_SortGroupClause
Definition: nodes.h:483
@ T_CoerceToDomainValue
Definition: nodes.h:194
@ T_ObjectWithArgs
Definition: nodes.h:486
@ T_DiscardStmt
Definition: nodes.h:377
@ T_WindowFunc
Definition: nodes.h:162
@ T_ImportForeignSchemaStmt
Definition: nodes.h:427
@ T_FieldSelect
Definition: nodes.h:174
@ T_VacuumStmt
Definition: nodes.h:370
@ T_ArrayExpr
Definition: nodes.h:184
@ T_TableFunc
Definition: nodes.h:156
@ T_AlterOperatorStmt
Definition: nodes.h:406
@ T_CollateExpr
Definition: nodes.h:180
@ T_JsonBehavior
Definition: nodes.h:525
@ T_JsonArrayConstructor
Definition: nodes.h:512
@ T_ReturnStmt
Definition: nodes.h:337
@ T_CreateTableSpaceStmt
Definition: nodes.h:401
@ T_DropRoleStmt
Definition: nodes.h:382
@ T_AlterTableSpaceOptionsStmt
Definition: nodes.h:423
@ T_PartitionElem
Definition: nodes.h:503
@ T_BoolExpr
Definition: nodes.h:170
@ T_AlterCollationStmt
Definition: nodes.h:446
@ T_AccessPriv
Definition: nodes.h:487
@ T_OpExpr
Definition: nodes.h:166
@ T_CreateStatsStmt
Definition: nodes.h:445
@ T_CreateFunctionStmt
Definition: nodes.h:356
@ T_TypeName
Definition: nodes.h:473
@ T_AlterDatabaseStmt
Definition: nodes.h:388
@ T_CreateSubscriptionStmt
Definition: nodes.h:442
@ T_PublicationObjSpec
Definition: nodes.h:509
@ T_SpecialJoinInfo
Definition: nodes.h:287
@ T_AlterRoleStmt
Definition: nodes.h:381
@ T_JoinExpr
Definition: nodes.h:201
@ T_ScalarArrayOpExpr
Definition: nodes.h:169
@ T_CaseExpr
Definition: nodes.h:181
@ T_JsonArgument
Definition: nodes.h:523
@ T_RelabelType
Definition: nodes.h:176
@ T_CreatePublicationStmt
Definition: nodes.h:440
@ T_PlaceHolderInfo
Definition: nodes.h:290
@ T_JsonTableParent
Definition: nodes.h:215
@ T_PublicationTable
Definition: nodes.h:510
@ T_DeleteStmt
Definition: nodes.h:333
@ T_XmlExpr
Definition: nodes.h:190
@ T_CreateForeignTableStmt
Definition: nodes.h:426
@ T_GroupingSet
Definition: nodes.h:484
@ T_AlterObjectDependsStmt
Definition: nodes.h:403
@ T_CreateRangeStmt
Definition: nodes.h:412
@ T_CreateConversionStmt
Definition: nodes.h:392