pg_query 5.1.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 +18 -0
- data/README.md +1 -1
- data/Rakefile +2 -2
- 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 +10 -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 +8 -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 +221 -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 +33 -24
- 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 +7 -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 +31 -36
- 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 +1 -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 +5 -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 +453 -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 +28 -2
- 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 +1 -1
- 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 +29 -25
- 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 +102 -82
- data/ext/pg_query/include/postgres/mb/stringinfo_mb.h +1 -1
- data/ext/pg_query/include/postgres/miscadmin.h +64 -52
- data/ext/pg_query/include/postgres/nodes/bitmapset.h +17 -3
- data/ext/pg_query/include/postgres/nodes/execnodes.h +109 -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 +60 -9
- 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 +344 -50
- 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 +2 -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 +34 -34
- 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 -11
- data/ext/pg_query/include/postgres/port.h +7 -3
- 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 +18 -28
- data/ext/pg_query/include/postgres/replication/slot.h +41 -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 +1 -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 -23
- 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 +41 -27
- 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 +5 -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 +11 -17
- data/ext/pg_query/include/postgres/utils/plancache.h +5 -3
- data/ext/pg_query/include/postgres/utils/portal.h +9 -9
- 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 +2 -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_ruby_freebsd.sym +0 -1
- data/ext/pg_query/pg_query_scan.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 +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 +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 +173 -28
- data/ext/pg_query/src_port_pgstrcasecmp.c +29 -1
- data/ext/pg_query/src_port_snprintf.c +1 -1
- data/ext/pg_query/src_port_strerror.c +1 -3
- data/ext/pg_query/src_port_strlcpy.c +1 -1
- data/lib/pg_query/param_refs.rb +1 -1
- data/lib/pg_query/pg_query_pb.rb +26 -3
- data/lib/pg_query/treewalker.rb +38 -11
- data/lib/pg_query/truncate.rb +1 -1
- data/lib/pg_query/version.rb +1 -1
- metadata +25 -11
- 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/src_backend_nodes_nodes.c +0 -38
@@ -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
|
/*
|
@@ -1598,7 +1671,7 @@ typedef struct JsonReturning
|
|
1598
1671
|
*
|
1599
1672
|
* The actual value is obtained by evaluating formatted_expr. raw_expr is
|
1600
1673
|
* only there for displaying the original user-written expression and is not
|
1601
|
-
* evaluated by ExecInterpExpr() and
|
1674
|
+
* evaluated by ExecInterpExpr() and eval_const_expressions_mutator().
|
1602
1675
|
*/
|
1603
1676
|
typedef struct JsonValueExpr
|
1604
1677
|
{
|
@@ -1613,7 +1686,10 @@ typedef enum JsonConstructorType
|
|
1613
1686
|
JSCTOR_JSON_OBJECT = 1,
|
1614
1687
|
JSCTOR_JSON_ARRAY = 2,
|
1615
1688
|
JSCTOR_JSON_OBJECTAGG = 3,
|
1616
|
-
JSCTOR_JSON_ARRAYAGG = 4
|
1689
|
+
JSCTOR_JSON_ARRAYAGG = 4,
|
1690
|
+
JSCTOR_JSON_PARSE = 5,
|
1691
|
+
JSCTOR_JSON_SCALAR = 6,
|
1692
|
+
JSCTOR_JSON_SERIALIZE = 7,
|
1617
1693
|
} JsonConstructorType;
|
1618
1694
|
|
1619
1695
|
/*
|
@@ -1630,7 +1706,7 @@ typedef struct JsonConstructorExpr
|
|
1630
1706
|
JsonReturning *returning; /* RETURNING clause */
|
1631
1707
|
bool absent_on_null; /* ABSENT ON NULL? */
|
1632
1708
|
bool unique; /* WITH UNIQUE KEYS? (JSON_OBJECT[AGG] only) */
|
1633
|
-
|
1709
|
+
ParseLoc location;
|
1634
1710
|
} JsonConstructorExpr;
|
1635
1711
|
|
1636
1712
|
/*
|
@@ -1642,7 +1718,7 @@ typedef enum JsonValueType
|
|
1642
1718
|
JS_TYPE_ANY, /* IS JSON [VALUE] */
|
1643
1719
|
JS_TYPE_OBJECT, /* IS JSON OBJECT */
|
1644
1720
|
JS_TYPE_ARRAY, /* IS JSON ARRAY */
|
1645
|
-
JS_TYPE_SCALAR /* IS JSON SCALAR */
|
1721
|
+
JS_TYPE_SCALAR, /* IS JSON SCALAR */
|
1646
1722
|
} JsonValueType;
|
1647
1723
|
|
1648
1724
|
/*
|
@@ -1656,9 +1732,198 @@ typedef struct JsonIsPredicate
|
|
1656
1732
|
JsonFormat *format; /* FORMAT clause, if specified */
|
1657
1733
|
JsonValueType item_type; /* JSON item type */
|
1658
1734
|
bool unique_keys; /* check key uniqueness? */
|
1659
|
-
|
1735
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1660
1736
|
} JsonIsPredicate;
|
1661
1737
|
|
1738
|
+
/* Nodes used in SQL/JSON query functions */
|
1739
|
+
|
1740
|
+
/*
|
1741
|
+
* JsonWrapper -
|
1742
|
+
* representation of WRAPPER clause for JSON_QUERY()
|
1743
|
+
*/
|
1744
|
+
typedef enum JsonWrapper
|
1745
|
+
{
|
1746
|
+
JSW_UNSPEC,
|
1747
|
+
JSW_NONE,
|
1748
|
+
JSW_CONDITIONAL,
|
1749
|
+
JSW_UNCONDITIONAL,
|
1750
|
+
} JsonWrapper;
|
1751
|
+
|
1752
|
+
/*
|
1753
|
+
* JsonBehaviorType -
|
1754
|
+
* enumeration of behavior types used in SQL/JSON ON ERROR/EMPTY clauses
|
1755
|
+
*
|
1756
|
+
* If enum members are reordered, get_json_behavior() from ruleutils.c
|
1757
|
+
* must be updated accordingly.
|
1758
|
+
*/
|
1759
|
+
typedef enum JsonBehaviorType
|
1760
|
+
{
|
1761
|
+
JSON_BEHAVIOR_NULL = 0,
|
1762
|
+
JSON_BEHAVIOR_ERROR,
|
1763
|
+
JSON_BEHAVIOR_EMPTY,
|
1764
|
+
JSON_BEHAVIOR_TRUE,
|
1765
|
+
JSON_BEHAVIOR_FALSE,
|
1766
|
+
JSON_BEHAVIOR_UNKNOWN,
|
1767
|
+
JSON_BEHAVIOR_EMPTY_ARRAY,
|
1768
|
+
JSON_BEHAVIOR_EMPTY_OBJECT,
|
1769
|
+
JSON_BEHAVIOR_DEFAULT,
|
1770
|
+
} JsonBehaviorType;
|
1771
|
+
|
1772
|
+
/*
|
1773
|
+
* JsonBehavior
|
1774
|
+
* Specifications for ON ERROR / ON EMPTY behaviors of SQL/JSON
|
1775
|
+
* query functions specified by a JsonExpr
|
1776
|
+
*
|
1777
|
+
* 'expr' is the expression to emit when a given behavior (EMPTY or ERROR)
|
1778
|
+
* occurs on evaluating the SQL/JSON query function. 'coerce' is set to true
|
1779
|
+
* if 'expr' isn't already of the expected target type given by
|
1780
|
+
* JsonExpr.returning.
|
1781
|
+
*/
|
1782
|
+
typedef struct JsonBehavior
|
1783
|
+
{
|
1784
|
+
NodeTag type;
|
1785
|
+
|
1786
|
+
JsonBehaviorType btype;
|
1787
|
+
Node *expr;
|
1788
|
+
bool coerce;
|
1789
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1790
|
+
} JsonBehavior;
|
1791
|
+
|
1792
|
+
/*
|
1793
|
+
* JsonExprOp -
|
1794
|
+
* enumeration of SQL/JSON query function types
|
1795
|
+
*/
|
1796
|
+
typedef enum JsonExprOp
|
1797
|
+
{
|
1798
|
+
JSON_EXISTS_OP, /* JSON_EXISTS() */
|
1799
|
+
JSON_QUERY_OP, /* JSON_QUERY() */
|
1800
|
+
JSON_VALUE_OP, /* JSON_VALUE() */
|
1801
|
+
JSON_TABLE_OP, /* JSON_TABLE() */
|
1802
|
+
} JsonExprOp;
|
1803
|
+
|
1804
|
+
/*
|
1805
|
+
* JsonExpr -
|
1806
|
+
* Transformed representation of JSON_VALUE(), JSON_QUERY(), and
|
1807
|
+
* JSON_EXISTS()
|
1808
|
+
*/
|
1809
|
+
typedef struct JsonExpr
|
1810
|
+
{
|
1811
|
+
Expr xpr;
|
1812
|
+
|
1813
|
+
JsonExprOp op;
|
1814
|
+
|
1815
|
+
char *column_name; /* JSON_TABLE() column name or NULL if this is
|
1816
|
+
* not for a JSON_TABLE() */
|
1817
|
+
|
1818
|
+
/* jsonb-valued expression to query */
|
1819
|
+
Node *formatted_expr;
|
1820
|
+
|
1821
|
+
/* Format of the above expression needed by ruleutils.c */
|
1822
|
+
JsonFormat *format;
|
1823
|
+
|
1824
|
+
/* jsonpath-valued expression containing the query pattern */
|
1825
|
+
Node *path_spec;
|
1826
|
+
|
1827
|
+
/* Expected type/format of the output. */
|
1828
|
+
JsonReturning *returning;
|
1829
|
+
|
1830
|
+
/* Information about the PASSING argument expressions */
|
1831
|
+
List *passing_names;
|
1832
|
+
List *passing_values;
|
1833
|
+
|
1834
|
+
/* User-specified or default ON EMPTY and ON ERROR behaviors */
|
1835
|
+
JsonBehavior *on_empty;
|
1836
|
+
JsonBehavior *on_error;
|
1837
|
+
|
1838
|
+
/*
|
1839
|
+
* Information about converting the result of jsonpath functions
|
1840
|
+
* JsonPathQuery() and JsonPathValue() to the RETURNING type.
|
1841
|
+
*/
|
1842
|
+
bool use_io_coercion;
|
1843
|
+
bool use_json_coercion;
|
1844
|
+
|
1845
|
+
/* WRAPPER specification for JSON_QUERY */
|
1846
|
+
JsonWrapper wrapper;
|
1847
|
+
|
1848
|
+
/* KEEP or OMIT QUOTES for singleton scalars returned by JSON_QUERY() */
|
1849
|
+
bool omit_quotes;
|
1850
|
+
|
1851
|
+
/* JsonExpr's collation. */
|
1852
|
+
Oid collation;
|
1853
|
+
|
1854
|
+
/* Original JsonFuncExpr's location */
|
1855
|
+
ParseLoc location;
|
1856
|
+
} JsonExpr;
|
1857
|
+
|
1858
|
+
/*
|
1859
|
+
* JsonTablePath
|
1860
|
+
* A JSON path expression to be computed as part of evaluating
|
1861
|
+
* a JSON_TABLE plan node
|
1862
|
+
*/
|
1863
|
+
typedef struct JsonTablePath
|
1864
|
+
{
|
1865
|
+
NodeTag type;
|
1866
|
+
|
1867
|
+
Const *value;
|
1868
|
+
char *name;
|
1869
|
+
} JsonTablePath;
|
1870
|
+
|
1871
|
+
/*
|
1872
|
+
* JsonTablePlan -
|
1873
|
+
* Abstract class to represent different types of JSON_TABLE "plans".
|
1874
|
+
* A plan is used to generate a "row pattern" value by evaluating a JSON
|
1875
|
+
* path expression against an input JSON document, which is then used for
|
1876
|
+
* populating JSON_TABLE() columns
|
1877
|
+
*/
|
1878
|
+
typedef struct JsonTablePlan
|
1879
|
+
{
|
1880
|
+
pg_node_attr(abstract)
|
1881
|
+
|
1882
|
+
NodeTag type;
|
1883
|
+
} JsonTablePlan;
|
1884
|
+
|
1885
|
+
/*
|
1886
|
+
* JSON_TABLE plan to evaluate a JSON path expression and NESTED paths, if
|
1887
|
+
* any.
|
1888
|
+
*/
|
1889
|
+
typedef struct JsonTablePathScan
|
1890
|
+
{
|
1891
|
+
JsonTablePlan plan;
|
1892
|
+
|
1893
|
+
/* JSON path to evaluate */
|
1894
|
+
JsonTablePath *path;
|
1895
|
+
|
1896
|
+
/*
|
1897
|
+
* ERROR/EMPTY ON ERROR behavior; only significant in the plan for the
|
1898
|
+
* top-level path.
|
1899
|
+
*/
|
1900
|
+
bool errorOnError;
|
1901
|
+
|
1902
|
+
/* Plan(s) for nested columns, if any. */
|
1903
|
+
JsonTablePlan *child;
|
1904
|
+
|
1905
|
+
/*
|
1906
|
+
* 0-based index in TableFunc.colvalexprs of the 1st and the last column
|
1907
|
+
* covered by this plan. Both are -1 if all columns are nested and thus
|
1908
|
+
* computed by the child plan(s).
|
1909
|
+
*/
|
1910
|
+
int colMin;
|
1911
|
+
int colMax;
|
1912
|
+
} JsonTablePathScan;
|
1913
|
+
|
1914
|
+
/*
|
1915
|
+
* JsonTableSiblingJoin -
|
1916
|
+
* Plan to join rows of sibling NESTED COLUMNS clauses in the same parent
|
1917
|
+
* COLUMNS clause
|
1918
|
+
*/
|
1919
|
+
typedef struct JsonTableSiblingJoin
|
1920
|
+
{
|
1921
|
+
JsonTablePlan plan;
|
1922
|
+
|
1923
|
+
JsonTablePlan *lplan;
|
1924
|
+
JsonTablePlan *rplan;
|
1925
|
+
} JsonTableSiblingJoin;
|
1926
|
+
|
1662
1927
|
/* ----------------
|
1663
1928
|
* NullTest
|
1664
1929
|
*
|
@@ -1690,7 +1955,7 @@ typedef struct NullTest
|
|
1690
1955
|
NullTestType nulltesttype; /* IS NULL, IS NOT NULL */
|
1691
1956
|
/* T to perform field-by-field null checks */
|
1692
1957
|
bool argisrow pg_node_attr(query_jumble_ignore);
|
1693
|
-
|
1958
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1694
1959
|
} NullTest;
|
1695
1960
|
|
1696
1961
|
/*
|
@@ -1712,9 +1977,38 @@ typedef struct BooleanTest
|
|
1712
1977
|
Expr xpr;
|
1713
1978
|
Expr *arg; /* input expression */
|
1714
1979
|
BoolTestType booltesttype; /* test type */
|
1715
|
-
|
1980
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1716
1981
|
} BooleanTest;
|
1717
1982
|
|
1983
|
+
|
1984
|
+
/*
|
1985
|
+
* MergeAction
|
1986
|
+
*
|
1987
|
+
* Transformed representation of a WHEN clause in a MERGE statement
|
1988
|
+
*/
|
1989
|
+
|
1990
|
+
typedef enum MergeMatchKind
|
1991
|
+
{
|
1992
|
+
MERGE_WHEN_MATCHED,
|
1993
|
+
MERGE_WHEN_NOT_MATCHED_BY_SOURCE,
|
1994
|
+
MERGE_WHEN_NOT_MATCHED_BY_TARGET
|
1995
|
+
} MergeMatchKind;
|
1996
|
+
|
1997
|
+
#define NUM_MERGE_MATCH_KINDS (MERGE_WHEN_NOT_MATCHED_BY_TARGET + 1)
|
1998
|
+
|
1999
|
+
typedef struct MergeAction
|
2000
|
+
{
|
2001
|
+
NodeTag type;
|
2002
|
+
MergeMatchKind matchKind; /* MATCHED/NOT MATCHED BY SOURCE/TARGET */
|
2003
|
+
CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */
|
2004
|
+
/* OVERRIDING clause */
|
2005
|
+
OverridingKind override pg_node_attr(query_jumble_ignore);
|
2006
|
+
Node *qual; /* transformed WHEN conditions */
|
2007
|
+
List *targetList; /* the target list (of TargetEntry) */
|
2008
|
+
/* target attribute numbers of an UPDATE */
|
2009
|
+
List *updateColnos pg_node_attr(query_jumble_ignore);
|
2010
|
+
} MergeAction;
|
2011
|
+
|
1718
2012
|
/*
|
1719
2013
|
* CoerceToDomain
|
1720
2014
|
*
|
@@ -1735,7 +2029,7 @@ typedef struct CoerceToDomain
|
|
1735
2029
|
Oid resultcollid pg_node_attr(query_jumble_ignore);
|
1736
2030
|
/* how to display this node */
|
1737
2031
|
CoercionForm coercionformat pg_node_attr(query_jumble_ignore);
|
1738
|
-
|
2032
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1739
2033
|
} CoerceToDomain;
|
1740
2034
|
|
1741
2035
|
/*
|
@@ -1757,7 +2051,7 @@ typedef struct CoerceToDomainValue
|
|
1757
2051
|
/* collation for the substituted value */
|
1758
2052
|
Oid collation pg_node_attr(query_jumble_ignore);
|
1759
2053
|
/* token location, or -1 if unknown */
|
1760
|
-
|
2054
|
+
ParseLoc location;
|
1761
2055
|
} CoerceToDomainValue;
|
1762
2056
|
|
1763
2057
|
/*
|
@@ -1777,7 +2071,7 @@ typedef struct SetToDefault
|
|
1777
2071
|
/* collation for the substituted value */
|
1778
2072
|
Oid collation pg_node_attr(query_jumble_ignore);
|
1779
2073
|
/* token location, or -1 if unknown */
|
1780
|
-
|
2074
|
+
ParseLoc location;
|
1781
2075
|
} SetToDefault;
|
1782
2076
|
|
1783
2077
|
/*
|