pg_query 2.2.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +86 -0
- data/README.md +57 -31
- data/Rakefile +5 -6
- data/ext/pg_query/ext_symbols_freebsd.sym +1 -0
- data/ext/pg_query/ext_symbols_freebsd_with_ruby_abi_version.sym +2 -0
- data/ext/pg_query/ext_symbols_openbsd.sym +1 -0
- data/ext/pg_query/ext_symbols_openbsd_with_ruby_abi_version.sym +2 -0
- data/ext/pg_query/ext_symbols_with_ruby_abi_version.sym +2 -0
- data/ext/pg_query/extconf.rb +33 -9
- data/ext/pg_query/include/pg_query.h +30 -4
- data/ext/pg_query/include/pg_query_enum_defs.c +839 -290
- data/ext/pg_query/include/pg_query_fingerprint_conds.c +638 -481
- data/ext/pg_query/include/pg_query_fingerprint_defs.c +6786 -4193
- data/ext/pg_query/include/pg_query_outfuncs_conds.c +450 -330
- data/ext/pg_query/include/pg_query_outfuncs_defs.c +1489 -1044
- data/ext/pg_query/include/pg_query_readfuncs_conds.c +157 -118
- data/ext/pg_query/include/pg_query_readfuncs_defs.c +1933 -1410
- data/ext/pg_query/include/postgres/access/amapi.h +303 -0
- data/ext/pg_query/include/postgres/access/attmap.h +54 -0
- data/ext/pg_query/include/postgres/access/attnum.h +64 -0
- data/ext/pg_query/include/postgres/access/brin_internal.h +116 -0
- data/ext/pg_query/include/postgres/access/brin_tuple.h +112 -0
- data/ext/pg_query/include/postgres/access/clog.h +62 -0
- data/ext/pg_query/include/postgres/access/commit_ts.h +73 -0
- data/ext/pg_query/include/postgres/access/detoast.h +82 -0
- data/ext/pg_query/include/postgres/access/genam.h +246 -0
- data/ext/pg_query/include/postgres/access/gin.h +91 -0
- data/ext/pg_query/include/postgres/access/htup.h +89 -0
- data/ext/pg_query/include/postgres/access/htup_details.h +811 -0
- data/ext/pg_query/include/postgres/access/itup.h +170 -0
- data/ext/pg_query/include/postgres/access/parallel.h +81 -0
- data/ext/pg_query/include/postgres/access/printtup.h +35 -0
- data/ext/pg_query/include/postgres/access/relation.h +28 -0
- data/ext/pg_query/include/postgres/access/relscan.h +191 -0
- data/ext/pg_query/include/postgres/access/rmgr.h +62 -0
- data/ext/pg_query/include/postgres/access/rmgrlist.h +49 -0
- data/ext/pg_query/include/postgres/access/sdir.h +67 -0
- data/ext/pg_query/include/postgres/access/skey.h +151 -0
- data/ext/pg_query/include/postgres/access/slru.h +218 -0
- data/ext/pg_query/include/postgres/access/stratnum.h +85 -0
- data/ext/pg_query/include/postgres/access/sysattr.h +29 -0
- data/ext/pg_query/include/postgres/access/table.h +28 -0
- data/ext/pg_query/include/postgres/access/tableam.h +2110 -0
- data/ext/pg_query/include/postgres/access/tidstore.h +50 -0
- data/ext/pg_query/include/postgres/access/toast_compression.h +73 -0
- data/ext/pg_query/include/postgres/access/transam.h +418 -0
- data/ext/pg_query/include/postgres/access/tsmapi.h +82 -0
- data/ext/pg_query/include/postgres/access/tupconvert.h +54 -0
- data/ext/pg_query/include/postgres/access/tupdesc.h +154 -0
- data/ext/pg_query/include/postgres/access/tupmacs.h +207 -0
- data/ext/pg_query/include/postgres/access/twophase.h +65 -0
- data/ext/pg_query/include/postgres/access/xact.h +530 -0
- data/ext/pg_query/include/postgres/access/xlog.h +310 -0
- data/ext/pg_query/include/postgres/access/xlog_internal.h +405 -0
- data/ext/pg_query/include/postgres/access/xlogbackup.h +43 -0
- data/ext/pg_query/include/postgres/access/xlogdefs.h +82 -0
- data/ext/pg_query/include/postgres/access/xlogprefetcher.h +55 -0
- data/ext/pg_query/include/postgres/access/xlogreader.h +444 -0
- data/ext/pg_query/include/postgres/access/xlogrecord.h +248 -0
- data/ext/pg_query/include/postgres/access/xlogrecovery.h +158 -0
- data/ext/pg_query/include/postgres/archive/archive_module.h +67 -0
- data/ext/pg_query/include/postgres/c.h +1374 -0
- data/ext/pg_query/include/postgres/catalog/catalog.h +47 -0
- data/ext/pg_query/include/postgres/catalog/catversion.h +62 -0
- data/ext/pg_query/include/postgres/catalog/dependency.h +228 -0
- data/ext/pg_query/include/postgres/catalog/genbki.h +149 -0
- data/ext/pg_query/include/postgres/catalog/index.h +218 -0
- data/ext/pg_query/include/postgres/catalog/indexing.h +54 -0
- data/ext/pg_query/include/postgres/catalog/namespace.h +189 -0
- data/ext/pg_query/include/postgres/catalog/objectaccess.h +267 -0
- data/ext/pg_query/include/postgres/catalog/objectaddress.h +93 -0
- data/ext/pg_query/include/postgres/catalog/pg_aggregate.h +182 -0
- data/ext/pg_query/include/postgres/catalog/pg_aggregate_d.h +78 -0
- data/ext/pg_query/include/postgres/catalog/pg_am.h +66 -0
- data/ext/pg_query/include/postgres/catalog/pg_am_d.h +47 -0
- data/ext/pg_query/include/postgres/catalog/pg_attribute.h +240 -0
- data/ext/pg_query/include/postgres/catalog/pg_attribute_d.h +62 -0
- data/ext/pg_query/include/postgres/catalog/pg_authid.h +66 -0
- data/ext/pg_query/include/postgres/catalog/pg_authid_d.h +60 -0
- data/ext/pg_query/include/postgres/catalog/pg_class.h +235 -0
- data/ext/pg_query/include/postgres/catalog/pg_class_d.h +134 -0
- data/ext/pg_query/include/postgres/catalog/pg_collation.h +106 -0
- data/ext/pg_query/include/postgres/catalog/pg_collation_d.h +66 -0
- data/ext/pg_query/include/postgres/catalog/pg_constraint.h +278 -0
- data/ext/pg_query/include/postgres/catalog/pg_constraint_d.h +74 -0
- data/ext/pg_query/include/postgres/catalog/pg_control.h +260 -0
- data/ext/pg_query/include/postgres/catalog/pg_conversion.h +79 -0
- data/ext/pg_query/include/postgres/catalog/pg_conversion_d.h +38 -0
- data/ext/pg_query/include/postgres/catalog/pg_database.h +129 -0
- data/ext/pg_query/include/postgres/catalog/pg_database_d.h +53 -0
- data/ext/pg_query/include/postgres/catalog/pg_depend.h +77 -0
- data/ext/pg_query/include/postgres/catalog/pg_depend_d.h +36 -0
- data/ext/pg_query/include/postgres/catalog/pg_event_trigger.h +60 -0
- data/ext/pg_query/include/postgres/catalog/pg_event_trigger_d.h +36 -0
- data/ext/pg_query/include/postgres/catalog/pg_index.h +92 -0
- data/ext/pg_query/include/postgres/catalog/pg_index_d.h +59 -0
- data/ext/pg_query/include/postgres/catalog/pg_language.h +75 -0
- data/ext/pg_query/include/postgres/catalog/pg_language_d.h +41 -0
- data/ext/pg_query/include/postgres/catalog/pg_namespace.h +67 -0
- data/ext/pg_query/include/postgres/catalog/pg_namespace_d.h +36 -0
- data/ext/pg_query/include/postgres/catalog/pg_opclass.h +91 -0
- data/ext/pg_query/include/postgres/catalog/pg_opclass_d.h +51 -0
- data/ext/pg_query/include/postgres/catalog/pg_operator.h +124 -0
- data/ext/pg_query/include/postgres/catalog/pg_operator_d.h +142 -0
- data/ext/pg_query/include/postgres/catalog/pg_opfamily.h +67 -0
- data/ext/pg_query/include/postgres/catalog/pg_opfamily_d.h +51 -0
- data/ext/pg_query/include/postgres/catalog/pg_partitioned_table.h +76 -0
- data/ext/pg_query/include/postgres/catalog/pg_partitioned_table_d.h +36 -0
- data/ext/pg_query/include/postgres/catalog/pg_proc.h +223 -0
- data/ext/pg_query/include/postgres/catalog/pg_proc_d.h +101 -0
- data/ext/pg_query/include/postgres/catalog/pg_publication.h +161 -0
- data/ext/pg_query/include/postgres/catalog/pg_publication_d.h +38 -0
- data/ext/pg_query/include/postgres/catalog/pg_replication_origin.h +65 -0
- data/ext/pg_query/include/postgres/catalog/pg_replication_origin_d.h +33 -0
- data/ext/pg_query/include/postgres/catalog/pg_statistic.h +288 -0
- data/ext/pg_query/include/postgres/catalog/pg_statistic_d.h +199 -0
- data/ext/pg_query/include/postgres/catalog/pg_statistic_ext.h +91 -0
- data/ext/pg_query/include/postgres/catalog/pg_statistic_ext_d.h +45 -0
- data/ext/pg_query/include/postgres/catalog/pg_transform.h +51 -0
- data/ext/pg_query/include/postgres/catalog/pg_transform_d.h +34 -0
- data/ext/pg_query/include/postgres/catalog/pg_trigger.h +153 -0
- data/ext/pg_query/include/postgres/catalog/pg_trigger_d.h +109 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_config.h +56 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_config_d.h +34 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_dict.h +62 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_dict_d.h +35 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_parser.h +63 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_parser_d.h +37 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_template.h +54 -0
- data/ext/pg_query/include/postgres/catalog/pg_ts_template_d.h +34 -0
- data/ext/pg_query/include/postgres/catalog/pg_type.h +407 -0
- data/ext/pg_query/include/postgres/catalog/pg_type_d.h +324 -0
- data/ext/pg_query/include/postgres/catalog/storage.h +50 -0
- data/ext/pg_query/include/postgres/catalog/syscache_ids.h +104 -0
- data/ext/pg_query/include/postgres/commands/async.h +49 -0
- data/ext/pg_query/include/postgres/commands/dbcommands.h +37 -0
- data/ext/pg_query/include/postgres/commands/defrem.h +161 -0
- data/ext/pg_query/include/postgres/commands/event_trigger.h +97 -0
- data/ext/pg_query/include/postgres/commands/explain.h +145 -0
- data/ext/pg_query/include/postgres/commands/prepare.h +61 -0
- data/ext/pg_query/include/postgres/commands/tablespace.h +69 -0
- data/ext/pg_query/include/postgres/commands/trigger.h +288 -0
- data/ext/pg_query/include/postgres/commands/user.h +43 -0
- data/ext/pg_query/include/postgres/commands/vacuum.h +388 -0
- data/ext/pg_query/include/postgres/common/cryptohash.h +39 -0
- data/ext/pg_query/include/postgres/common/file_perm.h +56 -0
- data/ext/pg_query/include/postgres/common/file_utils.h +65 -0
- data/ext/pg_query/include/postgres/common/hashfn.h +119 -0
- data/ext/pg_query/include/postgres/common/hashfn_unstable.h +407 -0
- data/ext/pg_query/include/postgres/common/int.h +512 -0
- data/ext/pg_query/include/postgres/common/keywords.h +29 -0
- data/ext/pg_query/include/postgres/common/kwlookup.h +44 -0
- data/ext/pg_query/include/postgres/common/pg_prng.h +62 -0
- data/ext/pg_query/include/postgres/common/relpath.h +97 -0
- data/ext/pg_query/include/postgres/common/scram-common.h +70 -0
- data/ext/pg_query/include/postgres/common/sha2.h +32 -0
- data/ext/pg_query/include/postgres/common/string.h +44 -0
- data/ext/pg_query/include/postgres/common/unicode_east_asian_fw_table.h +124 -0
- data/ext/pg_query/include/postgres/common/unicode_nonspacing_table.h +326 -0
- data/ext/pg_query/include/postgres/copyfuncs.funcs.c +5261 -0
- data/ext/pg_query/include/postgres/copyfuncs.switch.c +989 -0
- data/ext/pg_query/include/postgres/datatype/timestamp.h +269 -0
- data/ext/pg_query/include/postgres/equalfuncs.funcs.c +3310 -0
- data/ext/pg_query/include/postgres/equalfuncs.switch.c +836 -0
- data/ext/pg_query/include/postgres/executor/execdesc.h +70 -0
- data/ext/pg_query/include/postgres/executor/executor.h +681 -0
- data/ext/pg_query/include/postgres/executor/functions.h +56 -0
- data/ext/pg_query/include/postgres/executor/instrument.h +120 -0
- data/ext/pg_query/include/postgres/executor/spi.h +207 -0
- data/ext/pg_query/include/postgres/executor/tablefunc.h +67 -0
- data/ext/pg_query/include/postgres/executor/tuptable.h +523 -0
- data/ext/pg_query/include/postgres/fmgr.h +800 -0
- data/ext/pg_query/include/postgres/foreign/fdwapi.h +294 -0
- data/ext/pg_query/include/postgres/funcapi.h +360 -0
- data/ext/pg_query/include/postgres/gram.h +1168 -0
- data/ext/pg_query/include/postgres/gramparse.h +75 -0
- data/ext/pg_query/include/postgres/jit/jit.h +106 -0
- data/ext/pg_query/include/postgres/kwlist_d.h +1164 -0
- data/ext/pg_query/include/postgres/lib/dshash.h +130 -0
- data/ext/pg_query/include/postgres/lib/ilist.h +1159 -0
- data/ext/pg_query/include/postgres/lib/pairingheap.h +102 -0
- data/ext/pg_query/include/postgres/lib/simplehash.h +1206 -0
- data/ext/pg_query/include/postgres/lib/sort_template.h +445 -0
- data/ext/pg_query/include/postgres/lib/stringinfo.h +243 -0
- data/ext/pg_query/include/postgres/libpq/auth.h +37 -0
- data/ext/pg_query/include/postgres/libpq/crypt.h +47 -0
- data/ext/pg_query/include/postgres/libpq/hba.h +186 -0
- data/ext/pg_query/include/postgres/libpq/libpq-be.h +361 -0
- data/ext/pg_query/include/postgres/libpq/libpq.h +143 -0
- data/ext/pg_query/include/postgres/libpq/pqcomm.h +169 -0
- data/ext/pg_query/include/postgres/libpq/pqformat.h +209 -0
- data/ext/pg_query/include/postgres/libpq/pqsignal.h +54 -0
- data/ext/pg_query/include/postgres/libpq/protocol.h +89 -0
- data/ext/pg_query/include/postgres/libpq/sasl.h +136 -0
- data/ext/pg_query/include/postgres/libpq/scram.h +37 -0
- data/ext/pg_query/include/postgres/mb/pg_wchar.h +793 -0
- data/ext/pg_query/include/postgres/mb/stringinfo_mb.h +24 -0
- data/ext/pg_query/include/postgres/miscadmin.h +527 -0
- data/ext/pg_query/include/postgres/nodes/bitmapset.h +140 -0
- data/ext/pg_query/include/postgres/nodes/execnodes.h +2855 -0
- data/ext/pg_query/include/postgres/nodes/extensible.h +164 -0
- data/ext/pg_query/include/postgres/nodes/lockoptions.h +61 -0
- data/ext/pg_query/include/postgres/nodes/makefuncs.h +127 -0
- data/ext/pg_query/include/postgres/nodes/memnodes.h +152 -0
- data/ext/pg_query/include/postgres/nodes/miscnodes.h +56 -0
- data/ext/pg_query/include/postgres/nodes/nodeFuncs.h +222 -0
- data/ext/pg_query/include/postgres/nodes/nodes.h +435 -0
- data/ext/pg_query/include/postgres/nodes/nodetags.h +491 -0
- data/ext/pg_query/include/postgres/nodes/params.h +170 -0
- data/ext/pg_query/include/postgres/nodes/parsenodes.h +4233 -0
- data/ext/pg_query/include/postgres/nodes/pathnodes.h +3438 -0
- data/ext/pg_query/include/postgres/nodes/pg_list.h +686 -0
- data/ext/pg_query/include/postgres/nodes/plannodes.h +1593 -0
- data/ext/pg_query/include/postgres/nodes/primnodes.h +2339 -0
- data/ext/pg_query/include/postgres/nodes/print.h +34 -0
- data/ext/pg_query/include/postgres/nodes/queryjumble.h +86 -0
- data/ext/pg_query/include/postgres/nodes/replnodes.h +132 -0
- data/ext/pg_query/include/postgres/nodes/supportnodes.h +346 -0
- data/ext/pg_query/include/postgres/nodes/tidbitmap.h +75 -0
- data/ext/pg_query/include/postgres/nodes/value.h +90 -0
- data/ext/pg_query/include/postgres/optimizer/cost.h +216 -0
- data/ext/pg_query/include/postgres/optimizer/geqo.h +90 -0
- data/ext/pg_query/include/postgres/optimizer/geqo_gene.h +45 -0
- data/ext/pg_query/include/postgres/optimizer/optimizer.h +205 -0
- data/ext/pg_query/include/postgres/optimizer/paths.h +271 -0
- data/ext/pg_query/include/postgres/optimizer/planmain.h +123 -0
- data/ext/pg_query/include/postgres/parser/analyze.h +66 -0
- data/ext/pg_query/include/postgres/parser/kwlist.h +518 -0
- data/ext/pg_query/include/postgres/parser/parse_agg.h +65 -0
- data/ext/pg_query/include/postgres/parser/parse_coerce.h +105 -0
- data/ext/pg_query/include/postgres/parser/parse_expr.h +25 -0
- data/ext/pg_query/include/postgres/parser/parse_func.h +74 -0
- data/ext/pg_query/include/postgres/parser/parse_node.h +358 -0
- data/ext/pg_query/include/postgres/parser/parse_oper.h +68 -0
- data/ext/pg_query/include/postgres/parser/parse_relation.h +129 -0
- data/ext/pg_query/include/postgres/parser/parse_type.h +61 -0
- data/ext/pg_query/include/postgres/parser/parser.h +68 -0
- data/ext/pg_query/include/postgres/parser/parsetree.h +61 -0
- data/ext/pg_query/include/postgres/parser/scanner.h +152 -0
- data/ext/pg_query/include/postgres/parser/scansup.h +27 -0
- data/ext/pg_query/include/postgres/partitioning/partdefs.h +26 -0
- data/ext/pg_query/include/postgres/pg_config.h +985 -0
- data/ext/pg_query/include/postgres/pg_config_manual.h +385 -0
- data/ext/pg_query/include/postgres/pg_config_os.h +8 -0
- data/ext/pg_query/include/postgres/pg_getopt.h +56 -0
- data/ext/pg_query/include/postgres/pg_trace.h +17 -0
- data/ext/pg_query/include/postgres/pgstat.h +780 -0
- data/ext/pg_query/include/postgres/pgtime.h +94 -0
- data/ext/pg_query/include/postgres/pl_gram.h +385 -0
- data/ext/pg_query/include/postgres/pl_reserved_kwlist.h +52 -0
- data/ext/pg_query/include/postgres/pl_reserved_kwlist_d.h +114 -0
- data/ext/pg_query/include/postgres/pl_unreserved_kwlist.h +112 -0
- data/ext/pg_query/include/postgres/pl_unreserved_kwlist_d.h +246 -0
- data/ext/pg_query/include/postgres/plerrcodes.h +998 -0
- data/ext/pg_query/include/postgres/plpgsql.h +1342 -0
- data/ext/pg_query/include/postgres/port/atomics/arch-arm.h +32 -0
- data/ext/pg_query/include/postgres/port/atomics/arch-hppa.h +17 -0
- data/ext/pg_query/include/postgres/port/atomics/arch-ppc.h +256 -0
- data/ext/pg_query/include/postgres/port/atomics/arch-x86.h +254 -0
- data/ext/pg_query/include/postgres/port/atomics/fallback.h +170 -0
- data/ext/pg_query/include/postgres/port/atomics/generic-gcc.h +323 -0
- data/ext/pg_query/include/postgres/port/atomics/generic-msvc.h +119 -0
- data/ext/pg_query/include/postgres/port/atomics/generic-sunpro.h +121 -0
- data/ext/pg_query/include/postgres/port/atomics/generic.h +437 -0
- data/ext/pg_query/include/postgres/port/atomics.h +606 -0
- data/ext/pg_query/include/postgres/port/pg_bitutils.h +421 -0
- data/ext/pg_query/include/postgres/port/pg_bswap.h +161 -0
- data/ext/pg_query/include/postgres/port/pg_crc32c.h +110 -0
- data/ext/pg_query/include/postgres/port/pg_iovec.h +117 -0
- data/ext/pg_query/include/postgres/port/simd.h +422 -0
- data/ext/pg_query/include/postgres/port/win32/arpa/inet.h +3 -0
- data/ext/pg_query/include/postgres/port/win32/dlfcn.h +1 -0
- data/ext/pg_query/include/postgres/port/win32/grp.h +1 -0
- data/ext/pg_query/include/postgres/port/win32/netdb.h +7 -0
- data/ext/pg_query/include/postgres/port/win32/netinet/in.h +3 -0
- data/ext/pg_query/include/postgres/port/win32/netinet/tcp.h +7 -0
- data/ext/pg_query/include/postgres/port/win32/pwd.h +3 -0
- data/ext/pg_query/include/postgres/port/win32/sys/resource.h +20 -0
- data/ext/pg_query/include/postgres/port/win32/sys/select.h +3 -0
- data/ext/pg_query/include/postgres/port/win32/sys/socket.h +34 -0
- data/ext/pg_query/include/postgres/port/win32/sys/un.h +17 -0
- data/ext/pg_query/include/postgres/port/win32/sys/wait.h +3 -0
- data/ext/pg_query/include/postgres/port/win32.h +59 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/dirent.h +34 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/sys/file.h +1 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/sys/param.h +1 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/sys/time.h +1 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/unistd.h +9 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/utime.h +3 -0
- data/ext/pg_query/include/postgres/port/win32_port.h +582 -0
- data/ext/pg_query/include/postgres/port.h +555 -0
- data/ext/pg_query/include/postgres/portability/instr_time.h +197 -0
- data/ext/pg_query/include/postgres/postgres.h +579 -0
- data/ext/pg_query/include/postgres/postgres_ext.h +73 -0
- data/ext/pg_query/include/postgres/postmaster/autovacuum.h +69 -0
- data/ext/pg_query/include/postgres/postmaster/bgworker.h +164 -0
- data/ext/pg_query/include/postgres/postmaster/bgworker_internals.h +60 -0
- data/ext/pg_query/include/postgres/postmaster/bgwriter.h +45 -0
- data/ext/pg_query/include/postgres/postmaster/interrupt.h +32 -0
- data/ext/pg_query/include/postgres/postmaster/pgarch.h +36 -0
- data/ext/pg_query/include/postgres/postmaster/postmaster.h +101 -0
- data/ext/pg_query/include/postgres/postmaster/startup.h +41 -0
- data/ext/pg_query/include/postgres/postmaster/syslogger.h +101 -0
- data/ext/pg_query/include/postgres/postmaster/walsummarizer.h +35 -0
- data/ext/pg_query/include/postgres/postmaster/walwriter.h +23 -0
- data/ext/pg_query/include/postgres/regex/regex.h +272 -0
- data/ext/pg_query/include/postgres/replication/logicallauncher.h +34 -0
- data/ext/pg_query/include/postgres/replication/logicalproto.h +274 -0
- data/ext/pg_query/include/postgres/replication/logicalworker.h +33 -0
- data/ext/pg_query/include/postgres/replication/origin.h +73 -0
- data/ext/pg_query/include/postgres/replication/reorderbuffer.h +734 -0
- data/ext/pg_query/include/postgres/replication/slot.h +289 -0
- data/ext/pg_query/include/postgres/replication/slotsync.h +38 -0
- data/ext/pg_query/include/postgres/replication/syncrep.h +109 -0
- data/ext/pg_query/include/postgres/replication/walreceiver.h +504 -0
- data/ext/pg_query/include/postgres/replication/walsender.h +76 -0
- data/ext/pg_query/include/postgres/rewrite/prs2lock.h +46 -0
- data/ext/pg_query/include/postgres/rewrite/rewriteHandler.h +41 -0
- data/ext/pg_query/include/postgres/rewrite/rewriteManip.h +96 -0
- data/ext/pg_query/include/postgres/rewrite/rewriteSupport.h +26 -0
- data/ext/pg_query/include/postgres/storage/block.h +108 -0
- data/ext/pg_query/include/postgres/storage/buf.h +46 -0
- data/ext/pg_query/include/postgres/storage/bufmgr.h +411 -0
- data/ext/pg_query/include/postgres/storage/bufpage.h +510 -0
- data/ext/pg_query/include/postgres/storage/condition_variable.h +73 -0
- data/ext/pg_query/include/postgres/storage/dsm.h +61 -0
- data/ext/pg_query/include/postgres/storage/dsm_impl.h +79 -0
- data/ext/pg_query/include/postgres/storage/fd.h +219 -0
- data/ext/pg_query/include/postgres/storage/fileset.h +40 -0
- data/ext/pg_query/include/postgres/storage/ipc.h +87 -0
- data/ext/pg_query/include/postgres/storage/item.h +19 -0
- data/ext/pg_query/include/postgres/storage/itemid.h +184 -0
- data/ext/pg_query/include/postgres/storage/itemptr.h +245 -0
- data/ext/pg_query/include/postgres/storage/large_object.h +100 -0
- data/ext/pg_query/include/postgres/storage/latch.h +196 -0
- data/ext/pg_query/include/postgres/storage/lmgr.h +126 -0
- data/ext/pg_query/include/postgres/storage/lock.h +624 -0
- data/ext/pg_query/include/postgres/storage/lockdefs.h +61 -0
- data/ext/pg_query/include/postgres/storage/lwlock.h +228 -0
- data/ext/pg_query/include/postgres/storage/lwlocknames.h +47 -0
- data/ext/pg_query/include/postgres/storage/off.h +57 -0
- data/ext/pg_query/include/postgres/storage/pg_sema.h +61 -0
- data/ext/pg_query/include/postgres/storage/pg_shmem.h +93 -0
- data/ext/pg_query/include/postgres/storage/pmsignal.h +105 -0
- data/ext/pg_query/include/postgres/storage/predicate.h +83 -0
- data/ext/pg_query/include/postgres/storage/proc.h +488 -0
- data/ext/pg_query/include/postgres/storage/procarray.h +103 -0
- data/ext/pg_query/include/postgres/storage/proclist_types.h +53 -0
- data/ext/pg_query/include/postgres/storage/procnumber.h +43 -0
- data/ext/pg_query/include/postgres/storage/procsignal.h +75 -0
- data/ext/pg_query/include/postgres/storage/read_stream.h +65 -0
- data/ext/pg_query/include/postgres/storage/relfilelocator.h +100 -0
- data/ext/pg_query/include/postgres/storage/s_lock.h +847 -0
- data/ext/pg_query/include/postgres/storage/sharedfileset.h +37 -0
- data/ext/pg_query/include/postgres/storage/shm_mq.h +86 -0
- data/ext/pg_query/include/postgres/storage/shm_toc.h +58 -0
- data/ext/pg_query/include/postgres/storage/shmem.h +59 -0
- data/ext/pg_query/include/postgres/storage/sinval.h +153 -0
- data/ext/pg_query/include/postgres/storage/smgr.h +130 -0
- data/ext/pg_query/include/postgres/storage/spin.h +77 -0
- data/ext/pg_query/include/postgres/storage/standby.h +109 -0
- data/ext/pg_query/include/postgres/storage/standbydefs.h +74 -0
- data/ext/pg_query/include/postgres/storage/sync.h +66 -0
- data/ext/pg_query/include/postgres/tcop/cmdtag.h +62 -0
- data/ext/pg_query/include/postgres/tcop/cmdtaglist.h +219 -0
- data/ext/pg_query/include/postgres/tcop/deparse_utility.h +108 -0
- data/ext/pg_query/include/postgres/tcop/dest.h +148 -0
- data/ext/pg_query/include/postgres/tcop/fastpath.h +20 -0
- data/ext/pg_query/include/postgres/tcop/pquery.h +51 -0
- data/ext/pg_query/include/postgres/tcop/tcopprot.h +98 -0
- data/ext/pg_query/include/postgres/tcop/utility.h +112 -0
- data/ext/pg_query/include/postgres/tsearch/ts_cache.h +96 -0
- data/ext/pg_query/include/postgres/utils/acl.h +290 -0
- data/ext/pg_query/include/postgres/utils/aclchk_internal.h +45 -0
- data/ext/pg_query/include/postgres/utils/array.h +481 -0
- data/ext/pg_query/include/postgres/utils/ascii.h +84 -0
- data/ext/pg_query/include/postgres/utils/backend_progress.h +46 -0
- data/ext/pg_query/include/postgres/utils/backend_status.h +340 -0
- data/ext/pg_query/include/postgres/utils/builtins.h +139 -0
- data/ext/pg_query/include/postgres/utils/bytea.h +28 -0
- data/ext/pg_query/include/postgres/utils/catcache.h +231 -0
- data/ext/pg_query/include/postgres/utils/date.h +118 -0
- data/ext/pg_query/include/postgres/utils/datetime.h +367 -0
- data/ext/pg_query/include/postgres/utils/datum.h +76 -0
- data/ext/pg_query/include/postgres/utils/dsa.h +166 -0
- data/ext/pg_query/include/postgres/utils/elog.h +540 -0
- data/ext/pg_query/include/postgres/utils/errcodes.h +352 -0
- data/ext/pg_query/include/postgres/utils/expandeddatum.h +170 -0
- data/ext/pg_query/include/postgres/utils/expandedrecord.h +241 -0
- data/ext/pg_query/include/postgres/utils/float.h +357 -0
- data/ext/pg_query/include/postgres/utils/fmgroids.h +3347 -0
- data/ext/pg_query/include/postgres/utils/fmgrprotos.h +2904 -0
- data/ext/pg_query/include/postgres/utils/fmgrtab.h +49 -0
- data/ext/pg_query/include/postgres/utils/guc.h +456 -0
- data/ext/pg_query/include/postgres/utils/guc_hooks.h +184 -0
- data/ext/pg_query/include/postgres/utils/guc_tables.h +323 -0
- data/ext/pg_query/include/postgres/utils/hsearch.h +153 -0
- data/ext/pg_query/include/postgres/utils/injection_point.h +44 -0
- data/ext/pg_query/include/postgres/utils/inval.h +68 -0
- data/ext/pg_query/include/postgres/utils/logtape.h +77 -0
- data/ext/pg_query/include/postgres/utils/lsyscache.h +215 -0
- data/ext/pg_query/include/postgres/utils/memdebug.h +82 -0
- data/ext/pg_query/include/postgres/utils/memutils.h +193 -0
- data/ext/pg_query/include/postgres/utils/memutils_internal.h +176 -0
- data/ext/pg_query/include/postgres/utils/memutils_memorychunk.h +253 -0
- data/ext/pg_query/include/postgres/utils/numeric.h +110 -0
- data/ext/pg_query/include/postgres/utils/palloc.h +151 -0
- data/ext/pg_query/include/postgres/utils/partcache.h +103 -0
- data/ext/pg_query/include/postgres/utils/pg_locale.h +136 -0
- data/ext/pg_query/include/postgres/utils/pgstat_internal.h +827 -0
- data/ext/pg_query/include/postgres/utils/plancache.h +238 -0
- data/ext/pg_query/include/postgres/utils/portal.h +252 -0
- data/ext/pg_query/include/postgres/utils/probes.h +114 -0
- data/ext/pg_query/include/postgres/utils/ps_status.h +47 -0
- data/ext/pg_query/include/postgres/utils/queryenvironment.h +74 -0
- data/ext/pg_query/include/postgres/utils/regproc.h +39 -0
- data/ext/pg_query/include/postgres/utils/rel.h +711 -0
- data/ext/pg_query/include/postgres/utils/relcache.h +155 -0
- data/ext/pg_query/include/postgres/utils/reltrigger.h +81 -0
- data/ext/pg_query/include/postgres/utils/resowner.h +167 -0
- data/ext/pg_query/include/postgres/utils/ruleutils.h +52 -0
- data/ext/pg_query/include/postgres/utils/sharedtuplestore.h +61 -0
- data/ext/pg_query/include/postgres/utils/snapmgr.h +130 -0
- data/ext/pg_query/include/postgres/utils/snapshot.h +219 -0
- data/ext/pg_query/include/postgres/utils/sortsupport.h +391 -0
- data/ext/pg_query/include/postgres/utils/syscache.h +136 -0
- data/ext/pg_query/include/postgres/utils/timeout.h +96 -0
- data/ext/pg_query/include/postgres/utils/timestamp.h +147 -0
- data/ext/pg_query/include/postgres/utils/tuplesort.h +472 -0
- data/ext/pg_query/include/postgres/utils/tuplestore.h +88 -0
- data/ext/pg_query/include/postgres/utils/typcache.h +210 -0
- data/ext/pg_query/include/postgres/utils/varlena.h +53 -0
- data/ext/pg_query/include/postgres/utils/wait_event.h +108 -0
- data/ext/pg_query/include/postgres/utils/wait_event_types.h +218 -0
- data/ext/pg_query/include/postgres/utils/xml.h +94 -0
- data/ext/pg_query/include/postgres/varatt.h +358 -0
- data/ext/pg_query/include/protobuf/pg_query.pb-c.h +8077 -6217
- data/ext/pg_query/include/protobuf/pg_query.pb.h +132024 -88124
- data/ext/pg_query/pg_query.c +10 -1
- data/ext/pg_query/pg_query.pb-c.c +24028 -17173
- data/ext/pg_query/pg_query_deparse.c +1 -9902
- data/ext/pg_query/pg_query_fingerprint.c +42 -18
- data/ext/pg_query/pg_query_fingerprint.h +1 -1
- data/ext/pg_query/pg_query_internal.h +1 -1
- data/ext/pg_query/pg_query_json_plpgsql.c +1 -25
- data/ext/pg_query/pg_query_normalize.c +44 -3
- data/ext/pg_query/pg_query_outfuncs_json.c +62 -16
- data/ext/pg_query/pg_query_outfuncs_protobuf.c +73 -12
- data/ext/pg_query/pg_query_parse.c +47 -5
- data/ext/pg_query/pg_query_parse_plpgsql.c +19 -18
- data/ext/pg_query/pg_query_readfuncs_protobuf.c +45 -10
- data/ext/pg_query/pg_query_ruby.c +5 -0
- data/ext/pg_query/pg_query_scan.c +4 -3
- data/ext/pg_query/pg_query_split.c +6 -5
- data/ext/pg_query/postgres_deparse.c +11496 -0
- data/ext/pg_query/postgres_deparse.h +9 -0
- data/ext/pg_query/src_backend_catalog_namespace.c +262 -71
- data/ext/pg_query/src_backend_catalog_pg_proc.c +3 -2
- data/ext/pg_query/src_backend_commands_define.c +12 -3
- data/ext/pg_query/src_backend_nodes_bitmapset.c +142 -156
- data/ext/pg_query/src_backend_nodes_copyfuncs.c +100 -5881
- data/ext/pg_query/src_backend_nodes_equalfuncs.c +102 -3831
- data/ext/pg_query/src_backend_nodes_extensible.c +6 -29
- data/ext/pg_query/src_backend_nodes_list.c +89 -18
- data/ext/pg_query/src_backend_nodes_makefuncs.c +138 -4
- data/ext/pg_query/src_backend_nodes_nodeFuncs.c +433 -132
- data/ext/pg_query/src_backend_nodes_value.c +28 -19
- data/ext/pg_query/src_backend_parser_gram.c +45255 -38885
- data/ext/pg_query/src_backend_parser_parser.c +53 -8
- data/ext/pg_query/src_backend_parser_scan.c +6999 -3438
- data/ext/pg_query/src_backend_parser_scansup.c +5 -28
- data/ext/pg_query/src_backend_storage_ipc_ipc.c +13 -4
- data/ext/pg_query/src_backend_tcop_postgres.c +156 -114
- data/ext/pg_query/src_backend_utils_activity_pgstat_database.c +140 -0
- data/ext/pg_query/src_backend_utils_adt_datum.c +14 -2
- data/ext/pg_query/src_backend_utils_adt_expandeddatum.c +1 -1
- data/ext/pg_query/src_backend_utils_adt_format_type.c +6 -2
- data/ext/pg_query/src_backend_utils_adt_numutils.c +488 -0
- data/ext/pg_query/src_backend_utils_adt_ruleutils.c +247 -34
- data/ext/pg_query/src_backend_utils_error_assert.c +17 -18
- data/ext/pg_query/src_backend_utils_error_elog.c +543 -343
- data/ext/pg_query/src_backend_utils_fmgr_fmgr.c +47 -18
- data/ext/pg_query/src_backend_utils_init_globals.c +22 -7
- data/ext/pg_query/src_backend_utils_mb_mbutils.c +84 -148
- data/ext/pg_query/src_backend_utils_misc_guc_tables.c +502 -0
- data/ext/pg_query/src_backend_utils_mmgr_alignedalloc.c +166 -0
- data/ext/pg_query/src_backend_utils_mmgr_aset.c +708 -499
- data/ext/pg_query/src_backend_utils_mmgr_bump.c +728 -0
- data/ext/pg_query/src_backend_utils_mmgr_generation.c +1115 -0
- data/ext/pg_query/src_backend_utils_mmgr_mcxt.c +710 -218
- data/ext/pg_query/src_backend_utils_mmgr_slab.c +1079 -0
- data/ext/pg_query/src_common_encnames.c +46 -44
- data/ext/pg_query/src_common_hashfn.c +3 -3
- data/ext/pg_query/src_common_keywords.c +15 -2
- data/ext/pg_query/src_common_kwlist_d.h +602 -510
- 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 +21 -4
- data/ext/pg_query/src_common_wchar.c +754 -178
- data/ext/pg_query/src_pl_plpgsql_src_pl_comp.c +143 -24
- data/ext/pg_query/src_pl_plpgsql_src_pl_funcs.c +3 -18
- data/ext/pg_query/src_pl_plpgsql_src_pl_gram.c +1295 -1255
- 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 +10 -10
- data/ext/pg_query/src_pl_plpgsql_src_pl_scanner.c +20 -2
- data/ext/pg_query/src_pl_plpgsql_src_pl_unreserved_kwlist_d.h +60 -60
- data/ext/pg_query/src_port_pg_bitutils.c +283 -54
- data/ext/pg_query/src_port_pgstrcasecmp.c +57 -1
- data/ext/pg_query/src_port_qsort.c +12 -224
- data/ext/pg_query/src_port_snprintf.c +56 -39
- data/ext/pg_query/src_port_strerror.c +9 -21
- data/ext/pg_query/src_port_strlcpy.c +79 -0
- data/lib/pg_query/filter_columns.rb +1 -1
- data/lib/pg_query/fingerprint.rb +10 -9
- data/lib/pg_query/node.rb +18 -13
- data/lib/pg_query/param_refs.rb +3 -3
- data/lib/pg_query/parse.rb +25 -15
- data/lib/pg_query/parse_error.rb +1 -0
- data/lib/pg_query/pg_query_pb.rb +181 -3038
- data/lib/pg_query/scan.rb +1 -0
- data/lib/pg_query/treewalker.rb +55 -8
- data/lib/pg_query/truncate.rb +19 -21
- data/lib/pg_query/version.rb +1 -1
- metadata +447 -436
- data/ext/pg_query/guc-file.c +0 -0
- data/ext/pg_query/include/access/amapi.h +0 -246
- data/ext/pg_query/include/access/attmap.h +0 -52
- data/ext/pg_query/include/access/attnum.h +0 -64
- data/ext/pg_query/include/access/clog.h +0 -61
- data/ext/pg_query/include/access/commit_ts.h +0 -77
- data/ext/pg_query/include/access/detoast.h +0 -92
- data/ext/pg_query/include/access/genam.h +0 -228
- data/ext/pg_query/include/access/gin.h +0 -78
- data/ext/pg_query/include/access/htup.h +0 -89
- data/ext/pg_query/include/access/htup_details.h +0 -819
- data/ext/pg_query/include/access/itup.h +0 -161
- data/ext/pg_query/include/access/parallel.h +0 -82
- data/ext/pg_query/include/access/printtup.h +0 -35
- data/ext/pg_query/include/access/relation.h +0 -28
- data/ext/pg_query/include/access/relscan.h +0 -176
- data/ext/pg_query/include/access/rmgr.h +0 -35
- data/ext/pg_query/include/access/rmgrlist.h +0 -49
- data/ext/pg_query/include/access/sdir.h +0 -58
- data/ext/pg_query/include/access/skey.h +0 -151
- data/ext/pg_query/include/access/stratnum.h +0 -83
- data/ext/pg_query/include/access/sysattr.h +0 -29
- data/ext/pg_query/include/access/table.h +0 -27
- data/ext/pg_query/include/access/tableam.h +0 -1825
- data/ext/pg_query/include/access/transam.h +0 -265
- data/ext/pg_query/include/access/tupconvert.h +0 -51
- data/ext/pg_query/include/access/tupdesc.h +0 -154
- data/ext/pg_query/include/access/tupmacs.h +0 -247
- data/ext/pg_query/include/access/twophase.h +0 -63
- data/ext/pg_query/include/access/xact.h +0 -469
- data/ext/pg_query/include/access/xlog.h +0 -398
- data/ext/pg_query/include/access/xlog_internal.h +0 -339
- data/ext/pg_query/include/access/xlogdefs.h +0 -109
- data/ext/pg_query/include/access/xloginsert.h +0 -64
- data/ext/pg_query/include/access/xlogreader.h +0 -337
- data/ext/pg_query/include/access/xlogrecord.h +0 -227
- data/ext/pg_query/include/bootstrap/bootstrap.h +0 -62
- data/ext/pg_query/include/c.h +0 -1334
- data/ext/pg_query/include/catalog/catalog.h +0 -42
- data/ext/pg_query/include/catalog/catversion.h +0 -58
- data/ext/pg_query/include/catalog/dependency.h +0 -277
- data/ext/pg_query/include/catalog/genbki.h +0 -64
- data/ext/pg_query/include/catalog/index.h +0 -199
- data/ext/pg_query/include/catalog/indexing.h +0 -366
- data/ext/pg_query/include/catalog/namespace.h +0 -188
- data/ext/pg_query/include/catalog/objectaccess.h +0 -197
- data/ext/pg_query/include/catalog/objectaddress.h +0 -84
- data/ext/pg_query/include/catalog/pg_aggregate.h +0 -176
- data/ext/pg_query/include/catalog/pg_aggregate_d.h +0 -77
- data/ext/pg_query/include/catalog/pg_am.h +0 -60
- data/ext/pg_query/include/catalog/pg_am_d.h +0 -45
- data/ext/pg_query/include/catalog/pg_attribute.h +0 -204
- data/ext/pg_query/include/catalog/pg_attribute_d.h +0 -59
- data/ext/pg_query/include/catalog/pg_authid.h +0 -58
- data/ext/pg_query/include/catalog/pg_authid_d.h +0 -49
- data/ext/pg_query/include/catalog/pg_class.h +0 -200
- data/ext/pg_query/include/catalog/pg_class_d.h +0 -103
- data/ext/pg_query/include/catalog/pg_collation.h +0 -73
- data/ext/pg_query/include/catalog/pg_collation_d.h +0 -45
- data/ext/pg_query/include/catalog/pg_constraint.h +0 -247
- data/ext/pg_query/include/catalog/pg_constraint_d.h +0 -67
- data/ext/pg_query/include/catalog/pg_control.h +0 -252
- data/ext/pg_query/include/catalog/pg_conversion.h +0 -72
- data/ext/pg_query/include/catalog/pg_conversion_d.h +0 -35
- data/ext/pg_query/include/catalog/pg_depend.h +0 -73
- data/ext/pg_query/include/catalog/pg_depend_d.h +0 -34
- data/ext/pg_query/include/catalog/pg_event_trigger.h +0 -51
- data/ext/pg_query/include/catalog/pg_event_trigger_d.h +0 -34
- data/ext/pg_query/include/catalog/pg_index.h +0 -80
- data/ext/pg_query/include/catalog/pg_index_d.h +0 -56
- data/ext/pg_query/include/catalog/pg_language.h +0 -67
- data/ext/pg_query/include/catalog/pg_language_d.h +0 -39
- data/ext/pg_query/include/catalog/pg_namespace.h +0 -59
- data/ext/pg_query/include/catalog/pg_namespace_d.h +0 -34
- data/ext/pg_query/include/catalog/pg_opclass.h +0 -85
- data/ext/pg_query/include/catalog/pg_opclass_d.h +0 -49
- data/ext/pg_query/include/catalog/pg_operator.h +0 -104
- data/ext/pg_query/include/catalog/pg_operator_d.h +0 -106
- data/ext/pg_query/include/catalog/pg_opfamily.h +0 -60
- data/ext/pg_query/include/catalog/pg_opfamily_d.h +0 -47
- data/ext/pg_query/include/catalog/pg_partitioned_table.h +0 -63
- data/ext/pg_query/include/catalog/pg_partitioned_table_d.h +0 -35
- data/ext/pg_query/include/catalog/pg_proc.h +0 -211
- data/ext/pg_query/include/catalog/pg_proc_d.h +0 -99
- data/ext/pg_query/include/catalog/pg_publication.h +0 -118
- data/ext/pg_query/include/catalog/pg_publication_d.h +0 -36
- data/ext/pg_query/include/catalog/pg_replication_origin.h +0 -57
- data/ext/pg_query/include/catalog/pg_replication_origin_d.h +0 -29
- data/ext/pg_query/include/catalog/pg_statistic.h +0 -275
- data/ext/pg_query/include/catalog/pg_statistic_d.h +0 -194
- data/ext/pg_query/include/catalog/pg_statistic_ext.h +0 -74
- data/ext/pg_query/include/catalog/pg_statistic_ext_d.h +0 -40
- data/ext/pg_query/include/catalog/pg_transform.h +0 -45
- data/ext/pg_query/include/catalog/pg_transform_d.h +0 -32
- data/ext/pg_query/include/catalog/pg_trigger.h +0 -137
- data/ext/pg_query/include/catalog/pg_trigger_d.h +0 -106
- data/ext/pg_query/include/catalog/pg_ts_config.h +0 -50
- data/ext/pg_query/include/catalog/pg_ts_config_d.h +0 -32
- data/ext/pg_query/include/catalog/pg_ts_dict.h +0 -54
- data/ext/pg_query/include/catalog/pg_ts_dict_d.h +0 -33
- data/ext/pg_query/include/catalog/pg_ts_parser.h +0 -57
- data/ext/pg_query/include/catalog/pg_ts_parser_d.h +0 -35
- data/ext/pg_query/include/catalog/pg_ts_template.h +0 -48
- data/ext/pg_query/include/catalog/pg_ts_template_d.h +0 -32
- data/ext/pg_query/include/catalog/pg_type.h +0 -373
- data/ext/pg_query/include/catalog/pg_type_d.h +0 -285
- data/ext/pg_query/include/catalog/storage.h +0 -48
- data/ext/pg_query/include/commands/async.h +0 -54
- data/ext/pg_query/include/commands/dbcommands.h +0 -35
- data/ext/pg_query/include/commands/defrem.h +0 -173
- data/ext/pg_query/include/commands/event_trigger.h +0 -88
- data/ext/pg_query/include/commands/explain.h +0 -127
- data/ext/pg_query/include/commands/prepare.h +0 -61
- data/ext/pg_query/include/commands/tablespace.h +0 -69
- data/ext/pg_query/include/commands/trigger.h +0 -285
- data/ext/pg_query/include/commands/user.h +0 -37
- data/ext/pg_query/include/commands/vacuum.h +0 -293
- data/ext/pg_query/include/commands/variable.h +0 -38
- data/ext/pg_query/include/common/file_perm.h +0 -56
- data/ext/pg_query/include/common/hashfn.h +0 -104
- data/ext/pg_query/include/common/ip.h +0 -37
- data/ext/pg_query/include/common/keywords.h +0 -33
- data/ext/pg_query/include/common/kwlookup.h +0 -44
- data/ext/pg_query/include/common/relpath.h +0 -90
- data/ext/pg_query/include/common/string.h +0 -19
- data/ext/pg_query/include/common/unicode_combining_table.h +0 -196
- data/ext/pg_query/include/datatype/timestamp.h +0 -197
- data/ext/pg_query/include/executor/execdesc.h +0 -70
- data/ext/pg_query/include/executor/executor.h +0 -620
- data/ext/pg_query/include/executor/functions.h +0 -41
- data/ext/pg_query/include/executor/instrument.h +0 -101
- data/ext/pg_query/include/executor/spi.h +0 -175
- data/ext/pg_query/include/executor/tablefunc.h +0 -67
- data/ext/pg_query/include/executor/tuptable.h +0 -487
- data/ext/pg_query/include/fmgr.h +0 -775
- data/ext/pg_query/include/funcapi.h +0 -348
- data/ext/pg_query/include/getaddrinfo.h +0 -162
- data/ext/pg_query/include/jit/jit.h +0 -105
- data/ext/pg_query/include/kwlist_d.h +0 -1072
- data/ext/pg_query/include/lib/ilist.h +0 -727
- data/ext/pg_query/include/lib/pairingheap.h +0 -102
- data/ext/pg_query/include/lib/simplehash.h +0 -1059
- data/ext/pg_query/include/lib/stringinfo.h +0 -161
- data/ext/pg_query/include/libpq/auth.h +0 -29
- data/ext/pg_query/include/libpq/crypt.h +0 -46
- data/ext/pg_query/include/libpq/hba.h +0 -140
- data/ext/pg_query/include/libpq/libpq-be.h +0 -326
- data/ext/pg_query/include/libpq/libpq.h +0 -134
- data/ext/pg_query/include/libpq/pqcomm.h +0 -208
- data/ext/pg_query/include/libpq/pqformat.h +0 -210
- data/ext/pg_query/include/libpq/pqsignal.h +0 -42
- data/ext/pg_query/include/mb/pg_wchar.h +0 -673
- data/ext/pg_query/include/mb/stringinfo_mb.h +0 -24
- data/ext/pg_query/include/miscadmin.h +0 -489
- data/ext/pg_query/include/nodes/bitmapset.h +0 -122
- data/ext/pg_query/include/nodes/execnodes.h +0 -2523
- data/ext/pg_query/include/nodes/extensible.h +0 -160
- data/ext/pg_query/include/nodes/lockoptions.h +0 -61
- data/ext/pg_query/include/nodes/makefuncs.h +0 -108
- data/ext/pg_query/include/nodes/memnodes.h +0 -108
- data/ext/pg_query/include/nodes/nodeFuncs.h +0 -162
- data/ext/pg_query/include/nodes/nodes.h +0 -842
- data/ext/pg_query/include/nodes/params.h +0 -170
- data/ext/pg_query/include/nodes/parsenodes.h +0 -3580
- data/ext/pg_query/include/nodes/pathnodes.h +0 -2557
- data/ext/pg_query/include/nodes/pg_list.h +0 -606
- data/ext/pg_query/include/nodes/plannodes.h +0 -1266
- data/ext/pg_query/include/nodes/primnodes.h +0 -1541
- data/ext/pg_query/include/nodes/print.h +0 -34
- data/ext/pg_query/include/nodes/tidbitmap.h +0 -75
- data/ext/pg_query/include/nodes/value.h +0 -61
- data/ext/pg_query/include/optimizer/cost.h +0 -206
- data/ext/pg_query/include/optimizer/geqo.h +0 -88
- data/ext/pg_query/include/optimizer/geqo_gene.h +0 -45
- data/ext/pg_query/include/optimizer/optimizer.h +0 -194
- data/ext/pg_query/include/optimizer/paths.h +0 -257
- data/ext/pg_query/include/optimizer/planmain.h +0 -119
- data/ext/pg_query/include/parser/analyze.h +0 -49
- data/ext/pg_query/include/parser/gram.h +0 -1067
- data/ext/pg_query/include/parser/gramparse.h +0 -75
- data/ext/pg_query/include/parser/kwlist.h +0 -477
- data/ext/pg_query/include/parser/parse_agg.h +0 -68
- data/ext/pg_query/include/parser/parse_clause.h +0 -54
- data/ext/pg_query/include/parser/parse_coerce.h +0 -98
- data/ext/pg_query/include/parser/parse_collate.h +0 -27
- data/ext/pg_query/include/parser/parse_expr.h +0 -26
- data/ext/pg_query/include/parser/parse_func.h +0 -73
- data/ext/pg_query/include/parser/parse_node.h +0 -327
- data/ext/pg_query/include/parser/parse_oper.h +0 -67
- data/ext/pg_query/include/parser/parse_relation.h +0 -123
- data/ext/pg_query/include/parser/parse_target.h +0 -46
- data/ext/pg_query/include/parser/parse_type.h +0 -60
- data/ext/pg_query/include/parser/parser.h +0 -41
- data/ext/pg_query/include/parser/parsetree.h +0 -61
- data/ext/pg_query/include/parser/scanner.h +0 -152
- data/ext/pg_query/include/parser/scansup.h +0 -30
- data/ext/pg_query/include/partitioning/partdefs.h +0 -26
- data/ext/pg_query/include/pg_config.h +0 -995
- data/ext/pg_query/include/pg_config_manual.h +0 -357
- data/ext/pg_query/include/pg_config_os.h +0 -8
- data/ext/pg_query/include/pg_getopt.h +0 -56
- data/ext/pg_query/include/pg_trace.h +0 -17
- data/ext/pg_query/include/pgstat.h +0 -1488
- data/ext/pg_query/include/pgtime.h +0 -84
- data/ext/pg_query/include/pl_gram.h +0 -385
- data/ext/pg_query/include/pl_reserved_kwlist.h +0 -52
- data/ext/pg_query/include/pl_reserved_kwlist_d.h +0 -114
- data/ext/pg_query/include/pl_unreserved_kwlist.h +0 -112
- data/ext/pg_query/include/pl_unreserved_kwlist_d.h +0 -246
- data/ext/pg_query/include/plerrcodes.h +0 -990
- data/ext/pg_query/include/plpgsql.h +0 -1347
- data/ext/pg_query/include/port/atomics/arch-arm.h +0 -26
- data/ext/pg_query/include/port/atomics/arch-ppc.h +0 -254
- data/ext/pg_query/include/port/atomics/arch-x86.h +0 -252
- data/ext/pg_query/include/port/atomics/fallback.h +0 -170
- data/ext/pg_query/include/port/atomics/generic-gcc.h +0 -286
- data/ext/pg_query/include/port/atomics/generic.h +0 -401
- data/ext/pg_query/include/port/atomics.h +0 -524
- data/ext/pg_query/include/port/pg_bitutils.h +0 -272
- data/ext/pg_query/include/port/pg_bswap.h +0 -161
- data/ext/pg_query/include/port/pg_crc32c.h +0 -101
- data/ext/pg_query/include/port.h +0 -528
- data/ext/pg_query/include/portability/instr_time.h +0 -256
- data/ext/pg_query/include/postgres.h +0 -764
- data/ext/pg_query/include/postgres_ext.h +0 -74
- data/ext/pg_query/include/postmaster/autovacuum.h +0 -83
- data/ext/pg_query/include/postmaster/bgworker.h +0 -161
- data/ext/pg_query/include/postmaster/bgworker_internals.h +0 -64
- data/ext/pg_query/include/postmaster/bgwriter.h +0 -45
- data/ext/pg_query/include/postmaster/fork_process.h +0 -17
- data/ext/pg_query/include/postmaster/interrupt.h +0 -32
- data/ext/pg_query/include/postmaster/pgarch.h +0 -39
- data/ext/pg_query/include/postmaster/postmaster.h +0 -77
- data/ext/pg_query/include/postmaster/syslogger.h +0 -98
- data/ext/pg_query/include/postmaster/walwriter.h +0 -21
- data/ext/pg_query/include/regex/regex.h +0 -184
- data/ext/pg_query/include/replication/logicallauncher.h +0 -31
- data/ext/pg_query/include/replication/logicalproto.h +0 -110
- data/ext/pg_query/include/replication/logicalworker.h +0 -19
- data/ext/pg_query/include/replication/origin.h +0 -73
- data/ext/pg_query/include/replication/reorderbuffer.h +0 -468
- data/ext/pg_query/include/replication/slot.h +0 -219
- data/ext/pg_query/include/replication/syncrep.h +0 -115
- data/ext/pg_query/include/replication/walreceiver.h +0 -340
- data/ext/pg_query/include/replication/walsender.h +0 -74
- data/ext/pg_query/include/rewrite/prs2lock.h +0 -46
- data/ext/pg_query/include/rewrite/rewriteHandler.h +0 -40
- data/ext/pg_query/include/rewrite/rewriteManip.h +0 -87
- data/ext/pg_query/include/rewrite/rewriteSupport.h +0 -26
- data/ext/pg_query/include/storage/backendid.h +0 -37
- data/ext/pg_query/include/storage/block.h +0 -121
- data/ext/pg_query/include/storage/buf.h +0 -46
- data/ext/pg_query/include/storage/bufmgr.h +0 -292
- data/ext/pg_query/include/storage/bufpage.h +0 -459
- data/ext/pg_query/include/storage/condition_variable.h +0 -62
- data/ext/pg_query/include/storage/dsm.h +0 -61
- data/ext/pg_query/include/storage/dsm_impl.h +0 -75
- data/ext/pg_query/include/storage/fd.h +0 -168
- data/ext/pg_query/include/storage/ipc.h +0 -81
- data/ext/pg_query/include/storage/item.h +0 -19
- data/ext/pg_query/include/storage/itemid.h +0 -184
- data/ext/pg_query/include/storage/itemptr.h +0 -206
- data/ext/pg_query/include/storage/large_object.h +0 -100
- data/ext/pg_query/include/storage/latch.h +0 -190
- data/ext/pg_query/include/storage/lmgr.h +0 -114
- data/ext/pg_query/include/storage/lock.h +0 -613
- data/ext/pg_query/include/storage/lockdefs.h +0 -59
- data/ext/pg_query/include/storage/lwlock.h +0 -233
- data/ext/pg_query/include/storage/lwlocknames.h +0 -51
- data/ext/pg_query/include/storage/off.h +0 -57
- data/ext/pg_query/include/storage/pg_sema.h +0 -61
- data/ext/pg_query/include/storage/pg_shmem.h +0 -90
- data/ext/pg_query/include/storage/pmsignal.h +0 -94
- data/ext/pg_query/include/storage/predicate.h +0 -87
- data/ext/pg_query/include/storage/proc.h +0 -347
- data/ext/pg_query/include/storage/proclist_types.h +0 -51
- data/ext/pg_query/include/storage/procsignal.h +0 -75
- data/ext/pg_query/include/storage/relfilenode.h +0 -99
- data/ext/pg_query/include/storage/s_lock.h +0 -1071
- data/ext/pg_query/include/storage/sharedfileset.h +0 -45
- data/ext/pg_query/include/storage/shm_mq.h +0 -85
- data/ext/pg_query/include/storage/shm_toc.h +0 -58
- data/ext/pg_query/include/storage/shmem.h +0 -81
- data/ext/pg_query/include/storage/sinval.h +0 -153
- data/ext/pg_query/include/storage/sinvaladt.h +0 -43
- data/ext/pg_query/include/storage/smgr.h +0 -109
- data/ext/pg_query/include/storage/spin.h +0 -77
- data/ext/pg_query/include/storage/standby.h +0 -91
- data/ext/pg_query/include/storage/standbydefs.h +0 -74
- data/ext/pg_query/include/storage/sync.h +0 -62
- data/ext/pg_query/include/tcop/cmdtag.h +0 -58
- data/ext/pg_query/include/tcop/cmdtaglist.h +0 -217
- data/ext/pg_query/include/tcop/deparse_utility.h +0 -108
- data/ext/pg_query/include/tcop/dest.h +0 -149
- data/ext/pg_query/include/tcop/fastpath.h +0 -21
- data/ext/pg_query/include/tcop/pquery.h +0 -51
- data/ext/pg_query/include/tcop/tcopprot.h +0 -89
- data/ext/pg_query/include/tcop/utility.h +0 -108
- data/ext/pg_query/include/tsearch/ts_cache.h +0 -98
- data/ext/pg_query/include/utils/acl.h +0 -312
- data/ext/pg_query/include/utils/aclchk_internal.h +0 -45
- data/ext/pg_query/include/utils/array.h +0 -459
- data/ext/pg_query/include/utils/builtins.h +0 -128
- data/ext/pg_query/include/utils/bytea.h +0 -27
- data/ext/pg_query/include/utils/catcache.h +0 -231
- data/ext/pg_query/include/utils/date.h +0 -90
- data/ext/pg_query/include/utils/datetime.h +0 -343
- data/ext/pg_query/include/utils/datum.h +0 -68
- data/ext/pg_query/include/utils/dsa.h +0 -123
- data/ext/pg_query/include/utils/dynahash.h +0 -19
- data/ext/pg_query/include/utils/elog.h +0 -439
- data/ext/pg_query/include/utils/errcodes.h +0 -352
- data/ext/pg_query/include/utils/expandeddatum.h +0 -159
- data/ext/pg_query/include/utils/expandedrecord.h +0 -231
- data/ext/pg_query/include/utils/float.h +0 -356
- data/ext/pg_query/include/utils/fmgroids.h +0 -2657
- data/ext/pg_query/include/utils/fmgrprotos.h +0 -2646
- data/ext/pg_query/include/utils/fmgrtab.h +0 -48
- data/ext/pg_query/include/utils/guc.h +0 -443
- data/ext/pg_query/include/utils/guc_tables.h +0 -272
- data/ext/pg_query/include/utils/hsearch.h +0 -149
- data/ext/pg_query/include/utils/inval.h +0 -65
- data/ext/pg_query/include/utils/lsyscache.h +0 -198
- data/ext/pg_query/include/utils/memdebug.h +0 -82
- data/ext/pg_query/include/utils/memutils.h +0 -225
- data/ext/pg_query/include/utils/numeric.h +0 -76
- data/ext/pg_query/include/utils/palloc.h +0 -136
- data/ext/pg_query/include/utils/partcache.h +0 -102
- data/ext/pg_query/include/utils/pg_locale.h +0 -119
- data/ext/pg_query/include/utils/pg_lsn.h +0 -29
- data/ext/pg_query/include/utils/pidfile.h +0 -56
- data/ext/pg_query/include/utils/plancache.h +0 -235
- data/ext/pg_query/include/utils/portal.h +0 -254
- data/ext/pg_query/include/utils/probes.h +0 -114
- data/ext/pg_query/include/utils/ps_status.h +0 -25
- data/ext/pg_query/include/utils/queryenvironment.h +0 -74
- data/ext/pg_query/include/utils/regproc.h +0 -28
- data/ext/pg_query/include/utils/rel.h +0 -643
- data/ext/pg_query/include/utils/relcache.h +0 -150
- data/ext/pg_query/include/utils/reltrigger.h +0 -81
- data/ext/pg_query/include/utils/resowner.h +0 -86
- data/ext/pg_query/include/utils/rls.h +0 -50
- data/ext/pg_query/include/utils/ruleutils.h +0 -44
- data/ext/pg_query/include/utils/sharedtuplestore.h +0 -61
- data/ext/pg_query/include/utils/snapmgr.h +0 -159
- data/ext/pg_query/include/utils/snapshot.h +0 -206
- data/ext/pg_query/include/utils/sortsupport.h +0 -276
- data/ext/pg_query/include/utils/syscache.h +0 -219
- data/ext/pg_query/include/utils/timeout.h +0 -88
- data/ext/pg_query/include/utils/timestamp.h +0 -116
- data/ext/pg_query/include/utils/tuplesort.h +0 -277
- data/ext/pg_query/include/utils/tuplestore.h +0 -91
- data/ext/pg_query/include/utils/typcache.h +0 -202
- data/ext/pg_query/include/utils/tzparser.h +0 -39
- data/ext/pg_query/include/utils/varlena.h +0 -39
- data/ext/pg_query/include/utils/xml.h +0 -84
- data/ext/pg_query/pg_query_ruby_freebsd.sym +0 -2
- data/ext/pg_query/src_backend_libpq_pqcomm.c +0 -659
- data/ext/pg_query/src_backend_parser_parse_expr.c +0 -313
- data/ext/pg_query/src_backend_postmaster_postmaster.c +0 -2230
- data/ext/pg_query/src_backend_storage_lmgr_s_lock.c +0 -370
- data/ext/pg_query/src_backend_utils_hash_dynahash.c +0 -1086
- data/ext/pg_query/src_backend_utils_misc_guc.c +0 -1832
- data/ext/pg_query/src_common_string.c +0 -86
- data/ext/pg_query/src_port_erand48.c +0 -127
- data/ext/pg_query/src_port_pgsleep.c +0 -69
- data/ext/pg_query/src_port_random.c +0 -31
- data/ext/pg_query/src_port_strnlen.c +0 -39
- /data/ext/pg_query/{pg_query_ruby.sym → ext_symbols.sym} +0 -0
- /data/ext/pg_query/include/{pg_config_ext.h → postgres/pg_config_ext.h} +0 -0
@@ -1,1832 +0,0 @@
|
|
1
|
-
/*--------------------------------------------------------------------
|
2
|
-
* Symbols referenced in this file:
|
3
|
-
* - log_min_messages
|
4
|
-
* - client_min_messages
|
5
|
-
* - backtrace_functions
|
6
|
-
* - backtrace_symbol_list
|
7
|
-
* - check_function_bodies
|
8
|
-
*--------------------------------------------------------------------
|
9
|
-
*/
|
10
|
-
|
11
|
-
/*--------------------------------------------------------------------
|
12
|
-
* guc.c
|
13
|
-
*
|
14
|
-
* Support for grand unified configuration scheme, including SET
|
15
|
-
* command, configuration file, and command line options.
|
16
|
-
* See src/backend/utils/misc/README for more information.
|
17
|
-
*
|
18
|
-
*
|
19
|
-
* Copyright (c) 2000-2020, PostgreSQL Global Development Group
|
20
|
-
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
21
|
-
*
|
22
|
-
* IDENTIFICATION
|
23
|
-
* src/backend/utils/misc/guc.c
|
24
|
-
*
|
25
|
-
*--------------------------------------------------------------------
|
26
|
-
*/
|
27
|
-
#include "postgres.h"
|
28
|
-
|
29
|
-
#include <ctype.h>
|
30
|
-
#include <float.h>
|
31
|
-
#include <math.h>
|
32
|
-
#include <limits.h>
|
33
|
-
#include <unistd.h>
|
34
|
-
#include <sys/stat.h>
|
35
|
-
#ifdef HAVE_SYSLOG
|
36
|
-
#include <syslog.h>
|
37
|
-
#endif
|
38
|
-
|
39
|
-
#include "access/commit_ts.h"
|
40
|
-
#include "access/gin.h"
|
41
|
-
#include "access/rmgr.h"
|
42
|
-
#include "access/tableam.h"
|
43
|
-
#include "access/transam.h"
|
44
|
-
#include "access/twophase.h"
|
45
|
-
#include "access/xact.h"
|
46
|
-
#include "access/xlog_internal.h"
|
47
|
-
#include "catalog/namespace.h"
|
48
|
-
#include "catalog/pg_authid.h"
|
49
|
-
#include "catalog/storage.h"
|
50
|
-
#include "commands/async.h"
|
51
|
-
#include "commands/prepare.h"
|
52
|
-
#include "commands/tablespace.h"
|
53
|
-
#include "commands/trigger.h"
|
54
|
-
#include "commands/user.h"
|
55
|
-
#include "commands/vacuum.h"
|
56
|
-
#include "commands/variable.h"
|
57
|
-
#include "common/string.h"
|
58
|
-
#include "funcapi.h"
|
59
|
-
#include "jit/jit.h"
|
60
|
-
#include "libpq/auth.h"
|
61
|
-
#include "libpq/libpq.h"
|
62
|
-
#include "libpq/pqformat.h"
|
63
|
-
#include "miscadmin.h"
|
64
|
-
#include "optimizer/cost.h"
|
65
|
-
#include "optimizer/geqo.h"
|
66
|
-
#include "optimizer/optimizer.h"
|
67
|
-
#include "optimizer/paths.h"
|
68
|
-
#include "optimizer/planmain.h"
|
69
|
-
#include "parser/parse_expr.h"
|
70
|
-
#include "parser/parse_type.h"
|
71
|
-
#include "parser/parser.h"
|
72
|
-
#include "parser/scansup.h"
|
73
|
-
#include "pgstat.h"
|
74
|
-
#include "postmaster/autovacuum.h"
|
75
|
-
#include "postmaster/bgworker_internals.h"
|
76
|
-
#include "postmaster/bgwriter.h"
|
77
|
-
#include "postmaster/postmaster.h"
|
78
|
-
#include "postmaster/syslogger.h"
|
79
|
-
#include "postmaster/walwriter.h"
|
80
|
-
#include "replication/logicallauncher.h"
|
81
|
-
#include "replication/reorderbuffer.h"
|
82
|
-
#include "replication/slot.h"
|
83
|
-
#include "replication/syncrep.h"
|
84
|
-
#include "replication/walreceiver.h"
|
85
|
-
#include "replication/walsender.h"
|
86
|
-
#include "storage/bufmgr.h"
|
87
|
-
#include "storage/dsm_impl.h"
|
88
|
-
#include "storage/fd.h"
|
89
|
-
#include "storage/large_object.h"
|
90
|
-
#include "storage/pg_shmem.h"
|
91
|
-
#include "storage/predicate.h"
|
92
|
-
#include "storage/proc.h"
|
93
|
-
#include "storage/standby.h"
|
94
|
-
#include "tcop/tcopprot.h"
|
95
|
-
#include "tsearch/ts_cache.h"
|
96
|
-
#include "utils/acl.h"
|
97
|
-
#include "utils/builtins.h"
|
98
|
-
#include "utils/bytea.h"
|
99
|
-
#include "utils/float.h"
|
100
|
-
#include "utils/guc_tables.h"
|
101
|
-
#include "utils/memutils.h"
|
102
|
-
#include "utils/pg_locale.h"
|
103
|
-
#include "utils/pg_lsn.h"
|
104
|
-
#include "utils/plancache.h"
|
105
|
-
#include "utils/portal.h"
|
106
|
-
#include "utils/ps_status.h"
|
107
|
-
#include "utils/rls.h"
|
108
|
-
#include "utils/snapmgr.h"
|
109
|
-
#include "utils/tzparser.h"
|
110
|
-
#include "utils/varlena.h"
|
111
|
-
#include "utils/xml.h"
|
112
|
-
|
113
|
-
#ifndef PG_KRB_SRVTAB
|
114
|
-
#define PG_KRB_SRVTAB ""
|
115
|
-
#endif
|
116
|
-
|
117
|
-
#define CONFIG_FILENAME "postgresql.conf"
|
118
|
-
#define HBA_FILENAME "pg_hba.conf"
|
119
|
-
#define IDENT_FILENAME "pg_ident.conf"
|
120
|
-
|
121
|
-
#ifdef EXEC_BACKEND
|
122
|
-
#define CONFIG_EXEC_PARAMS "global/config_exec_params"
|
123
|
-
#define CONFIG_EXEC_PARAMS_NEW "global/config_exec_params.new"
|
124
|
-
#endif
|
125
|
-
|
126
|
-
/*
|
127
|
-
* Precision with which REAL type guc values are to be printed for GUC
|
128
|
-
* serialization.
|
129
|
-
*/
|
130
|
-
#define REALTYPE_PRECISION 17
|
131
|
-
|
132
|
-
/* XXX these should appear in other modules' header files */
|
133
|
-
extern bool Log_disconnections;
|
134
|
-
extern int CommitDelay;
|
135
|
-
extern int CommitSiblings;
|
136
|
-
extern char *default_tablespace;
|
137
|
-
extern char *temp_tablespaces;
|
138
|
-
extern bool ignore_checksum_failure;
|
139
|
-
extern bool ignore_invalid_pages;
|
140
|
-
extern bool synchronize_seqscans;
|
141
|
-
|
142
|
-
#ifdef TRACE_SYNCSCAN
|
143
|
-
extern bool trace_syncscan;
|
144
|
-
#endif
|
145
|
-
#ifdef DEBUG_BOUNDED_SORT
|
146
|
-
extern bool optimize_bounded_sort;
|
147
|
-
#endif
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
/* global variables for check hook support */
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
static void do_serialize(char **destptr, Size *maxbytes, const char *fmt,...) pg_attribute_printf(3, 4);
|
157
|
-
|
158
|
-
static void set_config_sourcefile(const char *name, char *sourcefile,
|
159
|
-
int sourceline);
|
160
|
-
static bool call_bool_check_hook(struct config_bool *conf, bool *newval,
|
161
|
-
void **extra, GucSource source, int elevel);
|
162
|
-
static bool call_int_check_hook(struct config_int *conf, int *newval,
|
163
|
-
void **extra, GucSource source, int elevel);
|
164
|
-
static bool call_real_check_hook(struct config_real *conf, double *newval,
|
165
|
-
void **extra, GucSource source, int elevel);
|
166
|
-
static bool call_string_check_hook(struct config_string *conf, char **newval,
|
167
|
-
void **extra, GucSource source, int elevel);
|
168
|
-
static bool call_enum_check_hook(struct config_enum *conf, int *newval,
|
169
|
-
void **extra, GucSource source, int elevel);
|
170
|
-
|
171
|
-
static bool check_log_destination(char **newval, void **extra, GucSource source);
|
172
|
-
static void assign_log_destination(const char *newval, void *extra);
|
173
|
-
|
174
|
-
static bool check_wal_consistency_checking(char **newval, void **extra,
|
175
|
-
GucSource source);
|
176
|
-
static void assign_wal_consistency_checking(const char *newval, void *extra);
|
177
|
-
|
178
|
-
#ifdef HAVE_SYSLOG
|
179
|
-
|
180
|
-
#else
|
181
|
-
static int syslog_facility = 0;
|
182
|
-
#endif
|
183
|
-
|
184
|
-
static void assign_syslog_facility(int newval, void *extra);
|
185
|
-
static void assign_syslog_ident(const char *newval, void *extra);
|
186
|
-
static void assign_session_replication_role(int newval, void *extra);
|
187
|
-
static bool check_temp_buffers(int *newval, void **extra, GucSource source);
|
188
|
-
static bool check_bonjour(bool *newval, void **extra, GucSource source);
|
189
|
-
static bool check_ssl(bool *newval, void **extra, GucSource source);
|
190
|
-
static bool check_stage_log_stats(bool *newval, void **extra, GucSource source);
|
191
|
-
static bool check_log_stats(bool *newval, void **extra, GucSource source);
|
192
|
-
static bool check_canonical_path(char **newval, void **extra, GucSource source);
|
193
|
-
static bool check_timezone_abbreviations(char **newval, void **extra, GucSource source);
|
194
|
-
static void assign_timezone_abbreviations(const char *newval, void *extra);
|
195
|
-
static void pg_timezone_abbrev_initialize(void);
|
196
|
-
static const char *show_archive_command(void);
|
197
|
-
static void assign_tcp_keepalives_idle(int newval, void *extra);
|
198
|
-
static void assign_tcp_keepalives_interval(int newval, void *extra);
|
199
|
-
static void assign_tcp_keepalives_count(int newval, void *extra);
|
200
|
-
static void assign_tcp_user_timeout(int newval, void *extra);
|
201
|
-
static const char *show_tcp_keepalives_idle(void);
|
202
|
-
static const char *show_tcp_keepalives_interval(void);
|
203
|
-
static const char *show_tcp_keepalives_count(void);
|
204
|
-
static const char *show_tcp_user_timeout(void);
|
205
|
-
static bool check_maxconnections(int *newval, void **extra, GucSource source);
|
206
|
-
static bool check_max_worker_processes(int *newval, void **extra, GucSource source);
|
207
|
-
static bool check_autovacuum_max_workers(int *newval, void **extra, GucSource source);
|
208
|
-
static bool check_max_wal_senders(int *newval, void **extra, GucSource source);
|
209
|
-
static bool check_autovacuum_work_mem(int *newval, void **extra, GucSource source);
|
210
|
-
static bool check_effective_io_concurrency(int *newval, void **extra, GucSource source);
|
211
|
-
static bool check_maintenance_io_concurrency(int *newval, void **extra, GucSource source);
|
212
|
-
static void assign_pgstat_temp_directory(const char *newval, void *extra);
|
213
|
-
static bool check_application_name(char **newval, void **extra, GucSource source);
|
214
|
-
static void assign_application_name(const char *newval, void *extra);
|
215
|
-
static bool check_cluster_name(char **newval, void **extra, GucSource source);
|
216
|
-
static const char *show_unix_socket_permissions(void);
|
217
|
-
static const char *show_log_file_mode(void);
|
218
|
-
static const char *show_data_directory_mode(void);
|
219
|
-
static bool check_backtrace_functions(char **newval, void **extra, GucSource source);
|
220
|
-
static void assign_backtrace_functions(const char *newval, void *extra);
|
221
|
-
static bool check_recovery_target_timeline(char **newval, void **extra, GucSource source);
|
222
|
-
static void assign_recovery_target_timeline(const char *newval, void *extra);
|
223
|
-
static bool check_recovery_target(char **newval, void **extra, GucSource source);
|
224
|
-
static void assign_recovery_target(const char *newval, void *extra);
|
225
|
-
static bool check_recovery_target_xid(char **newval, void **extra, GucSource source);
|
226
|
-
static void assign_recovery_target_xid(const char *newval, void *extra);
|
227
|
-
static bool check_recovery_target_time(char **newval, void **extra, GucSource source);
|
228
|
-
static void assign_recovery_target_time(const char *newval, void *extra);
|
229
|
-
static bool check_recovery_target_name(char **newval, void **extra, GucSource source);
|
230
|
-
static void assign_recovery_target_name(const char *newval, void *extra);
|
231
|
-
static bool check_recovery_target_lsn(char **newval, void **extra, GucSource source);
|
232
|
-
static void assign_recovery_target_lsn(const char *newval, void *extra);
|
233
|
-
static bool check_primary_slot_name(char **newval, void **extra, GucSource source);
|
234
|
-
static bool check_default_with_oids(bool *newval, void **extra, GucSource source);
|
235
|
-
|
236
|
-
/* Private functions in guc-file.l that need to be called from guc.c */
|
237
|
-
static ConfigVariable *ProcessConfigFileInternal(GucContext context,
|
238
|
-
bool applySettings, int elevel);
|
239
|
-
|
240
|
-
|
241
|
-
/*
|
242
|
-
* Options for enum values defined in this module.
|
243
|
-
*
|
244
|
-
* NOTE! Option values may not contain double quotes!
|
245
|
-
*/
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
StaticAssertDecl(lengthof(bytea_output_options) == (BYTEA_OUTPUT_HEX + 2),
|
250
|
-
"array length mismatch");
|
251
|
-
|
252
|
-
/*
|
253
|
-
* We have different sets for client and server message level options because
|
254
|
-
* they sort slightly different (see "log" level), and because "fatal"/"panic"
|
255
|
-
* aren't sensible for client_min_messages.
|
256
|
-
*/
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
StaticAssertDecl(lengthof(intervalstyle_options) == (INTSTYLE_ISO_8601 + 2),
|
264
|
-
"array length mismatch");
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
StaticAssertDecl(lengthof(log_error_verbosity_options) == (PGERROR_VERBOSE + 2),
|
269
|
-
"array length mismatch");
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
StaticAssertDecl(lengthof(log_statement_options) == (LOGSTMT_ALL + 2),
|
274
|
-
"array length mismatch");
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
StaticAssertDecl(lengthof(session_replication_role_options) == (SESSION_REPLICATION_ROLE_LOCAL + 2),
|
281
|
-
"array length mismatch");
|
282
|
-
|
283
|
-
#ifdef HAVE_SYSLOG
|
284
|
-
#else
|
285
|
-
#endif
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
StaticAssertDecl(lengthof(track_function_options) == (TRACK_FUNC_ALL + 2),
|
290
|
-
"array length mismatch");
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
StaticAssertDecl(lengthof(xmlbinary_options) == (XMLBINARY_HEX + 2),
|
295
|
-
"array length mismatch");
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
StaticAssertDecl(lengthof(xmloption_options) == (XMLOPTION_CONTENT + 2),
|
300
|
-
"array length mismatch");
|
301
|
-
|
302
|
-
/*
|
303
|
-
* Although only "on", "off", and "safe_encoding" are documented, we
|
304
|
-
* accept all the likely variants of "on" and "off".
|
305
|
-
*/
|
306
|
-
|
307
|
-
|
308
|
-
/*
|
309
|
-
* Although only "on", "off", and "partition" are documented, we
|
310
|
-
* accept all the likely variants of "on" and "off".
|
311
|
-
*/
|
312
|
-
|
313
|
-
|
314
|
-
/*
|
315
|
-
* Although only "on", "off", "remote_apply", "remote_write", and "local" are
|
316
|
-
* documented, we accept all the likely variants of "on" and "off".
|
317
|
-
*/
|
318
|
-
|
319
|
-
|
320
|
-
/*
|
321
|
-
* Although only "on", "off", "try" are documented, we accept all the likely
|
322
|
-
* variants of "on" and "off".
|
323
|
-
*/
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
/*
|
331
|
-
* password_encryption used to be a boolean, so accept all the likely
|
332
|
-
* variants of "on", too. "off" used to store passwords in plaintext,
|
333
|
-
* but we don't support that anymore.
|
334
|
-
*/
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
StaticAssertDecl(lengthof(ssl_protocol_versions_info) == (PG_TLS1_3_VERSION + 2),
|
340
|
-
"array length mismatch");
|
341
|
-
|
342
|
-
#ifndef WIN32
|
343
|
-
#endif
|
344
|
-
#ifndef EXEC_BACKEND
|
345
|
-
#endif
|
346
|
-
#ifdef WIN32
|
347
|
-
#endif
|
348
|
-
|
349
|
-
/*
|
350
|
-
* Options for enum values stored in other modules
|
351
|
-
*/
|
352
|
-
extern const struct config_enum_entry wal_level_options[];
|
353
|
-
extern const struct config_enum_entry archive_mode_options[];
|
354
|
-
extern const struct config_enum_entry recovery_target_action_options[];
|
355
|
-
extern const struct config_enum_entry sync_method_options[];
|
356
|
-
extern const struct config_enum_entry dynamic_shared_memory_options[];
|
357
|
-
|
358
|
-
/*
|
359
|
-
* GUC option variables that are exported from this module
|
360
|
-
*/
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
/* this is sort of all three above
|
371
|
-
* together */
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
__thread bool check_function_bodies = true;
|
377
|
-
|
378
|
-
|
379
|
-
/*
|
380
|
-
* This GUC exists solely for backward compatibility, check its definition for
|
381
|
-
* details.
|
382
|
-
*/
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
__thread int log_min_messages = WARNING;
|
388
|
-
|
389
|
-
__thread int client_min_messages = NOTICE;
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
__thread char *backtrace_functions;
|
400
|
-
|
401
|
-
__thread char *backtrace_symbol_list;
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
/*
|
424
|
-
* SSL renegotiation was been removed in PostgreSQL 9.5, but we tolerate it
|
425
|
-
* being set to zero (meaning never renegotiate) for backward compatibility.
|
426
|
-
* This avoids breaking compatibility with clients that have never supported
|
427
|
-
* renegotiation and therefore always try to zero it.
|
428
|
-
*/
|
429
|
-
|
430
|
-
|
431
|
-
/*
|
432
|
-
* This really belongs in pg_shmem.c, but is defined here so that it doesn't
|
433
|
-
* need to be duplicated in all the different implementations of pg_shmem.c.
|
434
|
-
*/
|
435
|
-
|
436
|
-
|
437
|
-
/*
|
438
|
-
* These variables are all dummies that don't do anything, except in some
|
439
|
-
* cases provide the value for SHOW to display. The real state is elsewhere
|
440
|
-
* and is kept in sync by assign_hooks.
|
441
|
-
*/
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
/* should be static, but commands/variable.c needs to get at this */
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
/*
|
477
|
-
* Displayable names for context types (enum GucContext)
|
478
|
-
*
|
479
|
-
* Note: these strings are deliberately not localized.
|
480
|
-
*/
|
481
|
-
|
482
|
-
|
483
|
-
StaticAssertDecl(lengthof(GucContext_Names) == (PGC_USERSET + 1),
|
484
|
-
"array length mismatch");
|
485
|
-
|
486
|
-
/*
|
487
|
-
* Displayable names for source types (enum GucSource)
|
488
|
-
*
|
489
|
-
* Note: these strings are deliberately not localized.
|
490
|
-
*/
|
491
|
-
|
492
|
-
|
493
|
-
StaticAssertDecl(lengthof(GucSource_Names) == (PGC_S_SESSION + 1),
|
494
|
-
"array length mismatch");
|
495
|
-
|
496
|
-
/*
|
497
|
-
* Displayable names for the groupings defined in enum config_group
|
498
|
-
*/
|
499
|
-
|
500
|
-
|
501
|
-
StaticAssertDecl(lengthof(config_group_names) == (DEVELOPER_OPTIONS + 2),
|
502
|
-
"array length mismatch");
|
503
|
-
|
504
|
-
/*
|
505
|
-
* Displayable names for GUC variable types (enum config_type)
|
506
|
-
*
|
507
|
-
* Note: these strings are deliberately not localized.
|
508
|
-
*/
|
509
|
-
|
510
|
-
|
511
|
-
StaticAssertDecl(lengthof(config_type_names) == (PGC_ENUM + 1),
|
512
|
-
"array length mismatch");
|
513
|
-
|
514
|
-
/*
|
515
|
-
* Unit conversion tables.
|
516
|
-
*
|
517
|
-
* There are two tables, one for memory units, and another for time units.
|
518
|
-
* For each supported conversion from one unit to another, we have an entry
|
519
|
-
* in the table.
|
520
|
-
*
|
521
|
-
* To keep things simple, and to avoid possible roundoff error,
|
522
|
-
* conversions are never chained. There needs to be a direct conversion
|
523
|
-
* between all units (of the same type).
|
524
|
-
*
|
525
|
-
* The conversions for each base unit must be kept in order from greatest to
|
526
|
-
* smallest human-friendly unit; convert_xxx_from_base_unit() rely on that.
|
527
|
-
* (The order of the base-unit groups does not matter.)
|
528
|
-
*/
|
529
|
-
#define MAX_UNIT_LEN 3 /* length of longest recognized unit string */
|
530
|
-
|
531
|
-
typedef struct
|
532
|
-
{
|
533
|
-
char unit[MAX_UNIT_LEN + 1]; /* unit, as a string, like "kB" or
|
534
|
-
* "min" */
|
535
|
-
int base_unit; /* GUC_UNIT_XXX */
|
536
|
-
double multiplier; /* Factor for converting unit -> base_unit */
|
537
|
-
} unit_conversion;
|
538
|
-
|
539
|
-
/* Ensure that the constants in the tables don't overflow or underflow */
|
540
|
-
#if BLCKSZ < 1024 || BLCKSZ > (1024*1024)
|
541
|
-
#error BLCKSZ must be between 1KB and 1MB
|
542
|
-
#endif
|
543
|
-
#if XLOG_BLCKSZ < 1024 || XLOG_BLCKSZ > (1024*1024)
|
544
|
-
#error XLOG_BLCKSZ must be between 1KB and 1MB
|
545
|
-
#endif
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
/*
|
556
|
-
* Contents of GUC tables
|
557
|
-
*
|
558
|
-
* See src/backend/utils/misc/README for design notes.
|
559
|
-
*
|
560
|
-
* TO ADD AN OPTION:
|
561
|
-
*
|
562
|
-
* 1. Declare a global variable of type bool, int, double, or char*
|
563
|
-
* and make use of it.
|
564
|
-
*
|
565
|
-
* 2. Decide at what times it's safe to set the option. See guc.h for
|
566
|
-
* details.
|
567
|
-
*
|
568
|
-
* 3. Decide on a name, a default value, upper and lower bounds (if
|
569
|
-
* applicable), etc.
|
570
|
-
*
|
571
|
-
* 4. Add a record below.
|
572
|
-
*
|
573
|
-
* 5. Add it to src/backend/utils/misc/postgresql.conf.sample, if
|
574
|
-
* appropriate.
|
575
|
-
*
|
576
|
-
* 6. Don't forget to document the option (at least in config.sgml).
|
577
|
-
*
|
578
|
-
* 7. If it's a new GUC_LIST_QUOTE option, you must add it to
|
579
|
-
* variable_is_guc_list_quote() in src/bin/pg_dump/dumputils.c.
|
580
|
-
*/
|
581
|
-
|
582
|
-
|
583
|
-
/******** option records follow ********/
|
584
|
-
|
585
|
-
#ifdef USE_ASSERT_CHECKING
|
586
|
-
#else
|
587
|
-
#endif
|
588
|
-
#ifdef BTREE_BUILD_STATS
|
589
|
-
#endif
|
590
|
-
#ifdef WIN32
|
591
|
-
#else
|
592
|
-
#endif
|
593
|
-
#ifdef LOCK_DEBUG
|
594
|
-
#endif
|
595
|
-
#ifdef TRACE_SORT
|
596
|
-
#endif
|
597
|
-
#ifdef TRACE_SYNCSCAN
|
598
|
-
#endif
|
599
|
-
#ifdef DEBUG_BOUNDED_SORT
|
600
|
-
#endif
|
601
|
-
#ifdef WAL_DEBUG
|
602
|
-
#endif
|
603
|
-
|
604
|
-
|
605
|
-
#ifdef LOCK_DEBUG
|
606
|
-
#endif
|
607
|
-
#ifdef USE_PREFETCH
|
608
|
-
#else
|
609
|
-
#endif
|
610
|
-
#ifdef USE_PREFETCH
|
611
|
-
#else
|
612
|
-
#endif
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
#ifdef HAVE_UNIX_SOCKETS
|
619
|
-
#else
|
620
|
-
#endif
|
621
|
-
#ifdef USE_SSL
|
622
|
-
#else
|
623
|
-
#endif
|
624
|
-
#ifdef USE_OPENSSL
|
625
|
-
#else
|
626
|
-
#endif
|
627
|
-
#ifdef USE_SSL
|
628
|
-
#else
|
629
|
-
#endif
|
630
|
-
|
631
|
-
|
632
|
-
#ifdef HAVE_SYSLOG
|
633
|
-
#else
|
634
|
-
#endif
|
635
|
-
|
636
|
-
/******** end of options list ********/
|
637
|
-
|
638
|
-
|
639
|
-
/*
|
640
|
-
* To allow continued support of obsolete names for GUC variables, we apply
|
641
|
-
* the following mappings to any unrecognized name. Note that an old name
|
642
|
-
* should be mapped to a new one only if the new variable has very similar
|
643
|
-
* semantics to the old.
|
644
|
-
*/
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
/*
|
649
|
-
* Actual lookup of variables is done through this single, sorted array.
|
650
|
-
*/
|
651
|
-
|
652
|
-
|
653
|
-
/* Current number of variables contained in the vector */
|
654
|
-
|
655
|
-
|
656
|
-
/* Vector capacity */
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
/* true if need to do commit/abort work */
|
661
|
-
|
662
|
-
/* true to enable GUC_REPORT */
|
663
|
-
|
664
|
-
/* 1 when in main transaction */
|
665
|
-
|
666
|
-
|
667
|
-
static int guc_var_compare(const void *a, const void *b);
|
668
|
-
static int guc_name_compare(const char *namea, const char *nameb);
|
669
|
-
static void InitializeGUCOptionsFromEnvironment(void);
|
670
|
-
static void InitializeOneGUCOption(struct config_generic *gconf);
|
671
|
-
static void push_old_value(struct config_generic *gconf, GucAction action);
|
672
|
-
static void ReportGUCOption(struct config_generic *record);
|
673
|
-
static void reapply_stacked_values(struct config_generic *variable,
|
674
|
-
struct config_string *pHolder,
|
675
|
-
GucStack *stack,
|
676
|
-
const char *curvalue,
|
677
|
-
GucContext curscontext, GucSource cursource);
|
678
|
-
static void ShowGUCConfigOption(const char *name, DestReceiver *dest);
|
679
|
-
static void ShowAllGUCConfig(DestReceiver *dest);
|
680
|
-
static char *_ShowOption(struct config_generic *record, bool use_units);
|
681
|
-
static bool validate_option_array_item(const char *name, const char *value,
|
682
|
-
bool skipIfNoPermissions);
|
683
|
-
static void write_auto_conf_file(int fd, const char *filename, ConfigVariable *head_p);
|
684
|
-
static void replace_auto_config_value(ConfigVariable **head_p, ConfigVariable **tail_p,
|
685
|
-
const char *name, const char *value);
|
686
|
-
|
687
|
-
|
688
|
-
/*
|
689
|
-
* Some infrastructure for checking malloc/strdup/realloc calls
|
690
|
-
*/
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
/*
|
699
|
-
* Detect whether strval is referenced anywhere in a GUC string item
|
700
|
-
*/
|
701
|
-
|
702
|
-
|
703
|
-
/*
|
704
|
-
* Support for assigning to a field of a string GUC item. Free the prior
|
705
|
-
* value if it's not referenced anywhere else in the item (including stacked
|
706
|
-
* states).
|
707
|
-
*/
|
708
|
-
|
709
|
-
|
710
|
-
/*
|
711
|
-
* Detect whether an "extra" struct is referenced anywhere in a GUC item
|
712
|
-
*/
|
713
|
-
|
714
|
-
|
715
|
-
/*
|
716
|
-
* Support for assigning to an "extra" field of a GUC item. Free the prior
|
717
|
-
* value if it's not referenced anywhere else in the item (including stacked
|
718
|
-
* states).
|
719
|
-
*/
|
720
|
-
|
721
|
-
|
722
|
-
/*
|
723
|
-
* Support for copying a variable's active value into a stack entry.
|
724
|
-
* The "extra" field associated with the active value is copied, too.
|
725
|
-
*
|
726
|
-
* NB: be sure stringval and extra fields of a new stack entry are
|
727
|
-
* initialized to NULL before this is used, else we'll try to free() them.
|
728
|
-
*/
|
729
|
-
|
730
|
-
|
731
|
-
/*
|
732
|
-
* Support for discarding a no-longer-needed value in a stack entry.
|
733
|
-
* The "extra" field associated with the stack entry is cleared, too.
|
734
|
-
*/
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
/*
|
739
|
-
* Fetch the sorted array pointer (exported for help_config.c's use ONLY)
|
740
|
-
*/
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
/*
|
745
|
-
* Build the sorted array. This is split out so that it could be
|
746
|
-
* re-executed after startup (e.g., we could allow loadable modules to
|
747
|
-
* add vars, and then we'd need to re-sort).
|
748
|
-
*/
|
749
|
-
|
750
|
-
|
751
|
-
/*
|
752
|
-
* Add a new GUC variable to the list of known variables. The
|
753
|
-
* list is expanded if needed.
|
754
|
-
*/
|
755
|
-
|
756
|
-
|
757
|
-
/*
|
758
|
-
* Create and add a placeholder variable for a custom variable name.
|
759
|
-
*/
|
760
|
-
|
761
|
-
|
762
|
-
/*
|
763
|
-
* Look up option NAME. If it exists, return a pointer to its record,
|
764
|
-
* else return NULL. If create_placeholders is true, we'll create a
|
765
|
-
* placeholder record for a valid-looking custom variable name.
|
766
|
-
*/
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
/*
|
771
|
-
* comparator for qsorting and bsearching guc_variables array
|
772
|
-
*/
|
773
|
-
|
774
|
-
|
775
|
-
/*
|
776
|
-
* the bare comparison function for GUC names
|
777
|
-
*/
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
/*
|
782
|
-
* Initialize GUC options during program startup.
|
783
|
-
*
|
784
|
-
* Note that we cannot read the config file yet, since we have not yet
|
785
|
-
* processed command-line switches.
|
786
|
-
*/
|
787
|
-
|
788
|
-
|
789
|
-
/*
|
790
|
-
* Assign any GUC values that can come from the server's environment.
|
791
|
-
*
|
792
|
-
* This is called from InitializeGUCOptions, and also from ProcessConfigFile
|
793
|
-
* to deal with the possibility that a setting has been removed from
|
794
|
-
* postgresql.conf and should now get a value from the environment.
|
795
|
-
* (The latter is a kludge that should probably go away someday; if so,
|
796
|
-
* fold this back into InitializeGUCOptions.)
|
797
|
-
*/
|
798
|
-
|
799
|
-
|
800
|
-
/*
|
801
|
-
* Initialize one GUC option variable to its compiled-in default.
|
802
|
-
*
|
803
|
-
* Note: the reason for calling check_hooks is not that we think the boot_val
|
804
|
-
* might fail, but that the hooks might wish to compute an "extra" struct.
|
805
|
-
*/
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
/*
|
810
|
-
* Select the configuration files and data directory to be used, and
|
811
|
-
* do the initial read of postgresql.conf.
|
812
|
-
*
|
813
|
-
* This is called after processing command-line switches.
|
814
|
-
* userDoption is the -D switch value if any (NULL if unspecified).
|
815
|
-
* progname is just for use in error messages.
|
816
|
-
*
|
817
|
-
* Returns true on success; on failure, prints a suitable error message
|
818
|
-
* to stderr and returns false.
|
819
|
-
*/
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
/*
|
824
|
-
* Reset all options to their saved default values (implements RESET ALL)
|
825
|
-
*/
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
/*
|
830
|
-
* push_old_value
|
831
|
-
* Push previous state during transactional assignment to a GUC variable.
|
832
|
-
*/
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
/*
|
837
|
-
* Do GUC processing at main transaction start.
|
838
|
-
*/
|
839
|
-
|
840
|
-
|
841
|
-
/*
|
842
|
-
* Enter a new nesting level for GUC values. This is called at subtransaction
|
843
|
-
* start, and when entering a function that has proconfig settings, and in
|
844
|
-
* some other places where we want to set GUC variables transiently.
|
845
|
-
* NOTE we must not risk error here, else subtransaction start will be unhappy.
|
846
|
-
*/
|
847
|
-
|
848
|
-
|
849
|
-
/*
|
850
|
-
* Do GUC processing at transaction or subtransaction commit or abort, or
|
851
|
-
* when exiting a function that has proconfig settings, or when undoing a
|
852
|
-
* transient assignment to some GUC variables. (The name is thus a bit of
|
853
|
-
* a misnomer; perhaps it should be ExitGUCNestLevel or some such.)
|
854
|
-
* During abort, we discard all GUC settings that were applied at nesting
|
855
|
-
* levels >= nestLevel. nestLevel == 1 corresponds to the main transaction.
|
856
|
-
*/
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
/*
|
861
|
-
* Start up automatic reporting of changes to variables marked GUC_REPORT.
|
862
|
-
* This is executed at completion of backend startup.
|
863
|
-
*/
|
864
|
-
|
865
|
-
|
866
|
-
/*
|
867
|
-
* ReportGUCOption: if appropriate, transmit option value to frontend
|
868
|
-
*/
|
869
|
-
|
870
|
-
|
871
|
-
/*
|
872
|
-
* Convert a value from one of the human-friendly units ("kB", "min" etc.)
|
873
|
-
* to the given base unit. 'value' and 'unit' are the input value and unit
|
874
|
-
* to convert from (there can be trailing spaces in the unit string).
|
875
|
-
* The converted value is stored in *base_value.
|
876
|
-
* It's caller's responsibility to round off the converted value as necessary
|
877
|
-
* and check for out-of-range.
|
878
|
-
*
|
879
|
-
* Returns true on success, false if the input unit is not recognized.
|
880
|
-
*/
|
881
|
-
|
882
|
-
|
883
|
-
/*
|
884
|
-
* Convert an integer value in some base unit to a human-friendly unit.
|
885
|
-
*
|
886
|
-
* The output unit is chosen so that it's the greatest unit that can represent
|
887
|
-
* the value without loss. For example, if the base unit is GUC_UNIT_KB, 1024
|
888
|
-
* is converted to 1 MB, but 1025 is represented as 1025 kB.
|
889
|
-
*/
|
890
|
-
|
891
|
-
|
892
|
-
/*
|
893
|
-
* Convert a floating-point value in some base unit to a human-friendly unit.
|
894
|
-
*
|
895
|
-
* Same as above, except we have to do the math a bit differently, and
|
896
|
-
* there's a possibility that we don't find any exact divisor.
|
897
|
-
*/
|
898
|
-
|
899
|
-
|
900
|
-
/*
|
901
|
-
* Return the name of a GUC's base unit (e.g. "ms") given its flags.
|
902
|
-
* Return NULL if the GUC is unitless.
|
903
|
-
*/
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
/*
|
908
|
-
* Try to parse value as an integer. The accepted formats are the
|
909
|
-
* usual decimal, octal, or hexadecimal formats, as well as floating-point
|
910
|
-
* formats (which will be rounded to integer after any units conversion).
|
911
|
-
* Optionally, the value can be followed by a unit name if "flags" indicates
|
912
|
-
* a unit is allowed.
|
913
|
-
*
|
914
|
-
* If the string parses okay, return true, else false.
|
915
|
-
* If okay and result is not NULL, return the value in *result.
|
916
|
-
* If not okay and hintmsg is not NULL, *hintmsg is set to a suitable
|
917
|
-
* HINT message, or NULL if no hint provided.
|
918
|
-
*/
|
919
|
-
|
920
|
-
|
921
|
-
/*
|
922
|
-
* Try to parse value as a floating point number in the usual format.
|
923
|
-
* Optionally, the value can be followed by a unit name if "flags" indicates
|
924
|
-
* a unit is allowed.
|
925
|
-
*
|
926
|
-
* If the string parses okay, return true, else false.
|
927
|
-
* If okay and result is not NULL, return the value in *result.
|
928
|
-
* If not okay and hintmsg is not NULL, *hintmsg is set to a suitable
|
929
|
-
* HINT message, or NULL if no hint provided.
|
930
|
-
*/
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
/*
|
935
|
-
* Lookup the name for an enum option with the selected value.
|
936
|
-
* Should only ever be called with known-valid values, so throws
|
937
|
-
* an elog(ERROR) if the enum option is not found.
|
938
|
-
*
|
939
|
-
* The returned string is a pointer to static data and not
|
940
|
-
* allocated for modification.
|
941
|
-
*/
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
/*
|
946
|
-
* Lookup the value for an enum option with the selected name
|
947
|
-
* (case-insensitive).
|
948
|
-
* If the enum option is found, sets the retval value and returns
|
949
|
-
* true. If it's not found, return false and retval is set to 0.
|
950
|
-
*/
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
/*
|
955
|
-
* Return a list of all available options for an enum, excluding
|
956
|
-
* hidden ones, separated by the given separator.
|
957
|
-
* If prefix is non-NULL, it is added before the first enum value.
|
958
|
-
* If suffix is non-NULL, it is added to the end of the string.
|
959
|
-
*/
|
960
|
-
|
961
|
-
|
962
|
-
/*
|
963
|
-
* Parse and validate a proposed value for the specified configuration
|
964
|
-
* parameter.
|
965
|
-
*
|
966
|
-
* This does built-in checks (such as range limits for an integer parameter)
|
967
|
-
* and also calls any check hook the parameter may have.
|
968
|
-
*
|
969
|
-
* record: GUC variable's info record
|
970
|
-
* name: variable name (should match the record of course)
|
971
|
-
* value: proposed value, as a string
|
972
|
-
* source: identifies source of value (check hooks may need this)
|
973
|
-
* elevel: level to log any error reports at
|
974
|
-
* newval: on success, converted parameter value is returned here
|
975
|
-
* newextra: on success, receives any "extra" data returned by check hook
|
976
|
-
* (caller must initialize *newextra to NULL)
|
977
|
-
*
|
978
|
-
* Returns true if OK, false if not (or throws error, if elevel >= ERROR)
|
979
|
-
*/
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
/*
|
984
|
-
* Sets option `name' to given value.
|
985
|
-
*
|
986
|
-
* The value should be a string, which will be parsed and converted to
|
987
|
-
* the appropriate data type. The context and source parameters indicate
|
988
|
-
* in which context this function is being called, so that it can apply the
|
989
|
-
* access restrictions properly.
|
990
|
-
*
|
991
|
-
* If value is NULL, set the option to its default value (normally the
|
992
|
-
* reset_val, but if source == PGC_S_DEFAULT we instead use the boot_val).
|
993
|
-
*
|
994
|
-
* action indicates whether to set the value globally in the session, locally
|
995
|
-
* to the current top transaction, or just for the duration of a function call.
|
996
|
-
*
|
997
|
-
* If changeVal is false then don't really set the option but do all
|
998
|
-
* the checks to see if it would work.
|
999
|
-
*
|
1000
|
-
* elevel should normally be passed as zero, allowing this function to make
|
1001
|
-
* its standard choice of ereport level. However some callers need to be
|
1002
|
-
* able to override that choice; they should pass the ereport level to use.
|
1003
|
-
*
|
1004
|
-
* Return value:
|
1005
|
-
* +1: the value is valid and was successfully applied.
|
1006
|
-
* 0: the name or value is invalid (but see below).
|
1007
|
-
* -1: the value was not applied because of context, priority, or changeVal.
|
1008
|
-
*
|
1009
|
-
* If there is an error (non-existing option, invalid value) then an
|
1010
|
-
* ereport(ERROR) is thrown *unless* this is called for a source for which
|
1011
|
-
* we don't want an ERROR (currently, those are defaults, the config file,
|
1012
|
-
* and per-database or per-user settings, as well as callers who specify
|
1013
|
-
* a less-than-ERROR elevel). In those cases we write a suitable error
|
1014
|
-
* message via ereport() and return 0.
|
1015
|
-
*
|
1016
|
-
* See also SetConfigOption for an external interface.
|
1017
|
-
*/
|
1018
|
-
#define newval (newval_union.boolval)
|
1019
|
-
#undef newval
|
1020
|
-
#define newval (newval_union.intval)
|
1021
|
-
#undef newval
|
1022
|
-
#define newval (newval_union.realval)
|
1023
|
-
#undef newval
|
1024
|
-
#define newval (newval_union.stringval)
|
1025
|
-
#undef newval
|
1026
|
-
#define newval (newval_union.enumval)
|
1027
|
-
#undef newval
|
1028
|
-
|
1029
|
-
|
1030
|
-
/*
|
1031
|
-
* Set the fields for source file and line number the setting came from.
|
1032
|
-
*/
|
1033
|
-
|
1034
|
-
|
1035
|
-
/*
|
1036
|
-
* Set a config option to the given value.
|
1037
|
-
*
|
1038
|
-
* See also set_config_option; this is just the wrapper to be called from
|
1039
|
-
* outside GUC. (This function should be used when possible, because its API
|
1040
|
-
* is more stable than set_config_option's.)
|
1041
|
-
*
|
1042
|
-
* Note: there is no support here for setting source file/line, as it
|
1043
|
-
* is currently not needed.
|
1044
|
-
*/
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
/*
|
1050
|
-
* Fetch the current value of the option `name', as a string.
|
1051
|
-
*
|
1052
|
-
* If the option doesn't exist, return NULL if missing_ok is true (NOTE that
|
1053
|
-
* this cannot be distinguished from a string variable with a NULL value!),
|
1054
|
-
* otherwise throw an ereport and don't return.
|
1055
|
-
*
|
1056
|
-
* If restrict_privileged is true, we also enforce that only superusers and
|
1057
|
-
* members of the pg_read_all_settings role can see GUC_SUPERUSER_ONLY
|
1058
|
-
* variables. This should only be passed as true in user-driven calls.
|
1059
|
-
*
|
1060
|
-
* The string is *not* allocated for modification and is really only
|
1061
|
-
* valid until the next call to configuration related functions.
|
1062
|
-
*/
|
1063
|
-
|
1064
|
-
|
1065
|
-
/*
|
1066
|
-
* Get the RESET value associated with the given option.
|
1067
|
-
*
|
1068
|
-
* Note: this is not re-entrant, due to use of static result buffer;
|
1069
|
-
* not to mention that a string variable could have its reset_val changed.
|
1070
|
-
* Beware of assuming the result value is good for very long.
|
1071
|
-
*/
|
1072
|
-
|
1073
|
-
|
1074
|
-
/*
|
1075
|
-
* Get the GUC flags associated with the given option.
|
1076
|
-
*
|
1077
|
-
* If the option doesn't exist, return 0 if missing_ok is true,
|
1078
|
-
* otherwise throw an ereport and don't return.
|
1079
|
-
*/
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
/*
|
1084
|
-
* flatten_set_variable_args
|
1085
|
-
* Given a parsenode List as emitted by the grammar for SET,
|
1086
|
-
* convert to the flat string representation used by GUC.
|
1087
|
-
*
|
1088
|
-
* We need to be told the name of the variable the args are for, because
|
1089
|
-
* the flattening rules vary (ugh).
|
1090
|
-
*
|
1091
|
-
* The result is NULL if args is NIL (i.e., SET ... TO DEFAULT), otherwise
|
1092
|
-
* a palloc'd string.
|
1093
|
-
*/
|
1094
|
-
|
1095
|
-
|
1096
|
-
/*
|
1097
|
-
* Write updated configuration parameter values into a temporary file.
|
1098
|
-
* This function traverses the list of parameters and quotes the string
|
1099
|
-
* values before writing them.
|
1100
|
-
*/
|
1101
|
-
|
1102
|
-
|
1103
|
-
/*
|
1104
|
-
* Update the given list of configuration parameters, adding, replacing
|
1105
|
-
* or deleting the entry for item "name" (delete if "value" == NULL).
|
1106
|
-
*/
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
/*
|
1111
|
-
* Execute ALTER SYSTEM statement.
|
1112
|
-
*
|
1113
|
-
* Read the old PG_AUTOCONF_FILENAME file, merge in the new variable value,
|
1114
|
-
* and write out an updated file. If the command is ALTER SYSTEM RESET ALL,
|
1115
|
-
* we can skip reading the old file and just write an empty file.
|
1116
|
-
*
|
1117
|
-
* An LWLock is used to serialize updates of the configuration file.
|
1118
|
-
*
|
1119
|
-
* In case of an error, we leave the original automatic
|
1120
|
-
* configuration file (PG_AUTOCONF_FILENAME) intact.
|
1121
|
-
*/
|
1122
|
-
|
1123
|
-
|
1124
|
-
/*
|
1125
|
-
* SET command
|
1126
|
-
*/
|
1127
|
-
|
1128
|
-
|
1129
|
-
/*
|
1130
|
-
* Get the value to assign for a VariableSetStmt, or NULL if it's RESET.
|
1131
|
-
* The result is palloc'd.
|
1132
|
-
*
|
1133
|
-
* This is exported for use by actions such as ALTER ROLE SET.
|
1134
|
-
*/
|
1135
|
-
|
1136
|
-
|
1137
|
-
/*
|
1138
|
-
* SetPGVariable - SET command exported as an easily-C-callable function.
|
1139
|
-
*
|
1140
|
-
* This provides access to SET TO value, as well as SET TO DEFAULT (expressed
|
1141
|
-
* by passing args == NIL), but not SET FROM CURRENT functionality.
|
1142
|
-
*/
|
1143
|
-
|
1144
|
-
|
1145
|
-
/*
|
1146
|
-
* SET command wrapped as a SQL callable function.
|
1147
|
-
*/
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
/*
|
1152
|
-
* Common code for DefineCustomXXXVariable subroutines: allocate the
|
1153
|
-
* new variable's config struct and fill in generic fields.
|
1154
|
-
*/
|
1155
|
-
|
1156
|
-
|
1157
|
-
/*
|
1158
|
-
* Common code for DefineCustomXXXVariable subroutines: insert the new
|
1159
|
-
* variable into the GUC variable array, replacing any placeholder.
|
1160
|
-
*/
|
1161
|
-
|
1162
|
-
|
1163
|
-
/*
|
1164
|
-
* Recursive subroutine for define_custom_variable: reapply non-reset values
|
1165
|
-
*
|
1166
|
-
* We recurse so that the values are applied in the same order as originally.
|
1167
|
-
* At each recursion level, apply the upper-level value (passed in) in the
|
1168
|
-
* fashion implied by the stack entry.
|
1169
|
-
*/
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
/*
|
1186
|
-
* SHOW command
|
1187
|
-
*/
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
/*
|
1194
|
-
* SHOW command
|
1195
|
-
*/
|
1196
|
-
|
1197
|
-
|
1198
|
-
/*
|
1199
|
-
* SHOW ALL command
|
1200
|
-
*/
|
1201
|
-
|
1202
|
-
|
1203
|
-
/*
|
1204
|
-
* Return an array of modified GUC options to show in EXPLAIN.
|
1205
|
-
*
|
1206
|
-
* We only report options related to query planning (marked with GUC_EXPLAIN),
|
1207
|
-
* with values different from their built-in defaults.
|
1208
|
-
*/
|
1209
|
-
|
1210
|
-
|
1211
|
-
/*
|
1212
|
-
* Return GUC variable value by name; optionally return canonical form of
|
1213
|
-
* name. If the GUC is unset, then throw an error unless missing_ok is true,
|
1214
|
-
* in which case return NULL. Return value is palloc'd (but *varname isn't).
|
1215
|
-
*/
|
1216
|
-
|
1217
|
-
|
1218
|
-
/*
|
1219
|
-
* Return GUC variable value by variable number; optionally return canonical
|
1220
|
-
* form of name. Return value is palloc'd.
|
1221
|
-
*/
|
1222
|
-
|
1223
|
-
|
1224
|
-
/*
|
1225
|
-
* Return the total number of GUC variables
|
1226
|
-
*/
|
1227
|
-
|
1228
|
-
|
1229
|
-
/*
|
1230
|
-
* show_config_by_name - equiv to SHOW X command but implemented as
|
1231
|
-
* a function.
|
1232
|
-
*/
|
1233
|
-
|
1234
|
-
|
1235
|
-
/*
|
1236
|
-
* show_config_by_name_missing_ok - equiv to SHOW X command but implemented as
|
1237
|
-
* a function. If X does not exist, suppress the error and just return NULL
|
1238
|
-
* if missing_ok is true.
|
1239
|
-
*/
|
1240
|
-
|
1241
|
-
|
1242
|
-
/*
|
1243
|
-
* show_all_settings - equiv to SHOW ALL command but implemented as
|
1244
|
-
* a Table Function.
|
1245
|
-
*/
|
1246
|
-
#define NUM_PG_SETTINGS_ATTS 17
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
/*
|
1251
|
-
* show_all_file_settings
|
1252
|
-
*
|
1253
|
-
* Returns a table of all parameter settings in all configuration files
|
1254
|
-
* which includes the config file pathname, the line number, a sequence number
|
1255
|
-
* indicating the order in which the settings were encountered, the parameter
|
1256
|
-
* name and value, a bool showing if the value could be applied, and possibly
|
1257
|
-
* an associated error message. (For problems such as syntax errors, the
|
1258
|
-
* parameter name/value might be NULL.)
|
1259
|
-
*
|
1260
|
-
* Note: no filtering is done here, instead we depend on the GRANT system
|
1261
|
-
* to prevent unprivileged users from accessing this function or the view
|
1262
|
-
* built on top of it.
|
1263
|
-
*/
|
1264
|
-
#define NUM_PG_FILE_SETTINGS_ATTS 7
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
#ifdef EXEC_BACKEND
|
1270
|
-
|
1271
|
-
/*
|
1272
|
-
* These routines dump out all non-default GUC options into a binary
|
1273
|
-
* file that is read by all exec'ed backends. The format is:
|
1274
|
-
*
|
1275
|
-
* variable name, string, null terminated
|
1276
|
-
* variable value, string, null terminated
|
1277
|
-
* variable sourcefile, string, null terminated (empty if none)
|
1278
|
-
* variable sourceline, integer
|
1279
|
-
* variable source, integer
|
1280
|
-
* variable scontext, integer
|
1281
|
-
*/
|
1282
|
-
static void
|
1283
|
-
write_one_nondefault_variable(FILE *fp, struct config_generic *gconf)
|
1284
|
-
{
|
1285
|
-
if (gconf->source == PGC_S_DEFAULT)
|
1286
|
-
return;
|
1287
|
-
|
1288
|
-
fprintf(fp, "%s", gconf->name);
|
1289
|
-
fputc(0, fp);
|
1290
|
-
|
1291
|
-
switch (gconf->vartype)
|
1292
|
-
{
|
1293
|
-
case PGC_BOOL:
|
1294
|
-
{
|
1295
|
-
struct config_bool *conf = (struct config_bool *) gconf;
|
1296
|
-
|
1297
|
-
if (*conf->variable)
|
1298
|
-
fprintf(fp, "true");
|
1299
|
-
else
|
1300
|
-
fprintf(fp, "false");
|
1301
|
-
}
|
1302
|
-
break;
|
1303
|
-
|
1304
|
-
case PGC_INT:
|
1305
|
-
{
|
1306
|
-
struct config_int *conf = (struct config_int *) gconf;
|
1307
|
-
|
1308
|
-
fprintf(fp, "%d", *conf->variable);
|
1309
|
-
}
|
1310
|
-
break;
|
1311
|
-
|
1312
|
-
case PGC_REAL:
|
1313
|
-
{
|
1314
|
-
struct config_real *conf = (struct config_real *) gconf;
|
1315
|
-
|
1316
|
-
fprintf(fp, "%.17g", *conf->variable);
|
1317
|
-
}
|
1318
|
-
break;
|
1319
|
-
|
1320
|
-
case PGC_STRING:
|
1321
|
-
{
|
1322
|
-
struct config_string *conf = (struct config_string *) gconf;
|
1323
|
-
|
1324
|
-
fprintf(fp, "%s", *conf->variable);
|
1325
|
-
}
|
1326
|
-
break;
|
1327
|
-
|
1328
|
-
case PGC_ENUM:
|
1329
|
-
{
|
1330
|
-
struct config_enum *conf = (struct config_enum *) gconf;
|
1331
|
-
|
1332
|
-
fprintf(fp, "%s",
|
1333
|
-
config_enum_lookup_by_value(conf, *conf->variable));
|
1334
|
-
}
|
1335
|
-
break;
|
1336
|
-
}
|
1337
|
-
|
1338
|
-
fputc(0, fp);
|
1339
|
-
|
1340
|
-
if (gconf->sourcefile)
|
1341
|
-
fprintf(fp, "%s", gconf->sourcefile);
|
1342
|
-
fputc(0, fp);
|
1343
|
-
|
1344
|
-
fwrite(&gconf->sourceline, 1, sizeof(gconf->sourceline), fp);
|
1345
|
-
fwrite(&gconf->source, 1, sizeof(gconf->source), fp);
|
1346
|
-
fwrite(&gconf->scontext, 1, sizeof(gconf->scontext), fp);
|
1347
|
-
}
|
1348
|
-
|
1349
|
-
void
|
1350
|
-
write_nondefault_variables(GucContext context)
|
1351
|
-
{
|
1352
|
-
int elevel;
|
1353
|
-
FILE *fp;
|
1354
|
-
int i;
|
1355
|
-
|
1356
|
-
Assert(context == PGC_POSTMASTER || context == PGC_SIGHUP);
|
1357
|
-
|
1358
|
-
elevel = (context == PGC_SIGHUP) ? LOG : ERROR;
|
1359
|
-
|
1360
|
-
/*
|
1361
|
-
* Open file
|
1362
|
-
*/
|
1363
|
-
fp = AllocateFile(CONFIG_EXEC_PARAMS_NEW, "w");
|
1364
|
-
if (!fp)
|
1365
|
-
{
|
1366
|
-
ereport(elevel,
|
1367
|
-
(errcode_for_file_access(),
|
1368
|
-
errmsg("could not write to file \"%s\": %m",
|
1369
|
-
CONFIG_EXEC_PARAMS_NEW)));
|
1370
|
-
return;
|
1371
|
-
}
|
1372
|
-
|
1373
|
-
for (i = 0; i < num_guc_variables; i++)
|
1374
|
-
{
|
1375
|
-
write_one_nondefault_variable(fp, guc_variables[i]);
|
1376
|
-
}
|
1377
|
-
|
1378
|
-
if (FreeFile(fp))
|
1379
|
-
{
|
1380
|
-
ereport(elevel,
|
1381
|
-
(errcode_for_file_access(),
|
1382
|
-
errmsg("could not write to file \"%s\": %m",
|
1383
|
-
CONFIG_EXEC_PARAMS_NEW)));
|
1384
|
-
return;
|
1385
|
-
}
|
1386
|
-
|
1387
|
-
/*
|
1388
|
-
* Put new file in place. This could delay on Win32, but we don't hold
|
1389
|
-
* any exclusive locks.
|
1390
|
-
*/
|
1391
|
-
rename(CONFIG_EXEC_PARAMS_NEW, CONFIG_EXEC_PARAMS);
|
1392
|
-
}
|
1393
|
-
|
1394
|
-
|
1395
|
-
/*
|
1396
|
-
* Read string, including null byte from file
|
1397
|
-
*
|
1398
|
-
* Return NULL on EOF and nothing read
|
1399
|
-
*/
|
1400
|
-
static char *
|
1401
|
-
read_string_with_null(FILE *fp)
|
1402
|
-
{
|
1403
|
-
int i = 0,
|
1404
|
-
ch,
|
1405
|
-
maxlen = 256;
|
1406
|
-
char *str = NULL;
|
1407
|
-
|
1408
|
-
do
|
1409
|
-
{
|
1410
|
-
if ((ch = fgetc(fp)) == EOF)
|
1411
|
-
{
|
1412
|
-
if (i == 0)
|
1413
|
-
return NULL;
|
1414
|
-
else
|
1415
|
-
elog(FATAL, "invalid format of exec config params file");
|
1416
|
-
}
|
1417
|
-
if (i == 0)
|
1418
|
-
str = guc_malloc(FATAL, maxlen);
|
1419
|
-
else if (i == maxlen)
|
1420
|
-
str = guc_realloc(FATAL, str, maxlen *= 2);
|
1421
|
-
str[i++] = ch;
|
1422
|
-
} while (ch != 0);
|
1423
|
-
|
1424
|
-
return str;
|
1425
|
-
}
|
1426
|
-
|
1427
|
-
|
1428
|
-
/*
|
1429
|
-
* This routine loads a previous postmaster dump of its non-default
|
1430
|
-
* settings.
|
1431
|
-
*/
|
1432
|
-
void
|
1433
|
-
read_nondefault_variables(void)
|
1434
|
-
{
|
1435
|
-
FILE *fp;
|
1436
|
-
char *varname,
|
1437
|
-
*varvalue,
|
1438
|
-
*varsourcefile;
|
1439
|
-
int varsourceline;
|
1440
|
-
GucSource varsource;
|
1441
|
-
GucContext varscontext;
|
1442
|
-
|
1443
|
-
/*
|
1444
|
-
* Assert that PGC_BACKEND/PGC_SU_BACKEND case in set_config_option() will
|
1445
|
-
* do the right thing.
|
1446
|
-
*/
|
1447
|
-
Assert(IsInitProcessingMode());
|
1448
|
-
|
1449
|
-
/*
|
1450
|
-
* Open file
|
1451
|
-
*/
|
1452
|
-
fp = AllocateFile(CONFIG_EXEC_PARAMS, "r");
|
1453
|
-
if (!fp)
|
1454
|
-
{
|
1455
|
-
/* File not found is fine */
|
1456
|
-
if (errno != ENOENT)
|
1457
|
-
ereport(FATAL,
|
1458
|
-
(errcode_for_file_access(),
|
1459
|
-
errmsg("could not read from file \"%s\": %m",
|
1460
|
-
CONFIG_EXEC_PARAMS)));
|
1461
|
-
return;
|
1462
|
-
}
|
1463
|
-
|
1464
|
-
for (;;)
|
1465
|
-
{
|
1466
|
-
struct config_generic *record;
|
1467
|
-
|
1468
|
-
if ((varname = read_string_with_null(fp)) == NULL)
|
1469
|
-
break;
|
1470
|
-
|
1471
|
-
if ((record = find_option(varname, true, FATAL)) == NULL)
|
1472
|
-
elog(FATAL, "failed to locate variable \"%s\" in exec config params file", varname);
|
1473
|
-
|
1474
|
-
if ((varvalue = read_string_with_null(fp)) == NULL)
|
1475
|
-
elog(FATAL, "invalid format of exec config params file");
|
1476
|
-
if ((varsourcefile = read_string_with_null(fp)) == NULL)
|
1477
|
-
elog(FATAL, "invalid format of exec config params file");
|
1478
|
-
if (fread(&varsourceline, 1, sizeof(varsourceline), fp) != sizeof(varsourceline))
|
1479
|
-
elog(FATAL, "invalid format of exec config params file");
|
1480
|
-
if (fread(&varsource, 1, sizeof(varsource), fp) != sizeof(varsource))
|
1481
|
-
elog(FATAL, "invalid format of exec config params file");
|
1482
|
-
if (fread(&varscontext, 1, sizeof(varscontext), fp) != sizeof(varscontext))
|
1483
|
-
elog(FATAL, "invalid format of exec config params file");
|
1484
|
-
|
1485
|
-
(void) set_config_option(varname, varvalue,
|
1486
|
-
varscontext, varsource,
|
1487
|
-
GUC_ACTION_SET, true, 0, true);
|
1488
|
-
if (varsourcefile[0])
|
1489
|
-
set_config_sourcefile(varname, varsourcefile, varsourceline);
|
1490
|
-
|
1491
|
-
free(varname);
|
1492
|
-
free(varvalue);
|
1493
|
-
free(varsourcefile);
|
1494
|
-
}
|
1495
|
-
|
1496
|
-
FreeFile(fp);
|
1497
|
-
}
|
1498
|
-
#endif /* EXEC_BACKEND */
|
1499
|
-
|
1500
|
-
/*
|
1501
|
-
* can_skip_gucvar:
|
1502
|
-
* When serializing, determine whether to skip this GUC. When restoring, the
|
1503
|
-
* negation of this test determines whether to restore the compiled-in default
|
1504
|
-
* value before processing serialized values.
|
1505
|
-
*
|
1506
|
-
* A PGC_S_DEFAULT setting on the serialize side will typically match new
|
1507
|
-
* postmaster children, but that can be false when got_SIGHUP == true and the
|
1508
|
-
* pending configuration change modifies this setting. Nonetheless, we omit
|
1509
|
-
* PGC_S_DEFAULT settings from serialization and make up for that by restoring
|
1510
|
-
* defaults before applying serialized values.
|
1511
|
-
*
|
1512
|
-
* PGC_POSTMASTER variables always have the same value in every child of a
|
1513
|
-
* particular postmaster. Most PGC_INTERNAL variables are compile-time
|
1514
|
-
* constants; a few, like server_encoding and lc_ctype, are handled specially
|
1515
|
-
* outside the serialize/restore procedure. Therefore, SerializeGUCState()
|
1516
|
-
* never sends these, and RestoreGUCState() never changes them.
|
1517
|
-
*
|
1518
|
-
* Role is a special variable in the sense that its current value can be an
|
1519
|
-
* invalid value and there are multiple ways by which that can happen (like
|
1520
|
-
* after setting the role, someone drops it). So we handle it outside of
|
1521
|
-
* serialize/restore machinery.
|
1522
|
-
*/
|
1523
|
-
|
1524
|
-
|
1525
|
-
/*
|
1526
|
-
* estimate_variable_size:
|
1527
|
-
* Compute space needed for dumping the given GUC variable.
|
1528
|
-
*
|
1529
|
-
* It's OK to overestimate, but not to underestimate.
|
1530
|
-
*/
|
1531
|
-
|
1532
|
-
|
1533
|
-
/*
|
1534
|
-
* EstimateGUCStateSpace:
|
1535
|
-
* Returns the size needed to store the GUC state for the current process
|
1536
|
-
*/
|
1537
|
-
|
1538
|
-
|
1539
|
-
/*
|
1540
|
-
* do_serialize:
|
1541
|
-
* Copies the formatted string into the destination. Moves ahead the
|
1542
|
-
* destination pointer, and decrements the maxbytes by that many bytes. If
|
1543
|
-
* maxbytes is not sufficient to copy the string, error out.
|
1544
|
-
*/
|
1545
|
-
|
1546
|
-
|
1547
|
-
/* Binary copy version of do_serialize() */
|
1548
|
-
|
1549
|
-
|
1550
|
-
/*
|
1551
|
-
* serialize_variable:
|
1552
|
-
* Dumps name, value and other information of a GUC variable into destptr.
|
1553
|
-
*/
|
1554
|
-
|
1555
|
-
|
1556
|
-
/*
|
1557
|
-
* SerializeGUCState:
|
1558
|
-
* Dumps the complete GUC state onto the memory location at start_address.
|
1559
|
-
*/
|
1560
|
-
|
1561
|
-
|
1562
|
-
/*
|
1563
|
-
* read_gucstate:
|
1564
|
-
* Actually it does not read anything, just returns the srcptr. But it does
|
1565
|
-
* move the srcptr past the terminating zero byte, so that the caller is ready
|
1566
|
-
* to read the next string.
|
1567
|
-
*/
|
1568
|
-
|
1569
|
-
|
1570
|
-
/* Binary read version of read_gucstate(). Copies into dest */
|
1571
|
-
|
1572
|
-
|
1573
|
-
/*
|
1574
|
-
* Callback used to add a context message when reporting errors that occur
|
1575
|
-
* while trying to restore GUCs in parallel workers.
|
1576
|
-
*/
|
1577
|
-
|
1578
|
-
|
1579
|
-
/*
|
1580
|
-
* RestoreGUCState:
|
1581
|
-
* Reads the GUC state at the specified address and updates the GUCs with the
|
1582
|
-
* values read from the GUC state.
|
1583
|
-
*/
|
1584
|
-
|
1585
|
-
|
1586
|
-
/*
|
1587
|
-
* A little "long argument" simulation, although not quite GNU
|
1588
|
-
* compliant. Takes a string of the form "some-option=some value" and
|
1589
|
-
* returns name = "some_option" and value = "some value" in malloc'ed
|
1590
|
-
* storage. Note that '-' is converted to '_' in the option name. If
|
1591
|
-
* there is no '=' in the input string then value will be NULL.
|
1592
|
-
*/
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
/*
|
1597
|
-
* Handle options fetched from pg_db_role_setting.setconfig,
|
1598
|
-
* pg_proc.proconfig, etc. Caller must specify proper context/source/action.
|
1599
|
-
*
|
1600
|
-
* The array parameter must be an array of TEXT (it must not be NULL).
|
1601
|
-
*/
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
/*
|
1606
|
-
* Add an entry to an option array. The array parameter may be NULL
|
1607
|
-
* to indicate the current table entry is NULL.
|
1608
|
-
*/
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
/*
|
1613
|
-
* Delete an entry from an option array. The array parameter may be NULL
|
1614
|
-
* to indicate the current table entry is NULL. Also, if the return value
|
1615
|
-
* is NULL then a null should be stored.
|
1616
|
-
*/
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
/*
|
1621
|
-
* Given a GUC array, delete all settings from it that our permission
|
1622
|
-
* level allows: if superuser, delete them all; if regular user, only
|
1623
|
-
* those that are PGC_USERSET
|
1624
|
-
*/
|
1625
|
-
|
1626
|
-
|
1627
|
-
/*
|
1628
|
-
* Validate a proposed option setting for GUCArrayAdd/Delete/Reset.
|
1629
|
-
*
|
1630
|
-
* name is the option name. value is the proposed value for the Add case,
|
1631
|
-
* or NULL for the Delete/Reset cases. If skipIfNoPermissions is true, it's
|
1632
|
-
* not an error to have no permissions to set the option.
|
1633
|
-
*
|
1634
|
-
* Returns true if OK, false if skipIfNoPermissions is true and user does not
|
1635
|
-
* have permission to change this option (all other error cases result in an
|
1636
|
-
* error being thrown).
|
1637
|
-
*/
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
/*
|
1642
|
-
* Called by check_hooks that want to override the normal
|
1643
|
-
* ERRCODE_INVALID_PARAMETER_VALUE SQLSTATE for check hook failures.
|
1644
|
-
*
|
1645
|
-
* Note that GUC_check_errmsg() etc are just macros that result in a direct
|
1646
|
-
* assignment to the associated variables. That is ugly, but forced by the
|
1647
|
-
* limitations of C's macro mechanisms.
|
1648
|
-
*/
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
/*
|
1653
|
-
* Convenience functions to manage calling a variable's check_hook.
|
1654
|
-
* These mostly take care of the protocol for letting check hooks supply
|
1655
|
-
* portions of the error report on failure.
|
1656
|
-
*/
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
/*
|
1670
|
-
* check_hook, assign_hook and show_hook subroutines
|
1671
|
-
*/
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
#ifdef HAVE_SYSLOG
|
1678
|
-
#endif
|
1679
|
-
#ifdef WIN32
|
1680
|
-
#endif
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
#ifdef HAVE_SYSLOG
|
1685
|
-
#endif
|
1686
|
-
|
1687
|
-
#ifdef HAVE_SYSLOG
|
1688
|
-
#endif
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
#ifndef USE_BONJOUR
|
1696
|
-
#endif
|
1697
|
-
|
1698
|
-
#ifndef USE_SSL
|
1699
|
-
#endif
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
/*
|
1712
|
-
* pg_timezone_abbrev_initialize --- set default value if not done already
|
1713
|
-
*
|
1714
|
-
* This is called after initial loading of postgresql.conf. If no
|
1715
|
-
* timezone_abbreviations setting was found therein, select default.
|
1716
|
-
* If a non-default value is already installed, nothing will happen.
|
1717
|
-
*
|
1718
|
-
* This can also be called from ProcessConfigFile to establish the default
|
1719
|
-
* value after a postgresql.conf entry for it is removed.
|
1720
|
-
*/
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
|
1742
|
-
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1751
|
-
#ifndef USE_PREFETCH
|
1752
|
-
#endif /* USE_PREFETCH */
|
1753
|
-
|
1754
|
-
#ifndef USE_PREFETCH
|
1755
|
-
#endif /* USE_PREFETCH */
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
/*
|
1772
|
-
* We split the input string, where commas separate function names
|
1773
|
-
* and certain whitespace chars are ignored, into a \0-separated (and
|
1774
|
-
* \0\0-terminated) list of function names. This formulation allows
|
1775
|
-
* easy scanning when an error is thrown while avoiding the use of
|
1776
|
-
* non-reentrant strtok(), as well as keeping the output data in a
|
1777
|
-
* single palloc() chunk.
|
1778
|
-
*/
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1787
|
-
/*
|
1788
|
-
* Recovery target settings: Only one of the several recovery_target* settings
|
1789
|
-
* may be set. Setting a second one results in an error. The global variable
|
1790
|
-
* recoveryTarget tracks which kind of recovery target was chosen. Other
|
1791
|
-
* variables store the actual target value (for example a string or a xid).
|
1792
|
-
* The assign functions of the parameters check whether a competing parameter
|
1793
|
-
* was already set. But we want to allow setting the same parameter multiple
|
1794
|
-
* times. We also want to allow unsetting a parameter and setting a different
|
1795
|
-
* one, so we unset recoveryTarget when the parameter is set to an empty
|
1796
|
-
* string.
|
1797
|
-
*/
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1801
|
-
|
1802
|
-
|
1803
|
-
|
1804
|
-
|
1805
|
-
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
1809
|
-
/*
|
1810
|
-
* The interpretation of the recovery_target_time string can depend on the
|
1811
|
-
* time zone setting, so we need to wait until after all GUC processing is
|
1812
|
-
* done before we can do the final parsing of the string. This check function
|
1813
|
-
* only does a parsing pass to catch syntax errors, but we store the string
|
1814
|
-
* and parse it again when we need to use it.
|
1815
|
-
*/
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
#include "guc-file.c"
|