pg_query 5.0.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +27 -0
- data/README.md +1 -1
- data/Rakefile +3 -4
- data/ext/pg_query/extconf.rb +14 -4
- data/ext/pg_query/include/pg_query.h +4 -3
- data/ext/pg_query/include/pg_query_enum_defs.c +424 -154
- data/ext/pg_query/include/pg_query_fingerprint_conds.c +68 -4
- data/ext/pg_query/include/pg_query_fingerprint_defs.c +2901 -1794
- data/ext/pg_query/include/pg_query_outfuncs_conds.c +51 -3
- data/ext/pg_query/include/pg_query_outfuncs_defs.c +211 -24
- data/ext/pg_query/include/pg_query_readfuncs_conds.c +17 -1
- data/ext/pg_query/include/pg_query_readfuncs_defs.c +272 -53
- data/ext/pg_query/include/postgres/access/amapi.h +299 -0
- data/ext/pg_query/include/postgres/access/attmap.h +54 -0
- data/ext/pg_query/include/postgres/access/attnum.h +64 -0
- data/ext/pg_query/include/postgres/access/brin_internal.h +116 -0
- data/ext/pg_query/include/postgres/access/brin_tuple.h +112 -0
- data/ext/pg_query/include/postgres/access/clog.h +62 -0
- data/ext/pg_query/include/postgres/access/commit_ts.h +73 -0
- data/ext/pg_query/include/postgres/access/detoast.h +82 -0
- data/ext/pg_query/include/postgres/access/genam.h +237 -0
- data/ext/pg_query/include/postgres/access/gin.h +91 -0
- data/ext/pg_query/include/postgres/access/htup.h +89 -0
- data/ext/pg_query/include/postgres/access/htup_details.h +811 -0
- data/ext/pg_query/include/postgres/access/itup.h +170 -0
- data/ext/pg_query/include/postgres/access/parallel.h +81 -0
- data/ext/pg_query/include/postgres/access/printtup.h +35 -0
- data/ext/pg_query/include/postgres/access/relation.h +28 -0
- data/ext/pg_query/include/postgres/access/relscan.h +191 -0
- data/ext/pg_query/include/postgres/access/rmgrlist.h +49 -0
- data/ext/pg_query/include/postgres/access/sdir.h +67 -0
- data/ext/pg_query/include/postgres/access/skey.h +151 -0
- data/ext/pg_query/include/postgres/access/slru.h +221 -0
- data/ext/pg_query/include/postgres/access/stratnum.h +85 -0
- data/ext/pg_query/include/postgres/access/sysattr.h +29 -0
- data/ext/pg_query/include/postgres/access/table.h +28 -0
- data/ext/pg_query/include/postgres/access/tableam.h +2109 -0
- data/ext/pg_query/include/postgres/access/tidstore.h +50 -0
- data/ext/pg_query/include/postgres/access/toast_compression.h +73 -0
- data/ext/pg_query/include/postgres/access/transam.h +375 -0
- data/ext/pg_query/include/postgres/access/tsmapi.h +82 -0
- data/ext/pg_query/include/postgres/access/tupconvert.h +54 -0
- data/ext/pg_query/include/postgres/access/tupdesc.h +154 -0
- data/ext/pg_query/include/postgres/access/tupmacs.h +207 -0
- data/ext/pg_query/include/postgres/access/twophase.h +65 -0
- data/ext/pg_query/include/postgres/access/xact.h +530 -0
- data/ext/pg_query/include/postgres/access/xlog.h +310 -0
- data/ext/pg_query/include/postgres/access/xlog_internal.h +405 -0
- data/ext/pg_query/include/postgres/access/xlogbackup.h +43 -0
- data/ext/pg_query/include/postgres/access/xlogdefs.h +82 -0
- data/ext/pg_query/include/postgres/access/xlogprefetcher.h +55 -0
- data/ext/pg_query/include/postgres/access/xlogreader.h +444 -0
- data/ext/pg_query/include/postgres/access/xlogrecord.h +248 -0
- data/ext/pg_query/include/postgres/access/xlogrecovery.h +158 -0
- data/ext/pg_query/include/postgres/archive/archive_module.h +67 -0
- data/ext/pg_query/include/postgres/c.h +1374 -0
- data/ext/pg_query/include/postgres/catalog/catalog.h +47 -0
- data/ext/pg_query/include/postgres/catalog/catversion.h +62 -0
- data/ext/pg_query/include/postgres/catalog/dependency.h +228 -0
- data/ext/pg_query/include/postgres/catalog/genbki.h +149 -0
- data/ext/pg_query/include/postgres/catalog/index.h +218 -0
- data/ext/pg_query/include/postgres/catalog/indexing.h +54 -0
- data/ext/pg_query/include/postgres/catalog/namespace.h +189 -0
- data/ext/pg_query/include/postgres/catalog/objectaccess.h +267 -0
- data/ext/pg_query/include/postgres/catalog/objectaddress.h +89 -0
- data/ext/pg_query/include/postgres/catalog/pg_aggregate.h +182 -0
- data/ext/pg_query/include/postgres/catalog/pg_aggregate_d.h +78 -0
- data/ext/pg_query/include/postgres/catalog/pg_am.h +66 -0
- data/ext/pg_query/include/postgres/catalog/pg_am_d.h +47 -0
- data/ext/pg_query/include/postgres/catalog/pg_attribute.h +240 -0
- data/ext/pg_query/include/postgres/catalog/pg_attribute_d.h +62 -0
- data/ext/pg_query/include/postgres/catalog/pg_authid.h +66 -0
- data/ext/pg_query/include/postgres/catalog/pg_authid_d.h +60 -0
- data/ext/pg_query/include/postgres/catalog/pg_class.h +235 -0
- data/ext/pg_query/include/postgres/catalog/pg_class_d.h +134 -0
- data/ext/pg_query/include/postgres/catalog/pg_collation.h +106 -0
- data/ext/pg_query/include/postgres/catalog/pg_collation_d.h +66 -0
- data/ext/pg_query/include/postgres/catalog/pg_constraint.h +278 -0
- data/ext/pg_query/include/postgres/catalog/pg_constraint_d.h +74 -0
- data/ext/pg_query/include/postgres/catalog/pg_control.h +260 -0
- data/ext/pg_query/include/postgres/catalog/pg_conversion.h +79 -0
- data/ext/pg_query/include/postgres/catalog/pg_conversion_d.h +38 -0
- data/ext/pg_query/include/postgres/catalog/pg_database.h +129 -0
- data/ext/pg_query/include/postgres/catalog/pg_database_d.h +53 -0
- data/ext/pg_query/include/postgres/catalog/pg_depend.h +77 -0
- data/ext/pg_query/include/postgres/catalog/pg_depend_d.h +36 -0
- data/ext/pg_query/include/postgres/catalog/pg_event_trigger.h +60 -0
- data/ext/pg_query/include/postgres/catalog/pg_event_trigger_d.h +36 -0
- data/ext/pg_query/include/postgres/catalog/pg_index.h +92 -0
- data/ext/pg_query/include/postgres/catalog/pg_index_d.h +59 -0
- data/ext/pg_query/include/postgres/catalog/pg_language.h +75 -0
- data/ext/pg_query/include/postgres/catalog/pg_language_d.h +41 -0
- data/ext/pg_query/include/postgres/catalog/pg_namespace.h +67 -0
- data/ext/pg_query/include/postgres/catalog/pg_namespace_d.h +36 -0
- data/ext/pg_query/include/postgres/catalog/pg_opclass.h +91 -0
- data/ext/pg_query/include/postgres/catalog/pg_opclass_d.h +51 -0
- data/ext/pg_query/include/postgres/catalog/pg_operator.h +124 -0
- data/ext/pg_query/include/postgres/catalog/pg_operator_d.h +142 -0
- data/ext/pg_query/include/postgres/catalog/pg_opfamily.h +67 -0
- data/ext/pg_query/include/postgres/catalog/pg_opfamily_d.h +51 -0
- data/ext/pg_query/include/postgres/catalog/pg_partitioned_table.h +76 -0
- data/ext/pg_query/include/postgres/catalog/pg_partitioned_table_d.h +36 -0
- data/ext/pg_query/include/postgres/catalog/pg_proc.h +223 -0
- data/ext/pg_query/include/postgres/catalog/pg_proc_d.h +101 -0
- data/ext/pg_query/include/postgres/catalog/pg_publication.h +161 -0
- data/ext/pg_query/include/postgres/catalog/pg_publication_d.h +38 -0
- data/ext/pg_query/include/postgres/catalog/pg_replication_origin.h +65 -0
- data/ext/pg_query/include/postgres/catalog/pg_replication_origin_d.h +33 -0
- data/ext/pg_query/include/postgres/catalog/pg_statistic.h +288 -0
- data/ext/pg_query/include/postgres/catalog/pg_statistic_d.h +199 -0
- data/ext/pg_query/include/postgres/catalog/pg_statistic_ext.h +91 -0
- data/ext/pg_query/include/postgres/catalog/pg_statistic_ext_d.h +45 -0
- data/ext/pg_query/include/postgres/catalog/pg_transform.h +51 -0
- data/ext/pg_query/include/postgres/catalog/pg_transform_d.h +34 -0
- data/ext/pg_query/include/postgres/catalog/pg_trigger.h +153 -0
- data/ext/pg_query/include/postgres/catalog/pg_trigger_d.h +109 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_config.h +56 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_config_d.h +34 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_dict.h +62 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_dict_d.h +35 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_parser.h +63 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_parser_d.h +37 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_template.h +54 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_template_d.h +34 -0
- data/ext/pg_query/include/postgres/catalog/pg_type.h +407 -0
- data/ext/pg_query/include/postgres/catalog/pg_type_d.h +324 -0
- data/ext/pg_query/include/postgres/catalog/storage.h +50 -0
- data/ext/pg_query/include/postgres/catalog/syscache_ids.h +104 -0
- data/ext/pg_query/include/postgres/commands/async.h +49 -0
- data/ext/pg_query/include/postgres/commands/dbcommands.h +37 -0
- data/ext/pg_query/include/postgres/commands/defrem.h +161 -0
- data/ext/pg_query/include/postgres/commands/event_trigger.h +91 -0
- data/ext/pg_query/include/postgres/commands/explain.h +145 -0
- data/ext/pg_query/include/postgres/commands/prepare.h +61 -0
- data/ext/pg_query/include/postgres/commands/tablespace.h +69 -0
- data/ext/pg_query/include/postgres/commands/trigger.h +288 -0
- data/ext/pg_query/include/postgres/commands/vacuum.h +388 -0
- data/ext/pg_query/include/postgres/common/cryptohash.h +39 -0
- data/ext/pg_query/include/postgres/common/file_perm.h +56 -0
- data/ext/pg_query/include/postgres/common/file_utils.h +65 -0
- data/ext/pg_query/include/postgres/common/hashfn.h +119 -0
- data/ext/pg_query/include/postgres/common/hashfn_unstable.h +453 -0
- data/ext/pg_query/include/postgres/common/int.h +512 -0
- data/ext/pg_query/include/postgres/common/keywords.h +29 -0
- data/ext/pg_query/include/postgres/common/kwlookup.h +44 -0
- data/ext/pg_query/include/postgres/common/pg_prng.h +62 -0
- data/ext/pg_query/include/postgres/common/relpath.h +97 -0
- data/ext/pg_query/include/postgres/common/scram-common.h +70 -0
- data/ext/pg_query/include/postgres/common/sha2.h +32 -0
- data/ext/pg_query/include/postgres/common/string.h +44 -0
- data/ext/pg_query/include/postgres/common/unicode_east_asian_fw_table.h +124 -0
- data/ext/pg_query/include/postgres/copyfuncs.funcs.c +5261 -0
- data/ext/pg_query/include/postgres/copyfuncs.switch.c +989 -0
- data/ext/pg_query/include/postgres/datatype/timestamp.h +269 -0
- data/ext/pg_query/include/postgres/equalfuncs.funcs.c +3310 -0
- data/ext/pg_query/include/postgres/equalfuncs.switch.c +836 -0
- data/ext/pg_query/include/postgres/executor/execdesc.h +70 -0
- data/ext/pg_query/include/postgres/executor/executor.h +681 -0
- data/ext/pg_query/include/postgres/executor/functions.h +56 -0
- data/ext/pg_query/include/postgres/executor/instrument.h +120 -0
- data/ext/pg_query/include/postgres/executor/spi.h +207 -0
- data/ext/pg_query/include/postgres/executor/tablefunc.h +67 -0
- data/ext/pg_query/include/postgres/executor/tuptable.h +523 -0
- data/ext/pg_query/include/postgres/fmgr.h +800 -0
- data/ext/pg_query/include/postgres/foreign/fdwapi.h +294 -0
- data/ext/pg_query/include/postgres/funcapi.h +360 -0
- data/ext/pg_query/include/postgres/gram.h +1168 -0
- data/ext/pg_query/include/postgres/gramparse.h +75 -0
- data/ext/pg_query/include/postgres/jit/jit.h +106 -0
- data/ext/pg_query/include/postgres/kwlist_d.h +1164 -0
- data/ext/pg_query/include/postgres/lib/dshash.h +130 -0
- data/ext/pg_query/include/postgres/lib/ilist.h +1159 -0
- data/ext/pg_query/include/postgres/lib/pairingheap.h +102 -0
- data/ext/pg_query/include/postgres/lib/simplehash.h +1206 -0
- data/ext/pg_query/include/postgres/lib/sort_template.h +445 -0
- data/ext/pg_query/include/postgres/lib/stringinfo.h +243 -0
- data/ext/pg_query/include/postgres/libpq/auth.h +37 -0
- data/ext/pg_query/include/postgres/libpq/crypt.h +47 -0
- data/ext/pg_query/include/postgres/libpq/hba.h +186 -0
- data/ext/pg_query/include/postgres/libpq/libpq-be.h +358 -0
- data/ext/pg_query/include/postgres/libpq/libpq.h +143 -0
- data/ext/pg_query/include/postgres/libpq/pqcomm.h +169 -0
- data/ext/pg_query/include/postgres/libpq/pqformat.h +209 -0
- data/ext/pg_query/include/postgres/libpq/pqsignal.h +54 -0
- data/ext/pg_query/include/postgres/libpq/protocol.h +89 -0
- data/ext/pg_query/include/postgres/libpq/sasl.h +136 -0
- data/ext/pg_query/include/postgres/libpq/scram.h +37 -0
- data/ext/pg_query/include/postgres/mb/pg_wchar.h +792 -0
- data/ext/pg_query/include/postgres/mb/stringinfo_mb.h +24 -0
- data/ext/pg_query/include/postgres/miscadmin.h +519 -0
- data/ext/pg_query/include/postgres/nodes/bitmapset.h +140 -0
- data/ext/pg_query/include/postgres/nodes/execnodes.h +2852 -0
- data/ext/pg_query/include/postgres/nodes/extensible.h +164 -0
- data/ext/pg_query/include/postgres/nodes/lockoptions.h +61 -0
- data/ext/pg_query/include/postgres/nodes/makefuncs.h +127 -0
- data/ext/pg_query/include/postgres/nodes/memnodes.h +152 -0
- data/ext/pg_query/include/postgres/nodes/miscnodes.h +56 -0
- data/ext/pg_query/include/postgres/nodes/nodeFuncs.h +222 -0
- data/ext/pg_query/include/postgres/nodes/nodes.h +435 -0
- data/ext/pg_query/include/postgres/nodes/nodetags.h +491 -0
- data/ext/pg_query/include/postgres/nodes/params.h +170 -0
- data/ext/pg_query/include/postgres/nodes/parsenodes.h +4233 -0
- data/ext/pg_query/include/postgres/nodes/pathnodes.h +3435 -0
- data/ext/pg_query/include/postgres/nodes/pg_list.h +686 -0
- data/ext/pg_query/include/postgres/nodes/plannodes.h +1593 -0
- data/ext/pg_query/include/postgres/nodes/primnodes.h +2335 -0
- data/ext/pg_query/include/postgres/nodes/print.h +34 -0
- data/ext/pg_query/include/postgres/nodes/queryjumble.h +86 -0
- data/ext/pg_query/include/postgres/nodes/replnodes.h +132 -0
- data/ext/pg_query/include/postgres/nodes/supportnodes.h +346 -0
- data/ext/pg_query/include/postgres/nodes/tidbitmap.h +75 -0
- data/ext/pg_query/include/postgres/nodes/value.h +90 -0
- data/ext/pg_query/include/postgres/optimizer/cost.h +216 -0
- data/ext/pg_query/include/postgres/optimizer/geqo.h +90 -0
- data/ext/pg_query/include/postgres/optimizer/geqo_gene.h +45 -0
- data/ext/pg_query/include/postgres/optimizer/optimizer.h +205 -0
- data/ext/pg_query/include/postgres/optimizer/paths.h +271 -0
- data/ext/pg_query/include/postgres/optimizer/planmain.h +123 -0
- data/ext/pg_query/include/postgres/parser/analyze.h +66 -0
- data/ext/pg_query/include/postgres/parser/kwlist.h +518 -0
- data/ext/pg_query/include/postgres/parser/parse_agg.h +65 -0
- data/ext/pg_query/include/postgres/parser/parse_coerce.h +102 -0
- data/ext/pg_query/include/postgres/parser/parse_expr.h +25 -0
- data/ext/pg_query/include/postgres/parser/parse_func.h +74 -0
- data/ext/pg_query/include/postgres/parser/parse_node.h +358 -0
- data/ext/pg_query/include/postgres/parser/parse_oper.h +68 -0
- data/ext/pg_query/include/postgres/parser/parse_relation.h +129 -0
- data/ext/pg_query/include/postgres/parser/parse_type.h +61 -0
- data/ext/pg_query/include/postgres/parser/parser.h +68 -0
- data/ext/pg_query/include/postgres/parser/parsetree.h +61 -0
- data/ext/pg_query/include/postgres/parser/scanner.h +152 -0
- data/ext/pg_query/include/postgres/parser/scansup.h +27 -0
- data/ext/pg_query/include/postgres/partitioning/partdefs.h +26 -0
- data/ext/pg_query/include/postgres/pg_config.h +977 -0
- data/ext/pg_query/include/postgres/pg_config_manual.h +385 -0
- data/ext/pg_query/include/postgres/pg_config_os.h +8 -0
- data/ext/pg_query/include/postgres/pg_getopt.h +56 -0
- data/ext/pg_query/include/postgres/pg_trace.h +17 -0
- data/ext/pg_query/include/postgres/pgstat.h +780 -0
- data/ext/pg_query/include/postgres/pgtime.h +94 -0
- data/ext/pg_query/include/postgres/pl_gram.h +385 -0
- data/ext/pg_query/include/postgres/pl_reserved_kwlist.h +52 -0
- data/ext/pg_query/include/postgres/pl_reserved_kwlist_d.h +114 -0
- data/ext/pg_query/include/postgres/pl_unreserved_kwlist.h +112 -0
- data/ext/pg_query/include/postgres/pl_unreserved_kwlist_d.h +246 -0
- data/ext/pg_query/include/postgres/plerrcodes.h +998 -0
- data/ext/pg_query/include/postgres/plpgsql.h +1342 -0
- data/ext/pg_query/include/postgres/port/atomics/arch-arm.h +32 -0
- data/ext/pg_query/include/postgres/port/atomics/arch-hppa.h +17 -0
- data/ext/pg_query/include/postgres/port/atomics/arch-ppc.h +256 -0
- data/ext/pg_query/include/postgres/port/atomics/arch-x86.h +254 -0
- data/ext/pg_query/include/postgres/port/atomics/fallback.h +170 -0
- data/ext/pg_query/include/postgres/port/atomics/generic-gcc.h +323 -0
- data/ext/pg_query/include/postgres/port/atomics/generic-msvc.h +119 -0
- data/ext/pg_query/include/postgres/port/atomics/generic-sunpro.h +121 -0
- data/ext/pg_query/include/postgres/port/atomics/generic.h +437 -0
- data/ext/pg_query/include/postgres/port/atomics.h +606 -0
- data/ext/pg_query/include/postgres/port/pg_bitutils.h +421 -0
- data/ext/pg_query/include/postgres/port/pg_bswap.h +161 -0
- data/ext/pg_query/include/postgres/port/pg_crc32c.h +110 -0
- data/ext/pg_query/include/postgres/port/pg_iovec.h +117 -0
- data/ext/pg_query/include/postgres/port/simd.h +422 -0
- data/ext/pg_query/include/postgres/port/win32/arpa/inet.h +3 -0
- data/ext/pg_query/include/postgres/port/win32/dlfcn.h +1 -0
- data/ext/pg_query/include/postgres/port/win32/grp.h +1 -0
- data/ext/pg_query/include/postgres/port/win32/netdb.h +7 -0
- data/ext/pg_query/include/postgres/port/win32/netinet/in.h +3 -0
- data/ext/pg_query/include/postgres/port/win32/netinet/tcp.h +7 -0
- data/ext/pg_query/include/postgres/port/win32/pwd.h +3 -0
- data/ext/pg_query/include/postgres/port/win32/sys/resource.h +20 -0
- data/ext/pg_query/include/postgres/port/win32/sys/select.h +3 -0
- data/ext/pg_query/include/postgres/port/win32/sys/socket.h +34 -0
- data/ext/pg_query/include/postgres/port/win32/sys/un.h +17 -0
- data/ext/pg_query/include/postgres/port/win32/sys/wait.h +3 -0
- data/ext/pg_query/include/postgres/port/win32.h +59 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/dirent.h +34 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/sys/file.h +1 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/sys/param.h +1 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/sys/time.h +1 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/unistd.h +9 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/utime.h +3 -0
- data/ext/pg_query/include/postgres/port/win32_port.h +584 -0
- data/ext/pg_query/include/postgres/port.h +524 -0
- data/ext/pg_query/include/postgres/portability/instr_time.h +197 -0
- data/ext/pg_query/include/postgres/postgres.h +579 -0
- data/ext/pg_query/include/postgres/postmaster/autovacuum.h +69 -0
- data/ext/pg_query/include/postgres/postmaster/bgworker.h +164 -0
- data/ext/pg_query/include/postgres/postmaster/bgworker_internals.h +60 -0
- data/ext/pg_query/include/postgres/postmaster/bgwriter.h +45 -0
- data/ext/pg_query/include/postgres/postmaster/interrupt.h +32 -0
- data/ext/pg_query/include/postgres/postmaster/pgarch.h +36 -0
- data/ext/pg_query/include/postgres/postmaster/postmaster.h +101 -0
- data/ext/pg_query/include/postgres/postmaster/startup.h +41 -0
- data/ext/pg_query/include/postgres/postmaster/syslogger.h +101 -0
- data/ext/pg_query/include/postgres/postmaster/walsummarizer.h +35 -0
- data/ext/pg_query/include/postgres/postmaster/walwriter.h +23 -0
- data/ext/pg_query/include/postgres/regex/regex.h +272 -0
- data/ext/pg_query/include/postgres/replication/logicallauncher.h +34 -0
- data/ext/pg_query/include/postgres/replication/logicalproto.h +274 -0
- data/ext/pg_query/include/postgres/replication/logicalworker.h +33 -0
- data/ext/pg_query/include/postgres/replication/origin.h +73 -0
- data/ext/pg_query/include/postgres/replication/reorderbuffer.h +743 -0
- data/ext/pg_query/include/postgres/replication/slot.h +285 -0
- data/ext/pg_query/include/postgres/replication/slotsync.h +38 -0
- data/ext/pg_query/include/postgres/replication/syncrep.h +109 -0
- data/ext/pg_query/include/postgres/replication/walreceiver.h +504 -0
- data/ext/pg_query/include/postgres/replication/walsender.h +76 -0
- data/ext/pg_query/include/postgres/rewrite/prs2lock.h +46 -0
- data/ext/pg_query/include/postgres/rewrite/rewriteHandler.h +41 -0
- data/ext/pg_query/include/postgres/rewrite/rewriteManip.h +96 -0
- data/ext/pg_query/include/postgres/rewrite/rewriteSupport.h +26 -0
- data/ext/pg_query/include/postgres/storage/block.h +108 -0
- data/ext/pg_query/include/postgres/storage/buf.h +46 -0
- data/ext/pg_query/include/postgres/storage/bufmgr.h +411 -0
- data/ext/pg_query/include/postgres/storage/bufpage.h +510 -0
- data/ext/pg_query/include/postgres/storage/condition_variable.h +73 -0
- data/ext/pg_query/include/postgres/storage/dsm.h +61 -0
- data/ext/pg_query/include/postgres/storage/dsm_impl.h +79 -0
- data/ext/pg_query/include/postgres/storage/fd.h +219 -0
- data/ext/pg_query/include/postgres/storage/fileset.h +40 -0
- data/ext/pg_query/include/postgres/storage/ipc.h +87 -0
- data/ext/pg_query/include/postgres/storage/item.h +19 -0
- data/ext/pg_query/include/postgres/storage/itemid.h +184 -0
- data/ext/pg_query/include/postgres/storage/itemptr.h +245 -0
- data/ext/pg_query/include/postgres/storage/large_object.h +100 -0
- data/ext/pg_query/include/postgres/storage/latch.h +196 -0
- data/ext/pg_query/include/postgres/storage/lmgr.h +126 -0
- data/ext/pg_query/include/postgres/storage/lock.h +624 -0
- data/ext/pg_query/include/postgres/storage/lockdefs.h +59 -0
- data/ext/pg_query/include/postgres/storage/lwlock.h +228 -0
- data/ext/pg_query/include/postgres/storage/lwlocknames.h +47 -0
- data/ext/pg_query/include/postgres/storage/off.h +57 -0
- data/ext/pg_query/include/postgres/storage/pg_sema.h +61 -0
- data/ext/pg_query/include/postgres/storage/pg_shmem.h +93 -0
- data/ext/pg_query/include/postgres/storage/pmsignal.h +105 -0
- data/ext/pg_query/include/postgres/storage/predicate.h +83 -0
- data/ext/pg_query/include/postgres/storage/proc.h +491 -0
- data/ext/pg_query/include/postgres/storage/procarray.h +103 -0
- data/ext/pg_query/include/postgres/storage/proclist_types.h +53 -0
- data/ext/pg_query/include/postgres/storage/procnumber.h +43 -0
- data/ext/pg_query/include/postgres/storage/procsignal.h +75 -0
- data/ext/pg_query/include/postgres/storage/read_stream.h +65 -0
- data/ext/pg_query/include/postgres/storage/relfilelocator.h +100 -0
- data/ext/pg_query/include/postgres/storage/s_lock.h +847 -0
- data/ext/pg_query/include/postgres/storage/sharedfileset.h +37 -0
- data/ext/pg_query/include/postgres/storage/shm_mq.h +86 -0
- data/ext/pg_query/include/postgres/storage/shm_toc.h +58 -0
- data/ext/pg_query/include/postgres/storage/shmem.h +59 -0
- data/ext/pg_query/include/postgres/storage/sinval.h +153 -0
- data/ext/pg_query/include/postgres/storage/smgr.h +127 -0
- data/ext/pg_query/include/postgres/storage/spin.h +77 -0
- data/ext/pg_query/include/postgres/storage/standby.h +109 -0
- data/ext/pg_query/include/postgres/storage/standbydefs.h +74 -0
- data/ext/pg_query/include/postgres/storage/sync.h +66 -0
- data/ext/pg_query/include/postgres/tcop/cmdtag.h +62 -0
- data/ext/pg_query/include/postgres/tcop/cmdtaglist.h +219 -0
- data/ext/pg_query/include/postgres/tcop/deparse_utility.h +108 -0
- data/ext/pg_query/include/postgres/tcop/dest.h +148 -0
- data/ext/pg_query/include/postgres/tcop/fastpath.h +20 -0
- data/ext/pg_query/include/postgres/tcop/pquery.h +51 -0
- data/ext/pg_query/include/postgres/tcop/tcopprot.h +98 -0
- data/ext/pg_query/include/postgres/tcop/utility.h +112 -0
- data/ext/pg_query/include/postgres/tsearch/ts_cache.h +96 -0
- data/ext/pg_query/include/postgres/utils/acl.h +290 -0
- data/ext/pg_query/include/postgres/utils/aclchk_internal.h +45 -0
- data/ext/pg_query/include/postgres/utils/array.h +481 -0
- data/ext/pg_query/include/postgres/utils/ascii.h +84 -0
- data/ext/pg_query/include/postgres/utils/backend_progress.h +46 -0
- data/ext/pg_query/include/postgres/utils/backend_status.h +340 -0
- data/ext/pg_query/include/postgres/utils/builtins.h +139 -0
- data/ext/pg_query/include/postgres/utils/bytea.h +28 -0
- data/ext/pg_query/include/postgres/utils/catcache.h +230 -0
- data/ext/pg_query/include/postgres/utils/date.h +118 -0
- data/ext/pg_query/include/postgres/utils/datetime.h +367 -0
- data/ext/pg_query/include/postgres/utils/datum.h +76 -0
- data/ext/pg_query/include/postgres/utils/dsa.h +166 -0
- data/ext/pg_query/include/postgres/utils/elog.h +540 -0
- data/ext/pg_query/include/postgres/utils/errcodes.h +352 -0
- data/ext/pg_query/include/postgres/utils/expandeddatum.h +170 -0
- data/ext/pg_query/include/postgres/utils/expandedrecord.h +241 -0
- data/ext/pg_query/include/postgres/utils/float.h +357 -0
- data/ext/pg_query/include/postgres/utils/fmgroids.h +3347 -0
- data/ext/pg_query/include/postgres/utils/fmgrprotos.h +2904 -0
- data/ext/pg_query/include/postgres/utils/fmgrtab.h +49 -0
- data/ext/pg_query/include/postgres/utils/guc.h +456 -0
- data/ext/pg_query/include/postgres/utils/guc_hooks.h +184 -0
- data/ext/pg_query/include/postgres/utils/guc_tables.h +323 -0
- data/ext/pg_query/include/postgres/utils/hsearch.h +153 -0
- data/ext/pg_query/include/postgres/utils/injection_point.h +44 -0
- data/ext/pg_query/include/postgres/utils/inval.h +68 -0
- data/ext/pg_query/include/postgres/utils/logtape.h +77 -0
- data/ext/pg_query/include/postgres/utils/lsyscache.h +215 -0
- data/ext/pg_query/include/postgres/utils/memdebug.h +82 -0
- data/ext/pg_query/include/postgres/utils/memutils.h +193 -0
- data/ext/pg_query/include/postgres/utils/memutils_internal.h +176 -0
- data/ext/pg_query/include/postgres/utils/memutils_memorychunk.h +253 -0
- data/ext/pg_query/include/postgres/utils/numeric.h +110 -0
- data/ext/pg_query/include/postgres/utils/palloc.h +151 -0
- data/ext/pg_query/include/postgres/utils/partcache.h +103 -0
- data/ext/pg_query/include/postgres/utils/pg_locale.h +136 -0
- data/ext/pg_query/include/postgres/utils/pgstat_internal.h +808 -0
- data/ext/pg_query/include/postgres/utils/plancache.h +238 -0
- data/ext/pg_query/include/postgres/utils/portal.h +252 -0
- data/ext/pg_query/include/postgres/utils/queryenvironment.h +74 -0
- data/ext/pg_query/include/postgres/utils/regproc.h +39 -0
- data/ext/pg_query/include/postgres/utils/rel.h +711 -0
- data/ext/pg_query/include/postgres/utils/relcache.h +155 -0
- data/ext/pg_query/include/postgres/utils/reltrigger.h +81 -0
- data/ext/pg_query/include/postgres/utils/resowner.h +167 -0
- data/ext/pg_query/include/postgres/utils/ruleutils.h +52 -0
- data/ext/pg_query/include/postgres/utils/sharedtuplestore.h +61 -0
- data/ext/pg_query/include/postgres/utils/snapmgr.h +130 -0
- data/ext/pg_query/include/postgres/utils/snapshot.h +219 -0
- data/ext/pg_query/include/postgres/utils/sortsupport.h +391 -0
- data/ext/pg_query/include/postgres/utils/syscache.h +131 -0
- data/ext/pg_query/include/postgres/utils/timeout.h +96 -0
- data/ext/pg_query/include/postgres/utils/timestamp.h +147 -0
- data/ext/pg_query/include/postgres/utils/tuplesort.h +472 -0
- data/ext/pg_query/include/postgres/utils/tuplestore.h +88 -0
- data/ext/pg_query/include/postgres/utils/typcache.h +210 -0
- data/ext/pg_query/include/postgres/utils/varlena.h +53 -0
- data/ext/pg_query/include/postgres/utils/wait_event.h +108 -0
- data/ext/pg_query/include/postgres/utils/wait_event_types.h +218 -0
- data/ext/pg_query/include/postgres/utils/xml.h +94 -0
- data/ext/pg_query/include/postgres/varatt.h +358 -0
- data/ext/pg_query/include/protobuf/pg_query.pb-c.h +1546 -792
- data/ext/pg_query/include/protobuf/pg_query.pb.h +58365 -46595
- data/ext/pg_query/pg_query.c +9 -0
- data/ext/pg_query/pg_query.pb-c.c +6598 -3739
- data/ext/pg_query/pg_query_fingerprint.c +4 -5
- data/ext/pg_query/pg_query_normalize.c +42 -1
- data/ext/pg_query/pg_query_outfuncs_json.c +9 -1
- data/ext/pg_query/pg_query_outfuncs_protobuf.c +1 -0
- data/ext/pg_query/pg_query_parse.c +1 -1
- data/ext/pg_query/pg_query_parse_plpgsql.c +18 -17
- data/ext/pg_query/pg_query_readfuncs_protobuf.c +3 -2
- data/ext/pg_query/pg_query_ruby.c +5 -0
- data/ext/pg_query/pg_query_ruby_freebsd.sym +0 -1
- data/ext/pg_query/pg_query_scan.c +1 -1
- data/ext/pg_query/pg_query_split.c +1 -1
- data/ext/pg_query/postgres_deparse.c +409 -21
- data/ext/pg_query/src_backend_catalog_namespace.c +241 -66
- data/ext/pg_query/src_backend_catalog_pg_proc.c +1 -3
- data/ext/pg_query/src_backend_commands_define.c +2 -3
- data/ext/pg_query/src_backend_nodes_bitmapset.c +137 -94
- data/ext/pg_query/src_backend_nodes_copyfuncs.c +1 -1
- data/ext/pg_query/src_backend_nodes_equalfuncs.c +1 -1
- data/ext/pg_query/src_backend_nodes_extensible.c +1 -1
- data/ext/pg_query/src_backend_nodes_list.c +3 -7
- data/ext/pg_query/src_backend_nodes_makefuncs.c +59 -20
- data/ext/pg_query/src_backend_nodes_nodeFuncs.c +109 -2
- data/ext/pg_query/src_backend_nodes_value.c +1 -1
- data/ext/pg_query/src_backend_parser_gram.c +34490 -32135
- data/ext/pg_query/src_backend_parser_parser.c +8 -8
- data/ext/pg_query/src_backend_parser_scan.c +5637 -3028
- data/ext/pg_query/src_backend_parser_scansup.c +2 -1
- data/ext/pg_query/src_backend_storage_ipc_ipc.c +1 -1
- data/ext/pg_query/src_backend_tcop_postgres.c +34 -10
- data/ext/pg_query/src_backend_utils_activity_pgstat_database.c +2 -2
- data/ext/pg_query/src_backend_utils_adt_datum.c +8 -6
- data/ext/pg_query/src_backend_utils_adt_expandeddatum.c +1 -1
- data/ext/pg_query/src_backend_utils_adt_format_type.c +1 -1
- data/ext/pg_query/src_backend_utils_adt_numutils.c +4 -5
- data/ext/pg_query/src_backend_utils_adt_ruleutils.c +101 -28
- data/ext/pg_query/src_backend_utils_error_assert.c +1 -1
- data/ext/pg_query/src_backend_utils_error_elog.c +60 -190
- data/ext/pg_query/src_backend_utils_fmgr_fmgr.c +4 -2
- data/ext/pg_query/src_backend_utils_init_globals.c +16 -4
- data/ext/pg_query/src_backend_utils_mb_mbutils.c +19 -81
- data/ext/pg_query/src_backend_utils_misc_guc_tables.c +16 -8
- data/ext/pg_query/src_backend_utils_mmgr_alignedalloc.c +8 -5
- data/ext/pg_query/src_backend_utils_mmgr_aset.c +308 -238
- data/ext/pg_query/src_backend_utils_mmgr_bump.c +728 -0
- data/ext/pg_query/src_backend_utils_mmgr_generation.c +273 -197
- data/ext/pg_query/src_backend_utils_mmgr_mcxt.c +270 -215
- data/ext/pg_query/src_backend_utils_mmgr_slab.c +154 -96
- data/ext/pg_query/src_common_encnames.c +43 -44
- data/ext/pg_query/src_common_hashfn.c +1 -1
- data/ext/pg_query/src_common_keywords.c +1 -1
- data/ext/pg_query/src_common_kwlist_d.h +511 -466
- data/ext/pg_query/src_common_kwlookup.c +1 -1
- data/ext/pg_query/src_common_psprintf.c +3 -3
- data/ext/pg_query/src_common_stringinfo.c +18 -1
- data/ext/pg_query/src_common_wchar.c +45 -108
- data/ext/pg_query/src_pl_plpgsql_src_pl_comp.c +99 -5
- data/ext/pg_query/src_pl_plpgsql_src_pl_funcs.c +1 -1
- data/ext/pg_query/src_pl_plpgsql_src_pl_gram.c +242 -143
- data/ext/pg_query/src_pl_plpgsql_src_pl_handler.c +1 -1
- data/ext/pg_query/src_pl_plpgsql_src_pl_reserved_kwlist_d.h +1 -1
- data/ext/pg_query/src_pl_plpgsql_src_pl_scanner.c +19 -1
- data/ext/pg_query/src_pl_plpgsql_src_pl_unreserved_kwlist_d.h +1 -1
- data/ext/pg_query/src_port_pg_bitutils.c +251 -32
- data/ext/pg_query/src_port_pgstrcasecmp.c +29 -1
- data/ext/pg_query/src_port_snprintf.c +4 -4
- data/ext/pg_query/src_port_strerror.c +1 -3
- data/ext/pg_query/src_port_strlcpy.c +79 -0
- data/lib/pg_query/fingerprint.rb +2 -3
- data/lib/pg_query/node.rb +16 -11
- data/lib/pg_query/param_refs.rb +1 -1
- data/lib/pg_query/parse.rb +1 -1
- data/lib/pg_query/pg_query_pb.rb +26 -3
- data/lib/pg_query/treewalker.rb +52 -12
- data/lib/pg_query/truncate.rb +1 -1
- data/lib/pg_query/version.rb +1 -1
- metadata +444 -400
- data/ext/pg_query/guc-file.c +0 -0
- data/ext/pg_query/include/access/amapi.h +0 -292
- data/ext/pg_query/include/access/attmap.h +0 -54
- data/ext/pg_query/include/access/attnum.h +0 -64
- data/ext/pg_query/include/access/clog.h +0 -63
- data/ext/pg_query/include/access/commit_ts.h +0 -74
- data/ext/pg_query/include/access/detoast.h +0 -82
- data/ext/pg_query/include/access/genam.h +0 -233
- data/ext/pg_query/include/access/gin.h +0 -91
- data/ext/pg_query/include/access/htup.h +0 -89
- data/ext/pg_query/include/access/htup_details.h +0 -811
- data/ext/pg_query/include/access/itup.h +0 -170
- data/ext/pg_query/include/access/parallel.h +0 -82
- data/ext/pg_query/include/access/printtup.h +0 -35
- data/ext/pg_query/include/access/relation.h +0 -28
- data/ext/pg_query/include/access/relscan.h +0 -191
- data/ext/pg_query/include/access/rmgrlist.h +0 -49
- data/ext/pg_query/include/access/sdir.h +0 -67
- data/ext/pg_query/include/access/skey.h +0 -151
- data/ext/pg_query/include/access/stratnum.h +0 -85
- data/ext/pg_query/include/access/sysattr.h +0 -29
- data/ext/pg_query/include/access/table.h +0 -28
- data/ext/pg_query/include/access/tableam.h +0 -2100
- data/ext/pg_query/include/access/toast_compression.h +0 -73
- data/ext/pg_query/include/access/transam.h +0 -375
- data/ext/pg_query/include/access/tsmapi.h +0 -82
- data/ext/pg_query/include/access/tupconvert.h +0 -54
- data/ext/pg_query/include/access/tupdesc.h +0 -154
- data/ext/pg_query/include/access/tupmacs.h +0 -207
- data/ext/pg_query/include/access/twophase.h +0 -65
- data/ext/pg_query/include/access/xact.h +0 -530
- data/ext/pg_query/include/access/xlog.h +0 -302
- data/ext/pg_query/include/access/xlog_internal.h +0 -404
- data/ext/pg_query/include/access/xlogbackup.h +0 -41
- data/ext/pg_query/include/access/xlogdefs.h +0 -82
- data/ext/pg_query/include/access/xlogprefetcher.h +0 -55
- data/ext/pg_query/include/access/xlogreader.h +0 -444
- data/ext/pg_query/include/access/xlogrecord.h +0 -248
- data/ext/pg_query/include/access/xlogrecovery.h +0 -158
- data/ext/pg_query/include/archive/archive_module.h +0 -59
- data/ext/pg_query/include/c.h +0 -1379
- data/ext/pg_query/include/catalog/catalog.h +0 -45
- data/ext/pg_query/include/catalog/catversion.h +0 -62
- data/ext/pg_query/include/catalog/dependency.h +0 -270
- data/ext/pg_query/include/catalog/genbki.h +0 -143
- data/ext/pg_query/include/catalog/index.h +0 -214
- data/ext/pg_query/include/catalog/indexing.h +0 -54
- data/ext/pg_query/include/catalog/namespace.h +0 -190
- data/ext/pg_query/include/catalog/objectaccess.h +0 -267
- data/ext/pg_query/include/catalog/objectaddress.h +0 -89
- data/ext/pg_query/include/catalog/pg_aggregate.h +0 -180
- data/ext/pg_query/include/catalog/pg_aggregate_d.h +0 -78
- data/ext/pg_query/include/catalog/pg_am.h +0 -63
- data/ext/pg_query/include/catalog/pg_am_d.h +0 -47
- data/ext/pg_query/include/catalog/pg_attribute.h +0 -223
- data/ext/pg_query/include/catalog/pg_attribute_d.h +0 -62
- data/ext/pg_query/include/catalog/pg_authid.h +0 -63
- data/ext/pg_query/include/catalog/pg_authid_d.h +0 -59
- data/ext/pg_query/include/catalog/pg_class.h +0 -230
- data/ext/pg_query/include/catalog/pg_class_d.h +0 -132
- data/ext/pg_query/include/catalog/pg_collation.h +0 -100
- data/ext/pg_query/include/catalog/pg_collation_d.h +0 -63
- data/ext/pg_query/include/catalog/pg_constraint.h +0 -273
- data/ext/pg_query/include/catalog/pg_constraint_d.h +0 -73
- data/ext/pg_query/include/catalog/pg_control.h +0 -258
- data/ext/pg_query/include/catalog/pg_conversion.h +0 -75
- data/ext/pg_query/include/catalog/pg_conversion_d.h +0 -38
- data/ext/pg_query/include/catalog/pg_database.h +0 -124
- data/ext/pg_query/include/catalog/pg_database_d.h +0 -52
- data/ext/pg_query/include/catalog/pg_depend.h +0 -77
- data/ext/pg_query/include/catalog/pg_depend_d.h +0 -36
- data/ext/pg_query/include/catalog/pg_event_trigger.h +0 -57
- data/ext/pg_query/include/catalog/pg_event_trigger_d.h +0 -36
- data/ext/pg_query/include/catalog/pg_index.h +0 -90
- data/ext/pg_query/include/catalog/pg_index_d.h +0 -59
- data/ext/pg_query/include/catalog/pg_language.h +0 -72
- data/ext/pg_query/include/catalog/pg_language_d.h +0 -41
- data/ext/pg_query/include/catalog/pg_namespace.h +0 -64
- data/ext/pg_query/include/catalog/pg_namespace_d.h +0 -36
- data/ext/pg_query/include/catalog/pg_opclass.h +0 -88
- data/ext/pg_query/include/catalog/pg_opclass_d.h +0 -51
- data/ext/pg_query/include/catalog/pg_operator.h +0 -107
- data/ext/pg_query/include/catalog/pg_operator_d.h +0 -142
- data/ext/pg_query/include/catalog/pg_opfamily.h +0 -64
- data/ext/pg_query/include/catalog/pg_opfamily_d.h +0 -51
- data/ext/pg_query/include/catalog/pg_partitioned_table.h +0 -74
- data/ext/pg_query/include/catalog/pg_partitioned_table_d.h +0 -36
- data/ext/pg_query/include/catalog/pg_proc.h +0 -220
- data/ext/pg_query/include/catalog/pg_proc_d.h +0 -101
- data/ext/pg_query/include/catalog/pg_publication.h +0 -158
- data/ext/pg_query/include/catalog/pg_publication_d.h +0 -38
- data/ext/pg_query/include/catalog/pg_replication_origin.h +0 -62
- data/ext/pg_query/include/catalog/pg_replication_origin_d.h +0 -33
- data/ext/pg_query/include/catalog/pg_statistic.h +0 -282
- data/ext/pg_query/include/catalog/pg_statistic_d.h +0 -195
- data/ext/pg_query/include/catalog/pg_statistic_ext.h +0 -88
- data/ext/pg_query/include/catalog/pg_statistic_ext_d.h +0 -45
- data/ext/pg_query/include/catalog/pg_transform.h +0 -48
- data/ext/pg_query/include/catalog/pg_transform_d.h +0 -34
- data/ext/pg_query/include/catalog/pg_trigger.h +0 -153
- data/ext/pg_query/include/catalog/pg_trigger_d.h +0 -109
- data/ext/pg_query/include/catalog/pg_ts_config.h +0 -53
- data/ext/pg_query/include/catalog/pg_ts_config_d.h +0 -34
- data/ext/pg_query/include/catalog/pg_ts_dict.h +0 -59
- data/ext/pg_query/include/catalog/pg_ts_dict_d.h +0 -35
- data/ext/pg_query/include/catalog/pg_ts_parser.h +0 -60
- data/ext/pg_query/include/catalog/pg_ts_parser_d.h +0 -37
- data/ext/pg_query/include/catalog/pg_ts_template.h +0 -51
- data/ext/pg_query/include/catalog/pg_ts_template_d.h +0 -34
- data/ext/pg_query/include/catalog/pg_type.h +0 -404
- data/ext/pg_query/include/catalog/pg_type_d.h +0 -324
- data/ext/pg_query/include/catalog/storage.h +0 -50
- data/ext/pg_query/include/commands/async.h +0 -53
- data/ext/pg_query/include/commands/dbcommands.h +0 -37
- data/ext/pg_query/include/commands/defrem.h +0 -161
- data/ext/pg_query/include/commands/event_trigger.h +0 -88
- data/ext/pg_query/include/commands/explain.h +0 -129
- data/ext/pg_query/include/commands/prepare.h +0 -61
- data/ext/pg_query/include/commands/tablespace.h +0 -69
- data/ext/pg_query/include/commands/trigger.h +0 -288
- data/ext/pg_query/include/commands/vacuum.h +0 -386
- data/ext/pg_query/include/common/cryptohash.h +0 -39
- data/ext/pg_query/include/common/file_perm.h +0 -56
- data/ext/pg_query/include/common/hashfn.h +0 -104
- data/ext/pg_query/include/common/int.h +0 -437
- data/ext/pg_query/include/common/ip.h +0 -33
- data/ext/pg_query/include/common/keywords.h +0 -29
- data/ext/pg_query/include/common/kwlookup.h +0 -44
- data/ext/pg_query/include/common/pg_prng.h +0 -61
- data/ext/pg_query/include/common/relpath.h +0 -97
- data/ext/pg_query/include/common/scram-common.h +0 -70
- data/ext/pg_query/include/common/sha2.h +0 -32
- data/ext/pg_query/include/common/string.h +0 -44
- data/ext/pg_query/include/common/unicode_east_asian_fw_table.h +0 -125
- data/ext/pg_query/include/copyfuncs.funcs.c +0 -5013
- data/ext/pg_query/include/copyfuncs.switch.c +0 -938
- data/ext/pg_query/include/datatype/timestamp.h +0 -243
- data/ext/pg_query/include/equalfuncs.funcs.c +0 -3097
- data/ext/pg_query/include/equalfuncs.switch.c +0 -785
- data/ext/pg_query/include/executor/execdesc.h +0 -70
- data/ext/pg_query/include/executor/executor.h +0 -680
- data/ext/pg_query/include/executor/functions.h +0 -55
- data/ext/pg_query/include/executor/instrument.h +0 -118
- data/ext/pg_query/include/executor/spi.h +0 -213
- data/ext/pg_query/include/executor/tablefunc.h +0 -67
- data/ext/pg_query/include/executor/tuptable.h +0 -494
- data/ext/pg_query/include/fmgr.h +0 -800
- data/ext/pg_query/include/foreign/fdwapi.h +0 -294
- data/ext/pg_query/include/funcapi.h +0 -360
- data/ext/pg_query/include/gram.h +0 -1127
- data/ext/pg_query/include/gramparse.h +0 -75
- data/ext/pg_query/include/jit/jit.h +0 -105
- data/ext/pg_query/include/kwlist_d.h +0 -1119
- data/ext/pg_query/include/lib/dshash.h +0 -115
- data/ext/pg_query/include/lib/ilist.h +0 -1159
- data/ext/pg_query/include/lib/pairingheap.h +0 -102
- data/ext/pg_query/include/lib/simplehash.h +0 -1184
- data/ext/pg_query/include/lib/sort_template.h +0 -432
- data/ext/pg_query/include/lib/stringinfo.h +0 -161
- data/ext/pg_query/include/libpq/auth.h +0 -37
- data/ext/pg_query/include/libpq/crypt.h +0 -47
- data/ext/pg_query/include/libpq/hba.h +0 -186
- data/ext/pg_query/include/libpq/libpq-be.h +0 -354
- data/ext/pg_query/include/libpq/libpq.h +0 -144
- data/ext/pg_query/include/libpq/pqcomm.h +0 -163
- data/ext/pg_query/include/libpq/pqformat.h +0 -210
- data/ext/pg_query/include/libpq/pqsignal.h +0 -54
- data/ext/pg_query/include/libpq/sasl.h +0 -136
- data/ext/pg_query/include/libpq/scram.h +0 -37
- data/ext/pg_query/include/mb/pg_wchar.h +0 -772
- data/ext/pg_query/include/mb/stringinfo_mb.h +0 -24
- data/ext/pg_query/include/miscadmin.h +0 -507
- data/ext/pg_query/include/nodes/bitmapset.h +0 -126
- data/ext/pg_query/include/nodes/execnodes.h +0 -2768
- data/ext/pg_query/include/nodes/extensible.h +0 -164
- data/ext/pg_query/include/nodes/lockoptions.h +0 -61
- data/ext/pg_query/include/nodes/makefuncs.h +0 -121
- data/ext/pg_query/include/nodes/memnodes.h +0 -113
- data/ext/pg_query/include/nodes/miscnodes.h +0 -56
- data/ext/pg_query/include/nodes/nodeFuncs.h +0 -222
- data/ext/pg_query/include/nodes/nodes.h +0 -446
- data/ext/pg_query/include/nodes/nodetags.h +0 -471
- data/ext/pg_query/include/nodes/params.h +0 -170
- data/ext/pg_query/include/nodes/parsenodes.h +0 -4050
- data/ext/pg_query/include/nodes/pathnodes.h +0 -3384
- data/ext/pg_query/include/nodes/pg_list.h +0 -635
- data/ext/pg_query/include/nodes/plannodes.h +0 -1592
- data/ext/pg_query/include/nodes/primnodes.h +0 -2041
- data/ext/pg_query/include/nodes/print.h +0 -34
- data/ext/pg_query/include/nodes/queryjumble.h +0 -86
- data/ext/pg_query/include/nodes/replnodes.h +0 -111
- data/ext/pg_query/include/nodes/supportnodes.h +0 -346
- data/ext/pg_query/include/nodes/tidbitmap.h +0 -75
- data/ext/pg_query/include/nodes/value.h +0 -90
- data/ext/pg_query/include/optimizer/cost.h +0 -215
- data/ext/pg_query/include/optimizer/geqo.h +0 -90
- data/ext/pg_query/include/optimizer/geqo_gene.h +0 -45
- data/ext/pg_query/include/optimizer/optimizer.h +0 -202
- data/ext/pg_query/include/optimizer/paths.h +0 -266
- data/ext/pg_query/include/optimizer/planmain.h +0 -117
- data/ext/pg_query/include/parser/analyze.h +0 -64
- data/ext/pg_query/include/parser/kwlist.h +0 -498
- data/ext/pg_query/include/parser/parse_agg.h +0 -65
- data/ext/pg_query/include/parser/parse_coerce.h +0 -102
- data/ext/pg_query/include/parser/parse_expr.h +0 -25
- data/ext/pg_query/include/parser/parse_func.h +0 -74
- data/ext/pg_query/include/parser/parse_node.h +0 -357
- data/ext/pg_query/include/parser/parse_oper.h +0 -65
- data/ext/pg_query/include/parser/parse_relation.h +0 -129
- data/ext/pg_query/include/parser/parse_type.h +0 -61
- data/ext/pg_query/include/parser/parser.h +0 -68
- data/ext/pg_query/include/parser/parsetree.h +0 -61
- data/ext/pg_query/include/parser/scanner.h +0 -152
- data/ext/pg_query/include/parser/scansup.h +0 -27
- data/ext/pg_query/include/partitioning/partdefs.h +0 -26
- data/ext/pg_query/include/pg_config.h +0 -843
- data/ext/pg_query/include/pg_config_manual.h +0 -372
- data/ext/pg_query/include/pg_config_os.h +0 -8
- data/ext/pg_query/include/pg_getopt.h +0 -56
- data/ext/pg_query/include/pg_trace.h +0 -17
- data/ext/pg_query/include/pgstat.h +0 -778
- data/ext/pg_query/include/pgtime.h +0 -94
- data/ext/pg_query/include/pl_gram.h +0 -385
- data/ext/pg_query/include/pl_reserved_kwlist.h +0 -52
- data/ext/pg_query/include/pl_reserved_kwlist_d.h +0 -114
- data/ext/pg_query/include/pl_unreserved_kwlist.h +0 -112
- data/ext/pg_query/include/pl_unreserved_kwlist_d.h +0 -246
- data/ext/pg_query/include/plerrcodes.h +0 -998
- data/ext/pg_query/include/plpgsql.h +0 -1340
- data/ext/pg_query/include/port/atomics/arch-arm.h +0 -32
- data/ext/pg_query/include/port/atomics/arch-ppc.h +0 -254
- data/ext/pg_query/include/port/atomics/arch-x86.h +0 -252
- data/ext/pg_query/include/port/atomics/fallback.h +0 -170
- data/ext/pg_query/include/port/atomics/generic-gcc.h +0 -286
- data/ext/pg_query/include/port/atomics/generic.h +0 -401
- data/ext/pg_query/include/port/atomics.h +0 -519
- data/ext/pg_query/include/port/pg_bitutils.h +0 -339
- data/ext/pg_query/include/port/pg_bswap.h +0 -161
- data/ext/pg_query/include/port/pg_crc32c.h +0 -101
- data/ext/pg_query/include/port/simd.h +0 -375
- data/ext/pg_query/include/port.h +0 -520
- data/ext/pg_query/include/portability/instr_time.h +0 -197
- data/ext/pg_query/include/postgres.h +0 -579
- data/ext/pg_query/include/postmaster/autovacuum.h +0 -80
- data/ext/pg_query/include/postmaster/auxprocess.h +0 -20
- data/ext/pg_query/include/postmaster/bgworker.h +0 -162
- data/ext/pg_query/include/postmaster/bgworker_internals.h +0 -64
- data/ext/pg_query/include/postmaster/bgwriter.h +0 -45
- data/ext/pg_query/include/postmaster/fork_process.h +0 -17
- data/ext/pg_query/include/postmaster/interrupt.h +0 -32
- data/ext/pg_query/include/postmaster/pgarch.h +0 -36
- data/ext/pg_query/include/postmaster/postmaster.h +0 -81
- data/ext/pg_query/include/postmaster/startup.h +0 -41
- data/ext/pg_query/include/postmaster/syslogger.h +0 -103
- data/ext/pg_query/include/postmaster/walwriter.h +0 -23
- data/ext/pg_query/include/regex/regex.h +0 -189
- data/ext/pg_query/include/replication/logicallauncher.h +0 -34
- data/ext/pg_query/include/replication/logicalproto.h +0 -274
- data/ext/pg_query/include/replication/logicalworker.h +0 -32
- data/ext/pg_query/include/replication/origin.h +0 -73
- data/ext/pg_query/include/replication/reorderbuffer.h +0 -753
- data/ext/pg_query/include/replication/slot.h +0 -249
- data/ext/pg_query/include/replication/syncrep.h +0 -109
- data/ext/pg_query/include/replication/walreceiver.h +0 -478
- data/ext/pg_query/include/replication/walsender.h +0 -74
- data/ext/pg_query/include/rewrite/prs2lock.h +0 -46
- data/ext/pg_query/include/rewrite/rewriteHandler.h +0 -35
- data/ext/pg_query/include/rewrite/rewriteManip.h +0 -96
- data/ext/pg_query/include/rewrite/rewriteSupport.h +0 -26
- data/ext/pg_query/include/src_backend_nodes_copyfuncs.funcs.c +0 -5321
- data/ext/pg_query/include/src_backend_nodes_equalfuncs.funcs.c +0 -3354
- data/ext/pg_query/include/storage/backendid.h +0 -37
- data/ext/pg_query/include/storage/block.h +0 -108
- data/ext/pg_query/include/storage/buf.h +0 -46
- data/ext/pg_query/include/storage/bufmgr.h +0 -393
- data/ext/pg_query/include/storage/bufpage.h +0 -510
- data/ext/pg_query/include/storage/condition_variable.h +0 -73
- data/ext/pg_query/include/storage/dsm.h +0 -61
- data/ext/pg_query/include/storage/dsm_impl.h +0 -79
- data/ext/pg_query/include/storage/fd.h +0 -202
- data/ext/pg_query/include/storage/fileset.h +0 -40
- data/ext/pg_query/include/storage/ipc.h +0 -84
- data/ext/pg_query/include/storage/item.h +0 -19
- data/ext/pg_query/include/storage/itemid.h +0 -184
- data/ext/pg_query/include/storage/itemptr.h +0 -245
- data/ext/pg_query/include/storage/large_object.h +0 -100
- data/ext/pg_query/include/storage/latch.h +0 -194
- data/ext/pg_query/include/storage/lmgr.h +0 -120
- data/ext/pg_query/include/storage/lock.h +0 -624
- data/ext/pg_query/include/storage/lockdefs.h +0 -59
- data/ext/pg_query/include/storage/lwlock.h +0 -220
- data/ext/pg_query/include/storage/lwlocknames.h +0 -50
- data/ext/pg_query/include/storage/off.h +0 -57
- data/ext/pg_query/include/storage/pg_sema.h +0 -61
- data/ext/pg_query/include/storage/pg_shmem.h +0 -92
- data/ext/pg_query/include/storage/pmsignal.h +0 -105
- data/ext/pg_query/include/storage/predicate.h +0 -87
- data/ext/pg_query/include/storage/proc.h +0 -466
- data/ext/pg_query/include/storage/procarray.h +0 -99
- data/ext/pg_query/include/storage/proclist_types.h +0 -51
- data/ext/pg_query/include/storage/procsignal.h +0 -73
- data/ext/pg_query/include/storage/relfilelocator.h +0 -99
- data/ext/pg_query/include/storage/s_lock.h +0 -867
- data/ext/pg_query/include/storage/sharedfileset.h +0 -37
- data/ext/pg_query/include/storage/shm_mq.h +0 -86
- data/ext/pg_query/include/storage/shm_toc.h +0 -58
- data/ext/pg_query/include/storage/shmem.h +0 -59
- data/ext/pg_query/include/storage/sinval.h +0 -153
- data/ext/pg_query/include/storage/sinvaladt.h +0 -45
- data/ext/pg_query/include/storage/smgr.h +0 -113
- data/ext/pg_query/include/storage/spin.h +0 -77
- data/ext/pg_query/include/storage/standby.h +0 -99
- data/ext/pg_query/include/storage/standbydefs.h +0 -74
- data/ext/pg_query/include/storage/sync.h +0 -66
- data/ext/pg_query/include/tcop/cmdtag.h +0 -63
- data/ext/pg_query/include/tcop/cmdtaglist.h +0 -218
- data/ext/pg_query/include/tcop/deparse_utility.h +0 -108
- data/ext/pg_query/include/tcop/dest.h +0 -147
- data/ext/pg_query/include/tcop/fastpath.h +0 -20
- data/ext/pg_query/include/tcop/pquery.h +0 -51
- data/ext/pg_query/include/tcop/tcopprot.h +0 -94
- data/ext/pg_query/include/tcop/utility.h +0 -112
- data/ext/pg_query/include/tsearch/ts_cache.h +0 -96
- data/ext/pg_query/include/utils/acl.h +0 -278
- data/ext/pg_query/include/utils/aclchk_internal.h +0 -45
- data/ext/pg_query/include/utils/array.h +0 -482
- data/ext/pg_query/include/utils/backend_progress.h +0 -45
- data/ext/pg_query/include/utils/backend_status.h +0 -342
- data/ext/pg_query/include/utils/builtins.h +0 -136
- data/ext/pg_query/include/utils/bytea.h +0 -28
- data/ext/pg_query/include/utils/catcache.h +0 -231
- data/ext/pg_query/include/utils/date.h +0 -118
- data/ext/pg_query/include/utils/datetime.h +0 -364
- data/ext/pg_query/include/utils/datum.h +0 -76
- data/ext/pg_query/include/utils/dsa.h +0 -127
- data/ext/pg_query/include/utils/elog.h +0 -545
- data/ext/pg_query/include/utils/errcodes.h +0 -354
- data/ext/pg_query/include/utils/expandeddatum.h +0 -170
- data/ext/pg_query/include/utils/expandedrecord.h +0 -241
- data/ext/pg_query/include/utils/float.h +0 -357
- data/ext/pg_query/include/utils/fmgroids.h +0 -3314
- data/ext/pg_query/include/utils/fmgrprotos.h +0 -2871
- data/ext/pg_query/include/utils/fmgrtab.h +0 -49
- data/ext/pg_query/include/utils/guc.h +0 -442
- data/ext/pg_query/include/utils/guc_hooks.h +0 -163
- data/ext/pg_query/include/utils/guc_tables.h +0 -322
- data/ext/pg_query/include/utils/hsearch.h +0 -153
- data/ext/pg_query/include/utils/inval.h +0 -68
- data/ext/pg_query/include/utils/logtape.h +0 -77
- data/ext/pg_query/include/utils/lsyscache.h +0 -212
- data/ext/pg_query/include/utils/memdebug.h +0 -82
- data/ext/pg_query/include/utils/memutils.h +0 -186
- data/ext/pg_query/include/utils/memutils_internal.h +0 -136
- data/ext/pg_query/include/utils/memutils_memorychunk.h +0 -237
- data/ext/pg_query/include/utils/numeric.h +0 -105
- data/ext/pg_query/include/utils/palloc.h +0 -165
- data/ext/pg_query/include/utils/partcache.h +0 -103
- data/ext/pg_query/include/utils/pg_locale.h +0 -135
- data/ext/pg_query/include/utils/pgstat_internal.h +0 -814
- data/ext/pg_query/include/utils/pidfile.h +0 -56
- data/ext/pg_query/include/utils/plancache.h +0 -236
- data/ext/pg_query/include/utils/portal.h +0 -252
- data/ext/pg_query/include/utils/queryenvironment.h +0 -74
- data/ext/pg_query/include/utils/regproc.h +0 -39
- data/ext/pg_query/include/utils/rel.h +0 -712
- data/ext/pg_query/include/utils/relcache.h +0 -158
- data/ext/pg_query/include/utils/reltrigger.h +0 -81
- data/ext/pg_query/include/utils/resowner.h +0 -86
- data/ext/pg_query/include/utils/ruleutils.h +0 -52
- data/ext/pg_query/include/utils/sharedtuplestore.h +0 -61
- data/ext/pg_query/include/utils/snapmgr.h +0 -181
- data/ext/pg_query/include/utils/snapshot.h +0 -219
- data/ext/pg_query/include/utils/sortsupport.h +0 -391
- data/ext/pg_query/include/utils/syscache.h +0 -227
- data/ext/pg_query/include/utils/timeout.h +0 -95
- data/ext/pg_query/include/utils/timestamp.h +0 -147
- data/ext/pg_query/include/utils/tuplesort.h +0 -445
- data/ext/pg_query/include/utils/tuplestore.h +0 -91
- data/ext/pg_query/include/utils/typcache.h +0 -209
- data/ext/pg_query/include/utils/varlena.h +0 -53
- data/ext/pg_query/include/utils/wait_event.h +0 -294
- data/ext/pg_query/include/utils/xml.h +0 -94
- data/ext/pg_query/include/varatt.h +0 -358
- data/ext/pg_query/src_backend_postmaster_postmaster.c +0 -2220
- data/ext/pg_query/src_port_strnlen.c +0 -39
- /data/ext/pg_query/include/{access → postgres/access}/rmgr.h +0 -0
- /data/ext/pg_query/include/{commands → postgres/commands}/user.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/unicode_nonspacing_table.h +0 -0
- /data/ext/pg_query/include/{pg_config_ext.h → postgres/pg_config_ext.h} +0 -0
- /data/ext/pg_query/include/{postgres_ext.h → postgres/postgres_ext.h} +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/probes.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/ps_status.h +0 -0
@@ -0,0 +1,102 @@
|
|
1
|
+
/*-------------------------------------------------------------------------
|
2
|
+
*
|
3
|
+
* parse_coerce.h
|
4
|
+
* Routines for type coercion.
|
5
|
+
*
|
6
|
+
*
|
7
|
+
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
|
8
|
+
* Portions Copyright (c) 1994, Regents of the University of California
|
9
|
+
*
|
10
|
+
* src/include/parser/parse_coerce.h
|
11
|
+
*
|
12
|
+
*-------------------------------------------------------------------------
|
13
|
+
*/
|
14
|
+
#ifndef PARSE_COERCE_H
|
15
|
+
#define PARSE_COERCE_H
|
16
|
+
|
17
|
+
#include "parser/parse_node.h"
|
18
|
+
|
19
|
+
|
20
|
+
/* Type categories (see TYPCATEGORY_xxx symbols in catalog/pg_type.h) */
|
21
|
+
typedef char TYPCATEGORY;
|
22
|
+
|
23
|
+
/* Result codes for find_coercion_pathway */
|
24
|
+
typedef enum CoercionPathType
|
25
|
+
{
|
26
|
+
COERCION_PATH_NONE, /* failed to find any coercion pathway */
|
27
|
+
COERCION_PATH_FUNC, /* apply the specified coercion function */
|
28
|
+
COERCION_PATH_RELABELTYPE, /* binary-compatible cast, no function */
|
29
|
+
COERCION_PATH_ARRAYCOERCE, /* need an ArrayCoerceExpr node */
|
30
|
+
COERCION_PATH_COERCEVIAIO, /* need a CoerceViaIO node */
|
31
|
+
} CoercionPathType;
|
32
|
+
|
33
|
+
|
34
|
+
extern bool IsBinaryCoercible(Oid srctype, Oid targettype);
|
35
|
+
extern bool IsBinaryCoercibleWithCast(Oid srctype, Oid targettype,
|
36
|
+
Oid *castoid);
|
37
|
+
extern bool IsPreferredType(TYPCATEGORY category, Oid type);
|
38
|
+
extern TYPCATEGORY TypeCategory(Oid type);
|
39
|
+
|
40
|
+
extern Node *coerce_to_target_type(ParseState *pstate,
|
41
|
+
Node *expr, Oid exprtype,
|
42
|
+
Oid targettype, int32 targettypmod,
|
43
|
+
CoercionContext ccontext,
|
44
|
+
CoercionForm cformat,
|
45
|
+
int location);
|
46
|
+
extern bool can_coerce_type(int nargs, const Oid *input_typeids, const Oid *target_typeids,
|
47
|
+
CoercionContext ccontext);
|
48
|
+
extern Node *coerce_type(ParseState *pstate, Node *node,
|
49
|
+
Oid inputTypeId, Oid targetTypeId, int32 targetTypeMod,
|
50
|
+
CoercionContext ccontext, CoercionForm cformat, int location);
|
51
|
+
extern Node *coerce_to_domain(Node *arg, Oid baseTypeId, int32 baseTypeMod,
|
52
|
+
Oid typeId,
|
53
|
+
CoercionContext ccontext, CoercionForm cformat, int location,
|
54
|
+
bool hideInputCoercion);
|
55
|
+
|
56
|
+
extern Node *coerce_to_boolean(ParseState *pstate, Node *node,
|
57
|
+
const char *constructName);
|
58
|
+
extern Node *coerce_to_specific_type(ParseState *pstate, Node *node,
|
59
|
+
Oid targetTypeId,
|
60
|
+
const char *constructName);
|
61
|
+
|
62
|
+
extern Node *coerce_to_specific_type_typmod(ParseState *pstate, Node *node,
|
63
|
+
Oid targetTypeId, int32 targetTypmod,
|
64
|
+
const char *constructName);
|
65
|
+
|
66
|
+
extern int parser_coercion_errposition(ParseState *pstate,
|
67
|
+
int coerce_location,
|
68
|
+
Node *input_expr);
|
69
|
+
|
70
|
+
extern Oid select_common_type(ParseState *pstate, List *exprs,
|
71
|
+
const char *context, Node **which_expr);
|
72
|
+
extern Node *coerce_to_common_type(ParseState *pstate, Node *node,
|
73
|
+
Oid targetTypeId,
|
74
|
+
const char *context);
|
75
|
+
extern bool verify_common_type(Oid common_type, List *exprs);
|
76
|
+
|
77
|
+
extern int32 select_common_typmod(ParseState *pstate, List *exprs, Oid common_type);
|
78
|
+
|
79
|
+
extern bool check_generic_type_consistency(const Oid *actual_arg_types,
|
80
|
+
const Oid *declared_arg_types,
|
81
|
+
int nargs);
|
82
|
+
extern Oid enforce_generic_type_consistency(const Oid *actual_arg_types,
|
83
|
+
Oid *declared_arg_types,
|
84
|
+
int nargs,
|
85
|
+
Oid rettype,
|
86
|
+
bool allow_poly);
|
87
|
+
|
88
|
+
extern char *check_valid_polymorphic_signature(Oid ret_type,
|
89
|
+
const Oid *declared_arg_types,
|
90
|
+
int nargs);
|
91
|
+
extern char *check_valid_internal_signature(Oid ret_type,
|
92
|
+
const Oid *declared_arg_types,
|
93
|
+
int nargs);
|
94
|
+
|
95
|
+
extern CoercionPathType find_coercion_pathway(Oid targetTypeId,
|
96
|
+
Oid sourceTypeId,
|
97
|
+
CoercionContext ccontext,
|
98
|
+
Oid *funcid);
|
99
|
+
extern CoercionPathType find_typmod_coercion_function(Oid typeId,
|
100
|
+
Oid *funcid);
|
101
|
+
|
102
|
+
#endif /* PARSE_COERCE_H */
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/*-------------------------------------------------------------------------
|
2
|
+
*
|
3
|
+
* parse_expr.h
|
4
|
+
* handle expressions in parser
|
5
|
+
*
|
6
|
+
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
|
7
|
+
* Portions Copyright (c) 1994, Regents of the University of California
|
8
|
+
*
|
9
|
+
* src/include/parser/parse_expr.h
|
10
|
+
*
|
11
|
+
*-------------------------------------------------------------------------
|
12
|
+
*/
|
13
|
+
#ifndef PARSE_EXPR_H
|
14
|
+
#define PARSE_EXPR_H
|
15
|
+
|
16
|
+
#include "parser/parse_node.h"
|
17
|
+
|
18
|
+
/* GUC parameters */
|
19
|
+
extern PGDLLIMPORT bool Transform_null_equals;
|
20
|
+
|
21
|
+
extern Node *transformExpr(ParseState *pstate, Node *expr, ParseExprKind exprKind);
|
22
|
+
|
23
|
+
extern const char *ParseExprKindName(ParseExprKind exprKind);
|
24
|
+
|
25
|
+
#endif /* PARSE_EXPR_H */
|
@@ -0,0 +1,74 @@
|
|
1
|
+
/*-------------------------------------------------------------------------
|
2
|
+
*
|
3
|
+
* parse_func.h
|
4
|
+
*
|
5
|
+
*
|
6
|
+
*
|
7
|
+
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
|
8
|
+
* Portions Copyright (c) 1994, Regents of the University of California
|
9
|
+
*
|
10
|
+
* src/include/parser/parse_func.h
|
11
|
+
*
|
12
|
+
*-------------------------------------------------------------------------
|
13
|
+
*/
|
14
|
+
#ifndef PARSE_FUNC_H
|
15
|
+
#define PARSE_FUNC_H
|
16
|
+
|
17
|
+
#include "catalog/namespace.h"
|
18
|
+
#include "parser/parse_node.h"
|
19
|
+
|
20
|
+
|
21
|
+
/* Result codes for func_get_detail */
|
22
|
+
typedef enum
|
23
|
+
{
|
24
|
+
FUNCDETAIL_NOTFOUND, /* no matching function */
|
25
|
+
FUNCDETAIL_MULTIPLE, /* too many matching functions */
|
26
|
+
FUNCDETAIL_NORMAL, /* found a matching regular function */
|
27
|
+
FUNCDETAIL_PROCEDURE, /* found a matching procedure */
|
28
|
+
FUNCDETAIL_AGGREGATE, /* found a matching aggregate function */
|
29
|
+
FUNCDETAIL_WINDOWFUNC, /* found a matching window function */
|
30
|
+
FUNCDETAIL_COERCION, /* it's a type coercion request */
|
31
|
+
} FuncDetailCode;
|
32
|
+
|
33
|
+
|
34
|
+
extern Node *ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
|
35
|
+
Node *last_srf, FuncCall *fn, bool proc_call,
|
36
|
+
int location);
|
37
|
+
|
38
|
+
extern FuncDetailCode func_get_detail(List *funcname,
|
39
|
+
List *fargs, List *fargnames,
|
40
|
+
int nargs, Oid *argtypes,
|
41
|
+
bool expand_variadic, bool expand_defaults,
|
42
|
+
bool include_out_arguments,
|
43
|
+
Oid *funcid, Oid *rettype,
|
44
|
+
bool *retset, int *nvargs, Oid *vatype,
|
45
|
+
Oid **true_typeids, List **argdefaults);
|
46
|
+
|
47
|
+
extern int func_match_argtypes(int nargs,
|
48
|
+
Oid *input_typeids,
|
49
|
+
FuncCandidateList raw_candidates,
|
50
|
+
FuncCandidateList *candidates);
|
51
|
+
|
52
|
+
extern FuncCandidateList func_select_candidate(int nargs,
|
53
|
+
Oid *input_typeids,
|
54
|
+
FuncCandidateList candidates);
|
55
|
+
|
56
|
+
extern void make_fn_arguments(ParseState *pstate,
|
57
|
+
List *fargs,
|
58
|
+
Oid *actual_arg_types,
|
59
|
+
Oid *declared_arg_types);
|
60
|
+
|
61
|
+
extern const char *funcname_signature_string(const char *funcname, int nargs,
|
62
|
+
List *argnames, const Oid *argtypes);
|
63
|
+
extern const char *func_signature_string(List *funcname, int nargs,
|
64
|
+
List *argnames, const Oid *argtypes);
|
65
|
+
|
66
|
+
extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
|
67
|
+
bool missing_ok);
|
68
|
+
extern Oid LookupFuncWithArgs(ObjectType objtype, ObjectWithArgs *func,
|
69
|
+
bool missing_ok);
|
70
|
+
|
71
|
+
extern void check_srf_call_placement(ParseState *pstate, Node *last_srf,
|
72
|
+
int location);
|
73
|
+
|
74
|
+
#endif /* PARSE_FUNC_H */
|
@@ -0,0 +1,358 @@
|
|
1
|
+
/*-------------------------------------------------------------------------
|
2
|
+
*
|
3
|
+
* parse_node.h
|
4
|
+
* Internal definitions for parser
|
5
|
+
*
|
6
|
+
*
|
7
|
+
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
|
8
|
+
* Portions Copyright (c) 1994, Regents of the University of California
|
9
|
+
*
|
10
|
+
* src/include/parser/parse_node.h
|
11
|
+
*
|
12
|
+
*-------------------------------------------------------------------------
|
13
|
+
*/
|
14
|
+
#ifndef PARSE_NODE_H
|
15
|
+
#define PARSE_NODE_H
|
16
|
+
|
17
|
+
#include "nodes/parsenodes.h"
|
18
|
+
#include "utils/queryenvironment.h"
|
19
|
+
#include "utils/relcache.h"
|
20
|
+
|
21
|
+
|
22
|
+
/* Forward references for some structs declared below */
|
23
|
+
typedef struct ParseState ParseState;
|
24
|
+
typedef struct ParseNamespaceItem ParseNamespaceItem;
|
25
|
+
typedef struct ParseNamespaceColumn ParseNamespaceColumn;
|
26
|
+
|
27
|
+
/*
|
28
|
+
* Expression kinds distinguished by transformExpr(). Many of these are not
|
29
|
+
* semantically distinct so far as expression transformation goes; rather,
|
30
|
+
* we distinguish them so that context-specific error messages can be printed.
|
31
|
+
*
|
32
|
+
* Note: EXPR_KIND_OTHER is not used in the core code, but is left for use
|
33
|
+
* by extension code that might need to call transformExpr(). The core code
|
34
|
+
* will not enforce any context-driven restrictions on EXPR_KIND_OTHER
|
35
|
+
* expressions, so the caller would have to check for sub-selects, aggregates,
|
36
|
+
* window functions, SRFs, etc if those need to be disallowed.
|
37
|
+
*/
|
38
|
+
typedef enum ParseExprKind
|
39
|
+
{
|
40
|
+
EXPR_KIND_NONE = 0, /* "not in an expression" */
|
41
|
+
EXPR_KIND_OTHER, /* reserved for extensions */
|
42
|
+
EXPR_KIND_JOIN_ON, /* JOIN ON */
|
43
|
+
EXPR_KIND_JOIN_USING, /* JOIN USING */
|
44
|
+
EXPR_KIND_FROM_SUBSELECT, /* sub-SELECT in FROM clause */
|
45
|
+
EXPR_KIND_FROM_FUNCTION, /* function in FROM clause */
|
46
|
+
EXPR_KIND_WHERE, /* WHERE */
|
47
|
+
EXPR_KIND_HAVING, /* HAVING */
|
48
|
+
EXPR_KIND_FILTER, /* FILTER */
|
49
|
+
EXPR_KIND_WINDOW_PARTITION, /* window definition PARTITION BY */
|
50
|
+
EXPR_KIND_WINDOW_ORDER, /* window definition ORDER BY */
|
51
|
+
EXPR_KIND_WINDOW_FRAME_RANGE, /* window frame clause with RANGE */
|
52
|
+
EXPR_KIND_WINDOW_FRAME_ROWS, /* window frame clause with ROWS */
|
53
|
+
EXPR_KIND_WINDOW_FRAME_GROUPS, /* window frame clause with GROUPS */
|
54
|
+
EXPR_KIND_SELECT_TARGET, /* SELECT target list item */
|
55
|
+
EXPR_KIND_INSERT_TARGET, /* INSERT target list item */
|
56
|
+
EXPR_KIND_UPDATE_SOURCE, /* UPDATE assignment source item */
|
57
|
+
EXPR_KIND_UPDATE_TARGET, /* UPDATE assignment target item */
|
58
|
+
EXPR_KIND_MERGE_WHEN, /* MERGE WHEN [NOT] MATCHED condition */
|
59
|
+
EXPR_KIND_GROUP_BY, /* GROUP BY */
|
60
|
+
EXPR_KIND_ORDER_BY, /* ORDER BY */
|
61
|
+
EXPR_KIND_DISTINCT_ON, /* DISTINCT ON */
|
62
|
+
EXPR_KIND_LIMIT, /* LIMIT */
|
63
|
+
EXPR_KIND_OFFSET, /* OFFSET */
|
64
|
+
EXPR_KIND_RETURNING, /* RETURNING in INSERT/UPDATE/DELETE */
|
65
|
+
EXPR_KIND_MERGE_RETURNING, /* RETURNING in MERGE */
|
66
|
+
EXPR_KIND_VALUES, /* VALUES */
|
67
|
+
EXPR_KIND_VALUES_SINGLE, /* single-row VALUES (in INSERT only) */
|
68
|
+
EXPR_KIND_CHECK_CONSTRAINT, /* CHECK constraint for a table */
|
69
|
+
EXPR_KIND_DOMAIN_CHECK, /* CHECK constraint for a domain */
|
70
|
+
EXPR_KIND_COLUMN_DEFAULT, /* default value for a table column */
|
71
|
+
EXPR_KIND_FUNCTION_DEFAULT, /* default parameter value for function */
|
72
|
+
EXPR_KIND_INDEX_EXPRESSION, /* index expression */
|
73
|
+
EXPR_KIND_INDEX_PREDICATE, /* index predicate */
|
74
|
+
EXPR_KIND_STATS_EXPRESSION, /* extended statistics expression */
|
75
|
+
EXPR_KIND_ALTER_COL_TRANSFORM, /* transform expr in ALTER COLUMN TYPE */
|
76
|
+
EXPR_KIND_EXECUTE_PARAMETER, /* parameter value in EXECUTE */
|
77
|
+
EXPR_KIND_TRIGGER_WHEN, /* WHEN condition in CREATE TRIGGER */
|
78
|
+
EXPR_KIND_POLICY, /* USING or WITH CHECK expr in policy */
|
79
|
+
EXPR_KIND_PARTITION_BOUND, /* partition bound expression */
|
80
|
+
EXPR_KIND_PARTITION_EXPRESSION, /* PARTITION BY expression */
|
81
|
+
EXPR_KIND_CALL_ARGUMENT, /* procedure argument in CALL */
|
82
|
+
EXPR_KIND_COPY_WHERE, /* WHERE condition in COPY FROM */
|
83
|
+
EXPR_KIND_GENERATED_COLUMN, /* generation expression for a column */
|
84
|
+
EXPR_KIND_CYCLE_MARK, /* cycle mark value */
|
85
|
+
} ParseExprKind;
|
86
|
+
|
87
|
+
|
88
|
+
/*
|
89
|
+
* Function signatures for parser hooks
|
90
|
+
*/
|
91
|
+
typedef Node *(*PreParseColumnRefHook) (ParseState *pstate, ColumnRef *cref);
|
92
|
+
typedef Node *(*PostParseColumnRefHook) (ParseState *pstate, ColumnRef *cref, Node *var);
|
93
|
+
typedef Node *(*ParseParamRefHook) (ParseState *pstate, ParamRef *pref);
|
94
|
+
typedef Node *(*CoerceParamHook) (ParseState *pstate, Param *param,
|
95
|
+
Oid targetTypeId, int32 targetTypeMod,
|
96
|
+
int location);
|
97
|
+
|
98
|
+
|
99
|
+
/*
|
100
|
+
* State information used during parse analysis
|
101
|
+
*
|
102
|
+
* parentParseState: NULL in a top-level ParseState. When parsing a subquery,
|
103
|
+
* links to current parse state of outer query.
|
104
|
+
*
|
105
|
+
* p_sourcetext: source string that generated the raw parsetree being
|
106
|
+
* analyzed, or NULL if not available. (The string is used only to
|
107
|
+
* generate cursor positions in error messages: we need it to convert
|
108
|
+
* byte-wise locations in parse structures to character-wise cursor
|
109
|
+
* positions.)
|
110
|
+
*
|
111
|
+
* p_rtable: list of RTEs that will become the rangetable of the query.
|
112
|
+
* Note that neither relname nor refname of these entries are necessarily
|
113
|
+
* unique; searching the rtable by name is a bad idea.
|
114
|
+
*
|
115
|
+
* p_rteperminfos: list of RTEPermissionInfo containing an entry corresponding
|
116
|
+
* to each RTE_RELATION entry in p_rtable.
|
117
|
+
*
|
118
|
+
* p_joinexprs: list of JoinExpr nodes associated with p_rtable entries.
|
119
|
+
* This is one-for-one with p_rtable, but contains NULLs for non-join
|
120
|
+
* RTEs, and may be shorter than p_rtable if the last RTE(s) aren't joins.
|
121
|
+
*
|
122
|
+
* p_nullingrels: list of Bitmapsets associated with p_rtable entries, each
|
123
|
+
* containing the set of outer-join RTE indexes that can null that relation
|
124
|
+
* at the current point in the parse tree. This is one-for-one with p_rtable,
|
125
|
+
* but may be shorter than p_rtable, in which case the missing entries are
|
126
|
+
* implicitly empty (NULL). That rule allows us to save work when the query
|
127
|
+
* contains no outer joins.
|
128
|
+
*
|
129
|
+
* p_joinlist: list of join items (RangeTblRef and JoinExpr nodes) that
|
130
|
+
* will become the fromlist of the query's top-level FromExpr node.
|
131
|
+
*
|
132
|
+
* p_namespace: list of ParseNamespaceItems that represents the current
|
133
|
+
* namespace for table and column lookup. (The RTEs listed here may be just
|
134
|
+
* a subset of the whole rtable. See ParseNamespaceItem comments below.)
|
135
|
+
*
|
136
|
+
* p_lateral_active: true if we are currently parsing a LATERAL subexpression
|
137
|
+
* of this parse level. This makes p_lateral_only namespace items visible,
|
138
|
+
* whereas they are not visible when p_lateral_active is FALSE.
|
139
|
+
*
|
140
|
+
* p_ctenamespace: list of CommonTableExprs (WITH items) that are visible
|
141
|
+
* at the moment. This is entirely different from p_namespace because a CTE
|
142
|
+
* is not an RTE, rather "visibility" means you could make an RTE from it.
|
143
|
+
*
|
144
|
+
* p_future_ctes: list of CommonTableExprs (WITH items) that are not yet
|
145
|
+
* visible due to scope rules. This is used to help improve error messages.
|
146
|
+
*
|
147
|
+
* p_parent_cte: CommonTableExpr that immediately contains the current query,
|
148
|
+
* if any.
|
149
|
+
*
|
150
|
+
* p_target_relation: target relation, if query is INSERT/UPDATE/DELETE/MERGE
|
151
|
+
*
|
152
|
+
* p_target_nsitem: target relation's ParseNamespaceItem.
|
153
|
+
*
|
154
|
+
* p_is_insert: true to process assignment expressions like INSERT, false
|
155
|
+
* to process them like UPDATE. (Note this can change intra-statement, for
|
156
|
+
* cases like INSERT ON CONFLICT UPDATE.)
|
157
|
+
*
|
158
|
+
* p_windowdefs: list of WindowDefs representing WINDOW and OVER clauses.
|
159
|
+
* We collect these while transforming expressions and then transform them
|
160
|
+
* afterwards (so that any resjunk tlist items needed for the sort/group
|
161
|
+
* clauses end up at the end of the query tlist). A WindowDef's location in
|
162
|
+
* this list, counting from 1, is the winref number to use to reference it.
|
163
|
+
*
|
164
|
+
* p_expr_kind: kind of expression we're currently parsing, as per enum above;
|
165
|
+
* EXPR_KIND_NONE when not in an expression.
|
166
|
+
*
|
167
|
+
* p_next_resno: next TargetEntry.resno to assign, starting from 1.
|
168
|
+
*
|
169
|
+
* p_multiassign_exprs: partially-processed MultiAssignRef source expressions.
|
170
|
+
*
|
171
|
+
* p_locking_clause: query's FOR UPDATE/FOR SHARE clause, if any.
|
172
|
+
*
|
173
|
+
* p_locked_from_parent: true if parent query level applies FOR UPDATE/SHARE
|
174
|
+
* to this subquery as a whole.
|
175
|
+
*
|
176
|
+
* p_resolve_unknowns: resolve unknown-type SELECT output columns as type TEXT
|
177
|
+
* (this is true by default).
|
178
|
+
*
|
179
|
+
* p_hasAggs, p_hasWindowFuncs, etc: true if we've found any of the indicated
|
180
|
+
* constructs in the query.
|
181
|
+
*
|
182
|
+
* p_last_srf: the set-returning FuncExpr or OpExpr most recently found in
|
183
|
+
* the query, or NULL if none.
|
184
|
+
*
|
185
|
+
* p_pre_columnref_hook, etc: optional parser hook functions for modifying the
|
186
|
+
* interpretation of ColumnRefs and ParamRefs.
|
187
|
+
*
|
188
|
+
* p_ref_hook_state: passthrough state for the parser hook functions.
|
189
|
+
*/
|
190
|
+
struct ParseState
|
191
|
+
{
|
192
|
+
ParseState *parentParseState; /* stack link */
|
193
|
+
const char *p_sourcetext; /* source text, or NULL if not available */
|
194
|
+
List *p_rtable; /* range table so far */
|
195
|
+
List *p_rteperminfos; /* list of RTEPermissionInfo nodes for each
|
196
|
+
* RTE_RELATION entry in rtable */
|
197
|
+
List *p_joinexprs; /* JoinExprs for RTE_JOIN p_rtable entries */
|
198
|
+
List *p_nullingrels; /* Bitmapsets showing nulling outer joins */
|
199
|
+
List *p_joinlist; /* join items so far (will become FromExpr
|
200
|
+
* node's fromlist) */
|
201
|
+
List *p_namespace; /* currently-referenceable RTEs (List of
|
202
|
+
* ParseNamespaceItem) */
|
203
|
+
bool p_lateral_active; /* p_lateral_only items visible? */
|
204
|
+
List *p_ctenamespace; /* current namespace for common table exprs */
|
205
|
+
List *p_future_ctes; /* common table exprs not yet in namespace */
|
206
|
+
CommonTableExpr *p_parent_cte; /* this query's containing CTE */
|
207
|
+
Relation p_target_relation; /* INSERT/UPDATE/DELETE/MERGE target rel */
|
208
|
+
ParseNamespaceItem *p_target_nsitem; /* target rel's NSItem, or NULL */
|
209
|
+
bool p_is_insert; /* process assignment like INSERT not UPDATE */
|
210
|
+
List *p_windowdefs; /* raw representations of window clauses */
|
211
|
+
ParseExprKind p_expr_kind; /* what kind of expression we're parsing */
|
212
|
+
int p_next_resno; /* next targetlist resno to assign */
|
213
|
+
List *p_multiassign_exprs; /* junk tlist entries for multiassign */
|
214
|
+
List *p_locking_clause; /* raw FOR UPDATE/FOR SHARE info */
|
215
|
+
bool p_locked_from_parent; /* parent has marked this subquery
|
216
|
+
* with FOR UPDATE/FOR SHARE */
|
217
|
+
bool p_resolve_unknowns; /* resolve unknown-type SELECT outputs as
|
218
|
+
* type text */
|
219
|
+
|
220
|
+
QueryEnvironment *p_queryEnv; /* curr env, incl refs to enclosing env */
|
221
|
+
|
222
|
+
/* Flags telling about things found in the query: */
|
223
|
+
bool p_hasAggs;
|
224
|
+
bool p_hasWindowFuncs;
|
225
|
+
bool p_hasTargetSRFs;
|
226
|
+
bool p_hasSubLinks;
|
227
|
+
bool p_hasModifyingCTE;
|
228
|
+
|
229
|
+
Node *p_last_srf; /* most recent set-returning func/op found */
|
230
|
+
|
231
|
+
/*
|
232
|
+
* Optional hook functions for parser callbacks. These are null unless
|
233
|
+
* set up by the caller of make_parsestate.
|
234
|
+
*/
|
235
|
+
PreParseColumnRefHook p_pre_columnref_hook;
|
236
|
+
PostParseColumnRefHook p_post_columnref_hook;
|
237
|
+
ParseParamRefHook p_paramref_hook;
|
238
|
+
CoerceParamHook p_coerce_param_hook;
|
239
|
+
void *p_ref_hook_state; /* common passthrough link for above */
|
240
|
+
};
|
241
|
+
|
242
|
+
/*
|
243
|
+
* An element of a namespace list.
|
244
|
+
*
|
245
|
+
* p_names contains the table name and column names exposed by this nsitem.
|
246
|
+
* (Typically it's equal to p_rte->eref, but for a JOIN USING alias it's
|
247
|
+
* equal to p_rte->join_using_alias. Since the USING columns will be the
|
248
|
+
* join's first N columns, the net effect is just that we expose only those
|
249
|
+
* join columns via this nsitem.)
|
250
|
+
*
|
251
|
+
* p_rte and p_rtindex link to the underlying rangetable entry, and
|
252
|
+
* p_perminfo to the entry in rteperminfos.
|
253
|
+
*
|
254
|
+
* The p_nscolumns array contains info showing how to construct Vars
|
255
|
+
* referencing the names appearing in the p_names->colnames list.
|
256
|
+
*
|
257
|
+
* Namespace items with p_rel_visible set define which RTEs are accessible by
|
258
|
+
* qualified names, while those with p_cols_visible set define which RTEs are
|
259
|
+
* accessible by unqualified names. These sets are different because a JOIN
|
260
|
+
* without an alias does not hide the contained tables (so they must be
|
261
|
+
* visible for qualified references) but it does hide their columns
|
262
|
+
* (unqualified references to the columns refer to the JOIN, not the member
|
263
|
+
* tables, so we must not complain that such a reference is ambiguous).
|
264
|
+
* Conversely, a subquery without an alias does not hide the columns selected
|
265
|
+
* by the subquery, but it does hide the auto-generated relation name (so the
|
266
|
+
* subquery columns are visible for unqualified references only). Various
|
267
|
+
* special RTEs such as NEW/OLD for rules may also appear with only one flag
|
268
|
+
* set.
|
269
|
+
*
|
270
|
+
* While processing the FROM clause, namespace items may appear with
|
271
|
+
* p_lateral_only set, meaning they are visible only to LATERAL
|
272
|
+
* subexpressions. (The pstate's p_lateral_active flag tells whether we are
|
273
|
+
* inside such a subexpression at the moment.) If p_lateral_ok is not set,
|
274
|
+
* it's an error to actually use such a namespace item. One might think it
|
275
|
+
* would be better to just exclude such items from visibility, but the wording
|
276
|
+
* of SQL:2008 requires us to do it this way. We also use p_lateral_ok to
|
277
|
+
* forbid LATERAL references to an UPDATE/DELETE target table.
|
278
|
+
*
|
279
|
+
* At no time should a namespace list contain two entries that conflict
|
280
|
+
* according to the rules in checkNameSpaceConflicts; but note that those
|
281
|
+
* are more complicated than "must have different alias names", so in practice
|
282
|
+
* code searching a namespace list has to check for ambiguous references.
|
283
|
+
*/
|
284
|
+
struct ParseNamespaceItem
|
285
|
+
{
|
286
|
+
Alias *p_names; /* Table and column names */
|
287
|
+
RangeTblEntry *p_rte; /* The relation's rangetable entry */
|
288
|
+
int p_rtindex; /* The relation's index in the rangetable */
|
289
|
+
RTEPermissionInfo *p_perminfo; /* The relation's rteperminfos entry */
|
290
|
+
/* array of same length as p_names->colnames: */
|
291
|
+
ParseNamespaceColumn *p_nscolumns; /* per-column data */
|
292
|
+
bool p_rel_visible; /* Relation name is visible? */
|
293
|
+
bool p_cols_visible; /* Column names visible as unqualified refs? */
|
294
|
+
bool p_lateral_only; /* Is only visible to LATERAL expressions? */
|
295
|
+
bool p_lateral_ok; /* If so, does join type allow use? */
|
296
|
+
};
|
297
|
+
|
298
|
+
/*
|
299
|
+
* Data about one column of a ParseNamespaceItem.
|
300
|
+
*
|
301
|
+
* We track the info needed to construct a Var referencing the column
|
302
|
+
* (but only for user-defined columns; system column references and
|
303
|
+
* whole-row references are handled separately).
|
304
|
+
*
|
305
|
+
* p_varno and p_varattno identify the semantic referent, which is a
|
306
|
+
* base-relation column unless the reference is to a join USING column that
|
307
|
+
* isn't semantically equivalent to either join input column (because it is a
|
308
|
+
* FULL join or the input column requires a type coercion). In those cases
|
309
|
+
* p_varno and p_varattno refer to the JOIN RTE.
|
310
|
+
*
|
311
|
+
* p_varnosyn and p_varattnosyn are either identical to p_varno/p_varattno,
|
312
|
+
* or they specify the column's position in an aliased JOIN RTE that hides
|
313
|
+
* the semantic referent RTE's refname. (That could be either the JOIN RTE
|
314
|
+
* in which this ParseNamespaceColumn entry exists, or some lower join level.)
|
315
|
+
*
|
316
|
+
* If an RTE contains a dropped column, its ParseNamespaceColumn struct
|
317
|
+
* is all-zeroes. (Conventionally, test for p_varno == 0 to detect this.)
|
318
|
+
*/
|
319
|
+
struct ParseNamespaceColumn
|
320
|
+
{
|
321
|
+
Index p_varno; /* rangetable index */
|
322
|
+
AttrNumber p_varattno; /* attribute number of the column */
|
323
|
+
Oid p_vartype; /* pg_type OID */
|
324
|
+
int32 p_vartypmod; /* type modifier value */
|
325
|
+
Oid p_varcollid; /* OID of collation, or InvalidOid */
|
326
|
+
Index p_varnosyn; /* rangetable index of syntactic referent */
|
327
|
+
AttrNumber p_varattnosyn; /* attribute number of syntactic referent */
|
328
|
+
bool p_dontexpand; /* not included in star expansion */
|
329
|
+
};
|
330
|
+
|
331
|
+
/* Support for parser_errposition_callback function */
|
332
|
+
typedef struct ParseCallbackState
|
333
|
+
{
|
334
|
+
ParseState *pstate;
|
335
|
+
int location;
|
336
|
+
ErrorContextCallback errcallback;
|
337
|
+
} ParseCallbackState;
|
338
|
+
|
339
|
+
|
340
|
+
extern ParseState *make_parsestate(ParseState *parentParseState);
|
341
|
+
extern void free_parsestate(ParseState *pstate);
|
342
|
+
extern int parser_errposition(ParseState *pstate, int location);
|
343
|
+
|
344
|
+
extern void setup_parser_errposition_callback(ParseCallbackState *pcbstate,
|
345
|
+
ParseState *pstate, int location);
|
346
|
+
extern void cancel_parser_errposition_callback(ParseCallbackState *pcbstate);
|
347
|
+
|
348
|
+
extern void transformContainerType(Oid *containerType, int32 *containerTypmod);
|
349
|
+
|
350
|
+
extern SubscriptingRef *transformContainerSubscripts(ParseState *pstate,
|
351
|
+
Node *containerBase,
|
352
|
+
Oid containerType,
|
353
|
+
int32 containerTypMod,
|
354
|
+
List *indirection,
|
355
|
+
bool isAssignment);
|
356
|
+
extern Const *make_const(ParseState *pstate, A_Const *aconst);
|
357
|
+
|
358
|
+
#endif /* PARSE_NODE_H */
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/*-------------------------------------------------------------------------
|
2
|
+
*
|
3
|
+
* parse_oper.h
|
4
|
+
* handle operator things for parser
|
5
|
+
*
|
6
|
+
*
|
7
|
+
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
|
8
|
+
* Portions Copyright (c) 1994, Regents of the University of California
|
9
|
+
*
|
10
|
+
* src/include/parser/parse_oper.h
|
11
|
+
*
|
12
|
+
*-------------------------------------------------------------------------
|
13
|
+
*/
|
14
|
+
#ifndef PARSE_OPER_H
|
15
|
+
#define PARSE_OPER_H
|
16
|
+
|
17
|
+
#include "access/htup.h"
|
18
|
+
#include "nodes/parsenodes.h"
|
19
|
+
#include "parser/parse_node.h"
|
20
|
+
|
21
|
+
|
22
|
+
typedef HeapTuple Operator;
|
23
|
+
|
24
|
+
/* Routines to look up an operator given name and exact input type(s) */
|
25
|
+
extern Oid LookupOperName(ParseState *pstate, List *opername,
|
26
|
+
Oid oprleft, Oid oprright,
|
27
|
+
bool noError, int location);
|
28
|
+
extern Oid LookupOperWithArgs(ObjectWithArgs *oper, bool noError);
|
29
|
+
|
30
|
+
/* Routines to find operators matching a name and given input types */
|
31
|
+
/* NB: the selected operator may require coercion of the input types! */
|
32
|
+
extern Operator oper(ParseState *pstate, List *opname, Oid ltypeId,
|
33
|
+
Oid rtypeId, bool noError, int location);
|
34
|
+
extern Operator left_oper(ParseState *pstate, List *op, Oid arg,
|
35
|
+
bool noError, int location);
|
36
|
+
|
37
|
+
/* Routines to find operators that DO NOT require coercion --- ie, their */
|
38
|
+
/* input types are either exactly as given, or binary-compatible */
|
39
|
+
extern Operator compatible_oper(ParseState *pstate, List *op,
|
40
|
+
Oid arg1, Oid arg2,
|
41
|
+
bool noError, int location);
|
42
|
+
|
43
|
+
/* currently no need for compatible_left_oper/compatible_right_oper */
|
44
|
+
|
45
|
+
/* Error reporting support */
|
46
|
+
extern const char *op_signature_string(List *op, Oid arg1, Oid arg2);
|
47
|
+
|
48
|
+
/* Routines for identifying "<", "=", ">" operators for a type */
|
49
|
+
extern void get_sort_group_operators(Oid argtype,
|
50
|
+
bool needLT, bool needEQ, bool needGT,
|
51
|
+
Oid *ltOpr, Oid *eqOpr, Oid *gtOpr,
|
52
|
+
bool *isHashable);
|
53
|
+
|
54
|
+
/* Convenience routines for common calls on the above */
|
55
|
+
extern Oid compatible_oper_opid(List *op, Oid arg1, Oid arg2, bool noError);
|
56
|
+
|
57
|
+
/* Extract operator OID or underlying-function OID from an Operator tuple */
|
58
|
+
extern Oid oprid(Operator op);
|
59
|
+
extern Oid oprfuncid(Operator op);
|
60
|
+
|
61
|
+
/* Build expression tree for an operator invocation */
|
62
|
+
extern Expr *make_op(ParseState *pstate, List *opname,
|
63
|
+
Node *ltree, Node *rtree, Node *last_srf, int location);
|
64
|
+
extern Expr *make_scalar_array_op(ParseState *pstate, List *opname,
|
65
|
+
bool useOr,
|
66
|
+
Node *ltree, Node *rtree, int location);
|
67
|
+
|
68
|
+
#endif /* PARSE_OPER_H */
|