pg_query 5.1.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +1 -1
- data/Rakefile +4 -4
- data/ext/pg_query/ext_symbols_freebsd.sym +1 -0
- data/ext/pg_query/ext_symbols_freebsd_with_ruby_abi_version.sym +2 -0
- data/ext/pg_query/ext_symbols_openbsd.sym +1 -0
- data/ext/pg_query/ext_symbols_openbsd_with_ruby_abi_version.sym +2 -0
- data/ext/pg_query/ext_symbols_with_ruby_abi_version.sym +2 -0
- data/ext/pg_query/extconf.rb +20 -6
- 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 +2952 -1845
- data/ext/pg_query/include/pg_query_outfuncs_conds.c +51 -3
- data/ext/pg_query/include/pg_query_outfuncs_defs.c +210 -23
- data/ext/pg_query/include/pg_query_readfuncs_conds.c +17 -1
- data/ext/pg_query/include/pg_query_readfuncs_defs.c +271 -52
- data/ext/pg_query/include/postgres/access/amapi.h +14 -3
- data/ext/pg_query/include/postgres/access/attmap.h +1 -1
- data/ext/pg_query/include/postgres/access/attnum.h +1 -1
- 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 +2 -3
- data/ext/pg_query/include/postgres/access/commit_ts.h +2 -3
- data/ext/pg_query/include/postgres/access/detoast.h +1 -1
- data/ext/pg_query/include/postgres/access/genam.h +17 -4
- data/ext/pg_query/include/postgres/access/gin.h +1 -1
- data/ext/pg_query/include/postgres/access/htup.h +1 -1
- data/ext/pg_query/include/postgres/access/htup_details.h +11 -11
- data/ext/pg_query/include/postgres/access/itup.h +3 -3
- data/ext/pg_query/include/postgres/access/parallel.h +1 -2
- data/ext/pg_query/include/postgres/access/printtup.h +1 -1
- data/ext/pg_query/include/postgres/access/relation.h +1 -1
- data/ext/pg_query/include/postgres/access/relscan.h +1 -1
- data/ext/pg_query/include/postgres/access/rmgrlist.h +1 -1
- data/ext/pg_query/include/postgres/access/sdir.h +1 -1
- data/ext/pg_query/include/postgres/access/skey.h +1 -1
- data/ext/pg_query/include/postgres/access/slru.h +218 -0
- data/ext/pg_query/include/postgres/access/stratnum.h +1 -1
- data/ext/pg_query/include/postgres/access/sysattr.h +1 -1
- data/ext/pg_query/include/postgres/access/table.h +1 -1
- data/ext/pg_query/include/postgres/access/tableam.h +35 -25
- data/ext/pg_query/include/postgres/access/tidstore.h +50 -0
- data/ext/pg_query/include/postgres/access/toast_compression.h +2 -2
- data/ext/pg_query/include/postgres/access/transam.h +50 -7
- data/ext/pg_query/include/postgres/access/tsmapi.h +1 -1
- data/ext/pg_query/include/postgres/access/tupconvert.h +1 -1
- data/ext/pg_query/include/postgres/access/tupdesc.h +5 -5
- data/ext/pg_query/include/postgres/access/tupmacs.h +1 -1
- data/ext/pg_query/include/postgres/access/twophase.h +2 -2
- data/ext/pg_query/include/postgres/access/xact.h +5 -5
- data/ext/pg_query/include/postgres/access/xlog.h +20 -12
- data/ext/pg_query/include/postgres/access/xlog_internal.h +4 -3
- data/ext/pg_query/include/postgres/access/xlogbackup.h +3 -1
- data/ext/pg_query/include/postgres/access/xlogdefs.h +5 -5
- data/ext/pg_query/include/postgres/access/xlogprefetcher.h +2 -2
- data/ext/pg_query/include/postgres/access/xlogreader.h +2 -2
- data/ext/pg_query/include/postgres/access/xlogrecord.h +3 -3
- data/ext/pg_query/include/postgres/access/xlogrecovery.h +4 -4
- data/ext/pg_query/include/postgres/archive/archive_module.h +9 -1
- data/ext/pg_query/include/postgres/c.h +32 -37
- data/ext/pg_query/include/postgres/catalog/catalog.h +3 -1
- data/ext/pg_query/include/postgres/catalog/catversion.h +2 -2
- data/ext/pg_query/include/postgres/catalog/dependency.h +17 -59
- data/ext/pg_query/include/postgres/catalog/genbki.h +12 -6
- data/ext/pg_query/include/postgres/catalog/index.h +22 -18
- data/ext/pg_query/include/postgres/catalog/indexing.h +1 -1
- data/ext/pg_query/include/postgres/catalog/namespace.h +18 -19
- data/ext/pg_query/include/postgres/catalog/objectaccess.h +2 -2
- data/ext/pg_query/include/postgres/catalog/objectaddress.h +5 -1
- data/ext/pg_query/include/postgres/catalog/pg_aggregate.h +4 -2
- data/ext/pg_query/include/postgres/catalog/pg_aggregate_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_am.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_am_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_attribute.h +31 -14
- data/ext/pg_query/include/postgres/catalog/pg_attribute_d.h +3 -3
- data/ext/pg_query/include/postgres/catalog/pg_authid.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_authid_d.h +2 -1
- data/ext/pg_query/include/postgres/catalog/pg_class.h +10 -5
- data/ext/pg_query/include/postgres/catalog/pg_class_d.h +4 -2
- data/ext/pg_query/include/postgres/catalog/pg_collation.h +11 -5
- data/ext/pg_query/include/postgres/catalog/pg_collation_d.h +5 -2
- data/ext/pg_query/include/postgres/catalog/pg_constraint.h +15 -10
- data/ext/pg_query/include/postgres/catalog/pg_constraint_d.h +2 -1
- data/ext/pg_query/include/postgres/catalog/pg_control.h +5 -3
- data/ext/pg_query/include/postgres/catalog/pg_conversion.h +8 -4
- data/ext/pg_query/include/postgres/catalog/pg_conversion_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_database.h +9 -4
- data/ext/pg_query/include/postgres/catalog/pg_database_d.h +13 -12
- data/ext/pg_query/include/postgres/catalog/pg_depend.h +3 -3
- data/ext/pg_query/include/postgres/catalog/pg_depend_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_event_trigger.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_event_trigger_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_index.h +5 -3
- data/ext/pg_query/include/postgres/catalog/pg_index_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_language.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_language_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_namespace.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_namespace_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_opclass.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_opclass_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_operator.h +20 -3
- data/ext/pg_query/include/postgres/catalog/pg_operator_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_opfamily.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_opfamily_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_partitioned_table.h +4 -2
- data/ext/pg_query/include/postgres/catalog/pg_partitioned_table_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_proc.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_proc_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_publication.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_publication_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_replication_origin.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_replication_origin_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_statistic.h +10 -4
- data/ext/pg_query/include/postgres/catalog/pg_statistic_d.h +7 -3
- data/ext/pg_query/include/postgres/catalog/pg_statistic_ext.h +10 -7
- data/ext/pg_query/include/postgres/catalog/pg_statistic_ext_d.h +3 -3
- data/ext/pg_query/include/postgres/catalog/pg_transform.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_transform_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_trigger.h +4 -4
- data/ext/pg_query/include/postgres/catalog/pg_trigger_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_ts_config.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_ts_config_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_ts_dict.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_ts_dict_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_ts_parser.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_ts_parser_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_ts_template.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_ts_template_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/pg_type.h +6 -3
- data/ext/pg_query/include/postgres/catalog/pg_type_d.h +1 -1
- data/ext/pg_query/include/postgres/catalog/storage.h +1 -1
- data/ext/pg_query/include/postgres/catalog/syscache_ids.h +104 -0
- data/ext/pg_query/include/postgres/commands/async.h +2 -6
- data/ext/pg_query/include/postgres/commands/dbcommands.h +1 -1
- data/ext/pg_query/include/postgres/commands/defrem.h +6 -6
- data/ext/pg_query/include/postgres/commands/event_trigger.h +11 -2
- data/ext/pg_query/include/postgres/commands/explain.h +19 -3
- data/ext/pg_query/include/postgres/commands/prepare.h +1 -1
- data/ext/pg_query/include/postgres/commands/tablespace.h +1 -1
- data/ext/pg_query/include/postgres/commands/trigger.h +1 -1
- data/ext/pg_query/include/postgres/commands/vacuum.h +28 -26
- data/ext/pg_query/include/postgres/common/cryptohash.h +2 -2
- data/ext/pg_query/include/postgres/common/file_perm.h +1 -1
- data/ext/pg_query/include/postgres/common/file_utils.h +65 -0
- data/ext/pg_query/include/postgres/common/hashfn.h +16 -1
- data/ext/pg_query/include/postgres/common/hashfn_unstable.h +407 -0
- data/ext/pg_query/include/postgres/common/int.h +79 -4
- data/ext/pg_query/include/postgres/common/keywords.h +1 -1
- data/ext/pg_query/include/postgres/common/kwlookup.h +1 -1
- data/ext/pg_query/include/postgres/common/pg_prng.h +2 -1
- data/ext/pg_query/include/postgres/common/relpath.h +4 -4
- data/ext/pg_query/include/postgres/common/scram-common.h +1 -1
- data/ext/pg_query/include/postgres/common/sha2.h +1 -1
- data/ext/pg_query/include/postgres/common/string.h +1 -1
- data/ext/pg_query/include/postgres/common/unicode_east_asian_fw_table.h +2 -3
- data/ext/pg_query/include/postgres/copyfuncs.funcs.c +278 -30
- data/ext/pg_query/include/postgres/copyfuncs.switch.c +55 -4
- data/ext/pg_query/include/postgres/datatype/timestamp.h +29 -3
- data/ext/pg_query/include/postgres/equalfuncs.funcs.c +239 -26
- data/ext/pg_query/include/postgres/equalfuncs.switch.c +55 -4
- data/ext/pg_query/include/postgres/executor/execdesc.h +2 -2
- data/ext/pg_query/include/postgres/executor/executor.h +6 -5
- data/ext/pg_query/include/postgres/executor/functions.h +2 -1
- data/ext/pg_query/include/postgres/executor/instrument.h +5 -3
- data/ext/pg_query/include/postgres/executor/spi.h +2 -8
- data/ext/pg_query/include/postgres/executor/tablefunc.h +1 -1
- data/ext/pg_query/include/postgres/executor/tuptable.h +31 -2
- data/ext/pg_query/include/postgres/fmgr.h +2 -2
- data/ext/pg_query/include/postgres/foreign/fdwapi.h +1 -1
- data/ext/pg_query/include/postgres/funcapi.h +2 -2
- data/ext/pg_query/include/postgres/gram.h +871 -830
- data/ext/pg_query/include/postgres/gramparse.h +1 -1
- data/ext/pg_query/include/postgres/jit/jit.h +4 -3
- data/ext/pg_query/include/postgres/kwlist_d.h +511 -466
- data/ext/pg_query/include/postgres/lib/dshash.h +25 -10
- data/ext/pg_query/include/postgres/lib/ilist.h +1 -1
- data/ext/pg_query/include/postgres/lib/pairingheap.h +1 -1
- data/ext/pg_query/include/postgres/lib/simplehash.h +40 -18
- data/ext/pg_query/include/postgres/lib/sort_template.h +14 -1
- data/ext/pg_query/include/postgres/lib/stringinfo.h +93 -11
- data/ext/pg_query/include/postgres/libpq/auth.h +1 -1
- data/ext/pg_query/include/postgres/libpq/crypt.h +2 -2
- data/ext/pg_query/include/postgres/libpq/hba.h +4 -4
- data/ext/pg_query/include/postgres/libpq/libpq-be.h +35 -28
- data/ext/pg_query/include/postgres/libpq/libpq.h +6 -7
- data/ext/pg_query/include/postgres/libpq/pqcomm.h +26 -20
- data/ext/pg_query/include/postgres/libpq/pqformat.h +2 -3
- data/ext/pg_query/include/postgres/libpq/pqsignal.h +1 -1
- data/ext/pg_query/include/postgres/libpq/protocol.h +89 -0
- data/ext/pg_query/include/postgres/libpq/sasl.h +1 -1
- data/ext/pg_query/include/postgres/libpq/scram.h +1 -1
- data/ext/pg_query/include/postgres/mb/pg_wchar.h +103 -82
- data/ext/pg_query/include/postgres/mb/stringinfo_mb.h +1 -1
- data/ext/pg_query/include/postgres/miscadmin.h +72 -52
- data/ext/pg_query/include/postgres/nodes/bitmapset.h +17 -3
- data/ext/pg_query/include/postgres/nodes/execnodes.h +112 -25
- data/ext/pg_query/include/postgres/nodes/extensible.h +1 -1
- data/ext/pg_query/include/postgres/nodes/lockoptions.h +4 -4
- data/ext/pg_query/include/postgres/nodes/makefuncs.h +8 -2
- data/ext/pg_query/include/postgres/nodes/memnodes.h +43 -4
- data/ext/pg_query/include/postgres/nodes/miscnodes.h +1 -1
- data/ext/pg_query/include/postgres/nodes/nodeFuncs.h +1 -1
- data/ext/pg_query/include/postgres/nodes/nodes.h +30 -41
- data/ext/pg_query/include/postgres/nodes/nodetags.h +464 -444
- data/ext/pg_query/include/postgres/nodes/params.h +1 -1
- data/ext/pg_query/include/postgres/nodes/parsenodes.h +358 -175
- data/ext/pg_query/include/postgres/nodes/pathnodes.h +64 -10
- data/ext/pg_query/include/postgres/nodes/pg_list.h +62 -11
- data/ext/pg_query/include/postgres/nodes/plannodes.h +11 -10
- data/ext/pg_query/include/postgres/nodes/primnodes.h +352 -54
- data/ext/pg_query/include/postgres/nodes/print.h +1 -1
- data/ext/pg_query/include/postgres/nodes/queryjumble.h +2 -2
- data/ext/pg_query/include/postgres/nodes/replnodes.h +23 -2
- data/ext/pg_query/include/postgres/nodes/supportnodes.h +1 -1
- data/ext/pg_query/include/postgres/nodes/tidbitmap.h +1 -1
- data/ext/pg_query/include/postgres/nodes/value.h +1 -1
- data/ext/pg_query/include/postgres/optimizer/cost.h +5 -4
- data/ext/pg_query/include/postgres/optimizer/geqo.h +1 -1
- data/ext/pg_query/include/postgres/optimizer/geqo_gene.h +1 -1
- data/ext/pg_query/include/postgres/optimizer/optimizer.h +5 -2
- data/ext/pg_query/include/postgres/optimizer/paths.h +13 -8
- data/ext/pg_query/include/postgres/optimizer/planmain.h +7 -1
- data/ext/pg_query/include/postgres/parser/analyze.h +3 -1
- data/ext/pg_query/include/postgres/parser/kwlist.h +22 -2
- data/ext/pg_query/include/postgres/parser/parse_agg.h +1 -1
- data/ext/pg_query/include/postgres/parser/parse_coerce.h +5 -2
- data/ext/pg_query/include/postgres/parser/parse_expr.h +1 -1
- data/ext/pg_query/include/postgres/parser/parse_func.h +2 -2
- data/ext/pg_query/include/postgres/parser/parse_node.h +3 -2
- data/ext/pg_query/include/postgres/parser/parse_oper.h +4 -1
- data/ext/pg_query/include/postgres/parser/parse_relation.h +1 -1
- data/ext/pg_query/include/postgres/parser/parse_type.h +2 -2
- data/ext/pg_query/include/postgres/parser/parser.h +3 -3
- data/ext/pg_query/include/postgres/parser/parsetree.h +1 -1
- data/ext/pg_query/include/postgres/parser/scanner.h +1 -1
- data/ext/pg_query/include/postgres/parser/scansup.h +1 -1
- data/ext/pg_query/include/postgres/partitioning/partdefs.h +1 -1
- data/ext/pg_query/include/postgres/pg_config.h +53 -45
- data/ext/pg_query/include/postgres/pg_config_manual.h +21 -8
- data/ext/pg_query/include/postgres/pg_getopt.h +1 -1
- data/ext/pg_query/include/postgres/pg_trace.h +1 -1
- data/ext/pg_query/include/postgres/pgstat.h +13 -11
- data/ext/pg_query/include/postgres/pgtime.h +1 -1
- data/ext/pg_query/include/postgres/pl_reserved_kwlist.h +1 -1
- data/ext/pg_query/include/postgres/pl_reserved_kwlist_d.h +1 -1
- data/ext/pg_query/include/postgres/pl_unreserved_kwlist.h +1 -1
- data/ext/pg_query/include/postgres/pl_unreserved_kwlist_d.h +1 -1
- data/ext/pg_query/include/postgres/plerrcodes.h +4 -4
- data/ext/pg_query/include/postgres/plpgsql.h +15 -13
- data/ext/pg_query/include/postgres/port/atomics/arch-arm.h +1 -1
- data/ext/pg_query/include/postgres/port/atomics/arch-hppa.h +1 -1
- data/ext/pg_query/include/postgres/port/atomics/arch-ppc.h +3 -1
- data/ext/pg_query/include/postgres/port/atomics/arch-x86.h +3 -1
- data/ext/pg_query/include/postgres/port/atomics/fallback.h +1 -1
- data/ext/pg_query/include/postgres/port/atomics/generic-gcc.h +38 -1
- data/ext/pg_query/include/postgres/port/atomics/generic-msvc.h +19 -1
- data/ext/pg_query/include/postgres/port/atomics/generic-sunpro.h +16 -1
- data/ext/pg_query/include/postgres/port/atomics/generic.h +38 -2
- data/ext/pg_query/include/postgres/port/atomics.h +93 -6
- data/ext/pg_query/include/postgres/port/pg_bitutils.h +91 -9
- data/ext/pg_query/include/postgres/port/pg_bswap.h +1 -1
- data/ext/pg_query/include/postgres/port/pg_crc32c.h +10 -1
- data/ext/pg_query/include/postgres/port/pg_iovec.h +117 -0
- data/ext/pg_query/include/postgres/port/simd.h +48 -1
- data/ext/pg_query/include/postgres/port/win32/sys/socket.h +8 -0
- data/ext/pg_query/include/postgres/port/win32_port.h +1 -13
- data/ext/pg_query/include/postgres/port.h +39 -4
- data/ext/pg_query/include/postgres/portability/instr_time.h +1 -1
- data/ext/pg_query/include/postgres/postgres.h +1 -1
- data/ext/pg_query/include/postgres/postmaster/autovacuum.h +5 -16
- data/ext/pg_query/include/postgres/postmaster/bgworker.h +8 -6
- data/ext/pg_query/include/postgres/postmaster/bgworker_internals.h +3 -7
- data/ext/pg_query/include/postgres/postmaster/bgwriter.h +3 -3
- data/ext/pg_query/include/postgres/postmaster/interrupt.h +1 -1
- data/ext/pg_query/include/postgres/postmaster/pgarch.h +2 -2
- data/ext/pg_query/include/postgres/postmaster/postmaster.h +25 -5
- data/ext/pg_query/include/postgres/postmaster/startup.h +2 -2
- data/ext/pg_query/include/postgres/postmaster/syslogger.h +2 -4
- data/ext/pg_query/include/postgres/postmaster/walsummarizer.h +35 -0
- data/ext/pg_query/include/postgres/postmaster/walwriter.h +2 -2
- data/ext/pg_query/include/postgres/regex/regex.h +92 -9
- data/ext/pg_query/include/postgres/replication/logicallauncher.h +1 -1
- data/ext/pg_query/include/postgres/replication/logicalproto.h +2 -2
- data/ext/pg_query/include/postgres/replication/logicalworker.h +2 -1
- data/ext/pg_query/include/postgres/replication/origin.h +1 -1
- data/ext/pg_query/include/postgres/replication/reorderbuffer.h +27 -46
- data/ext/pg_query/include/postgres/replication/slot.h +45 -5
- data/ext/pg_query/include/postgres/replication/slotsync.h +38 -0
- data/ext/pg_query/include/postgres/replication/syncrep.h +1 -1
- data/ext/pg_query/include/postgres/replication/walreceiver.h +37 -11
- data/ext/pg_query/include/postgres/replication/walsender.h +5 -3
- data/ext/pg_query/include/postgres/rewrite/prs2lock.h +1 -1
- data/ext/pg_query/include/postgres/rewrite/rewriteHandler.h +7 -1
- data/ext/pg_query/include/postgres/rewrite/rewriteManip.h +2 -2
- data/ext/pg_query/include/postgres/rewrite/rewriteSupport.h +1 -1
- data/ext/pg_query/include/postgres/storage/block.h +1 -1
- data/ext/pg_query/include/postgres/storage/buf.h +1 -1
- data/ext/pg_query/include/postgres/storage/bufmgr.h +59 -41
- data/ext/pg_query/include/postgres/storage/bufpage.h +1 -1
- data/ext/pg_query/include/postgres/storage/condition_variable.h +1 -1
- data/ext/pg_query/include/postgres/storage/dsm.h +1 -1
- data/ext/pg_query/include/postgres/storage/dsm_impl.h +2 -2
- data/ext/pg_query/include/postgres/storage/fd.h +30 -13
- data/ext/pg_query/include/postgres/storage/fileset.h +1 -1
- data/ext/pg_query/include/postgres/storage/ipc.h +4 -1
- data/ext/pg_query/include/postgres/storage/item.h +1 -1
- data/ext/pg_query/include/postgres/storage/itemid.h +1 -1
- data/ext/pg_query/include/postgres/storage/itemptr.h +1 -1
- data/ext/pg_query/include/postgres/storage/large_object.h +1 -1
- data/ext/pg_query/include/postgres/storage/latch.h +4 -2
- data/ext/pg_query/include/postgres/storage/lmgr.h +8 -2
- data/ext/pg_query/include/postgres/storage/lock.h +19 -19
- data/ext/pg_query/include/postgres/storage/lockdefs.h +3 -1
- data/ext/pg_query/include/postgres/storage/lwlock.h +17 -9
- data/ext/pg_query/include/postgres/storage/lwlocknames.h +7 -10
- data/ext/pg_query/include/postgres/storage/off.h +1 -1
- data/ext/pg_query/include/postgres/storage/pg_sema.h +1 -1
- data/ext/pg_query/include/postgres/storage/pg_shmem.h +5 -4
- data/ext/pg_query/include/postgres/storage/pmsignal.h +2 -2
- data/ext/pg_query/include/postgres/storage/predicate.h +1 -5
- data/ext/pg_query/include/postgres/storage/proc.h +48 -26
- data/ext/pg_query/include/postgres/storage/procarray.h +5 -1
- data/ext/pg_query/include/postgres/storage/proclist_types.h +11 -9
- data/ext/pg_query/include/postgres/storage/procnumber.h +43 -0
- data/ext/pg_query/include/postgres/storage/procsignal.h +8 -6
- data/ext/pg_query/include/postgres/storage/read_stream.h +65 -0
- data/ext/pg_query/include/postgres/storage/relfilelocator.h +16 -15
- data/ext/pg_query/include/postgres/storage/s_lock.h +7 -27
- data/ext/pg_query/include/postgres/storage/sharedfileset.h +1 -1
- data/ext/pg_query/include/postgres/storage/shm_mq.h +2 -2
- data/ext/pg_query/include/postgres/storage/shm_toc.h +1 -1
- data/ext/pg_query/include/postgres/storage/shmem.h +1 -1
- data/ext/pg_query/include/postgres/storage/sinval.h +3 -3
- data/ext/pg_query/include/postgres/storage/smgr.h +46 -29
- data/ext/pg_query/include/postgres/storage/spin.h +1 -1
- data/ext/pg_query/include/postgres/storage/standby.h +13 -3
- data/ext/pg_query/include/postgres/storage/standbydefs.h +2 -2
- data/ext/pg_query/include/postgres/storage/sync.h +4 -4
- data/ext/pg_query/include/postgres/tcop/cmdtag.h +1 -2
- data/ext/pg_query/include/postgres/tcop/cmdtaglist.h +3 -2
- data/ext/pg_query/include/postgres/tcop/deparse_utility.h +2 -2
- data/ext/pg_query/include/postgres/tcop/dest.h +3 -2
- data/ext/pg_query/include/postgres/tcop/fastpath.h +1 -1
- data/ext/pg_query/include/postgres/tcop/pquery.h +1 -1
- data/ext/pg_query/include/postgres/tcop/tcopprot.h +9 -5
- data/ext/pg_query/include/postgres/tcop/utility.h +2 -2
- data/ext/pg_query/include/postgres/tsearch/ts_cache.h +1 -1
- data/ext/pg_query/include/postgres/utils/acl.h +19 -7
- data/ext/pg_query/include/postgres/utils/aclchk_internal.h +1 -1
- data/ext/pg_query/include/postgres/utils/array.h +1 -2
- data/ext/pg_query/include/postgres/utils/ascii.h +84 -0
- data/ext/pg_query/include/postgres/utils/backend_progress.h +3 -2
- data/ext/pg_query/include/postgres/utils/backend_status.h +8 -10
- data/ext/pg_query/include/postgres/utils/builtins.h +4 -1
- data/ext/pg_query/include/postgres/utils/bytea.h +2 -2
- data/ext/pg_query/include/postgres/utils/catcache.h +6 -6
- data/ext/pg_query/include/postgres/utils/date.h +1 -1
- data/ext/pg_query/include/postgres/utils/datetime.h +4 -1
- data/ext/pg_query/include/postgres/utils/datum.h +1 -1
- data/ext/pg_query/include/postgres/utils/dsa.h +44 -5
- data/ext/pg_query/include/postgres/utils/elog.h +3 -8
- data/ext/pg_query/include/postgres/utils/errcodes.h +1 -3
- data/ext/pg_query/include/postgres/utils/expandeddatum.h +1 -1
- data/ext/pg_query/include/postgres/utils/expandedrecord.h +1 -1
- data/ext/pg_query/include/postgres/utils/float.h +1 -1
- data/ext/pg_query/include/postgres/utils/fmgroids.h +49 -16
- data/ext/pg_query/include/postgres/utils/fmgrprotos.h +47 -14
- data/ext/pg_query/include/postgres/utils/fmgrtab.h +1 -1
- data/ext/pg_query/include/postgres/utils/guc.h +20 -6
- data/ext/pg_query/include/postgres/utils/guc_hooks.h +23 -2
- data/ext/pg_query/include/postgres/utils/guc_tables.h +6 -5
- data/ext/pg_query/include/postgres/utils/hsearch.h +2 -2
- data/ext/pg_query/include/postgres/utils/injection_point.h +44 -0
- data/ext/pg_query/include/postgres/utils/inval.h +1 -1
- data/ext/pg_query/include/postgres/utils/logtape.h +5 -5
- data/ext/pg_query/include/postgres/utils/lsyscache.h +6 -3
- data/ext/pg_query/include/postgres/utils/memdebug.h +1 -1
- data/ext/pg_query/include/postgres/utils/memutils.h +12 -5
- data/ext/pg_query/include/postgres/utils/memutils_internal.h +53 -13
- data/ext/pg_query/include/postgres/utils/memutils_memorychunk.h +25 -9
- data/ext/pg_query/include/postgres/utils/numeric.h +6 -1
- data/ext/pg_query/include/postgres/utils/palloc.h +1 -15
- data/ext/pg_query/include/postgres/utils/partcache.h +1 -1
- data/ext/pg_query/include/postgres/utils/pg_locale.h +8 -7
- data/ext/pg_query/include/postgres/utils/pgstat_internal.h +30 -17
- data/ext/pg_query/include/postgres/utils/plancache.h +5 -3
- data/ext/pg_query/include/postgres/utils/portal.h +10 -10
- data/ext/pg_query/include/postgres/utils/queryenvironment.h +2 -2
- data/ext/pg_query/include/postgres/utils/regproc.h +1 -1
- data/ext/pg_query/include/postgres/utils/rel.h +14 -15
- data/ext/pg_query/include/postgres/utils/relcache.h +2 -5
- data/ext/pg_query/include/postgres/utils/reltrigger.h +1 -1
- data/ext/pg_query/include/postgres/utils/resowner.h +90 -9
- data/ext/pg_query/include/postgres/utils/ruleutils.h +1 -1
- data/ext/pg_query/include/postgres/utils/sharedtuplestore.h +1 -1
- data/ext/pg_query/include/postgres/utils/snapmgr.h +1 -52
- data/ext/pg_query/include/postgres/utils/snapshot.h +2 -2
- data/ext/pg_query/include/postgres/utils/sortsupport.h +1 -1
- data/ext/pg_query/include/postgres/utils/syscache.h +7 -98
- data/ext/pg_query/include/postgres/utils/timeout.h +3 -2
- data/ext/pg_query/include/postgres/utils/timestamp.h +1 -1
- data/ext/pg_query/include/postgres/utils/tuplesort.h +36 -9
- data/ext/pg_query/include/postgres/utils/tuplestore.h +2 -5
- data/ext/pg_query/include/postgres/utils/typcache.h +2 -1
- data/ext/pg_query/include/postgres/utils/varlena.h +1 -1
- data/ext/pg_query/include/postgres/utils/wait_event.h +28 -214
- data/ext/pg_query/include/postgres/utils/wait_event_types.h +218 -0
- data/ext/pg_query/include/postgres/utils/xml.h +4 -4
- data/ext/pg_query/include/postgres/varatt.h +1 -1
- 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.pb-c.c +6598 -3739
- data/ext/pg_query/pg_query_normalize.c +42 -1
- data/ext/pg_query/pg_query_outfuncs_json.c +3 -1
- data/ext/pg_query/pg_query_parse_plpgsql.c +12 -13
- data/ext/pg_query/pg_query_readfuncs_protobuf.c +2 -2
- data/ext/pg_query/pg_query_scan.c +1 -1
- data/ext/pg_query/postgres_deparse.c +601 -172
- 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 +34491 -32136
- 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 +47 -42
- data/ext/pg_query/src_backend_utils_fmgr_fmgr.c +4 -2
- data/ext/pg_query/src_backend_utils_init_globals.c +15 -3
- data/ext/pg_query/src_backend_utils_mb_mbutils.c +11 -18
- data/ext/pg_query/src_backend_utils_misc_guc_tables.c +16 -6
- 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 +92 -109
- 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 +173 -28
- data/ext/pg_query/src_port_pgstrcasecmp.c +29 -1
- data/ext/pg_query/src_port_snprintf.c +15 -18
- data/ext/pg_query/src_port_strerror.c +1 -3
- data/ext/pg_query/src_port_strlcpy.c +1 -1
- data/lib/pg_query/fingerprint.rb +3 -5
- data/lib/pg_query/param_refs.rb +2 -2
- data/lib/pg_query/parse.rb +5 -7
- data/lib/pg_query/parse_error.rb +1 -0
- data/lib/pg_query/pg_query_pb.rb +27 -25
- data/lib/pg_query/scan.rb +1 -0
- data/lib/pg_query/treewalker.rb +38 -15
- data/lib/pg_query/truncate.rb +18 -20
- data/lib/pg_query/version.rb +1 -1
- metadata +31 -82
- data/ext/pg_query/include/postgres/storage/backendid.h +0 -37
- data/ext/pg_query/include/postgres/storage/sinvaladt.h +0 -45
- data/ext/pg_query/pg_query_ruby_freebsd.sym +0 -2
- data/ext/pg_query/src_backend_nodes_nodes.c +0 -38
- /data/ext/pg_query/{pg_query_ruby.sym → ext_symbols.sym} +0 -0
@@ -7,7 +7,7 @@
|
|
7
7
|
* and join trees.
|
8
8
|
*
|
9
9
|
*
|
10
|
-
* Portions Copyright (c) 1996-
|
10
|
+
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
|
11
11
|
* Portions Copyright (c) 1994, Regents of the University of California
|
12
12
|
*
|
13
13
|
* src/include/nodes/primnodes.h
|
@@ -22,6 +22,14 @@
|
|
22
22
|
#include "nodes/pg_list.h"
|
23
23
|
|
24
24
|
|
25
|
+
typedef enum OverridingKind
|
26
|
+
{
|
27
|
+
OVERRIDING_NOT_SET = 0,
|
28
|
+
OVERRIDING_USER_VALUE,
|
29
|
+
OVERRIDING_SYSTEM_VALUE,
|
30
|
+
} OverridingKind;
|
31
|
+
|
32
|
+
|
25
33
|
/* ----------------------------------------------------------------
|
26
34
|
* node definitions
|
27
35
|
* ----------------------------------------------------------------
|
@@ -49,7 +57,7 @@ typedef enum OnCommitAction
|
|
49
57
|
ONCOMMIT_NOOP, /* No ON COMMIT clause (do nothing) */
|
50
58
|
ONCOMMIT_PRESERVE_ROWS, /* ON COMMIT PRESERVE ROWS (do nothing) */
|
51
59
|
ONCOMMIT_DELETE_ROWS, /* ON COMMIT DELETE ROWS */
|
52
|
-
ONCOMMIT_DROP /* ON COMMIT DROP */
|
60
|
+
ONCOMMIT_DROP, /* ON COMMIT DROP */
|
53
61
|
} OnCommitAction;
|
54
62
|
|
55
63
|
/*
|
@@ -83,11 +91,17 @@ typedef struct RangeVar
|
|
83
91
|
Alias *alias;
|
84
92
|
|
85
93
|
/* token location, or -1 if unknown */
|
86
|
-
|
94
|
+
ParseLoc location;
|
87
95
|
} RangeVar;
|
88
96
|
|
97
|
+
typedef enum TableFuncType
|
98
|
+
{
|
99
|
+
TFT_XMLTABLE,
|
100
|
+
TFT_JSON_TABLE,
|
101
|
+
} TableFuncType;
|
102
|
+
|
89
103
|
/*
|
90
|
-
* TableFunc - node for a table function, such as XMLTABLE.
|
104
|
+
* TableFunc - node for a table function, such as XMLTABLE and JSON_TABLE.
|
91
105
|
*
|
92
106
|
* Entries in the ns_names list are either String nodes containing
|
93
107
|
* literal namespace names, or NULL pointers to represent DEFAULT.
|
@@ -95,6 +109,8 @@ typedef struct RangeVar
|
|
95
109
|
typedef struct TableFunc
|
96
110
|
{
|
97
111
|
NodeTag type;
|
112
|
+
/* XMLTABLE or JSON_TABLE */
|
113
|
+
TableFuncType functype;
|
98
114
|
/* list of namespace URI expressions */
|
99
115
|
List *ns_uris pg_node_attr(query_jumble_ignore);
|
100
116
|
/* list of namespace names or NULL */
|
@@ -115,12 +131,18 @@ typedef struct TableFunc
|
|
115
131
|
List *colexprs;
|
116
132
|
/* list of column default expressions */
|
117
133
|
List *coldefexprs pg_node_attr(query_jumble_ignore);
|
134
|
+
/* JSON_TABLE: list of column value expressions */
|
135
|
+
List *colvalexprs pg_node_attr(query_jumble_ignore);
|
136
|
+
/* JSON_TABLE: list of PASSING argument expressions */
|
137
|
+
List *passingvalexprs pg_node_attr(query_jumble_ignore);
|
118
138
|
/* nullability flag for each output column */
|
119
139
|
Bitmapset *notnulls pg_node_attr(query_jumble_ignore);
|
140
|
+
/* JSON_TABLE plan */
|
141
|
+
Node *plan pg_node_attr(query_jumble_ignore);
|
120
142
|
/* counts from 0; -1 if none specified */
|
121
143
|
int ordinalitycol pg_node_attr(query_jumble_ignore);
|
122
144
|
/* token location, or -1 if unknown */
|
123
|
-
|
145
|
+
ParseLoc location;
|
124
146
|
} TableFunc;
|
125
147
|
|
126
148
|
/*
|
@@ -268,7 +290,7 @@ typedef struct Var
|
|
268
290
|
AttrNumber varattnosyn pg_node_attr(equal_ignore, query_jumble_ignore);
|
269
291
|
|
270
292
|
/* token location, or -1 if unknown */
|
271
|
-
|
293
|
+
ParseLoc location;
|
272
294
|
} Var;
|
273
295
|
|
274
296
|
/*
|
@@ -310,7 +332,7 @@ typedef struct Const
|
|
310
332
|
* token location, or -1 if unknown. All constants are tracked as
|
311
333
|
* locations in query jumbling, to be marked as parameters.
|
312
334
|
*/
|
313
|
-
|
335
|
+
ParseLoc location pg_node_attr(query_jumble_location);
|
314
336
|
} Const;
|
315
337
|
|
316
338
|
/*
|
@@ -345,7 +367,7 @@ typedef enum ParamKind
|
|
345
367
|
PARAM_EXTERN,
|
346
368
|
PARAM_EXEC,
|
347
369
|
PARAM_SUBLINK,
|
348
|
-
PARAM_MULTIEXPR
|
370
|
+
PARAM_MULTIEXPR,
|
349
371
|
} ParamKind;
|
350
372
|
|
351
373
|
typedef struct Param
|
@@ -359,7 +381,7 @@ typedef struct Param
|
|
359
381
|
/* OID of collation, or InvalidOid if none */
|
360
382
|
Oid paramcollid pg_node_attr(query_jumble_ignore);
|
361
383
|
/* token location, or -1 if unknown */
|
362
|
-
|
384
|
+
ParseLoc location;
|
363
385
|
} Param;
|
364
386
|
|
365
387
|
/*
|
@@ -482,7 +504,7 @@ typedef struct Aggref
|
|
482
504
|
int aggtransno pg_node_attr(query_jumble_ignore);
|
483
505
|
|
484
506
|
/* token location, or -1 if unknown */
|
485
|
-
|
507
|
+
ParseLoc location;
|
486
508
|
} Aggref;
|
487
509
|
|
488
510
|
/*
|
@@ -529,7 +551,7 @@ typedef struct GroupingFunc
|
|
529
551
|
Index agglevelsup;
|
530
552
|
|
531
553
|
/* token location */
|
532
|
-
|
554
|
+
ParseLoc location;
|
533
555
|
} GroupingFunc;
|
534
556
|
|
535
557
|
/*
|
@@ -553,6 +575,8 @@ typedef struct WindowFunc
|
|
553
575
|
List *args;
|
554
576
|
/* FILTER expression, if any */
|
555
577
|
Expr *aggfilter;
|
578
|
+
/* List of WindowFuncRunConditions to help short-circuit execution */
|
579
|
+
List *runCondition pg_node_attr(query_jumble_ignore);
|
556
580
|
/* index of associated WindowClause */
|
557
581
|
Index winref;
|
558
582
|
/* true if argument list was really '*' */
|
@@ -560,9 +584,58 @@ typedef struct WindowFunc
|
|
560
584
|
/* is function a simple aggregate? */
|
561
585
|
bool winagg pg_node_attr(query_jumble_ignore);
|
562
586
|
/* token location, or -1 if unknown */
|
563
|
-
|
587
|
+
ParseLoc location;
|
564
588
|
} WindowFunc;
|
565
589
|
|
590
|
+
/*
|
591
|
+
* WindowFuncRunCondition
|
592
|
+
*
|
593
|
+
* Represents intermediate OpExprs which will be used by WindowAgg to
|
594
|
+
* short-circuit execution.
|
595
|
+
*/
|
596
|
+
typedef struct WindowFuncRunCondition
|
597
|
+
{
|
598
|
+
Expr xpr;
|
599
|
+
|
600
|
+
/* PG_OPERATOR OID of the operator */
|
601
|
+
Oid opno;
|
602
|
+
/* OID of collation that operator should use */
|
603
|
+
Oid inputcollid pg_node_attr(query_jumble_ignore);
|
604
|
+
|
605
|
+
/*
|
606
|
+
* true of WindowFunc belongs on the left of the resulting OpExpr or false
|
607
|
+
* if the WindowFunc is on the right.
|
608
|
+
*/
|
609
|
+
bool wfunc_left;
|
610
|
+
|
611
|
+
/*
|
612
|
+
* The Expr being compared to the WindowFunc to use in the OpExpr in the
|
613
|
+
* WindowAgg's runCondition
|
614
|
+
*/
|
615
|
+
Expr *arg;
|
616
|
+
} WindowFuncRunCondition;
|
617
|
+
|
618
|
+
/*
|
619
|
+
* MergeSupportFunc
|
620
|
+
*
|
621
|
+
* A MergeSupportFunc is a merge support function expression that can only
|
622
|
+
* appear in the RETURNING list of a MERGE command. It returns information
|
623
|
+
* about the currently executing merge action.
|
624
|
+
*
|
625
|
+
* Currently, the only supported function is MERGE_ACTION(), which returns the
|
626
|
+
* command executed ("INSERT", "UPDATE", or "DELETE").
|
627
|
+
*/
|
628
|
+
typedef struct MergeSupportFunc
|
629
|
+
{
|
630
|
+
Expr xpr;
|
631
|
+
/* type Oid of result */
|
632
|
+
Oid msftype;
|
633
|
+
/* OID of collation, or InvalidOid if none */
|
634
|
+
Oid msfcollid;
|
635
|
+
/* token location, or -1 if unknown */
|
636
|
+
ParseLoc location;
|
637
|
+
} MergeSupportFunc;
|
638
|
+
|
566
639
|
/*
|
567
640
|
* SubscriptingRef: describes a subscripting operation over a container
|
568
641
|
* (array, etc).
|
@@ -641,7 +714,7 @@ typedef enum CoercionContext
|
|
641
714
|
COERCION_IMPLICIT, /* coercion in context of expression */
|
642
715
|
COERCION_ASSIGNMENT, /* coercion in context of assignment */
|
643
716
|
COERCION_PLPGSQL, /* if no assignment cast, use CoerceViaIO */
|
644
|
-
COERCION_EXPLICIT /* explicit cast operation */
|
717
|
+
COERCION_EXPLICIT, /* explicit cast operation */
|
645
718
|
} CoercionContext;
|
646
719
|
|
647
720
|
/*
|
@@ -661,7 +734,7 @@ typedef enum CoercionForm
|
|
661
734
|
COERCE_EXPLICIT_CALL, /* display as a function call */
|
662
735
|
COERCE_EXPLICIT_CAST, /* display as an explicit cast */
|
663
736
|
COERCE_IMPLICIT_CAST, /* implicit cast, so hide it */
|
664
|
-
COERCE_SQL_SYNTAX /* display with SQL-mandated special syntax */
|
737
|
+
COERCE_SQL_SYNTAX, /* display with SQL-mandated special syntax */
|
665
738
|
} CoercionForm;
|
666
739
|
|
667
740
|
/*
|
@@ -694,7 +767,7 @@ typedef struct FuncExpr
|
|
694
767
|
/* arguments to the function */
|
695
768
|
List *args;
|
696
769
|
/* token location, or -1 if unknown */
|
697
|
-
|
770
|
+
ParseLoc location;
|
698
771
|
} FuncExpr;
|
699
772
|
|
700
773
|
/*
|
@@ -721,7 +794,7 @@ typedef struct NamedArgExpr
|
|
721
794
|
/* argument's number in positional notation */
|
722
795
|
int argnumber;
|
723
796
|
/* argument name location, or -1 if unknown */
|
724
|
-
|
797
|
+
ParseLoc location;
|
725
798
|
} NamedArgExpr;
|
726
799
|
|
727
800
|
/*
|
@@ -763,7 +836,7 @@ typedef struct OpExpr
|
|
763
836
|
List *args;
|
764
837
|
|
765
838
|
/* token location, or -1 if unknown */
|
766
|
-
|
839
|
+
ParseLoc location;
|
767
840
|
} OpExpr;
|
768
841
|
|
769
842
|
/*
|
@@ -843,7 +916,7 @@ typedef struct ScalarArrayOpExpr
|
|
843
916
|
List *args;
|
844
917
|
|
845
918
|
/* token location, or -1 if unknown */
|
846
|
-
|
919
|
+
ParseLoc location;
|
847
920
|
} ScalarArrayOpExpr;
|
848
921
|
|
849
922
|
/*
|
@@ -865,7 +938,7 @@ typedef struct BoolExpr
|
|
865
938
|
Expr xpr;
|
866
939
|
BoolExprType boolop;
|
867
940
|
List *args; /* arguments to this expression */
|
868
|
-
|
941
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
869
942
|
} BoolExpr;
|
870
943
|
|
871
944
|
/*
|
@@ -928,7 +1001,7 @@ typedef enum SubLinkType
|
|
928
1001
|
EXPR_SUBLINK,
|
929
1002
|
MULTIEXPR_SUBLINK,
|
930
1003
|
ARRAY_SUBLINK,
|
931
|
-
CTE_SUBLINK
|
1004
|
+
CTE_SUBLINK, /* for SubPlans only */
|
932
1005
|
} SubLinkType;
|
933
1006
|
|
934
1007
|
|
@@ -942,7 +1015,7 @@ typedef struct SubLink
|
|
942
1015
|
List *operName pg_node_attr(query_jumble_ignore);
|
943
1016
|
/* subselect as Query* or raw parsetree */
|
944
1017
|
Node *subselect;
|
945
|
-
|
1018
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
946
1019
|
} SubLink;
|
947
1020
|
|
948
1021
|
/*
|
@@ -1116,7 +1189,7 @@ typedef struct RelabelType
|
|
1116
1189
|
Oid resultcollid pg_node_attr(query_jumble_ignore);
|
1117
1190
|
/* how to display this node */
|
1118
1191
|
CoercionForm relabelformat pg_node_attr(query_jumble_ignore);
|
1119
|
-
|
1192
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1120
1193
|
} RelabelType;
|
1121
1194
|
|
1122
1195
|
/* ----------------
|
@@ -1138,7 +1211,7 @@ typedef struct CoerceViaIO
|
|
1138
1211
|
Oid resultcollid pg_node_attr(query_jumble_ignore);
|
1139
1212
|
/* how to display this node */
|
1140
1213
|
CoercionForm coerceformat pg_node_attr(query_jumble_ignore);
|
1141
|
-
|
1214
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1142
1215
|
} CoerceViaIO;
|
1143
1216
|
|
1144
1217
|
/* ----------------
|
@@ -1166,7 +1239,7 @@ typedef struct ArrayCoerceExpr
|
|
1166
1239
|
Oid resultcollid pg_node_attr(query_jumble_ignore);
|
1167
1240
|
/* how to display this node */
|
1168
1241
|
CoercionForm coerceformat pg_node_attr(query_jumble_ignore);
|
1169
|
-
|
1242
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1170
1243
|
} ArrayCoerceExpr;
|
1171
1244
|
|
1172
1245
|
/* ----------------
|
@@ -1190,7 +1263,7 @@ typedef struct ConvertRowtypeExpr
|
|
1190
1263
|
/* Like RowExpr, we deliberately omit a typmod and collation here */
|
1191
1264
|
/* how to display this node */
|
1192
1265
|
CoercionForm convertformat pg_node_attr(query_jumble_ignore);
|
1193
|
-
|
1266
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1194
1267
|
} ConvertRowtypeExpr;
|
1195
1268
|
|
1196
1269
|
/*----------
|
@@ -1205,7 +1278,7 @@ typedef struct CollateExpr
|
|
1205
1278
|
Expr xpr;
|
1206
1279
|
Expr *arg; /* input expression */
|
1207
1280
|
Oid collOid; /* collation's OID */
|
1208
|
-
|
1281
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1209
1282
|
} CollateExpr;
|
1210
1283
|
|
1211
1284
|
/*----------
|
@@ -1240,7 +1313,7 @@ typedef struct CaseExpr
|
|
1240
1313
|
Expr *arg; /* implicit equality comparison argument */
|
1241
1314
|
List *args; /* the arguments (list of WHEN clauses) */
|
1242
1315
|
Expr *defresult; /* the default result (ELSE clause) */
|
1243
|
-
|
1316
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1244
1317
|
} CaseExpr;
|
1245
1318
|
|
1246
1319
|
/*
|
@@ -1251,7 +1324,7 @@ typedef struct CaseWhen
|
|
1251
1324
|
Expr xpr;
|
1252
1325
|
Expr *expr; /* condition expression */
|
1253
1326
|
Expr *result; /* substitution result */
|
1254
|
-
|
1327
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1255
1328
|
} CaseWhen;
|
1256
1329
|
|
1257
1330
|
/*
|
@@ -1308,7 +1381,7 @@ typedef struct ArrayExpr
|
|
1308
1381
|
/* true if elements are sub-arrays */
|
1309
1382
|
bool multidims pg_node_attr(query_jumble_ignore);
|
1310
1383
|
/* token location, or -1 if unknown */
|
1311
|
-
|
1384
|
+
ParseLoc location;
|
1312
1385
|
} ArrayExpr;
|
1313
1386
|
|
1314
1387
|
/*
|
@@ -1359,7 +1432,7 @@ typedef struct RowExpr
|
|
1359
1432
|
/* list of String, or NIL */
|
1360
1433
|
List *colnames pg_node_attr(query_jumble_ignore);
|
1361
1434
|
|
1362
|
-
|
1435
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1363
1436
|
} RowExpr;
|
1364
1437
|
|
1365
1438
|
/*
|
@@ -1384,7 +1457,7 @@ typedef enum RowCompareType
|
|
1384
1457
|
ROWCOMPARE_EQ = 3, /* BTEqualStrategyNumber */
|
1385
1458
|
ROWCOMPARE_GE = 4, /* BTGreaterEqualStrategyNumber */
|
1386
1459
|
ROWCOMPARE_GT = 5, /* BTGreaterStrategyNumber */
|
1387
|
-
ROWCOMPARE_NE = 6 /* no such btree strategy */
|
1460
|
+
ROWCOMPARE_NE = 6, /* no such btree strategy */
|
1388
1461
|
} RowCompareType;
|
1389
1462
|
|
1390
1463
|
typedef struct RowCompareExpr
|
@@ -1418,7 +1491,7 @@ typedef struct CoalesceExpr
|
|
1418
1491
|
/* the arguments */
|
1419
1492
|
List *args;
|
1420
1493
|
/* token location, or -1 if unknown */
|
1421
|
-
|
1494
|
+
ParseLoc location;
|
1422
1495
|
} CoalesceExpr;
|
1423
1496
|
|
1424
1497
|
/*
|
@@ -1444,7 +1517,7 @@ typedef struct MinMaxExpr
|
|
1444
1517
|
/* the arguments */
|
1445
1518
|
List *args;
|
1446
1519
|
/* token location, or -1 if unknown */
|
1447
|
-
|
1520
|
+
ParseLoc location;
|
1448
1521
|
} MinMaxExpr;
|
1449
1522
|
|
1450
1523
|
/*
|
@@ -1474,7 +1547,7 @@ typedef enum SQLValueFunctionOp
|
|
1474
1547
|
SVFOP_USER,
|
1475
1548
|
SVFOP_SESSION_USER,
|
1476
1549
|
SVFOP_CURRENT_CATALOG,
|
1477
|
-
SVFOP_CURRENT_SCHEMA
|
1550
|
+
SVFOP_CURRENT_SCHEMA,
|
1478
1551
|
} SQLValueFunctionOp;
|
1479
1552
|
|
1480
1553
|
typedef struct SQLValueFunction
|
@@ -1488,7 +1561,7 @@ typedef struct SQLValueFunction
|
|
1488
1561
|
*/
|
1489
1562
|
Oid type pg_node_attr(query_jumble_ignore);
|
1490
1563
|
int32 typmod;
|
1491
|
-
|
1564
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1492
1565
|
} SQLValueFunction;
|
1493
1566
|
|
1494
1567
|
/*
|
@@ -1511,13 +1584,13 @@ typedef enum XmlExprOp
|
|
1511
1584
|
IS_XMLPI, /* XMLPI(name [, args]) */
|
1512
1585
|
IS_XMLROOT, /* XMLROOT(xml, version, standalone) */
|
1513
1586
|
IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval, indent) */
|
1514
|
-
IS_DOCUMENT
|
1587
|
+
IS_DOCUMENT, /* xmlval IS DOCUMENT */
|
1515
1588
|
} XmlExprOp;
|
1516
1589
|
|
1517
1590
|
typedef enum XmlOptionType
|
1518
1591
|
{
|
1519
1592
|
XMLOPTION_DOCUMENT,
|
1520
|
-
XMLOPTION_CONTENT
|
1593
|
+
XMLOPTION_CONTENT,
|
1521
1594
|
} XmlOptionType;
|
1522
1595
|
|
1523
1596
|
typedef struct XmlExpr
|
@@ -1541,7 +1614,7 @@ typedef struct XmlExpr
|
|
1541
1614
|
Oid type pg_node_attr(query_jumble_ignore);
|
1542
1615
|
int32 typmod pg_node_attr(query_jumble_ignore);
|
1543
1616
|
/* token location, or -1 if unknown */
|
1544
|
-
|
1617
|
+
ParseLoc location;
|
1545
1618
|
} XmlExpr;
|
1546
1619
|
|
1547
1620
|
/*
|
@@ -1564,7 +1637,7 @@ typedef enum JsonFormatType
|
|
1564
1637
|
{
|
1565
1638
|
JS_FORMAT_DEFAULT, /* unspecified */
|
1566
1639
|
JS_FORMAT_JSON, /* FORMAT JSON [ENCODING ...] */
|
1567
|
-
JS_FORMAT_JSONB
|
1640
|
+
JS_FORMAT_JSONB, /* implicit internal format for RETURNING
|
1568
1641
|
* jsonb */
|
1569
1642
|
} JsonFormatType;
|
1570
1643
|
|
@@ -1577,7 +1650,7 @@ typedef struct JsonFormat
|
|
1577
1650
|
NodeTag type;
|
1578
1651
|
JsonFormatType format_type; /* format type */
|
1579
1652
|
JsonEncoding encoding; /* JSON encoding */
|
1580
|
-
|
1653
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1581
1654
|
} JsonFormat;
|
1582
1655
|
|
1583
1656
|
/*
|
@@ -1596,15 +1669,19 @@ typedef struct JsonReturning
|
|
1596
1669
|
* JsonValueExpr -
|
1597
1670
|
* representation of JSON value expression (expr [FORMAT JsonFormat])
|
1598
1671
|
*
|
1599
|
-
*
|
1600
|
-
*
|
1601
|
-
*
|
1672
|
+
* raw_expr is the user-specified value, while formatted_expr is the value
|
1673
|
+
* obtained by coercing raw_expr to the type required by either the FORMAT
|
1674
|
+
* clause or an enclosing node's RETURNING clause.
|
1675
|
+
*
|
1676
|
+
* When deparsing a JsonValueExpr, get_rule_expr() prints raw_expr. However,
|
1677
|
+
* during the evaluation of a JsonValueExpr, the value of formatted_expr
|
1678
|
+
* takes precedence over that of raw_expr.
|
1602
1679
|
*/
|
1603
1680
|
typedef struct JsonValueExpr
|
1604
1681
|
{
|
1605
1682
|
NodeTag type;
|
1606
|
-
Expr *raw_expr; /*
|
1607
|
-
Expr *formatted_expr; /* formatted expression */
|
1683
|
+
Expr *raw_expr; /* user-specified expression */
|
1684
|
+
Expr *formatted_expr; /* coerced formatted expression */
|
1608
1685
|
JsonFormat *format; /* FORMAT clause, if specified */
|
1609
1686
|
} JsonValueExpr;
|
1610
1687
|
|
@@ -1613,7 +1690,10 @@ typedef enum JsonConstructorType
|
|
1613
1690
|
JSCTOR_JSON_OBJECT = 1,
|
1614
1691
|
JSCTOR_JSON_ARRAY = 2,
|
1615
1692
|
JSCTOR_JSON_OBJECTAGG = 3,
|
1616
|
-
JSCTOR_JSON_ARRAYAGG = 4
|
1693
|
+
JSCTOR_JSON_ARRAYAGG = 4,
|
1694
|
+
JSCTOR_JSON_PARSE = 5,
|
1695
|
+
JSCTOR_JSON_SCALAR = 6,
|
1696
|
+
JSCTOR_JSON_SERIALIZE = 7,
|
1617
1697
|
} JsonConstructorType;
|
1618
1698
|
|
1619
1699
|
/*
|
@@ -1630,7 +1710,7 @@ typedef struct JsonConstructorExpr
|
|
1630
1710
|
JsonReturning *returning; /* RETURNING clause */
|
1631
1711
|
bool absent_on_null; /* ABSENT ON NULL? */
|
1632
1712
|
bool unique; /* WITH UNIQUE KEYS? (JSON_OBJECT[AGG] only) */
|
1633
|
-
|
1713
|
+
ParseLoc location;
|
1634
1714
|
} JsonConstructorExpr;
|
1635
1715
|
|
1636
1716
|
/*
|
@@ -1642,7 +1722,7 @@ typedef enum JsonValueType
|
|
1642
1722
|
JS_TYPE_ANY, /* IS JSON [VALUE] */
|
1643
1723
|
JS_TYPE_OBJECT, /* IS JSON OBJECT */
|
1644
1724
|
JS_TYPE_ARRAY, /* IS JSON ARRAY */
|
1645
|
-
JS_TYPE_SCALAR /* IS JSON SCALAR */
|
1725
|
+
JS_TYPE_SCALAR, /* IS JSON SCALAR */
|
1646
1726
|
} JsonValueType;
|
1647
1727
|
|
1648
1728
|
/*
|
@@ -1656,9 +1736,198 @@ typedef struct JsonIsPredicate
|
|
1656
1736
|
JsonFormat *format; /* FORMAT clause, if specified */
|
1657
1737
|
JsonValueType item_type; /* JSON item type */
|
1658
1738
|
bool unique_keys; /* check key uniqueness? */
|
1659
|
-
|
1739
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1660
1740
|
} JsonIsPredicate;
|
1661
1741
|
|
1742
|
+
/* Nodes used in SQL/JSON query functions */
|
1743
|
+
|
1744
|
+
/*
|
1745
|
+
* JsonWrapper -
|
1746
|
+
* representation of WRAPPER clause for JSON_QUERY()
|
1747
|
+
*/
|
1748
|
+
typedef enum JsonWrapper
|
1749
|
+
{
|
1750
|
+
JSW_UNSPEC,
|
1751
|
+
JSW_NONE,
|
1752
|
+
JSW_CONDITIONAL,
|
1753
|
+
JSW_UNCONDITIONAL,
|
1754
|
+
} JsonWrapper;
|
1755
|
+
|
1756
|
+
/*
|
1757
|
+
* JsonBehaviorType -
|
1758
|
+
* enumeration of behavior types used in SQL/JSON ON ERROR/EMPTY clauses
|
1759
|
+
*
|
1760
|
+
* If enum members are reordered, get_json_behavior() from ruleutils.c
|
1761
|
+
* must be updated accordingly.
|
1762
|
+
*/
|
1763
|
+
typedef enum JsonBehaviorType
|
1764
|
+
{
|
1765
|
+
JSON_BEHAVIOR_NULL = 0,
|
1766
|
+
JSON_BEHAVIOR_ERROR,
|
1767
|
+
JSON_BEHAVIOR_EMPTY,
|
1768
|
+
JSON_BEHAVIOR_TRUE,
|
1769
|
+
JSON_BEHAVIOR_FALSE,
|
1770
|
+
JSON_BEHAVIOR_UNKNOWN,
|
1771
|
+
JSON_BEHAVIOR_EMPTY_ARRAY,
|
1772
|
+
JSON_BEHAVIOR_EMPTY_OBJECT,
|
1773
|
+
JSON_BEHAVIOR_DEFAULT,
|
1774
|
+
} JsonBehaviorType;
|
1775
|
+
|
1776
|
+
/*
|
1777
|
+
* JsonBehavior
|
1778
|
+
* Specifications for ON ERROR / ON EMPTY behaviors of SQL/JSON
|
1779
|
+
* query functions specified by a JsonExpr
|
1780
|
+
*
|
1781
|
+
* 'expr' is the expression to emit when a given behavior (EMPTY or ERROR)
|
1782
|
+
* occurs on evaluating the SQL/JSON query function. 'coerce' is set to true
|
1783
|
+
* if 'expr' isn't already of the expected target type given by
|
1784
|
+
* JsonExpr.returning.
|
1785
|
+
*/
|
1786
|
+
typedef struct JsonBehavior
|
1787
|
+
{
|
1788
|
+
NodeTag type;
|
1789
|
+
|
1790
|
+
JsonBehaviorType btype;
|
1791
|
+
Node *expr;
|
1792
|
+
bool coerce;
|
1793
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1794
|
+
} JsonBehavior;
|
1795
|
+
|
1796
|
+
/*
|
1797
|
+
* JsonExprOp -
|
1798
|
+
* enumeration of SQL/JSON query function types
|
1799
|
+
*/
|
1800
|
+
typedef enum JsonExprOp
|
1801
|
+
{
|
1802
|
+
JSON_EXISTS_OP, /* JSON_EXISTS() */
|
1803
|
+
JSON_QUERY_OP, /* JSON_QUERY() */
|
1804
|
+
JSON_VALUE_OP, /* JSON_VALUE() */
|
1805
|
+
JSON_TABLE_OP, /* JSON_TABLE() */
|
1806
|
+
} JsonExprOp;
|
1807
|
+
|
1808
|
+
/*
|
1809
|
+
* JsonExpr -
|
1810
|
+
* Transformed representation of JSON_VALUE(), JSON_QUERY(), and
|
1811
|
+
* JSON_EXISTS()
|
1812
|
+
*/
|
1813
|
+
typedef struct JsonExpr
|
1814
|
+
{
|
1815
|
+
Expr xpr;
|
1816
|
+
|
1817
|
+
JsonExprOp op;
|
1818
|
+
|
1819
|
+
char *column_name; /* JSON_TABLE() column name or NULL if this is
|
1820
|
+
* not for a JSON_TABLE() */
|
1821
|
+
|
1822
|
+
/* jsonb-valued expression to query */
|
1823
|
+
Node *formatted_expr;
|
1824
|
+
|
1825
|
+
/* Format of the above expression needed by ruleutils.c */
|
1826
|
+
JsonFormat *format;
|
1827
|
+
|
1828
|
+
/* jsonpath-valued expression containing the query pattern */
|
1829
|
+
Node *path_spec;
|
1830
|
+
|
1831
|
+
/* Expected type/format of the output. */
|
1832
|
+
JsonReturning *returning;
|
1833
|
+
|
1834
|
+
/* Information about the PASSING argument expressions */
|
1835
|
+
List *passing_names;
|
1836
|
+
List *passing_values;
|
1837
|
+
|
1838
|
+
/* User-specified or default ON EMPTY and ON ERROR behaviors */
|
1839
|
+
JsonBehavior *on_empty;
|
1840
|
+
JsonBehavior *on_error;
|
1841
|
+
|
1842
|
+
/*
|
1843
|
+
* Information about converting the result of jsonpath functions
|
1844
|
+
* JsonPathQuery() and JsonPathValue() to the RETURNING type.
|
1845
|
+
*/
|
1846
|
+
bool use_io_coercion;
|
1847
|
+
bool use_json_coercion;
|
1848
|
+
|
1849
|
+
/* WRAPPER specification for JSON_QUERY */
|
1850
|
+
JsonWrapper wrapper;
|
1851
|
+
|
1852
|
+
/* KEEP or OMIT QUOTES for singleton scalars returned by JSON_QUERY() */
|
1853
|
+
bool omit_quotes;
|
1854
|
+
|
1855
|
+
/* JsonExpr's collation. */
|
1856
|
+
Oid collation;
|
1857
|
+
|
1858
|
+
/* Original JsonFuncExpr's location */
|
1859
|
+
ParseLoc location;
|
1860
|
+
} JsonExpr;
|
1861
|
+
|
1862
|
+
/*
|
1863
|
+
* JsonTablePath
|
1864
|
+
* A JSON path expression to be computed as part of evaluating
|
1865
|
+
* a JSON_TABLE plan node
|
1866
|
+
*/
|
1867
|
+
typedef struct JsonTablePath
|
1868
|
+
{
|
1869
|
+
NodeTag type;
|
1870
|
+
|
1871
|
+
Const *value;
|
1872
|
+
char *name;
|
1873
|
+
} JsonTablePath;
|
1874
|
+
|
1875
|
+
/*
|
1876
|
+
* JsonTablePlan -
|
1877
|
+
* Abstract class to represent different types of JSON_TABLE "plans".
|
1878
|
+
* A plan is used to generate a "row pattern" value by evaluating a JSON
|
1879
|
+
* path expression against an input JSON document, which is then used for
|
1880
|
+
* populating JSON_TABLE() columns
|
1881
|
+
*/
|
1882
|
+
typedef struct JsonTablePlan
|
1883
|
+
{
|
1884
|
+
pg_node_attr(abstract)
|
1885
|
+
|
1886
|
+
NodeTag type;
|
1887
|
+
} JsonTablePlan;
|
1888
|
+
|
1889
|
+
/*
|
1890
|
+
* JSON_TABLE plan to evaluate a JSON path expression and NESTED paths, if
|
1891
|
+
* any.
|
1892
|
+
*/
|
1893
|
+
typedef struct JsonTablePathScan
|
1894
|
+
{
|
1895
|
+
JsonTablePlan plan;
|
1896
|
+
|
1897
|
+
/* JSON path to evaluate */
|
1898
|
+
JsonTablePath *path;
|
1899
|
+
|
1900
|
+
/*
|
1901
|
+
* ERROR/EMPTY ON ERROR behavior; only significant in the plan for the
|
1902
|
+
* top-level path.
|
1903
|
+
*/
|
1904
|
+
bool errorOnError;
|
1905
|
+
|
1906
|
+
/* Plan(s) for nested columns, if any. */
|
1907
|
+
JsonTablePlan *child;
|
1908
|
+
|
1909
|
+
/*
|
1910
|
+
* 0-based index in TableFunc.colvalexprs of the 1st and the last column
|
1911
|
+
* covered by this plan. Both are -1 if all columns are nested and thus
|
1912
|
+
* computed by the child plan(s).
|
1913
|
+
*/
|
1914
|
+
int colMin;
|
1915
|
+
int colMax;
|
1916
|
+
} JsonTablePathScan;
|
1917
|
+
|
1918
|
+
/*
|
1919
|
+
* JsonTableSiblingJoin -
|
1920
|
+
* Plan to join rows of sibling NESTED COLUMNS clauses in the same parent
|
1921
|
+
* COLUMNS clause
|
1922
|
+
*/
|
1923
|
+
typedef struct JsonTableSiblingJoin
|
1924
|
+
{
|
1925
|
+
JsonTablePlan plan;
|
1926
|
+
|
1927
|
+
JsonTablePlan *lplan;
|
1928
|
+
JsonTablePlan *rplan;
|
1929
|
+
} JsonTableSiblingJoin;
|
1930
|
+
|
1662
1931
|
/* ----------------
|
1663
1932
|
* NullTest
|
1664
1933
|
*
|
@@ -1690,7 +1959,7 @@ typedef struct NullTest
|
|
1690
1959
|
NullTestType nulltesttype; /* IS NULL, IS NOT NULL */
|
1691
1960
|
/* T to perform field-by-field null checks */
|
1692
1961
|
bool argisrow pg_node_attr(query_jumble_ignore);
|
1693
|
-
|
1962
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1694
1963
|
} NullTest;
|
1695
1964
|
|
1696
1965
|
/*
|
@@ -1712,9 +1981,38 @@ typedef struct BooleanTest
|
|
1712
1981
|
Expr xpr;
|
1713
1982
|
Expr *arg; /* input expression */
|
1714
1983
|
BoolTestType booltesttype; /* test type */
|
1715
|
-
|
1984
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1716
1985
|
} BooleanTest;
|
1717
1986
|
|
1987
|
+
|
1988
|
+
/*
|
1989
|
+
* MergeAction
|
1990
|
+
*
|
1991
|
+
* Transformed representation of a WHEN clause in a MERGE statement
|
1992
|
+
*/
|
1993
|
+
|
1994
|
+
typedef enum MergeMatchKind
|
1995
|
+
{
|
1996
|
+
MERGE_WHEN_MATCHED,
|
1997
|
+
MERGE_WHEN_NOT_MATCHED_BY_SOURCE,
|
1998
|
+
MERGE_WHEN_NOT_MATCHED_BY_TARGET
|
1999
|
+
} MergeMatchKind;
|
2000
|
+
|
2001
|
+
#define NUM_MERGE_MATCH_KINDS (MERGE_WHEN_NOT_MATCHED_BY_TARGET + 1)
|
2002
|
+
|
2003
|
+
typedef struct MergeAction
|
2004
|
+
{
|
2005
|
+
NodeTag type;
|
2006
|
+
MergeMatchKind matchKind; /* MATCHED/NOT MATCHED BY SOURCE/TARGET */
|
2007
|
+
CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */
|
2008
|
+
/* OVERRIDING clause */
|
2009
|
+
OverridingKind override pg_node_attr(query_jumble_ignore);
|
2010
|
+
Node *qual; /* transformed WHEN conditions */
|
2011
|
+
List *targetList; /* the target list (of TargetEntry) */
|
2012
|
+
/* target attribute numbers of an UPDATE */
|
2013
|
+
List *updateColnos pg_node_attr(query_jumble_ignore);
|
2014
|
+
} MergeAction;
|
2015
|
+
|
1718
2016
|
/*
|
1719
2017
|
* CoerceToDomain
|
1720
2018
|
*
|
@@ -1735,7 +2033,7 @@ typedef struct CoerceToDomain
|
|
1735
2033
|
Oid resultcollid pg_node_attr(query_jumble_ignore);
|
1736
2034
|
/* how to display this node */
|
1737
2035
|
CoercionForm coercionformat pg_node_attr(query_jumble_ignore);
|
1738
|
-
|
2036
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1739
2037
|
} CoerceToDomain;
|
1740
2038
|
|
1741
2039
|
/*
|
@@ -1757,7 +2055,7 @@ typedef struct CoerceToDomainValue
|
|
1757
2055
|
/* collation for the substituted value */
|
1758
2056
|
Oid collation pg_node_attr(query_jumble_ignore);
|
1759
2057
|
/* token location, or -1 if unknown */
|
1760
|
-
|
2058
|
+
ParseLoc location;
|
1761
2059
|
} CoerceToDomainValue;
|
1762
2060
|
|
1763
2061
|
/*
|
@@ -1777,7 +2075,7 @@ typedef struct SetToDefault
|
|
1777
2075
|
/* collation for the substituted value */
|
1778
2076
|
Oid collation pg_node_attr(query_jumble_ignore);
|
1779
2077
|
/* token location, or -1 if unknown */
|
1780
|
-
|
2078
|
+
ParseLoc location;
|
1781
2079
|
} SetToDefault;
|
1782
2080
|
|
1783
2081
|
/*
|