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