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