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
@@ -12,7 +12,7 @@
|
|
12
12
|
* identifying statement boundaries in multi-statement source strings.
|
13
13
|
*
|
14
14
|
*
|
15
|
-
* Portions Copyright (c) 1996-
|
15
|
+
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
|
16
16
|
* Portions Copyright (c) 1994, Regents of the University of California
|
17
17
|
*
|
18
18
|
* src/include/nodes/parsenodes.h
|
@@ -30,13 +30,6 @@
|
|
30
30
|
#include "partitioning/partdefs.h"
|
31
31
|
|
32
32
|
|
33
|
-
typedef enum OverridingKind
|
34
|
-
{
|
35
|
-
OVERRIDING_NOT_SET = 0,
|
36
|
-
OVERRIDING_USER_VALUE,
|
37
|
-
OVERRIDING_SYSTEM_VALUE
|
38
|
-
} OverridingKind;
|
39
|
-
|
40
33
|
/* Possible sources of a Query */
|
41
34
|
typedef enum QuerySource
|
42
35
|
{
|
@@ -44,7 +37,7 @@ typedef enum QuerySource
|
|
44
37
|
QSRC_PARSER, /* added by parse analysis (now unused) */
|
45
38
|
QSRC_INSTEAD_RULE, /* added by unconditional INSTEAD rule */
|
46
39
|
QSRC_QUAL_INSTEAD_RULE, /* added by conditional INSTEAD rule */
|
47
|
-
QSRC_NON_INSTEAD_RULE /* added by non-INSTEAD rule */
|
40
|
+
QSRC_NON_INSTEAD_RULE, /* added by non-INSTEAD rule */
|
48
41
|
} QuerySource;
|
49
42
|
|
50
43
|
/* Sort ordering options for ORDER BY and CREATE INDEX */
|
@@ -53,14 +46,14 @@ typedef enum SortByDir
|
|
53
46
|
SORTBY_DEFAULT,
|
54
47
|
SORTBY_ASC,
|
55
48
|
SORTBY_DESC,
|
56
|
-
SORTBY_USING /* not allowed in CREATE INDEX ... */
|
49
|
+
SORTBY_USING, /* not allowed in CREATE INDEX ... */
|
57
50
|
} SortByDir;
|
58
51
|
|
59
52
|
typedef enum SortByNulls
|
60
53
|
{
|
61
54
|
SORTBY_NULLS_DEFAULT,
|
62
55
|
SORTBY_NULLS_FIRST,
|
63
|
-
SORTBY_NULLS_LAST
|
56
|
+
SORTBY_NULLS_LAST,
|
64
57
|
} SortByNulls;
|
65
58
|
|
66
59
|
/* Options for [ ALL | DISTINCT ] */
|
@@ -68,7 +61,7 @@ typedef enum SetQuantifier
|
|
68
61
|
{
|
69
62
|
SET_QUANTIFIER_DEFAULT,
|
70
63
|
SET_QUANTIFIER_ALL,
|
71
|
-
SET_QUANTIFIER_DISTINCT
|
64
|
+
SET_QUANTIFIER_DISTINCT,
|
72
65
|
} SetQuantifier;
|
73
66
|
|
74
67
|
/*
|
@@ -94,7 +87,8 @@ typedef uint64 AclMode; /* a bitmask of privilege bits */
|
|
94
87
|
#define ACL_CONNECT (1<<11) /* for databases */
|
95
88
|
#define ACL_SET (1<<12) /* for configuration parameters */
|
96
89
|
#define ACL_ALTER_SYSTEM (1<<13) /* for configuration parameters */
|
97
|
-
#define
|
90
|
+
#define ACL_MAINTAIN (1<<14) /* for relations */
|
91
|
+
#define N_ACL_RIGHTS 15 /* 1 plus the last 1<<x */
|
98
92
|
#define ACL_NO_RIGHTS 0
|
99
93
|
/* Currently, SELECT ... FOR [KEY] UPDATE/SHARE requires UPDATE privileges */
|
100
94
|
#define ACL_SELECT_FOR_UPDATE ACL_UPDATE
|
@@ -160,7 +154,7 @@ typedef struct Query
|
|
160
154
|
bool hasDistinctOn pg_node_attr(query_jumble_ignore);
|
161
155
|
/* WITH RECURSIVE was specified */
|
162
156
|
bool hasRecursive pg_node_attr(query_jumble_ignore);
|
163
|
-
/* has INSERT/UPDATE/DELETE in WITH */
|
157
|
+
/* has INSERT/UPDATE/DELETE/MERGE in WITH */
|
164
158
|
bool hasModifyingCTE pg_node_attr(query_jumble_ignore);
|
165
159
|
/* FOR [KEY] UPDATE/SHARE was specified */
|
166
160
|
bool hasForUpdate pg_node_attr(query_jumble_ignore);
|
@@ -182,8 +176,17 @@ typedef struct Query
|
|
182
176
|
* also USING clause for MERGE */
|
183
177
|
|
184
178
|
List *mergeActionList; /* list of actions for MERGE (only) */
|
185
|
-
|
186
|
-
|
179
|
+
|
180
|
+
/*
|
181
|
+
* rtable index of target relation for MERGE to pull data. Initially, this
|
182
|
+
* is the same as resultRelation, but after query rewriting, if the target
|
183
|
+
* relation is a trigger-updatable view, this is the index of the expanded
|
184
|
+
* view subquery, whereas resultRelation is the index of the target view.
|
185
|
+
*/
|
186
|
+
int mergeTargetRelation pg_node_attr(query_jumble_ignore);
|
187
|
+
|
188
|
+
/* join condition between source and target for MERGE */
|
189
|
+
Node *mergeJoinCondition;
|
187
190
|
|
188
191
|
List *targetList; /* target list (of TargetEntry) */
|
189
192
|
|
@@ -232,9 +235,9 @@ typedef struct Query
|
|
232
235
|
* both be -1 meaning "unknown".
|
233
236
|
*/
|
234
237
|
/* start location, or -1 if unknown */
|
235
|
-
|
238
|
+
ParseLoc stmt_location;
|
236
239
|
/* length in bytes; 0 means "rest of string" */
|
237
|
-
|
240
|
+
ParseLoc stmt_len pg_node_attr(query_jumble_ignore);
|
238
241
|
} Query;
|
239
242
|
|
240
243
|
|
@@ -269,7 +272,7 @@ typedef struct TypeName
|
|
269
272
|
List *typmods; /* type modifier expression(s) */
|
270
273
|
int32 typemod; /* prespecified type modifier */
|
271
274
|
List *arrayBounds; /* array bounds */
|
272
|
-
|
275
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
273
276
|
} TypeName;
|
274
277
|
|
275
278
|
/*
|
@@ -289,7 +292,7 @@ typedef struct ColumnRef
|
|
289
292
|
{
|
290
293
|
NodeTag type;
|
291
294
|
List *fields; /* field names (String nodes) or A_Star */
|
292
|
-
|
295
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
293
296
|
} ColumnRef;
|
294
297
|
|
295
298
|
/*
|
@@ -299,7 +302,7 @@ typedef struct ParamRef
|
|
299
302
|
{
|
300
303
|
NodeTag type;
|
301
304
|
int number; /* the number of the parameter */
|
302
|
-
|
305
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
303
306
|
} ParamRef;
|
304
307
|
|
305
308
|
/*
|
@@ -320,7 +323,7 @@ typedef enum A_Expr_Kind
|
|
320
323
|
AEXPR_BETWEEN, /* name must be "BETWEEN" */
|
321
324
|
AEXPR_NOT_BETWEEN, /* name must be "NOT BETWEEN" */
|
322
325
|
AEXPR_BETWEEN_SYM, /* name must be "BETWEEN SYMMETRIC" */
|
323
|
-
AEXPR_NOT_BETWEEN_SYM /* name must be "NOT BETWEEN SYMMETRIC" */
|
326
|
+
AEXPR_NOT_BETWEEN_SYM, /* name must be "NOT BETWEEN SYMMETRIC" */
|
324
327
|
} A_Expr_Kind;
|
325
328
|
|
326
329
|
typedef struct A_Expr
|
@@ -332,7 +335,7 @@ typedef struct A_Expr
|
|
332
335
|
List *name; /* possibly-qualified name of operator */
|
333
336
|
Node *lexpr; /* left argument, or NULL if none */
|
334
337
|
Node *rexpr; /* right argument, or NULL if none */
|
335
|
-
|
338
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
336
339
|
} A_Expr;
|
337
340
|
|
338
341
|
/*
|
@@ -358,7 +361,7 @@ typedef struct A_Const
|
|
358
361
|
NodeTag type;
|
359
362
|
union ValUnion val;
|
360
363
|
bool isnull; /* SQL NULL constant */
|
361
|
-
|
364
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
362
365
|
} A_Const;
|
363
366
|
|
364
367
|
/*
|
@@ -369,7 +372,7 @@ typedef struct TypeCast
|
|
369
372
|
NodeTag type;
|
370
373
|
Node *arg; /* the expression being casted */
|
371
374
|
TypeName *typeName; /* the target type */
|
372
|
-
|
375
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
373
376
|
} TypeCast;
|
374
377
|
|
375
378
|
/*
|
@@ -380,7 +383,7 @@ typedef struct CollateClause
|
|
380
383
|
NodeTag type;
|
381
384
|
Node *arg; /* input expression */
|
382
385
|
List *collname; /* possibly-qualified collation name */
|
383
|
-
|
386
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
384
387
|
} CollateClause;
|
385
388
|
|
386
389
|
/*
|
@@ -392,7 +395,7 @@ typedef enum RoleSpecType
|
|
392
395
|
ROLESPEC_CURRENT_ROLE, /* role spec is CURRENT_ROLE */
|
393
396
|
ROLESPEC_CURRENT_USER, /* role spec is CURRENT_USER */
|
394
397
|
ROLESPEC_SESSION_USER, /* role spec is SESSION_USER */
|
395
|
-
ROLESPEC_PUBLIC
|
398
|
+
ROLESPEC_PUBLIC, /* role name is "public" */
|
396
399
|
} RoleSpecType;
|
397
400
|
|
398
401
|
typedef struct RoleSpec
|
@@ -400,7 +403,7 @@ typedef struct RoleSpec
|
|
400
403
|
NodeTag type;
|
401
404
|
RoleSpecType roletype; /* Type of this rolespec */
|
402
405
|
char *rolename; /* filled only for ROLESPEC_CSTRING */
|
403
|
-
|
406
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
404
407
|
} RoleSpec;
|
405
408
|
|
406
409
|
/*
|
@@ -430,7 +433,7 @@ typedef struct FuncCall
|
|
430
433
|
bool agg_distinct; /* arguments were labeled DISTINCT */
|
431
434
|
bool func_variadic; /* last argument was labeled VARIADIC */
|
432
435
|
CoercionForm funcformat; /* how to display this node */
|
433
|
-
|
436
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
434
437
|
} FuncCall;
|
435
438
|
|
436
439
|
/*
|
@@ -487,7 +490,7 @@ typedef struct A_ArrayExpr
|
|
487
490
|
{
|
488
491
|
NodeTag type;
|
489
492
|
List *elements; /* array element expressions */
|
490
|
-
|
493
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
491
494
|
} A_ArrayExpr;
|
492
495
|
|
493
496
|
/*
|
@@ -514,7 +517,7 @@ typedef struct ResTarget
|
|
514
517
|
char *name; /* column name or NULL */
|
515
518
|
List *indirection; /* subscripts, field names, and '*', or NIL */
|
516
519
|
Node *val; /* the value expression to compute or assign */
|
517
|
-
|
520
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
518
521
|
} ResTarget;
|
519
522
|
|
520
523
|
/*
|
@@ -544,7 +547,7 @@ typedef struct SortBy
|
|
544
547
|
SortByDir sortby_dir; /* ASC/DESC/USING/default */
|
545
548
|
SortByNulls sortby_nulls; /* NULLS FIRST/LAST */
|
546
549
|
List *useOp; /* name of op to use, if SORTBY_USING */
|
547
|
-
|
550
|
+
ParseLoc location; /* operator location, or -1 if none/unknown */
|
548
551
|
} SortBy;
|
549
552
|
|
550
553
|
/*
|
@@ -565,7 +568,7 @@ typedef struct WindowDef
|
|
565
568
|
int frameOptions; /* frame_clause options, see below */
|
566
569
|
Node *startOffset; /* expression for starting bound, if any */
|
567
570
|
Node *endOffset; /* expression for ending bound, if any */
|
568
|
-
|
571
|
+
ParseLoc location; /* parse location, or -1 if none/unknown */
|
569
572
|
} WindowDef;
|
570
573
|
|
571
574
|
/*
|
@@ -645,6 +648,9 @@ typedef struct RangeFunction
|
|
645
648
|
|
646
649
|
/*
|
647
650
|
* RangeTableFunc - raw form of "table functions" such as XMLTABLE
|
651
|
+
*
|
652
|
+
* Note: JSON_TABLE is also a "table function", but it uses JsonTable node,
|
653
|
+
* not RangeTableFunc.
|
648
654
|
*/
|
649
655
|
typedef struct RangeTableFunc
|
650
656
|
{
|
@@ -655,7 +661,7 @@ typedef struct RangeTableFunc
|
|
655
661
|
List *namespaces; /* list of namespaces as ResTarget */
|
656
662
|
List *columns; /* list of RangeTableFuncCol */
|
657
663
|
Alias *alias; /* table alias & optional column aliases */
|
658
|
-
|
664
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
659
665
|
} RangeTableFunc;
|
660
666
|
|
661
667
|
/*
|
@@ -673,7 +679,7 @@ typedef struct RangeTableFuncCol
|
|
673
679
|
bool is_not_null; /* does it have NOT NULL? */
|
674
680
|
Node *colexpr; /* column filter expression */
|
675
681
|
Node *coldefexpr; /* column default value expression */
|
676
|
-
|
682
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
677
683
|
} RangeTableFuncCol;
|
678
684
|
|
679
685
|
/*
|
@@ -693,7 +699,7 @@ typedef struct RangeTableSample
|
|
693
699
|
List *method; /* sampling method name (possibly qualified) */
|
694
700
|
List *args; /* argument(s) for sampling method */
|
695
701
|
Node *repeatable; /* REPEATABLE expression, or NULL if none */
|
696
|
-
|
702
|
+
ParseLoc location; /* method name location, or -1 if unknown */
|
697
703
|
} RangeTableSample;
|
698
704
|
|
699
705
|
/*
|
@@ -736,7 +742,7 @@ typedef struct ColumnDef
|
|
736
742
|
Oid collOid; /* collation OID (InvalidOid if not set) */
|
737
743
|
List *constraints; /* other constraints on column */
|
738
744
|
List *fdwoptions; /* per-column FDW options */
|
739
|
-
|
745
|
+
ParseLoc location; /* parse location, or -1 if none/unknown */
|
740
746
|
} ColumnDef;
|
741
747
|
|
742
748
|
/*
|
@@ -799,7 +805,7 @@ typedef enum DefElemAction
|
|
799
805
|
DEFELEM_UNSPEC, /* no action given */
|
800
806
|
DEFELEM_SET,
|
801
807
|
DEFELEM_ADD,
|
802
|
-
DEFELEM_DROP
|
808
|
+
DEFELEM_DROP,
|
803
809
|
} DefElemAction;
|
804
810
|
|
805
811
|
typedef struct DefElem
|
@@ -810,7 +816,7 @@ typedef struct DefElem
|
|
810
816
|
Node *arg; /* typically Integer, Float, String, or
|
811
817
|
* TypeName */
|
812
818
|
DefElemAction defaction; /* unspecified action, or SET/ADD/DROP */
|
813
|
-
|
819
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
814
820
|
} DefElem;
|
815
821
|
|
816
822
|
/*
|
@@ -840,7 +846,7 @@ typedef struct XmlSerialize
|
|
840
846
|
Node *expr;
|
841
847
|
TypeName *typeName;
|
842
848
|
bool indent; /* [NO] INDENT */
|
843
|
-
|
849
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
844
850
|
} XmlSerialize;
|
845
851
|
|
846
852
|
/* Partitioning related definitions */
|
@@ -858,14 +864,14 @@ typedef struct PartitionElem
|
|
858
864
|
Node *expr; /* expression to partition on, or NULL */
|
859
865
|
List *collation; /* name of collation; NIL = default */
|
860
866
|
List *opclass; /* name of desired opclass; NIL = default */
|
861
|
-
|
867
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
862
868
|
} PartitionElem;
|
863
869
|
|
864
870
|
typedef enum PartitionStrategy
|
865
871
|
{
|
866
872
|
PARTITION_STRATEGY_LIST = 'l',
|
867
873
|
PARTITION_STRATEGY_RANGE = 'r',
|
868
|
-
PARTITION_STRATEGY_HASH = 'h'
|
874
|
+
PARTITION_STRATEGY_HASH = 'h',
|
869
875
|
} PartitionStrategy;
|
870
876
|
|
871
877
|
/*
|
@@ -878,7 +884,7 @@ typedef struct PartitionSpec
|
|
878
884
|
NodeTag type;
|
879
885
|
PartitionStrategy strategy;
|
880
886
|
List *partParams; /* List of PartitionElems */
|
881
|
-
|
887
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
882
888
|
} PartitionSpec;
|
883
889
|
|
884
890
|
/*
|
@@ -905,7 +911,7 @@ struct PartitionBoundSpec
|
|
905
911
|
List *lowerdatums; /* List of PartitionRangeDatums */
|
906
912
|
List *upperdatums; /* List of PartitionRangeDatums */
|
907
913
|
|
908
|
-
|
914
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
909
915
|
};
|
910
916
|
|
911
917
|
/*
|
@@ -917,7 +923,7 @@ typedef enum PartitionRangeDatumKind
|
|
917
923
|
{
|
918
924
|
PARTITION_RANGE_DATUM_MINVALUE = -1, /* less than any other value */
|
919
925
|
PARTITION_RANGE_DATUM_VALUE = 0, /* a specific (bounded) value */
|
920
|
-
PARTITION_RANGE_DATUM_MAXVALUE = 1
|
926
|
+
PARTITION_RANGE_DATUM_MAXVALUE = 1, /* greater than any other value */
|
921
927
|
} PartitionRangeDatumKind;
|
922
928
|
|
923
929
|
typedef struct PartitionRangeDatum
|
@@ -928,9 +934,19 @@ typedef struct PartitionRangeDatum
|
|
928
934
|
Node *value; /* Const (or A_Const in raw tree), if kind is
|
929
935
|
* PARTITION_RANGE_DATUM_VALUE, else NULL */
|
930
936
|
|
931
|
-
|
937
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
932
938
|
} PartitionRangeDatum;
|
933
939
|
|
940
|
+
/*
|
941
|
+
* PartitionDesc - used in reverted ALTER TABLE SPLIT PARTITION command
|
942
|
+
*
|
943
|
+
* Kept as a stub for nodetag ABI compatibility.
|
944
|
+
*/
|
945
|
+
typedef struct SinglePartitionSpec
|
946
|
+
{
|
947
|
+
NodeTag type;
|
948
|
+
} SinglePartitionSpec;
|
949
|
+
|
934
950
|
/*
|
935
951
|
* PartitionCmd - info for ALTER TABLE/INDEX ATTACH/DETACH PARTITION commands
|
936
952
|
*/
|
@@ -988,10 +1004,6 @@ typedef struct PartitionCmd
|
|
988
1004
|
* them from the joinaliasvars list, because that would affect the attnums
|
989
1005
|
* of Vars referencing the rest of the list.)
|
990
1006
|
*
|
991
|
-
* inh is true for relation references that should be expanded to include
|
992
|
-
* inheritance children, if the rel has any. This *must* be false for
|
993
|
-
* RTEs other than RTE_RELATION entries.
|
994
|
-
*
|
995
1007
|
* inFromCl marks those range variables that are listed in the FROM clause.
|
996
1008
|
* It's false for RTEs that are added to a query behind the scenes, such
|
997
1009
|
* as the NEW and OLD variables for a rule, or the subqueries of a UNION.
|
@@ -1018,28 +1030,39 @@ typedef enum RTEKind
|
|
1018
1030
|
RTE_VALUES, /* VALUES (<exprlist>), (<exprlist>), ... */
|
1019
1031
|
RTE_CTE, /* common table expr (WITH list element) */
|
1020
1032
|
RTE_NAMEDTUPLESTORE, /* tuplestore, e.g. for AFTER triggers */
|
1021
|
-
RTE_RESULT /* RTE represents an empty FROM clause; such
|
1033
|
+
RTE_RESULT, /* RTE represents an empty FROM clause; such
|
1022
1034
|
* RTEs are added by the planner, they're not
|
1023
1035
|
* present during parsing or rewriting */
|
1024
1036
|
} RTEKind;
|
1025
1037
|
|
1026
1038
|
typedef struct RangeTblEntry
|
1027
1039
|
{
|
1028
|
-
pg_node_attr(custom_read_write
|
1040
|
+
pg_node_attr(custom_read_write)
|
1029
1041
|
|
1030
1042
|
NodeTag type;
|
1031
1043
|
|
1032
|
-
RTEKind rtekind; /* see above */
|
1033
|
-
|
1034
1044
|
/*
|
1035
|
-
*
|
1036
|
-
*
|
1037
|
-
*
|
1045
|
+
* Fields valid in all RTEs:
|
1046
|
+
*
|
1047
|
+
* put alias + eref first to make dump more legible
|
1038
1048
|
*/
|
1049
|
+
/* user-written alias clause, if any */
|
1050
|
+
Alias *alias pg_node_attr(query_jumble_ignore);
|
1051
|
+
/* expanded reference names */
|
1052
|
+
Alias *eref pg_node_attr(query_jumble_ignore);
|
1053
|
+
|
1054
|
+
RTEKind rtekind; /* see above */
|
1039
1055
|
|
1040
1056
|
/*
|
1041
1057
|
* Fields valid for a plain relation RTE (else zero):
|
1042
1058
|
*
|
1059
|
+
* inh is true for relation references that should be expanded to include
|
1060
|
+
* inheritance children, if the rel has any. In the parser, this will
|
1061
|
+
* only be true for RTE_RELATION entries. The planner also uses this
|
1062
|
+
* field to mark RTE_SUBQUERY entries that contain UNION ALL queries that
|
1063
|
+
* it has flattened into pulled-up subqueries (creating a structure much
|
1064
|
+
* like the effects of inheritance).
|
1065
|
+
*
|
1043
1066
|
* rellockmode is really LOCKMODE, but it's declared int to avoid having
|
1044
1067
|
* to include lock-related headers here. It must be RowExclusiveLock if
|
1045
1068
|
* the RTE is an INSERT/UPDATE/DELETE/MERGE target, else RowShareLock if
|
@@ -1068,17 +1091,26 @@ typedef struct RangeTblEntry
|
|
1068
1091
|
* relation. This allows plans referencing AFTER trigger transition
|
1069
1092
|
* tables to be invalidated if the underlying table is altered.
|
1070
1093
|
*/
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1094
|
+
/* OID of the relation */
|
1095
|
+
Oid relid;
|
1096
|
+
/* inheritance requested? */
|
1097
|
+
bool inh;
|
1098
|
+
/* relation kind (see pg_class.relkind) */
|
1099
|
+
char relkind pg_node_attr(query_jumble_ignore);
|
1100
|
+
/* lock level that query requires on the rel */
|
1101
|
+
int rellockmode pg_node_attr(query_jumble_ignore);
|
1102
|
+
/* index of RTEPermissionInfo entry, or 0 */
|
1103
|
+
Index perminfoindex pg_node_attr(query_jumble_ignore);
|
1104
|
+
/* sampling info, or NULL */
|
1105
|
+
struct TableSampleClause *tablesample;
|
1076
1106
|
|
1077
1107
|
/*
|
1078
1108
|
* Fields valid for a subquery RTE (else NULL):
|
1079
1109
|
*/
|
1080
|
-
|
1081
|
-
|
1110
|
+
/* the sub-query */
|
1111
|
+
Query *subquery;
|
1112
|
+
/* is from security_barrier view? */
|
1113
|
+
bool security_barrier pg_node_attr(query_jumble_ignore);
|
1082
1114
|
|
1083
1115
|
/*
|
1084
1116
|
* Fields valid for a join RTE (else NULL/zero):
|
@@ -1123,18 +1155,22 @@ typedef struct RangeTblEntry
|
|
1123
1155
|
* merged columns could not be dropped); this is not accounted for in
|
1124
1156
|
* joinleftcols/joinrighttcols.
|
1125
1157
|
*/
|
1126
|
-
JoinType jointype;
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
List *
|
1158
|
+
JoinType jointype;
|
1159
|
+
/* number of merged (JOIN USING) columns */
|
1160
|
+
int joinmergedcols pg_node_attr(query_jumble_ignore);
|
1161
|
+
/* list of alias-var expansions */
|
1162
|
+
List *joinaliasvars pg_node_attr(query_jumble_ignore);
|
1163
|
+
/* left-side input column numbers */
|
1164
|
+
List *joinleftcols pg_node_attr(query_jumble_ignore);
|
1165
|
+
/* right-side input column numbers */
|
1166
|
+
List *joinrightcols pg_node_attr(query_jumble_ignore);
|
1131
1167
|
|
1132
1168
|
/*
|
1133
1169
|
* join_using_alias is an alias clause attached directly to JOIN/USING. It
|
1134
1170
|
* is different from the alias field (below) in that it does not hide the
|
1135
1171
|
* range variables of the tables being joined.
|
1136
1172
|
*/
|
1137
|
-
Alias *join_using_alias;
|
1173
|
+
Alias *join_using_alias pg_node_attr(query_jumble_ignore);
|
1138
1174
|
|
1139
1175
|
/*
|
1140
1176
|
* Fields valid for a function RTE (else NIL/zero):
|
@@ -1144,8 +1180,10 @@ typedef struct RangeTblEntry
|
|
1144
1180
|
* implicit, and must be accounted for "by hand" in places such as
|
1145
1181
|
* expandRTE().
|
1146
1182
|
*/
|
1147
|
-
|
1148
|
-
|
1183
|
+
/* list of RangeTblFunction nodes */
|
1184
|
+
List *functions;
|
1185
|
+
/* is this called WITH ORDINALITY? */
|
1186
|
+
bool funcordinality;
|
1149
1187
|
|
1150
1188
|
/*
|
1151
1189
|
* Fields valid for a TableFunc RTE (else NULL):
|
@@ -1155,14 +1193,18 @@ typedef struct RangeTblEntry
|
|
1155
1193
|
/*
|
1156
1194
|
* Fields valid for a values RTE (else NIL):
|
1157
1195
|
*/
|
1158
|
-
|
1196
|
+
/* list of expression lists */
|
1197
|
+
List *values_lists;
|
1159
1198
|
|
1160
1199
|
/*
|
1161
1200
|
* Fields valid for a CTE RTE (else NULL/zero):
|
1162
1201
|
*/
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1202
|
+
/* name of the WITH list item */
|
1203
|
+
char *ctename;
|
1204
|
+
/* number of query levels up */
|
1205
|
+
Index ctelevelsup;
|
1206
|
+
/* is this a recursive self-reference? */
|
1207
|
+
bool self_reference pg_node_attr(query_jumble_ignore);
|
1166
1208
|
|
1167
1209
|
/*
|
1168
1210
|
* Fields valid for CTE, VALUES, ENR, and TableFunc RTEs (else NIL):
|
@@ -1182,25 +1224,30 @@ typedef struct RangeTblEntry
|
|
1182
1224
|
* all three lists (as well as an empty-string entry in eref). Testing
|
1183
1225
|
* for zero coltype is the standard way to detect a dropped column.
|
1184
1226
|
*/
|
1185
|
-
|
1186
|
-
List *
|
1187
|
-
|
1227
|
+
/* OID list of column type OIDs */
|
1228
|
+
List *coltypes pg_node_attr(query_jumble_ignore);
|
1229
|
+
/* integer list of column typmods */
|
1230
|
+
List *coltypmods pg_node_attr(query_jumble_ignore);
|
1231
|
+
/* OID list of column collation OIDs */
|
1232
|
+
List *colcollations pg_node_attr(query_jumble_ignore);
|
1188
1233
|
|
1189
1234
|
/*
|
1190
1235
|
* Fields valid for ENR RTEs (else NULL/zero):
|
1191
1236
|
*/
|
1192
|
-
|
1193
|
-
|
1237
|
+
/* name of ephemeral named relation */
|
1238
|
+
char *enrname;
|
1239
|
+
/* estimated or actual from caller */
|
1240
|
+
Cardinality enrtuples pg_node_attr(query_jumble_ignore);
|
1194
1241
|
|
1195
1242
|
/*
|
1196
1243
|
* Fields valid in all RTEs:
|
1197
1244
|
*/
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
bool
|
1202
|
-
|
1203
|
-
List *securityQuals;
|
1245
|
+
/* was LATERAL specified? */
|
1246
|
+
bool lateral pg_node_attr(query_jumble_ignore);
|
1247
|
+
/* present in FROM clause? */
|
1248
|
+
bool inFromCl pg_node_attr(query_jumble_ignore);
|
1249
|
+
/* security barrier quals to apply, if any */
|
1250
|
+
List *securityQuals pg_node_attr(query_jumble_ignore);
|
1204
1251
|
} RangeTblEntry;
|
1205
1252
|
|
1206
1253
|
/*
|
@@ -1315,7 +1362,7 @@ typedef enum WCOKind
|
|
1315
1362
|
WCO_RLS_UPDATE_CHECK, /* RLS UPDATE WITH CHECK policy */
|
1316
1363
|
WCO_RLS_CONFLICT_CHECK, /* RLS ON CONFLICT DO UPDATE USING policy */
|
1317
1364
|
WCO_RLS_MERGE_UPDATE_CHECK, /* RLS MERGE UPDATE USING policy */
|
1318
|
-
WCO_RLS_MERGE_DELETE_CHECK
|
1365
|
+
WCO_RLS_MERGE_DELETE_CHECK, /* RLS MERGE DELETE USING policy */
|
1319
1366
|
} WCOKind;
|
1320
1367
|
|
1321
1368
|
typedef struct WithCheckOption
|
@@ -1453,7 +1500,7 @@ typedef enum GroupingSetKind
|
|
1453
1500
|
GROUPING_SET_SIMPLE,
|
1454
1501
|
GROUPING_SET_ROLLUP,
|
1455
1502
|
GROUPING_SET_CUBE,
|
1456
|
-
GROUPING_SET_SETS
|
1503
|
+
GROUPING_SET_SETS,
|
1457
1504
|
} GroupingSetKind;
|
1458
1505
|
|
1459
1506
|
typedef struct GroupingSet
|
@@ -1461,7 +1508,7 @@ typedef struct GroupingSet
|
|
1461
1508
|
NodeTag type;
|
1462
1509
|
GroupingSetKind kind pg_node_attr(query_jumble_ignore);
|
1463
1510
|
List *content;
|
1464
|
-
|
1511
|
+
ParseLoc location;
|
1465
1512
|
} GroupingSet;
|
1466
1513
|
|
1467
1514
|
/*
|
@@ -1472,6 +1519,8 @@ typedef struct GroupingSet
|
|
1472
1519
|
* if the clause originally came from WINDOW, and is NULL if it originally
|
1473
1520
|
* was an OVER clause (but note that we collapse out duplicate OVERs).
|
1474
1521
|
* partitionClause and orderClause are lists of SortGroupClause structs.
|
1522
|
+
* partitionClause is sanitized by the query planner to remove any columns or
|
1523
|
+
* expressions belonging to redundant PathKeys.
|
1475
1524
|
* If we have RANGE with offset PRECEDING/FOLLOWING, the semantics of that are
|
1476
1525
|
* specified by startInRangeFunc/inRangeColl/inRangeAsc/inRangeNullsFirst
|
1477
1526
|
* for the start offset, or endInRangeFunc/inRange* for the end offset.
|
@@ -1497,8 +1546,6 @@ typedef struct WindowClause
|
|
1497
1546
|
int frameOptions; /* frame_clause options, see WindowDef */
|
1498
1547
|
Node *startOffset; /* expression for starting bound, if any */
|
1499
1548
|
Node *endOffset; /* expression for ending bound, if any */
|
1500
|
-
/* qual to help short-circuit execution */
|
1501
|
-
List *runCondition pg_node_attr(query_jumble_ignore);
|
1502
1549
|
/* in_range function for startOffset */
|
1503
1550
|
Oid startInRangeFunc pg_node_attr(query_jumble_ignore);
|
1504
1551
|
/* in_range function for endOffset */
|
@@ -1547,7 +1594,7 @@ typedef struct WithClause
|
|
1547
1594
|
NodeTag type;
|
1548
1595
|
List *ctes; /* list of CommonTableExprs */
|
1549
1596
|
bool recursive; /* true = WITH RECURSIVE */
|
1550
|
-
|
1597
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1551
1598
|
} WithClause;
|
1552
1599
|
|
1553
1600
|
/*
|
@@ -1562,7 +1609,7 @@ typedef struct InferClause
|
|
1562
1609
|
List *indexElems; /* IndexElems to infer unique index */
|
1563
1610
|
Node *whereClause; /* qualification (partial-index predicate) */
|
1564
1611
|
char *conname; /* Constraint name, or NULL if unnamed */
|
1565
|
-
|
1612
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1566
1613
|
} InferClause;
|
1567
1614
|
|
1568
1615
|
/*
|
@@ -1578,7 +1625,7 @@ typedef struct OnConflictClause
|
|
1578
1625
|
InferClause *infer; /* Optional index inference clause */
|
1579
1626
|
List *targetList; /* the target list (of ResTarget) */
|
1580
1627
|
Node *whereClause; /* qualifications */
|
1581
|
-
|
1628
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1582
1629
|
} OnConflictClause;
|
1583
1630
|
|
1584
1631
|
/*
|
@@ -1590,7 +1637,7 @@ typedef enum CTEMaterialize
|
|
1590
1637
|
{
|
1591
1638
|
CTEMaterializeDefault, /* no option specified */
|
1592
1639
|
CTEMaterializeAlways, /* MATERIALIZED */
|
1593
|
-
CTEMaterializeNever
|
1640
|
+
CTEMaterializeNever, /* NOT MATERIALIZED */
|
1594
1641
|
} CTEMaterialize;
|
1595
1642
|
|
1596
1643
|
typedef struct CTESearchClause
|
@@ -1599,7 +1646,7 @@ typedef struct CTESearchClause
|
|
1599
1646
|
List *search_col_list;
|
1600
1647
|
bool search_breadth_first;
|
1601
1648
|
char *search_seq_column;
|
1602
|
-
|
1649
|
+
ParseLoc location;
|
1603
1650
|
} CTESearchClause;
|
1604
1651
|
|
1605
1652
|
typedef struct CTECycleClause
|
@@ -1610,7 +1657,7 @@ typedef struct CTECycleClause
|
|
1610
1657
|
Node *cycle_mark_value;
|
1611
1658
|
Node *cycle_mark_default;
|
1612
1659
|
char *cycle_path_column;
|
1613
|
-
|
1660
|
+
ParseLoc location;
|
1614
1661
|
/* These fields are set during parse analysis: */
|
1615
1662
|
Oid cycle_mark_type; /* common type of _value and _default */
|
1616
1663
|
int cycle_mark_typmod;
|
@@ -1634,7 +1681,7 @@ typedef struct CommonTableExpr
|
|
1634
1681
|
Node *ctequery; /* the CTE's subquery */
|
1635
1682
|
CTESearchClause *search_clause pg_node_attr(query_jumble_ignore);
|
1636
1683
|
CTECycleClause *cycle_clause pg_node_attr(query_jumble_ignore);
|
1637
|
-
|
1684
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1638
1685
|
/* These fields are set during parse analysis: */
|
1639
1686
|
/* is this CTE actually recursive? */
|
1640
1687
|
bool cterecursive pg_node_attr(query_jumble_ignore);
|
@@ -1670,7 +1717,7 @@ typedef struct CommonTableExpr
|
|
1670
1717
|
typedef struct MergeWhenClause
|
1671
1718
|
{
|
1672
1719
|
NodeTag type;
|
1673
|
-
|
1720
|
+
MergeMatchKind matchKind; /* MATCHED/NOT MATCHED BY SOURCE/TARGET */
|
1674
1721
|
CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */
|
1675
1722
|
OverridingKind override; /* OVERRIDING clause */
|
1676
1723
|
Node *condition; /* WHEN conditions (raw parser) */
|
@@ -1679,23 +1726,6 @@ typedef struct MergeWhenClause
|
|
1679
1726
|
List *values; /* VALUES to INSERT, or NULL */
|
1680
1727
|
} MergeWhenClause;
|
1681
1728
|
|
1682
|
-
/*
|
1683
|
-
* MergeAction -
|
1684
|
-
* Transformed representation of a WHEN clause in a MERGE statement
|
1685
|
-
*/
|
1686
|
-
typedef struct MergeAction
|
1687
|
-
{
|
1688
|
-
NodeTag type;
|
1689
|
-
bool matched; /* true=MATCHED, false=NOT MATCHED */
|
1690
|
-
CmdType commandType; /* INSERT/UPDATE/DELETE/DO NOTHING */
|
1691
|
-
/* OVERRIDING clause */
|
1692
|
-
OverridingKind override pg_node_attr(query_jumble_ignore);
|
1693
|
-
Node *qual; /* transformed WHEN conditions */
|
1694
|
-
List *targetList; /* the target list (of TargetEntry) */
|
1695
|
-
/* target attribute numbers of an UPDATE */
|
1696
|
-
List *updateColnos pg_node_attr(query_jumble_ignore);
|
1697
|
-
} MergeAction;
|
1698
|
-
|
1699
1729
|
/*
|
1700
1730
|
* TriggerTransition -
|
1701
1731
|
* representation of transition row or table naming clause
|
@@ -1725,6 +1755,115 @@ typedef struct JsonOutput
|
|
1725
1755
|
JsonReturning *returning; /* RETURNING FORMAT clause and type Oids */
|
1726
1756
|
} JsonOutput;
|
1727
1757
|
|
1758
|
+
/*
|
1759
|
+
* JsonArgument -
|
1760
|
+
* representation of argument from JSON PASSING clause
|
1761
|
+
*/
|
1762
|
+
typedef struct JsonArgument
|
1763
|
+
{
|
1764
|
+
NodeTag type;
|
1765
|
+
JsonValueExpr *val; /* argument value expression */
|
1766
|
+
char *name; /* argument name */
|
1767
|
+
} JsonArgument;
|
1768
|
+
|
1769
|
+
/*
|
1770
|
+
* JsonQuotes -
|
1771
|
+
* representation of [KEEP|OMIT] QUOTES clause for JSON_QUERY()
|
1772
|
+
*/
|
1773
|
+
typedef enum JsonQuotes
|
1774
|
+
{
|
1775
|
+
JS_QUOTES_UNSPEC, /* unspecified */
|
1776
|
+
JS_QUOTES_KEEP, /* KEEP QUOTES */
|
1777
|
+
JS_QUOTES_OMIT, /* OMIT QUOTES */
|
1778
|
+
} JsonQuotes;
|
1779
|
+
|
1780
|
+
/*
|
1781
|
+
* JsonFuncExpr -
|
1782
|
+
* untransformed representation of function expressions for
|
1783
|
+
* SQL/JSON query functions
|
1784
|
+
*/
|
1785
|
+
typedef struct JsonFuncExpr
|
1786
|
+
{
|
1787
|
+
NodeTag type;
|
1788
|
+
JsonExprOp op; /* expression type */
|
1789
|
+
char *column_name; /* JSON_TABLE() column name or NULL if this is
|
1790
|
+
* not for a JSON_TABLE() */
|
1791
|
+
JsonValueExpr *context_item; /* context item expression */
|
1792
|
+
Node *pathspec; /* JSON path specification expression */
|
1793
|
+
List *passing; /* list of PASSING clause arguments, if any */
|
1794
|
+
JsonOutput *output; /* output clause, if specified */
|
1795
|
+
JsonBehavior *on_empty; /* ON EMPTY behavior */
|
1796
|
+
JsonBehavior *on_error; /* ON ERROR behavior */
|
1797
|
+
JsonWrapper wrapper; /* array wrapper behavior (JSON_QUERY only) */
|
1798
|
+
JsonQuotes quotes; /* omit or keep quotes? (JSON_QUERY only) */
|
1799
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1800
|
+
} JsonFuncExpr;
|
1801
|
+
|
1802
|
+
/*
|
1803
|
+
* JsonTablePathSpec
|
1804
|
+
* untransformed specification of JSON path expression with an optional
|
1805
|
+
* name
|
1806
|
+
*/
|
1807
|
+
typedef struct JsonTablePathSpec
|
1808
|
+
{
|
1809
|
+
NodeTag type;
|
1810
|
+
|
1811
|
+
Node *string;
|
1812
|
+
char *name;
|
1813
|
+
ParseLoc name_location;
|
1814
|
+
ParseLoc location; /* location of 'string' */
|
1815
|
+
} JsonTablePathSpec;
|
1816
|
+
|
1817
|
+
/*
|
1818
|
+
* JsonTable -
|
1819
|
+
* untransformed representation of JSON_TABLE
|
1820
|
+
*/
|
1821
|
+
typedef struct JsonTable
|
1822
|
+
{
|
1823
|
+
NodeTag type;
|
1824
|
+
JsonValueExpr *context_item; /* context item expression */
|
1825
|
+
JsonTablePathSpec *pathspec; /* JSON path specification */
|
1826
|
+
List *passing; /* list of PASSING clause arguments, if any */
|
1827
|
+
List *columns; /* list of JsonTableColumn */
|
1828
|
+
JsonBehavior *on_error; /* ON ERROR behavior */
|
1829
|
+
Alias *alias; /* table alias in FROM clause */
|
1830
|
+
bool lateral; /* does it have LATERAL prefix? */
|
1831
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1832
|
+
} JsonTable;
|
1833
|
+
|
1834
|
+
/*
|
1835
|
+
* JsonTableColumnType -
|
1836
|
+
* enumeration of JSON_TABLE column types
|
1837
|
+
*/
|
1838
|
+
typedef enum JsonTableColumnType
|
1839
|
+
{
|
1840
|
+
JTC_FOR_ORDINALITY,
|
1841
|
+
JTC_REGULAR,
|
1842
|
+
JTC_EXISTS,
|
1843
|
+
JTC_FORMATTED,
|
1844
|
+
JTC_NESTED,
|
1845
|
+
} JsonTableColumnType;
|
1846
|
+
|
1847
|
+
/*
|
1848
|
+
* JsonTableColumn -
|
1849
|
+
* untransformed representation of JSON_TABLE column
|
1850
|
+
*/
|
1851
|
+
typedef struct JsonTableColumn
|
1852
|
+
{
|
1853
|
+
NodeTag type;
|
1854
|
+
JsonTableColumnType coltype; /* column type */
|
1855
|
+
char *name; /* column name */
|
1856
|
+
TypeName *typeName; /* column type name */
|
1857
|
+
JsonTablePathSpec *pathspec; /* JSON path specification */
|
1858
|
+
JsonFormat *format; /* JSON format clause, if specified */
|
1859
|
+
JsonWrapper wrapper; /* WRAPPER behavior for formatted columns */
|
1860
|
+
JsonQuotes quotes; /* omit or keep quotes on scalar strings? */
|
1861
|
+
List *columns; /* nested columns */
|
1862
|
+
JsonBehavior *on_empty; /* ON EMPTY behavior */
|
1863
|
+
JsonBehavior *on_error; /* ON ERROR behavior */
|
1864
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1865
|
+
} JsonTableColumn;
|
1866
|
+
|
1728
1867
|
/*
|
1729
1868
|
* JsonKeyValue -
|
1730
1869
|
* untransformed representation of JSON object key-value pair for
|
@@ -1737,6 +1876,43 @@ typedef struct JsonKeyValue
|
|
1737
1876
|
JsonValueExpr *value; /* JSON value expression */
|
1738
1877
|
} JsonKeyValue;
|
1739
1878
|
|
1879
|
+
/*
|
1880
|
+
* JsonParseExpr -
|
1881
|
+
* untransformed representation of JSON()
|
1882
|
+
*/
|
1883
|
+
typedef struct JsonParseExpr
|
1884
|
+
{
|
1885
|
+
NodeTag type;
|
1886
|
+
JsonValueExpr *expr; /* string expression */
|
1887
|
+
JsonOutput *output; /* RETURNING clause, if specified */
|
1888
|
+
bool unique_keys; /* WITH UNIQUE KEYS? */
|
1889
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1890
|
+
} JsonParseExpr;
|
1891
|
+
|
1892
|
+
/*
|
1893
|
+
* JsonScalarExpr -
|
1894
|
+
* untransformed representation of JSON_SCALAR()
|
1895
|
+
*/
|
1896
|
+
typedef struct JsonScalarExpr
|
1897
|
+
{
|
1898
|
+
NodeTag type;
|
1899
|
+
Expr *expr; /* scalar expression */
|
1900
|
+
JsonOutput *output; /* RETURNING clause, if specified */
|
1901
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1902
|
+
} JsonScalarExpr;
|
1903
|
+
|
1904
|
+
/*
|
1905
|
+
* JsonSerializeExpr -
|
1906
|
+
* untransformed representation of JSON_SERIALIZE() function
|
1907
|
+
*/
|
1908
|
+
typedef struct JsonSerializeExpr
|
1909
|
+
{
|
1910
|
+
NodeTag type;
|
1911
|
+
JsonValueExpr *expr; /* json value expression */
|
1912
|
+
JsonOutput *output; /* RETURNING clause, if specified */
|
1913
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1914
|
+
} JsonSerializeExpr;
|
1915
|
+
|
1740
1916
|
/*
|
1741
1917
|
* JsonObjectConstructor -
|
1742
1918
|
* untransformed representation of JSON_OBJECT() constructor
|
@@ -1748,7 +1924,7 @@ typedef struct JsonObjectConstructor
|
|
1748
1924
|
JsonOutput *output; /* RETURNING clause, if specified */
|
1749
1925
|
bool absent_on_null; /* skip NULL values? */
|
1750
1926
|
bool unique; /* check key uniqueness? */
|
1751
|
-
|
1927
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1752
1928
|
} JsonObjectConstructor;
|
1753
1929
|
|
1754
1930
|
/*
|
@@ -1761,7 +1937,7 @@ typedef struct JsonArrayConstructor
|
|
1761
1937
|
List *exprs; /* list of JsonValueExpr elements */
|
1762
1938
|
JsonOutput *output; /* RETURNING clause, if specified */
|
1763
1939
|
bool absent_on_null; /* skip NULL elements? */
|
1764
|
-
|
1940
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1765
1941
|
} JsonArrayConstructor;
|
1766
1942
|
|
1767
1943
|
/*
|
@@ -1775,7 +1951,7 @@ typedef struct JsonArrayQueryConstructor
|
|
1775
1951
|
JsonOutput *output; /* RETURNING clause, if specified */
|
1776
1952
|
JsonFormat *format; /* FORMAT clause for subquery, if specified */
|
1777
1953
|
bool absent_on_null; /* skip NULL elements? */
|
1778
|
-
|
1954
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1779
1955
|
} JsonArrayQueryConstructor;
|
1780
1956
|
|
1781
1957
|
/*
|
@@ -1790,7 +1966,7 @@ typedef struct JsonAggConstructor
|
|
1790
1966
|
Node *agg_filter; /* FILTER clause, if any */
|
1791
1967
|
List *agg_order; /* ORDER BY clause, if any */
|
1792
1968
|
struct WindowDef *over; /* OVER clause, if any */
|
1793
|
-
|
1969
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
1794
1970
|
} JsonAggConstructor;
|
1795
1971
|
|
1796
1972
|
/*
|
@@ -1844,8 +2020,8 @@ typedef struct RawStmt
|
|
1844
2020
|
|
1845
2021
|
NodeTag type;
|
1846
2022
|
Node *stmt; /* raw parse tree */
|
1847
|
-
|
1848
|
-
|
2023
|
+
ParseLoc stmt_location; /* start location, or -1 if unknown */
|
2024
|
+
ParseLoc stmt_len; /* length in bytes; 0 means "rest of string" */
|
1849
2025
|
} RawStmt;
|
1850
2026
|
|
1851
2027
|
/*****************************************************************************
|
@@ -1912,6 +2088,7 @@ typedef struct MergeStmt
|
|
1912
2088
|
Node *sourceRelation; /* source relation */
|
1913
2089
|
Node *joinCondition; /* join condition between source and target */
|
1914
2090
|
List *mergeWhenClauses; /* list of MergeWhenClause(es) */
|
2091
|
+
List *returningList; /* list of expressions to return */
|
1915
2092
|
WithClause *withClause; /* WITH clause */
|
1916
2093
|
} MergeStmt;
|
1917
2094
|
|
@@ -1933,7 +2110,7 @@ typedef enum SetOperation
|
|
1933
2110
|
SETOP_NONE = 0,
|
1934
2111
|
SETOP_UNION,
|
1935
2112
|
SETOP_INTERSECT,
|
1936
|
-
SETOP_EXCEPT
|
2113
|
+
SETOP_EXCEPT,
|
1937
2114
|
} SetOperation;
|
1938
2115
|
|
1939
2116
|
typedef struct SelectStmt
|
@@ -2052,7 +2229,7 @@ typedef struct PLAssignStmt
|
|
2052
2229
|
List *indirection; /* subscripts and field names, if any */
|
2053
2230
|
int nnames; /* number of names to use in ColumnRef */
|
2054
2231
|
SelectStmt *val; /* the PL/pgSQL expression to assign */
|
2055
|
-
|
2232
|
+
ParseLoc location; /* name's token location, or -1 if unknown */
|
2056
2233
|
} PLAssignStmt;
|
2057
2234
|
|
2058
2235
|
|
@@ -2129,7 +2306,7 @@ typedef enum ObjectType
|
|
2129
2306
|
OBJECT_TSTEMPLATE,
|
2130
2307
|
OBJECT_TYPE,
|
2131
2308
|
OBJECT_USER_MAPPING,
|
2132
|
-
OBJECT_VIEW
|
2309
|
+
OBJECT_VIEW,
|
2133
2310
|
} ObjectType;
|
2134
2311
|
|
2135
2312
|
/* ----------------------
|
@@ -2152,7 +2329,7 @@ typedef struct CreateSchemaStmt
|
|
2152
2329
|
typedef enum DropBehavior
|
2153
2330
|
{
|
2154
2331
|
DROP_RESTRICT, /* drop fails if any dependent objects */
|
2155
|
-
DROP_CASCADE /* remove dependent objects too */
|
2332
|
+
DROP_CASCADE, /* remove dependent objects too */
|
2156
2333
|
} DropBehavior;
|
2157
2334
|
|
2158
2335
|
/* ----------------------
|
@@ -2176,6 +2353,7 @@ typedef enum AlterTableType
|
|
2176
2353
|
AT_CookedColumnDefault, /* add a pre-cooked column default */
|
2177
2354
|
AT_DropNotNull, /* alter column drop not null */
|
2178
2355
|
AT_SetNotNull, /* alter column set not null */
|
2356
|
+
AT_SetExpression, /* alter column set expression */
|
2179
2357
|
AT_DropExpression, /* alter column drop expression */
|
2180
2358
|
AT_CheckNotNull, /* check column is already marked not null */
|
2181
2359
|
AT_SetStatistics, /* alter column set statistics */
|
@@ -2235,7 +2413,7 @@ typedef enum AlterTableType
|
|
2235
2413
|
AT_AddIdentity, /* ADD IDENTITY */
|
2236
2414
|
AT_SetIdentity, /* SET identity column options */
|
2237
2415
|
AT_DropIdentity, /* DROP IDENTITY */
|
2238
|
-
AT_ReAddStatistics /* internal to commands/tablecmds.c */
|
2416
|
+
AT_ReAddStatistics, /* internal to commands/tablecmds.c */
|
2239
2417
|
} AlterTableType;
|
2240
2418
|
|
2241
2419
|
typedef struct ReplicaIdentityStmt
|
@@ -2250,7 +2428,7 @@ typedef struct AlterTableCmd /* one subcommand of an ALTER TABLE */
|
|
2250
2428
|
NodeTag type;
|
2251
2429
|
AlterTableType subtype; /* Type of table alteration to apply */
|
2252
2430
|
char *name; /* column, constraint, or trigger to act on,
|
2253
|
-
* or tablespace */
|
2431
|
+
* or tablespace, access method */
|
2254
2432
|
int16 num; /* attribute number for columns referenced by
|
2255
2433
|
* number */
|
2256
2434
|
RoleSpec *newowner;
|
@@ -2307,7 +2485,7 @@ typedef enum GrantTargetType
|
|
2307
2485
|
{
|
2308
2486
|
ACL_TARGET_OBJECT, /* grant on specific named object(s) */
|
2309
2487
|
ACL_TARGET_ALL_IN_SCHEMA, /* grant on all objects in given schema(s) */
|
2310
|
-
ACL_TARGET_DEFAULTS
|
2488
|
+
ACL_TARGET_DEFAULTS, /* ALTER DEFAULT PRIVILEGES */
|
2311
2489
|
} GrantTargetType;
|
2312
2490
|
|
2313
2491
|
typedef struct GrantStmt
|
@@ -2434,7 +2612,7 @@ typedef enum VariableSetKind
|
|
2434
2612
|
VAR_SET_CURRENT, /* SET var FROM CURRENT */
|
2435
2613
|
VAR_SET_MULTI, /* special case for SET TRANSACTION ... */
|
2436
2614
|
VAR_RESET, /* RESET var */
|
2437
|
-
VAR_RESET_ALL /* RESET ALL */
|
2615
|
+
VAR_RESET_ALL, /* RESET ALL */
|
2438
2616
|
} VariableSetKind;
|
2439
2617
|
|
2440
2618
|
typedef struct VariableSetStmt
|
@@ -2532,7 +2710,7 @@ typedef enum ConstrType /* types of constraints */
|
|
2532
2710
|
CONSTR_ATTR_DEFERRABLE, /* attributes for previous constraint node */
|
2533
2711
|
CONSTR_ATTR_NOT_DEFERRABLE,
|
2534
2712
|
CONSTR_ATTR_DEFERRED,
|
2535
|
-
CONSTR_ATTR_IMMEDIATE
|
2713
|
+
CONSTR_ATTR_IMMEDIATE,
|
2536
2714
|
} ConstrType;
|
2537
2715
|
|
2538
2716
|
/* Foreign key action codes */
|
@@ -2549,40 +2727,33 @@ typedef enum ConstrType /* types of constraints */
|
|
2549
2727
|
|
2550
2728
|
typedef struct Constraint
|
2551
2729
|
{
|
2552
|
-
pg_node_attr(custom_read_write)
|
2553
|
-
|
2554
2730
|
NodeTag type;
|
2555
2731
|
ConstrType contype; /* see above */
|
2556
|
-
|
2557
|
-
/* Fields used for most/all constraint types: */
|
2558
2732
|
char *conname; /* Constraint name, or NULL if unnamed */
|
2559
2733
|
bool deferrable; /* DEFERRABLE? */
|
2560
2734
|
bool initdeferred; /* INITIALLY DEFERRED? */
|
2561
|
-
|
2562
|
-
|
2563
|
-
/* Fields used for constraints with expressions (CHECK and DEFAULT): */
|
2735
|
+
bool skip_validation; /* skip validation of existing rows? */
|
2736
|
+
bool initially_valid; /* mark the new constraint as valid? */
|
2564
2737
|
bool is_no_inherit; /* is constraint non-inheritable? */
|
2565
|
-
Node *raw_expr; /*
|
2566
|
-
|
2738
|
+
Node *raw_expr; /* CHECK or DEFAULT expression, as
|
2739
|
+
* untransformed parse tree */
|
2740
|
+
char *cooked_expr; /* CHECK or DEFAULT expression, as
|
2741
|
+
* nodeToString representation */
|
2567
2742
|
char generated_when; /* ALWAYS or BY DEFAULT */
|
2568
|
-
|
2569
|
-
|
2743
|
+
int inhcount; /* initial inheritance count to apply, for
|
2744
|
+
* "raw" NOT NULL constraints */
|
2570
2745
|
bool nulls_not_distinct; /* null treatment for UNIQUE constraints */
|
2571
2746
|
List *keys; /* String nodes naming referenced key
|
2572
|
-
* column(s) */
|
2747
|
+
* column(s); for UNIQUE/PK/NOT NULL */
|
2573
2748
|
List *including; /* String nodes naming referenced nonkey
|
2574
|
-
* column(s) */
|
2575
|
-
|
2576
|
-
|
2577
|
-
List *exclusions; /* list of (IndexElem, operator name) pairs */
|
2578
|
-
|
2579
|
-
/* Fields used for index constraints (UNIQUE, PRIMARY KEY, EXCLUSION): */
|
2749
|
+
* column(s); for UNIQUE/PK */
|
2750
|
+
List *exclusions; /* list of (IndexElem, operator name) pairs;
|
2751
|
+
* for exclusion constraints */
|
2580
2752
|
List *options; /* options from WITH clause */
|
2581
2753
|
char *indexname; /* existing index to use; otherwise NULL */
|
2582
2754
|
char *indexspace; /* index tablespace; NULL for default */
|
2583
2755
|
bool reset_default_tblspc; /* reset default_tablespace prior to
|
2584
2756
|
* creating the index */
|
2585
|
-
/* These could be, but currently are not, used for UNIQUE/PKEY: */
|
2586
2757
|
char *access_method; /* index access method; NULL for default */
|
2587
2758
|
Node *where_clause; /* partial index predicate */
|
2588
2759
|
|
@@ -2598,9 +2769,7 @@ typedef struct Constraint
|
|
2598
2769
|
Oid old_pktable_oid; /* pg_constraint.confrelid of my former
|
2599
2770
|
* self */
|
2600
2771
|
|
2601
|
-
/*
|
2602
|
-
bool skip_validation; /* skip validation of existing rows? */
|
2603
|
-
bool initially_valid; /* mark the new constraint as valid? */
|
2772
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
2604
2773
|
} Constraint;
|
2605
2774
|
|
2606
2775
|
/* ----------------------
|
@@ -2769,7 +2938,7 @@ typedef enum ImportForeignSchemaType
|
|
2769
2938
|
{
|
2770
2939
|
FDW_IMPORT_SCHEMA_ALL, /* all relations wanted */
|
2771
2940
|
FDW_IMPORT_SCHEMA_LIMIT_TO, /* include only listed tables in import */
|
2772
|
-
FDW_IMPORT_SCHEMA_EXCEPT /* exclude listed tables from import */
|
2941
|
+
FDW_IMPORT_SCHEMA_EXCEPT, /* exclude listed tables from import */
|
2773
2942
|
} ImportForeignSchemaType;
|
2774
2943
|
|
2775
2944
|
typedef struct ImportForeignSchemaStmt
|
@@ -2906,7 +3075,7 @@ typedef enum RoleStmtType
|
|
2906
3075
|
{
|
2907
3076
|
ROLESTMT_ROLE,
|
2908
3077
|
ROLESTMT_USER,
|
2909
|
-
ROLESTMT_GROUP
|
3078
|
+
ROLESTMT_GROUP,
|
2910
3079
|
} RoleStmtType;
|
2911
3080
|
|
2912
3081
|
typedef struct CreateRoleStmt
|
@@ -3151,7 +3320,7 @@ typedef enum FetchDirection
|
|
3151
3320
|
FETCH_BACKWARD,
|
3152
3321
|
/* for these, howMany indicates a position; only one row is fetched */
|
3153
3322
|
FETCH_ABSOLUTE,
|
3154
|
-
FETCH_RELATIVE
|
3323
|
+
FETCH_RELATIVE,
|
3155
3324
|
} FetchDirection;
|
3156
3325
|
|
3157
3326
|
#define FETCH_ALL LONG_MAX
|
@@ -3247,7 +3416,7 @@ typedef struct AlterStatsStmt
|
|
3247
3416
|
{
|
3248
3417
|
NodeTag type;
|
3249
3418
|
List *defnames; /* qualified name (list of String) */
|
3250
|
-
|
3419
|
+
Node *stxstattarget; /* statistics target */
|
3251
3420
|
bool missing_ok; /* skip error if statistics object is missing */
|
3252
3421
|
} AlterStatsStmt;
|
3253
3422
|
|
@@ -3276,7 +3445,7 @@ typedef enum FunctionParameterMode
|
|
3276
3445
|
FUNC_PARAM_VARIADIC = 'v', /* variadic (always input) */
|
3277
3446
|
FUNC_PARAM_TABLE = 't', /* table function output column */
|
3278
3447
|
/* this is not used in pg_proc: */
|
3279
|
-
FUNC_PARAM_DEFAULT = 'd' /* default; effectively same as IN */
|
3448
|
+
FUNC_PARAM_DEFAULT = 'd', /* default; effectively same as IN */
|
3280
3449
|
} FunctionParameterMode;
|
3281
3450
|
|
3282
3451
|
typedef struct FunctionParameter
|
@@ -3333,11 +3502,12 @@ typedef struct InlineCodeBlock
|
|
3333
3502
|
typedef struct CallStmt
|
3334
3503
|
{
|
3335
3504
|
NodeTag type;
|
3336
|
-
|
3505
|
+
/* from the parser */
|
3506
|
+
FuncCall *funccall pg_node_attr(query_jumble_ignore);
|
3337
3507
|
/* transformed call, with only input args */
|
3338
|
-
FuncExpr *funcexpr
|
3508
|
+
FuncExpr *funcexpr;
|
3339
3509
|
/* transformed output-argument expressions */
|
3340
|
-
List *outargs
|
3510
|
+
List *outargs;
|
3341
3511
|
} CallStmt;
|
3342
3512
|
|
3343
3513
|
typedef struct CallContext
|
@@ -3491,7 +3661,7 @@ typedef enum TransactionStmtKind
|
|
3491
3661
|
TRANS_STMT_ROLLBACK_TO,
|
3492
3662
|
TRANS_STMT_PREPARE,
|
3493
3663
|
TRANS_STMT_COMMIT_PREPARED,
|
3494
|
-
TRANS_STMT_ROLLBACK_PREPARED
|
3664
|
+
TRANS_STMT_ROLLBACK_PREPARED,
|
3495
3665
|
} TransactionStmtKind;
|
3496
3666
|
|
3497
3667
|
typedef struct TransactionStmt
|
@@ -3499,9 +3669,13 @@ typedef struct TransactionStmt
|
|
3499
3669
|
NodeTag type;
|
3500
3670
|
TransactionStmtKind kind; /* see above */
|
3501
3671
|
List *options; /* for BEGIN/START commands */
|
3502
|
-
|
3503
|
-
char *
|
3672
|
+
/* for savepoint commands */
|
3673
|
+
char *savepoint_name pg_node_attr(query_jumble_ignore);
|
3674
|
+
/* for two-phase-commit related commands */
|
3675
|
+
char *gid pg_node_attr(query_jumble_ignore);
|
3504
3676
|
bool chain; /* AND CHAIN option */
|
3677
|
+
/* token location, or -1 if unknown */
|
3678
|
+
ParseLoc location pg_node_attr(query_jumble_location);
|
3505
3679
|
} TransactionStmt;
|
3506
3680
|
|
3507
3681
|
/* ----------------------
|
@@ -3560,7 +3734,7 @@ typedef enum ViewCheckOption
|
|
3560
3734
|
{
|
3561
3735
|
NO_CHECK_OPTION,
|
3562
3736
|
LOCAL_CHECK_OPTION,
|
3563
|
-
CASCADED_CHECK_OPTION
|
3737
|
+
CASCADED_CHECK_OPTION,
|
3564
3738
|
} ViewCheckOption;
|
3565
3739
|
|
3566
3740
|
typedef struct ViewStmt
|
@@ -3752,7 +3926,7 @@ typedef enum DiscardMode
|
|
3752
3926
|
DISCARD_ALL,
|
3753
3927
|
DISCARD_PLANS,
|
3754
3928
|
DISCARD_SEQUENCES,
|
3755
|
-
DISCARD_TEMP
|
3929
|
+
DISCARD_TEMP,
|
3756
3930
|
} DiscardMode;
|
3757
3931
|
|
3758
3932
|
typedef struct DiscardStmt
|
@@ -3794,7 +3968,7 @@ typedef enum ReindexObjectType
|
|
3794
3968
|
REINDEX_OBJECT_TABLE, /* table or materialized view */
|
3795
3969
|
REINDEX_OBJECT_SCHEMA, /* schema */
|
3796
3970
|
REINDEX_OBJECT_SYSTEM, /* system catalogs */
|
3797
|
-
REINDEX_OBJECT_DATABASE
|
3971
|
+
REINDEX_OBJECT_DATABASE, /* database */
|
3798
3972
|
} ReindexObjectType;
|
3799
3973
|
|
3800
3974
|
typedef struct ReindexStmt
|
@@ -3882,8 +4056,17 @@ typedef struct ExecuteStmt
|
|
3882
4056
|
typedef struct DeallocateStmt
|
3883
4057
|
{
|
3884
4058
|
NodeTag type;
|
3885
|
-
|
3886
|
-
|
4059
|
+
/* The name of the plan to remove, NULL if DEALLOCATE ALL */
|
4060
|
+
char *name pg_node_attr(query_jumble_ignore);
|
4061
|
+
|
4062
|
+
/*
|
4063
|
+
* True if DEALLOCATE ALL. This is redundant with "name == NULL", but we
|
4064
|
+
* make it a separate field so that exactly this condition (and not the
|
4065
|
+
* precise name) will be accounted for in query jumbling.
|
4066
|
+
*/
|
4067
|
+
bool isall;
|
4068
|
+
/* token location, or -1 if unknown */
|
4069
|
+
ParseLoc location pg_node_attr(query_jumble_location);
|
3887
4070
|
} DeallocateStmt;
|
3888
4071
|
|
3889
4072
|
/*
|
@@ -3925,7 +4108,7 @@ typedef enum AlterTSConfigType
|
|
3925
4108
|
ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN,
|
3926
4109
|
ALTER_TSCONFIG_REPLACE_DICT,
|
3927
4110
|
ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN,
|
3928
|
-
ALTER_TSCONFIG_DROP_MAPPING
|
4111
|
+
ALTER_TSCONFIG_DROP_MAPPING,
|
3929
4112
|
} AlterTSConfigType;
|
3930
4113
|
|
3931
4114
|
typedef struct AlterTSConfigurationStmt
|
@@ -3962,7 +4145,7 @@ typedef enum PublicationObjSpecType
|
|
3962
4145
|
PUBLICATIONOBJ_TABLES_IN_SCHEMA, /* All tables in schema */
|
3963
4146
|
PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA, /* All tables in first element of
|
3964
4147
|
* search_path */
|
3965
|
-
PUBLICATIONOBJ_CONTINUATION
|
4148
|
+
PUBLICATIONOBJ_CONTINUATION, /* Continuation of previous type */
|
3966
4149
|
} PublicationObjSpecType;
|
3967
4150
|
|
3968
4151
|
typedef struct PublicationObjSpec
|
@@ -3971,7 +4154,7 @@ typedef struct PublicationObjSpec
|
|
3971
4154
|
PublicationObjSpecType pubobjtype; /* type of this publication object */
|
3972
4155
|
char *name;
|
3973
4156
|
PublicationTable *pubtable;
|
3974
|
-
|
4157
|
+
ParseLoc location; /* token location, or -1 if unknown */
|
3975
4158
|
} PublicationObjSpec;
|
3976
4159
|
|
3977
4160
|
typedef struct CreatePublicationStmt
|
@@ -3987,7 +4170,7 @@ typedef enum AlterPublicationAction
|
|
3987
4170
|
{
|
3988
4171
|
AP_AddObjects, /* add objects to publication */
|
3989
4172
|
AP_DropObjects, /* remove objects from publication */
|
3990
|
-
AP_SetObjects /* set list of objects */
|
4173
|
+
AP_SetObjects, /* set list of objects */
|
3991
4174
|
} AlterPublicationAction;
|
3992
4175
|
|
3993
4176
|
typedef struct AlterPublicationStmt
|
@@ -4026,7 +4209,7 @@ typedef enum AlterSubscriptionType
|
|
4026
4209
|
ALTER_SUBSCRIPTION_DROP_PUBLICATION,
|
4027
4210
|
ALTER_SUBSCRIPTION_REFRESH,
|
4028
4211
|
ALTER_SUBSCRIPTION_ENABLED,
|
4029
|
-
ALTER_SUBSCRIPTION_SKIP
|
4212
|
+
ALTER_SUBSCRIPTION_SKIP,
|
4030
4213
|
} AlterSubscriptionType;
|
4031
4214
|
|
4032
4215
|
typedef struct AlterSubscriptionStmt
|