Bug Summary

File:src/backend/utils/misc/guc.c
Warning:line 7569, column 3
Null pointer passed as 1st argument to string copy function

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-apple-macosx10.15.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Wobjc-signed-char-bool -Werror=objc-bool-constant-conversion -Werror=tautological-objc-bool-compare -Werror=objc-signed-char-bool-implicit-float-conversion -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name guc.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=osx -analyzer-checker=security.insecureAPI.decodeValueOfObjCType -analyzer-checker=security.insecureAPI.task_for_pid -analyzer-checker=security.insecureAPI.processor_set_tasks -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -fno-rounding-math -munwind-tables -target-sdk-version=10.15.5 -fcompatibility-qualified-id-block-type-checking -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 519 -fcoverage-compilation-dir=/Users/buildslave/jenkins/workspace/Static_Analyzer_main/sources/postgresql-9.1rc1/PatchedSource/src/backend/utils/misc -resource-dir /Users/buildslave/jenkins/workspace/Static_Analyzer_main/host-compiler/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I . -I . -I ../../../../src/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/local/include -internal-isystem /Users/buildslave/jenkins/workspace/Static_Analyzer_main/host-compiler/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -internal-externc-isystem /Users/buildslave/jenkins/workspace/Static_Analyzer_main/host-compiler/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-error=implicit-function-declaration -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-suggest-override -Wno-suggest-destructor-override -Wno-pointer-to-int-cast -Wno-tautological-value-range-compare -Wno-four-char-constants -fdebug-compilation-dir=/Users/buildslave/jenkins/workspace/Static_Analyzer_main/sources/postgresql-9.1rc1/PatchedSource/src/backend/utils/misc -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcommon -analyzer-checker alpha.unix.SimpleStream,alpha.security.taint,cplusplus.NewDeleteLeaks,core,cplusplus,deadcode,security,unix,osx,nullability -analyzer-output=plist-html -analyzer-config serialize-stats=true,stable-report-filename=true -clang-vendor-feature=+nullptrToBoolConversion -clang-vendor-feature=+allowFormatVoidPointerWithStringSpecifier -clang-vendor-feature=+allowKRDefinitionsWithoutWstrictPrototypes -clang-vendor-feature=+allowStaticMemberInAnonymousUnion -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -clang-vendor-feature=+disableNullSanitizerCheckForPointerSanitizer -clang-vendor-feature=+disableOVEimplicitConv -fno-odr-hash-protocols -clang-vendor-feature=+disableBF16KeywordSupport -clang-vendor-feature=+legacyAvailabilityTempWorkaround -clang-vendor-feature=+disablePtrauthPacError -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+revertcff6dda604cb -mllvm -disable-aligned-alloc-awareness=1 -mllvm -x86-legacy-mnemonics -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /Users/buildslave/jenkins/workspace/Static_Analyzer_main/sources/postgresql-9.1rc1/ScanBuildResults/2021-04-06-001540-95977-1/report-vBEacZ.plist -x c guc.c
1/*--------------------------------------------------------------------
2 * guc.c
3 *
4 * Support for grand unified configuration scheme, including SET
5 * command, configuration file, and command line options.
6 * See src/backend/utils/misc/README for more information.
7 *
8 *
9 * Copyright (c) 2000-2011, PostgreSQL Global Development Group
10 * Written by Peter Eisentraut <peter_e@gmx.net>.
11 *
12 * IDENTIFICATION
13 * src/backend/utils/misc/guc.c
14 *
15 *--------------------------------------------------------------------
16 */
17#include "postgres.h"
18
19#include <ctype.h>
20#include <float.h>
21#include <math.h>
22#include <limits.h>
23#include <unistd.h>
24#include <sys/stat.h>
25#ifdef HAVE_SYSLOG1
26#include <syslog.h>
27#endif
28
29#include "access/gin.h"
30#include "access/transam.h"
31#include "access/twophase.h"
32#include "access/xact.h"
33#include "catalog/namespace.h"
34#include "commands/async.h"
35#include "commands/prepare.h"
36#include "commands/vacuum.h"
37#include "commands/variable.h"
38#include "commands/trigger.h"
39#include "funcapi.h"
40#include "libpq/auth.h"
41#include "libpq/be-fsstubs.h"
42#include "libpq/pqformat.h"
43#include "miscadmin.h"
44#include "optimizer/cost.h"
45#include "optimizer/geqo.h"
46#include "optimizer/paths.h"
47#include "optimizer/planmain.h"
48#include "parser/parse_expr.h"
49#include "parser/parse_type.h"
50#include "parser/parser.h"
51#include "parser/scansup.h"
52#include "pgstat.h"
53#include "postmaster/autovacuum.h"
54#include "postmaster/bgwriter.h"
55#include "postmaster/postmaster.h"
56#include "postmaster/syslogger.h"
57#include "postmaster/walwriter.h"
58#include "replication/syncrep.h"
59#include "replication/walreceiver.h"
60#include "replication/walsender.h"
61#include "storage/bufmgr.h"
62#include "storage/standby.h"
63#include "storage/fd.h"
64#include "storage/predicate.h"
65#include "tcop/tcopprot.h"
66#include "tsearch/ts_cache.h"
67#include "utils/builtins.h"
68#include "utils/bytea.h"
69#include "utils/guc_tables.h"
70#include "utils/memutils.h"
71#include "utils/pg_locale.h"
72#include "utils/plancache.h"
73#include "utils/portal.h"
74#include "utils/ps_status.h"
75#include "utils/tzparser.h"
76#include "utils/xml.h"
77
78#ifndef PG_KRB_SRVTAB""
79#define PG_KRB_SRVTAB"" ""
80#endif
81#ifndef PG_KRB_SRVNAM"postgres"
82#define PG_KRB_SRVNAM"postgres" ""
83#endif
84
85#define CONFIG_FILENAME"postgresql.conf" "postgresql.conf"
86#define HBA_FILENAME"pg_hba.conf" "pg_hba.conf"
87#define IDENT_FILENAME"pg_ident.conf" "pg_ident.conf"
88
89#ifdef EXEC_BACKEND
90#define CONFIG_EXEC_PARAMS "global/config_exec_params"
91#define CONFIG_EXEC_PARAMS_NEW "global/config_exec_params.new"
92#endif
93
94/* upper limit for GUC variables measured in kilobytes of memory */
95/* note that various places assume the byte size fits in a "long" variable */
96#if SIZEOF_SIZE_T8 > 4 && SIZEOF_LONG8 > 4
97#define MAX_KILOBYTES2147483647 INT_MAX2147483647
98#else
99#define MAX_KILOBYTES2147483647 (INT_MAX2147483647 / 1024)
100#endif
101
102/*
103 * Note: MAX_BACKENDS is limited to 2^23-1 because inval.c stores the
104 * backend ID as a 3-byte signed integer. Even if that limitation were
105 * removed, we still could not exceed INT_MAX/4 because some places compute
106 * 4*MaxBackends without any overflow check. This is rechecked in
107 * check_maxconnections, since MaxBackends is computed as MaxConnections
108 * plus autovacuum_max_workers plus one (for the autovacuum launcher).
109 */
110#define MAX_BACKENDS0x7fffff 0x7fffff
111
112#define KB_PER_MB(1024) (1024)
113#define KB_PER_GB(1024*1024) (1024*1024)
114
115#define MS_PER_S1000 1000
116#define S_PER_MIN60 60
117#define MS_PER_MIN(1000 * 60) (1000 * 60)
118#define MIN_PER_H60 60
119#define S_PER_H(60 * 60) (60 * 60)
120#define MS_PER_H(1000 * 60 * 60) (1000 * 60 * 60)
121#define MIN_PER_D(60 * 24) (60 * 24)
122#define S_PER_D(60 * 60 * 24) (60 * 60 * 24)
123#define MS_PER_D(1000 * 60 * 60 * 24) (1000 * 60 * 60 * 24)
124
125/* XXX these should appear in other modules' header files */
126extern bool Log_disconnections;
127extern int CommitDelay;
128extern int CommitSiblings;
129extern char *default_tablespace;
130extern char *temp_tablespaces;
131extern bool synchronize_seqscans;
132extern bool fullPageWrites;
133extern int ssl_renegotiation_limit;
134extern char *SSLCipherSuites;
135
136#ifdef TRACE_SORT1
137extern bool trace_sort;
138#endif
139#ifdef TRACE_SYNCSCAN
140extern bool trace_syncscan;
141#endif
142#ifdef DEBUG_BOUNDED_SORT
143extern bool optimize_bounded_sort;
144#endif
145
146static int GUC_check_errcode_value;
147
148/* global variables for check hook support */
149char *GUC_check_errmsg_string;
150char *GUC_check_errdetail_string;
151char *GUC_check_errhint_string;
152
153
154static void set_config_sourcefile(const char *name, char *sourcefile,
155 int sourceline);
156static bool call_bool_check_hook(struct config_bool * conf, bool *newval,
157 void **extra, GucSource source, int elevel);
158static bool call_int_check_hook(struct config_int * conf, int *newval,
159 void **extra, GucSource source, int elevel);
160static bool call_real_check_hook(struct config_real * conf, double *newval,
161 void **extra, GucSource source, int elevel);
162static bool call_string_check_hook(struct config_string * conf, char **newval,
163 void **extra, GucSource source, int elevel);
164static bool call_enum_check_hook(struct config_enum * conf, int *newval,
165 void **extra, GucSource source, int elevel);
166
167static bool check_log_destination(char **newval, void **extra, GucSource source);
168static void assign_log_destination(const char *newval, void *extra);
169
170#ifdef HAVE_SYSLOG1
171static int syslog_facility = LOG_LOCAL0(16<<3);
172#else
173static int syslog_facility = 0;
174#endif
175
176static void assign_syslog_facility(int newval, void *extra);
177static void assign_syslog_ident(const char *newval, void *extra);
178static void assign_session_replication_role(int newval, void *extra);
179static bool check_temp_buffers(int *newval, void **extra, GucSource source);
180static bool check_phony_autocommit(bool *newval, void **extra, GucSource source);
181static bool check_custom_variable_classes(char **newval, void **extra, GucSource source);
182static bool check_debug_assertions(bool *newval, void **extra, GucSource source);
183static bool check_bonjour(bool *newval, void **extra, GucSource source);
184static bool check_ssl(bool *newval, void **extra, GucSource source);
185static bool check_stage_log_stats(bool *newval, void **extra, GucSource source);
186static bool check_log_stats(bool *newval, void **extra, GucSource source);
187static bool check_canonical_path(char **newval, void **extra, GucSource source);
188static bool check_timezone_abbreviations(char **newval, void **extra, GucSource source);
189static void assign_timezone_abbreviations(const char *newval, void *extra);
190static const char *show_archive_command(void);
191static void assign_tcp_keepalives_idle(int newval, void *extra);
192static void assign_tcp_keepalives_interval(int newval, void *extra);
193static void assign_tcp_keepalives_count(int newval, void *extra);
194static const char *show_tcp_keepalives_idle(void);
195static const char *show_tcp_keepalives_interval(void);
196static const char *show_tcp_keepalives_count(void);
197static bool check_maxconnections(int *newval, void **extra, GucSource source);
198static void assign_maxconnections(int newval, void *extra);
199static bool check_autovacuum_max_workers(int *newval, void **extra, GucSource source);
200static void assign_autovacuum_max_workers(int newval, void *extra);
201static bool check_effective_io_concurrency(int *newval, void **extra, GucSource source);
202static void assign_effective_io_concurrency(int newval, void *extra);
203static void assign_pgstat_temp_directory(const char *newval, void *extra);
204static bool check_application_name(char **newval, void **extra, GucSource source);
205static void assign_application_name(const char *newval, void *extra);
206static const char *show_unix_socket_permissions(void);
207static const char *show_log_file_mode(void);
208
209static char *config_enum_get_options(struct config_enum * record,
210 const char *prefix, const char *suffix,
211 const char *separator);
212
213
214/*
215 * Options for enum values defined in this module.
216 *
217 * NOTE! Option values may not contain double quotes!
218 */
219
220static const struct config_enum_entry bytea_output_options[] = {
221 {"escape", BYTEA_OUTPUT_ESCAPE, false((bool) 0)},
222 {"hex", BYTEA_OUTPUT_HEX, false((bool) 0)},
223 {NULL((void*)0), 0, false((bool) 0)}
224};
225
226/*
227 * We have different sets for client and server message level options because
228 * they sort slightly different (see "log" level)
229 */
230static const struct config_enum_entry client_message_level_options[] = {
231 {"debug", DEBUG213, true((bool) 1)},
232 {"debug5", DEBUG510, false((bool) 0)},
233 {"debug4", DEBUG411, false((bool) 0)},
234 {"debug3", DEBUG312, false((bool) 0)},
235 {"debug2", DEBUG213, false((bool) 0)},
236 {"debug1", DEBUG114, false((bool) 0)},
237 {"log", LOG15, false((bool) 0)},
238 {"info", INFO17, true((bool) 1)},
239 {"notice", NOTICE18, false((bool) 0)},
240 {"warning", WARNING19, false((bool) 0)},
241 {"error", ERROR20, false((bool) 0)},
242 {"fatal", FATAL21, true((bool) 1)},
243 {"panic", PANIC22, true((bool) 1)},
244 {NULL((void*)0), 0, false((bool) 0)}
245};
246
247static const struct config_enum_entry server_message_level_options[] = {
248 {"debug", DEBUG213, true((bool) 1)},
249 {"debug5", DEBUG510, false((bool) 0)},
250 {"debug4", DEBUG411, false((bool) 0)},
251 {"debug3", DEBUG312, false((bool) 0)},
252 {"debug2", DEBUG213, false((bool) 0)},
253 {"debug1", DEBUG114, false((bool) 0)},
254 {"info", INFO17, false((bool) 0)},
255 {"notice", NOTICE18, false((bool) 0)},
256 {"warning", WARNING19, false((bool) 0)},
257 {"error", ERROR20, false((bool) 0)},
258 {"log", LOG15, false((bool) 0)},
259 {"fatal", FATAL21, false((bool) 0)},
260 {"panic", PANIC22, false((bool) 0)},
261 {NULL((void*)0), 0, false((bool) 0)}
262};
263
264static const struct config_enum_entry intervalstyle_options[] = {
265 {"postgres", INTSTYLE_POSTGRES0, false((bool) 0)},
266 {"postgres_verbose", INTSTYLE_POSTGRES_VERBOSE1, false((bool) 0)},
267 {"sql_standard", INTSTYLE_SQL_STANDARD2, false((bool) 0)},
268 {"iso_8601", INTSTYLE_ISO_86013, false((bool) 0)},
269 {NULL((void*)0), 0, false((bool) 0)}
270};
271
272static const struct config_enum_entry log_error_verbosity_options[] = {
273 {"terse", PGERROR_TERSE, false((bool) 0)},
274 {"default", PGERROR_DEFAULT, false((bool) 0)},
275 {"verbose", PGERROR_VERBOSE, false((bool) 0)},
276 {NULL((void*)0), 0, false((bool) 0)}
277};
278
279static const struct config_enum_entry log_statement_options[] = {
280 {"none", LOGSTMT_NONE, false((bool) 0)},
281 {"ddl", LOGSTMT_DDL, false((bool) 0)},
282 {"mod", LOGSTMT_MOD, false((bool) 0)},
283 {"all", LOGSTMT_ALL, false((bool) 0)},
284 {NULL((void*)0), 0, false((bool) 0)}
285};
286
287static const struct config_enum_entry isolation_level_options[] = {
288 {"serializable", XACT_SERIALIZABLE3, false((bool) 0)},
289 {"repeatable read", XACT_REPEATABLE_READ2, false((bool) 0)},
290 {"read committed", XACT_READ_COMMITTED1, false((bool) 0)},
291 {"read uncommitted", XACT_READ_UNCOMMITTED0, false((bool) 0)},
292 {NULL((void*)0), 0}
293};
294
295static const struct config_enum_entry session_replication_role_options[] = {
296 {"origin", SESSION_REPLICATION_ROLE_ORIGIN0, false((bool) 0)},
297 {"replica", SESSION_REPLICATION_ROLE_REPLICA1, false((bool) 0)},
298 {"local", SESSION_REPLICATION_ROLE_LOCAL2, false((bool) 0)},
299 {NULL((void*)0), 0, false((bool) 0)}
300};
301
302static const struct config_enum_entry syslog_facility_options[] = {
303#ifdef HAVE_SYSLOG1
304 {"local0", LOG_LOCAL0(16<<3), false((bool) 0)},
305 {"local1", LOG_LOCAL1(17<<3), false((bool) 0)},
306 {"local2", LOG_LOCAL2(18<<3), false((bool) 0)},
307 {"local3", LOG_LOCAL3(19<<3), false((bool) 0)},
308 {"local4", LOG_LOCAL4(20<<3), false((bool) 0)},
309 {"local5", LOG_LOCAL5(21<<3), false((bool) 0)},
310 {"local6", LOG_LOCAL6(22<<3), false((bool) 0)},
311 {"local7", LOG_LOCAL7(23<<3), false((bool) 0)},
312#else
313 {"none", 0, false((bool) 0)},
314#endif
315 {NULL((void*)0), 0}
316};
317
318static const struct config_enum_entry track_function_options[] = {
319 {"none", TRACK_FUNC_OFF, false((bool) 0)},
320 {"pl", TRACK_FUNC_PL, false((bool) 0)},
321 {"all", TRACK_FUNC_ALL, false((bool) 0)},
322 {NULL((void*)0), 0, false((bool) 0)}
323};
324
325static const struct config_enum_entry xmlbinary_options[] = {
326 {"base64", XMLBINARY_BASE64, false((bool) 0)},
327 {"hex", XMLBINARY_HEX, false((bool) 0)},
328 {NULL((void*)0), 0, false((bool) 0)}
329};
330
331static const struct config_enum_entry xmloption_options[] = {
332 {"content", XMLOPTION_CONTENT, false((bool) 0)},
333 {"document", XMLOPTION_DOCUMENT, false((bool) 0)},
334 {NULL((void*)0), 0, false((bool) 0)}
335};
336
337/*
338 * Although only "on", "off", and "safe_encoding" are documented, we
339 * accept all the likely variants of "on" and "off".
340 */
341static const struct config_enum_entry backslash_quote_options[] = {
342 {"safe_encoding", BACKSLASH_QUOTE_SAFE_ENCODING, false((bool) 0)},
343 {"on", BACKSLASH_QUOTE_ON, false((bool) 0)},
344 {"off", BACKSLASH_QUOTE_OFF, false((bool) 0)},
345 {"true", BACKSLASH_QUOTE_ON, true((bool) 1)},
346 {"false", BACKSLASH_QUOTE_OFF, true((bool) 1)},
347 {"yes", BACKSLASH_QUOTE_ON, true((bool) 1)},
348 {"no", BACKSLASH_QUOTE_OFF, true((bool) 1)},
349 {"1", BACKSLASH_QUOTE_ON, true((bool) 1)},
350 {"0", BACKSLASH_QUOTE_OFF, true((bool) 1)},
351 {NULL((void*)0), 0, false((bool) 0)}
352};
353
354/*
355 * Although only "on", "off", and "partition" are documented, we
356 * accept all the likely variants of "on" and "off".
357 */
358static const struct config_enum_entry constraint_exclusion_options[] = {
359 {"partition", CONSTRAINT_EXCLUSION_PARTITION, false((bool) 0)},
360 {"on", CONSTRAINT_EXCLUSION_ON, false((bool) 0)},
361 {"off", CONSTRAINT_EXCLUSION_OFF, false((bool) 0)},
362 {"true", CONSTRAINT_EXCLUSION_ON, true((bool) 1)},
363 {"false", CONSTRAINT_EXCLUSION_OFF, true((bool) 1)},
364 {"yes", CONSTRAINT_EXCLUSION_ON, true((bool) 1)},
365 {"no", CONSTRAINT_EXCLUSION_OFF, true((bool) 1)},
366 {"1", CONSTRAINT_EXCLUSION_ON, true((bool) 1)},
367 {"0", CONSTRAINT_EXCLUSION_OFF, true((bool) 1)},
368 {NULL((void*)0), 0, false((bool) 0)}
369};
370
371/*
372 * Although only "on", "off", and "local" are documented, we
373 * accept all the likely variants of "on" and "off".
374 */
375static const struct config_enum_entry synchronous_commit_options[] = {
376 {"local", SYNCHRONOUS_COMMIT_LOCAL_FLUSH, false((bool) 0)},
377 {"on", SYNCHRONOUS_COMMIT_ONSYNCHRONOUS_COMMIT_REMOTE_FLUSH, false((bool) 0)},
378 {"off", SYNCHRONOUS_COMMIT_OFF, false((bool) 0)},
379 {"true", SYNCHRONOUS_COMMIT_ONSYNCHRONOUS_COMMIT_REMOTE_FLUSH, true((bool) 1)},
380 {"false", SYNCHRONOUS_COMMIT_OFF, true((bool) 1)},
381 {"yes", SYNCHRONOUS_COMMIT_ONSYNCHRONOUS_COMMIT_REMOTE_FLUSH, true((bool) 1)},
382 {"no", SYNCHRONOUS_COMMIT_OFF, true((bool) 1)},
383 {"1", SYNCHRONOUS_COMMIT_ONSYNCHRONOUS_COMMIT_REMOTE_FLUSH, true((bool) 1)},
384 {"0", SYNCHRONOUS_COMMIT_OFF, true((bool) 1)},
385 {NULL((void*)0), 0, false((bool) 0)}
386};
387
388/*
389 * Options for enum values stored in other modules
390 */
391extern const struct config_enum_entry wal_level_options[];
392extern const struct config_enum_entry sync_method_options[];
393
394/*
395 * GUC option variables that are exported from this module
396 */
397#ifdef USE_ASSERT_CHECKING1
398bool assert_enabled = true((bool) 1);
399#else
400bool assert_enabled = false((bool) 0);
401#endif
402bool log_duration = false((bool) 0);
403bool Debug_print_plan = false((bool) 0);
404bool Debug_print_parse = false((bool) 0);
405bool Debug_print_rewritten = false((bool) 0);
406bool Debug_pretty_print = true((bool) 1);
407
408bool log_parser_stats = false((bool) 0);
409bool log_planner_stats = false((bool) 0);
410bool log_executor_stats = false((bool) 0);
411bool log_statement_stats = false((bool) 0); /* this is sort of all three
412 * above together */
413bool log_btree_build_stats = false((bool) 0);
414
415bool check_function_bodies = true((bool) 1);
416bool default_with_oids = false((bool) 0);
417bool SQL_inheritance = true((bool) 1);
418
419bool Password_encryption = true((bool) 1);
420
421int log_min_error_statement = ERROR20;
422int log_min_messages = WARNING19;
423int client_min_messages = NOTICE18;
424int log_min_duration_statement = -1;
425int log_temp_files = -1;
426int trace_recovery_messages = LOG15;
427
428int num_temp_buffers = 1024;
429
430char *data_directory;
431char *ConfigFileName;
432char *HbaFileName;
433char *IdentFileName;
434char *external_pid_file;
435
436char *pgstat_temp_directory;
437
438char *application_name;
439
440int tcp_keepalives_idle;
441int tcp_keepalives_interval;
442int tcp_keepalives_count;
443
444/*
445 * These variables are all dummies that don't do anything, except in some
446 * cases provide the value for SHOW to display. The real state is elsewhere
447 * and is kept in sync by assign_hooks.
448 */
449static char *log_destination_string;
450
451static char *syslog_ident_str;
452static bool phony_autocommit;
453static bool session_auth_is_superuser;
454static double phony_random_seed;
455static char *client_encoding_string;
456static char *datestyle_string;
457static char *locale_collate;
458static char *locale_ctype;
459static char *server_encoding_string;
460static char *server_version_string;
461static int server_version_num;
462static char *timezone_string;
463static char *log_timezone_string;
464static char *timezone_abbreviations_string;
465static char *XactIsoLevel_string;
466static char *session_authorization_string;
467static char *custom_variable_classes;
468static int max_function_args;
469static int max_index_keys;
470static int max_identifier_length;
471static int block_size;
472static int segment_size;
473static int wal_block_size;
474static int wal_segment_size;
475static bool integer_datetimes;
476static int effective_io_concurrency;
477
478/* should be static, but commands/variable.c needs to get at this */
479char *role_string;
480
481
482/*
483 * Displayable names for context types (enum GucContext)
484 *
485 * Note: these strings are deliberately not localized.
486 */
487const char *const GucContext_Names[] =
488{
489 /* PGC_INTERNAL */ "internal",
490 /* PGC_POSTMASTER */ "postmaster",
491 /* PGC_SIGHUP */ "sighup",
492 /* PGC_BACKEND */ "backend",
493 /* PGC_SUSET */ "superuser",
494 /* PGC_USERSET */ "user"
495};
496
497/*
498 * Displayable names for source types (enum GucSource)
499 *
500 * Note: these strings are deliberately not localized.
501 */
502const char *const GucSource_Names[] =
503{
504 /* PGC_S_DEFAULT */ "default",
505 /* PGC_S_DYNAMIC_DEFAULT */ "default",
506 /* PGC_S_ENV_VAR */ "environment variable",
507 /* PGC_S_FILE */ "configuration file",
508 /* PGC_S_ARGV */ "command line",
509 /* PGC_S_DATABASE */ "database",
510 /* PGC_S_USER */ "user",
511 /* PGC_S_DATABASE_USER */ "database user",
512 /* PGC_S_CLIENT */ "client",
513 /* PGC_S_OVERRIDE */ "override",
514 /* PGC_S_INTERACTIVE */ "interactive",
515 /* PGC_S_TEST */ "test",
516 /* PGC_S_SESSION */ "session"
517};
518
519/*
520 * Displayable names for the groupings defined in enum config_group
521 */
522const char *const config_group_names[] =
523{
524 /* UNGROUPED */
525 gettext_noop("Ungrouped")("Ungrouped"),
526 /* FILE_LOCATIONS */
527 gettext_noop("File Locations")("File Locations"),
528 /* CONN_AUTH */
529 gettext_noop("Connections and Authentication")("Connections and Authentication"),
530 /* CONN_AUTH_SETTINGS */
531 gettext_noop("Connections and Authentication / Connection Settings")("Connections and Authentication / Connection Settings"),
532 /* CONN_AUTH_SECURITY */
533 gettext_noop("Connections and Authentication / Security and Authentication")("Connections and Authentication / Security and Authentication"
)
,
534 /* RESOURCES */
535 gettext_noop("Resource Usage")("Resource Usage"),
536 /* RESOURCES_MEM */
537 gettext_noop("Resource Usage / Memory")("Resource Usage / Memory"),
538 /* RESOURCES_KERNEL */
539 gettext_noop("Resource Usage / Kernel Resources")("Resource Usage / Kernel Resources"),
540 /* RESOURCES_VACUUM_DELAY */
541 gettext_noop("Resource Usage / Cost-Based Vacuum Delay")("Resource Usage / Cost-Based Vacuum Delay"),
542 /* RESOURCES_BGWRITER */
543 gettext_noop("Resource Usage / Background Writer")("Resource Usage / Background Writer"),
544 /* RESOURCES_ASYNCHRONOUS */
545 gettext_noop("Resource Usage / Asynchronous Behavior")("Resource Usage / Asynchronous Behavior"),
546 /* WAL */
547 gettext_noop("Write-Ahead Log")("Write-Ahead Log"),
548 /* WAL_SETTINGS */
549 gettext_noop("Write-Ahead Log / Settings")("Write-Ahead Log / Settings"),
550 /* WAL_CHECKPOINTS */
551 gettext_noop("Write-Ahead Log / Checkpoints")("Write-Ahead Log / Checkpoints"),
552 /* WAL_ARCHIVING */
553 gettext_noop("Write-Ahead Log / Archiving")("Write-Ahead Log / Archiving"),
554 /* REPLICATION */
555 gettext_noop("Replication")("Replication"),
556 /* REPLICATION_MASTER */
557 gettext_noop("Replication / Master Server")("Replication / Master Server"),
558 /* REPLICATION_STANDBY */
559 gettext_noop("Replication / Standby Servers")("Replication / Standby Servers"),
560 /* QUERY_TUNING */
561 gettext_noop("Query Tuning")("Query Tuning"),
562 /* QUERY_TUNING_METHOD */
563 gettext_noop("Query Tuning / Planner Method Configuration")("Query Tuning / Planner Method Configuration"),
564 /* QUERY_TUNING_COST */
565 gettext_noop("Query Tuning / Planner Cost Constants")("Query Tuning / Planner Cost Constants"),
566 /* QUERY_TUNING_GEQO */
567 gettext_noop("Query Tuning / Genetic Query Optimizer")("Query Tuning / Genetic Query Optimizer"),
568 /* QUERY_TUNING_OTHER */
569 gettext_noop("Query Tuning / Other Planner Options")("Query Tuning / Other Planner Options"),
570 /* LOGGING */
571 gettext_noop("Reporting and Logging")("Reporting and Logging"),
572 /* LOGGING_WHERE */
573 gettext_noop("Reporting and Logging / Where to Log")("Reporting and Logging / Where to Log"),
574 /* LOGGING_WHEN */
575 gettext_noop("Reporting and Logging / When to Log")("Reporting and Logging / When to Log"),
576 /* LOGGING_WHAT */
577 gettext_noop("Reporting and Logging / What to Log")("Reporting and Logging / What to Log"),
578 /* STATS */
579 gettext_noop("Statistics")("Statistics"),
580 /* STATS_MONITORING */
581 gettext_noop("Statistics / Monitoring")("Statistics / Monitoring"),
582 /* STATS_COLLECTOR */
583 gettext_noop("Statistics / Query and Index Statistics Collector")("Statistics / Query and Index Statistics Collector"),
584 /* AUTOVACUUM */
585 gettext_noop("Autovacuum")("Autovacuum"),
586 /* CLIENT_CONN */
587 gettext_noop("Client Connection Defaults")("Client Connection Defaults"),
588 /* CLIENT_CONN_STATEMENT */
589 gettext_noop("Client Connection Defaults / Statement Behavior")("Client Connection Defaults / Statement Behavior"),
590 /* CLIENT_CONN_LOCALE */
591 gettext_noop("Client Connection Defaults / Locale and Formatting")("Client Connection Defaults / Locale and Formatting"),
592 /* CLIENT_CONN_OTHER */
593 gettext_noop("Client Connection Defaults / Other Defaults")("Client Connection Defaults / Other Defaults"),
594 /* LOCK_MANAGEMENT */
595 gettext_noop("Lock Management")("Lock Management"),
596 /* COMPAT_OPTIONS */
597 gettext_noop("Version and Platform Compatibility")("Version and Platform Compatibility"),
598 /* COMPAT_OPTIONS_PREVIOUS */
599 gettext_noop("Version and Platform Compatibility / Previous PostgreSQL Versions")("Version and Platform Compatibility / Previous PostgreSQL Versions"
)
,
600 /* COMPAT_OPTIONS_CLIENT */
601 gettext_noop("Version and Platform Compatibility / Other Platforms and Clients")("Version and Platform Compatibility / Other Platforms and Clients"
)
,
602 /* ERROR_HANDLING */
603 gettext_noop("Error Handling")("Error Handling"),
604 /* PRESET_OPTIONS */
605 gettext_noop("Preset Options")("Preset Options"),
606 /* CUSTOM_OPTIONS */
607 gettext_noop("Customized Options")("Customized Options"),
608 /* DEVELOPER_OPTIONS */
609 gettext_noop("Developer Options")("Developer Options"),
610 /* help_config wants this array to be null-terminated */
611 NULL((void*)0)
612};
613
614/*
615 * Displayable names for GUC variable types (enum config_type)
616 *
617 * Note: these strings are deliberately not localized.
618 */
619const char *const config_type_names[] =
620{
621 /* PGC_BOOL */ "bool",
622 /* PGC_INT */ "integer",
623 /* PGC_REAL */ "real",
624 /* PGC_STRING */ "string",
625 /* PGC_ENUM */ "enum"
626};
627
628
629/*
630 * Contents of GUC tables
631 *
632 * See src/backend/utils/misc/README for design notes.
633 *
634 * TO ADD AN OPTION:
635 *
636 * 1. Declare a global variable of type bool, int, double, or char*
637 * and make use of it.
638 *
639 * 2. Decide at what times it's safe to set the option. See guc.h for
640 * details.
641 *
642 * 3. Decide on a name, a default value, upper and lower bounds (if
643 * applicable), etc.
644 *
645 * 4. Add a record below.
646 *
647 * 5. Add it to src/backend/utils/misc/postgresql.conf.sample, if
648 * appropriate.
649 *
650 * 6. Don't forget to document the option (at least in config.sgml).
651 *
652 * 7. If it's a new GUC_LIST option you must edit pg_dumpall.c to ensure
653 * it is not single quoted at dump time.
654 */
655
656
657/******** option records follow ********/
658
659static struct config_bool ConfigureNamesBool[] =
660{
661 {
662 {"enable_seqscan", PGC_USERSET, QUERY_TUNING_METHOD,
663 gettext_noop("Enables the planner's use of sequential-scan plans.")("Enables the planner's use of sequential-scan plans."),
664 NULL((void*)0)
665 },
666 &enable_seqscan,
667 true((bool) 1),
668 NULL((void*)0), NULL((void*)0), NULL((void*)0)
669 },
670 {
671 {"enable_indexscan", PGC_USERSET, QUERY_TUNING_METHOD,
672 gettext_noop("Enables the planner's use of index-scan plans.")("Enables the planner's use of index-scan plans."),
673 NULL((void*)0)
674 },
675 &enable_indexscan,
676 true((bool) 1),
677 NULL((void*)0), NULL((void*)0), NULL((void*)0)
678 },
679 {
680 {"enable_bitmapscan", PGC_USERSET, QUERY_TUNING_METHOD,
681 gettext_noop("Enables the planner's use of bitmap-scan plans.")("Enables the planner's use of bitmap-scan plans."),
682 NULL((void*)0)
683 },
684 &enable_bitmapscan,
685 true((bool) 1),
686 NULL((void*)0), NULL((void*)0), NULL((void*)0)
687 },
688 {
689 {"enable_tidscan", PGC_USERSET, QUERY_TUNING_METHOD,
690 gettext_noop("Enables the planner's use of TID scan plans.")("Enables the planner's use of TID scan plans."),
691 NULL((void*)0)
692 },
693 &enable_tidscan,
694 true((bool) 1),
695 NULL((void*)0), NULL((void*)0), NULL((void*)0)
696 },
697 {
698 {"enable_sort", PGC_USERSET, QUERY_TUNING_METHOD,
699 gettext_noop("Enables the planner's use of explicit sort steps.")("Enables the planner's use of explicit sort steps."),
700 NULL((void*)0)
701 },
702 &enable_sort,
703 true((bool) 1),
704 NULL((void*)0), NULL((void*)0), NULL((void*)0)
705 },
706 {
707 {"enable_hashagg", PGC_USERSET, QUERY_TUNING_METHOD,
708 gettext_noop("Enables the planner's use of hashed aggregation plans.")("Enables the planner's use of hashed aggregation plans."),
709 NULL((void*)0)
710 },
711 &enable_hashagg,
712 true((bool) 1),
713 NULL((void*)0), NULL((void*)0), NULL((void*)0)
714 },
715 {
716 {"enable_material", PGC_USERSET, QUERY_TUNING_METHOD,
717 gettext_noop("Enables the planner's use of materialization.")("Enables the planner's use of materialization."),
718 NULL((void*)0)
719 },
720 &enable_material,
721 true((bool) 1),
722 NULL((void*)0), NULL((void*)0), NULL((void*)0)
723 },
724 {
725 {"enable_nestloop", PGC_USERSET, QUERY_TUNING_METHOD,
726 gettext_noop("Enables the planner's use of nested-loop join plans.")("Enables the planner's use of nested-loop join plans."),
727 NULL((void*)0)
728 },
729 &enable_nestloop,
730 true((bool) 1),
731 NULL((void*)0), NULL((void*)0), NULL((void*)0)
732 },
733 {
734 {"enable_mergejoin", PGC_USERSET, QUERY_TUNING_METHOD,
735 gettext_noop("Enables the planner's use of merge join plans.")("Enables the planner's use of merge join plans."),
736 NULL((void*)0)
737 },
738 &enable_mergejoin,
739 true((bool) 1),
740 NULL((void*)0), NULL((void*)0), NULL((void*)0)
741 },
742 {
743 {"enable_hashjoin", PGC_USERSET, QUERY_TUNING_METHOD,
744 gettext_noop("Enables the planner's use of hash join plans.")("Enables the planner's use of hash join plans."),
745 NULL((void*)0)
746 },
747 &enable_hashjoin,
748 true((bool) 1),
749 NULL((void*)0), NULL((void*)0), NULL((void*)0)
750 },
751 {
752 {"geqo", PGC_USERSET, QUERY_TUNING_GEQO,
753 gettext_noop("Enables genetic query optimization.")("Enables genetic query optimization."),
754 gettext_noop("This algorithm attempts to do planning without "("This algorithm attempts to do planning without " "exhaustive searching."
)
755 "exhaustive searching.")("This algorithm attempts to do planning without " "exhaustive searching."
)
756 },
757 &enable_geqo,
758 true((bool) 1),
759 NULL((void*)0), NULL((void*)0), NULL((void*)0)
760 },
761 {
762 /* Not for general use --- used by SET SESSION AUTHORIZATION */
763 {"is_superuser", PGC_INTERNAL, UNGROUPED,
764 gettext_noop("Shows whether the current user is a superuser.")("Shows whether the current user is a superuser."),
765 NULL((void*)0),
766 GUC_REPORT0x0010 | GUC_NO_SHOW_ALL0x0004 | GUC_NO_RESET_ALL0x0008 | GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
767 },
768 &session_auth_is_superuser,
769 false((bool) 0),
770 NULL((void*)0), NULL((void*)0), NULL((void*)0)
771 },
772 {
773 {"bonjour", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
774 gettext_noop("Enables advertising the server via Bonjour.")("Enables advertising the server via Bonjour."),
775 NULL((void*)0)
776 },
777 &enable_bonjour,
778 false((bool) 0),
779 check_bonjour, NULL((void*)0), NULL((void*)0)
780 },
781 {
782 {"ssl", PGC_POSTMASTER, CONN_AUTH_SECURITY,
783 gettext_noop("Enables SSL connections.")("Enables SSL connections."),
784 NULL((void*)0)
785 },
786 &EnableSSL,
787 false((bool) 0),
788 check_ssl, NULL((void*)0), NULL((void*)0)
789 },
790 {
791 {"fsync", PGC_SIGHUP, WAL_SETTINGS,
792 gettext_noop("Forces synchronization of updates to disk.")("Forces synchronization of updates to disk."),
793 gettext_noop("The server will use the fsync() system call in several places to make "("The server will use the fsync() system call in several places to make "
"sure that updates are physically written to disk. This insures "
"that a database cluster will recover to a consistent state after "
"an operating system or hardware crash.")
794 "sure that updates are physically written to disk. This insures "("The server will use the fsync() system call in several places to make "
"sure that updates are physically written to disk. This insures "
"that a database cluster will recover to a consistent state after "
"an operating system or hardware crash.")
795 "that a database cluster will recover to a consistent state after "("The server will use the fsync() system call in several places to make "
"sure that updates are physically written to disk. This insures "
"that a database cluster will recover to a consistent state after "
"an operating system or hardware crash.")
796 "an operating system or hardware crash.")("The server will use the fsync() system call in several places to make "
"sure that updates are physically written to disk. This insures "
"that a database cluster will recover to a consistent state after "
"an operating system or hardware crash.")
797 },
798 &enableFsync,
799 true((bool) 1),
800 NULL((void*)0), NULL((void*)0), NULL((void*)0)
801 },
802 {
803 {"zero_damaged_pages", PGC_SUSET, DEVELOPER_OPTIONS,
804 gettext_noop("Continues processing past damaged page headers.")("Continues processing past damaged page headers."),
805 gettext_noop("Detection of a damaged page header normally causes PostgreSQL to "("Detection of a damaged page header normally causes PostgreSQL to "
"report an error, aborting the current transaction. Setting "
"zero_damaged_pages to true causes the system to instead report a "
"warning, zero out the damaged page, and continue processing. This "
"behavior will destroy data, namely all the rows on the damaged page."
)
806 "report an error, aborting the current transaction. Setting "("Detection of a damaged page header normally causes PostgreSQL to "
"report an error, aborting the current transaction. Setting "
"zero_damaged_pages to true causes the system to instead report a "
"warning, zero out the damaged page, and continue processing. This "
"behavior will destroy data, namely all the rows on the damaged page."
)
807 "zero_damaged_pages to true causes the system to instead report a "("Detection of a damaged page header normally causes PostgreSQL to "
"report an error, aborting the current transaction. Setting "
"zero_damaged_pages to true causes the system to instead report a "
"warning, zero out the damaged page, and continue processing. This "
"behavior will destroy data, namely all the rows on the damaged page."
)
808 "warning, zero out the damaged page, and continue processing. This "("Detection of a damaged page header normally causes PostgreSQL to "
"report an error, aborting the current transaction. Setting "
"zero_damaged_pages to true causes the system to instead report a "
"warning, zero out the damaged page, and continue processing. This "
"behavior will destroy data, namely all the rows on the damaged page."
)
809 "behavior will destroy data, namely all the rows on the damaged page.")("Detection of a damaged page header normally causes PostgreSQL to "
"report an error, aborting the current transaction. Setting "
"zero_damaged_pages to true causes the system to instead report a "
"warning, zero out the damaged page, and continue processing. This "
"behavior will destroy data, namely all the rows on the damaged page."
)
,
810 GUC_NOT_IN_SAMPLE0x0020
811 },
812 &zero_damaged_pages,
813 false((bool) 0),
814 NULL((void*)0), NULL((void*)0), NULL((void*)0)
815 },
816 {
817 {"full_page_writes", PGC_SIGHUP, WAL_SETTINGS,
818 gettext_noop("Writes full pages to WAL when first modified after a checkpoint.")("Writes full pages to WAL when first modified after a checkpoint."
)
,
819 gettext_noop("A page write in process during an operating system crash might be "("A page write in process during an operating system crash might be "
"only partially written to disk. During recovery, the row changes "
"stored in WAL are not enough to recover. This option writes "
"pages when first modified after a checkpoint to WAL so full recovery "
"is possible.")
820 "only partially written to disk. During recovery, the row changes "("A page write in process during an operating system crash might be "
"only partially written to disk. During recovery, the row changes "
"stored in WAL are not enough to recover. This option writes "
"pages when first modified after a checkpoint to WAL so full recovery "
"is possible.")
821 "stored in WAL are not enough to recover. This option writes "("A page write in process during an operating system crash might be "
"only partially written to disk. During recovery, the row changes "
"stored in WAL are not enough to recover. This option writes "
"pages when first modified after a checkpoint to WAL so full recovery "
"is possible.")
822 "pages when first modified after a checkpoint to WAL so full recovery "("A page write in process during an operating system crash might be "
"only partially written to disk. During recovery, the row changes "
"stored in WAL are not enough to recover. This option writes "
"pages when first modified after a checkpoint to WAL so full recovery "
"is possible.")
823 "is possible.")("A page write in process during an operating system crash might be "
"only partially written to disk. During recovery, the row changes "
"stored in WAL are not enough to recover. This option writes "
"pages when first modified after a checkpoint to WAL so full recovery "
"is possible.")
824 },
825 &fullPageWrites,
826 true((bool) 1),
827 NULL((void*)0), NULL((void*)0), NULL((void*)0)
828 },
829 {
830 {"silent_mode", PGC_POSTMASTER, LOGGING_WHERE,
831 gettext_noop("Runs the server silently.")("Runs the server silently."),
832 gettext_noop("If this parameter is set, the server will automatically run in the "("If this parameter is set, the server will automatically run in the "
"background and any controlling terminals are dissociated.")
833 "background and any controlling terminals are dissociated.")("If this parameter is set, the server will automatically run in the "
"background and any controlling terminals are dissociated.")
834 },
835 &SilentMode,
836 false((bool) 0),
837 NULL((void*)0), NULL((void*)0), NULL((void*)0)
838 },
839 {
840 {"log_checkpoints", PGC_SIGHUP, LOGGING_WHAT,
841 gettext_noop("Logs each checkpoint.")("Logs each checkpoint."),
842 NULL((void*)0)
843 },
844 &log_checkpoints,
845 false((bool) 0),
846 NULL((void*)0), NULL((void*)0), NULL((void*)0)
847 },
848 {
849 {"log_connections", PGC_BACKEND, LOGGING_WHAT,
850 gettext_noop("Logs each successful connection.")("Logs each successful connection."),
851 NULL((void*)0)
852 },
853 &Log_connections,
854 false((bool) 0),
855 NULL((void*)0), NULL((void*)0), NULL((void*)0)
856 },
857 {
858 {"log_disconnections", PGC_BACKEND, LOGGING_WHAT,
859 gettext_noop("Logs end of a session, including duration.")("Logs end of a session, including duration."),
860 NULL((void*)0)
861 },
862 &Log_disconnections,
863 false((bool) 0),
864 NULL((void*)0), NULL((void*)0), NULL((void*)0)
865 },
866 {
867 {"debug_assertions", PGC_USERSET, DEVELOPER_OPTIONS,
868 gettext_noop("Turns on various assertion checks.")("Turns on various assertion checks."),
869 gettext_noop("This is a debugging aid.")("This is a debugging aid."),
870 GUC_NOT_IN_SAMPLE0x0020
871 },
872 &assert_enabled,
873#ifdef USE_ASSERT_CHECKING1
874 true((bool) 1),
875#else
876 false((bool) 0),
877#endif
878 check_debug_assertions, NULL((void*)0), NULL((void*)0)
879 },
880
881 {
882 {"exit_on_error", PGC_USERSET, ERROR_HANDLING_OPTIONS,
883 gettext_noop("Terminate session on any error.")("Terminate session on any error."),
884 NULL((void*)0)
885 },
886 &ExitOnAnyError,
887 false((bool) 0),
888 NULL((void*)0), NULL((void*)0), NULL((void*)0)
889 },
890 {
891 {"restart_after_crash", PGC_SIGHUP, ERROR_HANDLING_OPTIONS,
892 gettext_noop("Reinitialize server after backend crash.")("Reinitialize server after backend crash."),
893 NULL((void*)0)
894 },
895 &restart_after_crash,
896 true((bool) 1),
897 NULL((void*)0), NULL((void*)0), NULL((void*)0)
898 },
899
900 {
901 {"log_duration", PGC_SUSET, LOGGING_WHAT,
902 gettext_noop("Logs the duration of each completed SQL statement.")("Logs the duration of each completed SQL statement."),
903 NULL((void*)0)
904 },
905 &log_duration,
906 false((bool) 0),
907 NULL((void*)0), NULL((void*)0), NULL((void*)0)
908 },
909 {
910 {"debug_print_parse", PGC_USERSET, LOGGING_WHAT,
911 gettext_noop("Logs each query's parse tree.")("Logs each query's parse tree."),
912 NULL((void*)0)
913 },
914 &Debug_print_parse,
915 false((bool) 0),
916 NULL((void*)0), NULL((void*)0), NULL((void*)0)
917 },
918 {
919 {"debug_print_rewritten", PGC_USERSET, LOGGING_WHAT,
920 gettext_noop("Logs each query's rewritten parse tree.")("Logs each query's rewritten parse tree."),
921 NULL((void*)0)
922 },
923 &Debug_print_rewritten,
924 false((bool) 0),
925 NULL((void*)0), NULL((void*)0), NULL((void*)0)
926 },
927 {
928 {"debug_print_plan", PGC_USERSET, LOGGING_WHAT,
929 gettext_noop("Logs each query's execution plan.")("Logs each query's execution plan."),
930 NULL((void*)0)
931 },
932 &Debug_print_plan,
933 false((bool) 0),
934 NULL((void*)0), NULL((void*)0), NULL((void*)0)
935 },
936 {
937 {"debug_pretty_print", PGC_USERSET, LOGGING_WHAT,
938 gettext_noop("Indents parse and plan tree displays.")("Indents parse and plan tree displays."),
939 NULL((void*)0)
940 },
941 &Debug_pretty_print,
942 true((bool) 1),
943 NULL((void*)0), NULL((void*)0), NULL((void*)0)
944 },
945 {
946 {"log_parser_stats", PGC_SUSET, STATS_MONITORING,
947 gettext_noop("Writes parser performance statistics to the server log.")("Writes parser performance statistics to the server log."),
948 NULL((void*)0)
949 },
950 &log_parser_stats,
951 false((bool) 0),
952 check_stage_log_stats, NULL((void*)0), NULL((void*)0)
953 },
954 {
955 {"log_planner_stats", PGC_SUSET, STATS_MONITORING,
956 gettext_noop("Writes planner performance statistics to the server log.")("Writes planner performance statistics to the server log."),
957 NULL((void*)0)
958 },
959 &log_planner_stats,
960 false((bool) 0),
961 check_stage_log_stats, NULL((void*)0), NULL((void*)0)
962 },
963 {
964 {"log_executor_stats", PGC_SUSET, STATS_MONITORING,
965 gettext_noop("Writes executor performance statistics to the server log.")("Writes executor performance statistics to the server log."),
966 NULL((void*)0)
967 },
968 &log_executor_stats,
969 false((bool) 0),
970 check_stage_log_stats, NULL((void*)0), NULL((void*)0)
971 },
972 {
973 {"log_statement_stats", PGC_SUSET, STATS_MONITORING,
974 gettext_noop("Writes cumulative performance statistics to the server log.")("Writes cumulative performance statistics to the server log."
)
,
975 NULL((void*)0)
976 },
977 &log_statement_stats,
978 false((bool) 0),
979 check_log_stats, NULL((void*)0), NULL((void*)0)
980 },
981#ifdef BTREE_BUILD_STATS
982 {
983 {"log_btree_build_stats", PGC_SUSET, DEVELOPER_OPTIONS,
984 gettext_noop("No description available.")("No description available."),
985 NULL((void*)0),
986 GUC_NOT_IN_SAMPLE0x0020
987 },
988 &log_btree_build_stats,
989 false((bool) 0),
990 NULL((void*)0), NULL((void*)0), NULL((void*)0)
991 },
992#endif
993
994 {
995 {"track_activities", PGC_SUSET, STATS_COLLECTOR,
996 gettext_noop("Collects information about executing commands.")("Collects information about executing commands."),
997 gettext_noop("Enables the collection of information on the currently "("Enables the collection of information on the currently " "executing command of each session, along with "
"the time at which that command began execution.")
998 "executing command of each session, along with "("Enables the collection of information on the currently " "executing command of each session, along with "
"the time at which that command began execution.")
999 "the time at which that command began execution.")("Enables the collection of information on the currently " "executing command of each session, along with "
"the time at which that command began execution.")
1000 },
1001 &pgstat_track_activities,
1002 true((bool) 1),
1003 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1004 },
1005 {
1006 {"track_counts", PGC_SUSET, STATS_COLLECTOR,
1007 gettext_noop("Collects statistics on database activity.")("Collects statistics on database activity."),
1008 NULL((void*)0)
1009 },
1010 &pgstat_track_counts,
1011 true((bool) 1),
1012 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1013 },
1014
1015 {
1016 {"update_process_title", PGC_SUSET, STATS_COLLECTOR,
1017 gettext_noop("Updates the process title to show the active SQL command.")("Updates the process title to show the active SQL command."),
1018 gettext_noop("Enables updating of the process title every time a new SQL command is received by the server.")("Enables updating of the process title every time a new SQL command is received by the server."
)
1019 },
1020 &update_process_title,
1021 true((bool) 1),
1022 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1023 },
1024
1025 {
1026 {"autovacuum", PGC_SIGHUP, AUTOVACUUM,
1027 gettext_noop("Starts the autovacuum subprocess.")("Starts the autovacuum subprocess."),
1028 NULL((void*)0)
1029 },
1030 &autovacuum_start_daemon,
1031 true((bool) 1),
1032 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1033 },
1034
1035 {
1036 {"trace_notify", PGC_USERSET, DEVELOPER_OPTIONS,
1037 gettext_noop("Generates debugging output for LISTEN and NOTIFY.")("Generates debugging output for LISTEN and NOTIFY."),
1038 NULL((void*)0),
1039 GUC_NOT_IN_SAMPLE0x0020
1040 },
1041 &Trace_notify,
1042 false((bool) 0),
1043 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1044 },
1045
1046#ifdef LOCK_DEBUG
1047 {
1048 {"trace_locks", PGC_SUSET, DEVELOPER_OPTIONS,
1049 gettext_noop("No description available.")("No description available."),
1050 NULL((void*)0),
1051 GUC_NOT_IN_SAMPLE0x0020
1052 },
1053 &Trace_locks,
1054 false((bool) 0),
1055 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1056 },
1057 {
1058 {"trace_userlocks", PGC_SUSET, DEVELOPER_OPTIONS,
1059 gettext_noop("No description available.")("No description available."),
1060 NULL((void*)0),
1061 GUC_NOT_IN_SAMPLE0x0020
1062 },
1063 &Trace_userlocks,
1064 false((bool) 0),
1065 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1066 },
1067 {
1068 {"trace_lwlocks", PGC_SUSET, DEVELOPER_OPTIONS,
1069 gettext_noop("No description available.")("No description available."),
1070 NULL((void*)0),
1071 GUC_NOT_IN_SAMPLE0x0020
1072 },
1073 &Trace_lwlocks,
1074 false((bool) 0),
1075 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1076 },
1077 {
1078 {"debug_deadlocks", PGC_SUSET, DEVELOPER_OPTIONS,
1079 gettext_noop("No description available.")("No description available."),
1080 NULL((void*)0),
1081 GUC_NOT_IN_SAMPLE0x0020
1082 },
1083 &Debug_deadlocks,
1084 false((bool) 0),
1085 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1086 },
1087#endif
1088
1089 {
1090 {"log_lock_waits", PGC_SUSET, LOGGING_WHAT,
1091 gettext_noop("Logs long lock waits.")("Logs long lock waits."),
1092 NULL((void*)0)
1093 },
1094 &log_lock_waits,
1095 false((bool) 0),
1096 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1097 },
1098
1099 {
1100 {"log_hostname", PGC_SIGHUP, LOGGING_WHAT,
1101 gettext_noop("Logs the host name in the connection logs.")("Logs the host name in the connection logs."),
1102 gettext_noop("By default, connection logs only show the IP address "("By default, connection logs only show the IP address " "of the connecting host. If you want them to show the host name you "
"can turn this on, but depending on your host name resolution "
"setup it might impose a non-negligible performance penalty."
)
1103 "of the connecting host. If you want them to show the host name you "("By default, connection logs only show the IP address " "of the connecting host. If you want them to show the host name you "
"can turn this on, but depending on your host name resolution "
"setup it might impose a non-negligible performance penalty."
)
1104 "can turn this on, but depending on your host name resolution "("By default, connection logs only show the IP address " "of the connecting host. If you want them to show the host name you "
"can turn this on, but depending on your host name resolution "
"setup it might impose a non-negligible performance penalty."
)
1105 "setup it might impose a non-negligible performance penalty.")("By default, connection logs only show the IP address " "of the connecting host. If you want them to show the host name you "
"can turn this on, but depending on your host name resolution "
"setup it might impose a non-negligible performance penalty."
)
1106 },
1107 &log_hostname,
1108 false((bool) 0),
1109 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1110 },
1111 {
1112 {"sql_inheritance", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
1113 gettext_noop("Causes subtables to be included by default in various commands.")("Causes subtables to be included by default in various commands."
)
,
1114 NULL((void*)0)
1115 },
1116 &SQL_inheritance,
1117 true((bool) 1),
1118 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1119 },
1120 {
1121 {"password_encryption", PGC_USERSET, CONN_AUTH_SECURITY,
1122 gettext_noop("Encrypt passwords.")("Encrypt passwords."),
1123 gettext_noop("When a password is specified in CREATE USER or "("When a password is specified in CREATE USER or " "ALTER USER without writing either ENCRYPTED or UNENCRYPTED, "
"this parameter determines whether the password is to be encrypted."
)
1124 "ALTER USER without writing either ENCRYPTED or UNENCRYPTED, "("When a password is specified in CREATE USER or " "ALTER USER without writing either ENCRYPTED or UNENCRYPTED, "
"this parameter determines whether the password is to be encrypted."
)
1125 "this parameter determines whether the password is to be encrypted.")("When a password is specified in CREATE USER or " "ALTER USER without writing either ENCRYPTED or UNENCRYPTED, "
"this parameter determines whether the password is to be encrypted."
)
1126 },
1127 &Password_encryption,
1128 true((bool) 1),
1129 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1130 },
1131 {
1132 {"transform_null_equals", PGC_USERSET, COMPAT_OPTIONS_CLIENT,
1133 gettext_noop("Treats \"expr=NULL\" as \"expr IS NULL\".")("Treats \"expr=NULL\" as \"expr IS NULL\"."),
1134 gettext_noop("When turned on, expressions of the form expr = NULL "("When turned on, expressions of the form expr = NULL " "(or NULL = expr) are treated as expr IS NULL, that is, they "
"return true if expr evaluates to the null value, and false "
"otherwise. The correct behavior of expr = NULL is to always "
"return null (unknown).")
1135 "(or NULL = expr) are treated as expr IS NULL, that is, they "("When turned on, expressions of the form expr = NULL " "(or NULL = expr) are treated as expr IS NULL, that is, they "
"return true if expr evaluates to the null value, and false "
"otherwise. The correct behavior of expr = NULL is to always "
"return null (unknown).")
1136 "return true if expr evaluates to the null value, and false "("When turned on, expressions of the form expr = NULL " "(or NULL = expr) are treated as expr IS NULL, that is, they "
"return true if expr evaluates to the null value, and false "
"otherwise. The correct behavior of expr = NULL is to always "
"return null (unknown).")
1137 "otherwise. The correct behavior of expr = NULL is to always "("When turned on, expressions of the form expr = NULL " "(or NULL = expr) are treated as expr IS NULL, that is, they "
"return true if expr evaluates to the null value, and false "
"otherwise. The correct behavior of expr = NULL is to always "
"return null (unknown).")
1138 "return null (unknown).")("When turned on, expressions of the form expr = NULL " "(or NULL = expr) are treated as expr IS NULL, that is, they "
"return true if expr evaluates to the null value, and false "
"otherwise. The correct behavior of expr = NULL is to always "
"return null (unknown).")
1139 },
1140 &Transform_null_equals,
1141 false((bool) 0),
1142 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1143 },
1144 {
1145 {"db_user_namespace", PGC_SIGHUP, CONN_AUTH_SECURITY,
1146 gettext_noop("Enables per-database user names.")("Enables per-database user names."),
1147 NULL((void*)0)
1148 },
1149 &Db_user_namespace,
1150 false((bool) 0),
1151 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1152 },
1153 {
1154 /* only here for backwards compatibility */
1155 {"autocommit", PGC_USERSET, CLIENT_CONN_STATEMENT,
1156 gettext_noop("This parameter doesn't do anything.")("This parameter doesn't do anything."),
1157 gettext_noop("It's just here so that we won't choke on SET AUTOCOMMIT TO ON from 7.3-vintage clients.")("It's just here so that we won't choke on SET AUTOCOMMIT TO ON from 7.3-vintage clients."
)
,
1158 GUC_NO_SHOW_ALL0x0004 | GUC_NOT_IN_SAMPLE0x0020
1159 },
1160 &phony_autocommit,
1161 true((bool) 1),
1162 check_phony_autocommit, NULL((void*)0), NULL((void*)0)
1163 },
1164 {
1165 {"default_transaction_read_only", PGC_USERSET, CLIENT_CONN_STATEMENT,
1166 gettext_noop("Sets the default read-only status of new transactions.")("Sets the default read-only status of new transactions."),
1167 NULL((void*)0)
1168 },
1169 &DefaultXactReadOnly,
1170 false((bool) 0),
1171 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1172 },
1173 {
1174 {"transaction_read_only", PGC_USERSET, CLIENT_CONN_STATEMENT,
1175 gettext_noop("Sets the current transaction's read-only status.")("Sets the current transaction's read-only status."),
1176 NULL((void*)0),
1177 GUC_NO_RESET_ALL0x0008 | GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
1178 },
1179 &XactReadOnly,
1180 false((bool) 0),
1181 check_transaction_read_only, NULL((void*)0), NULL((void*)0)
1182 },
1183 {
1184 {"default_transaction_deferrable", PGC_USERSET, CLIENT_CONN_STATEMENT,
1185 gettext_noop("Sets the default deferrable status of new transactions.")("Sets the default deferrable status of new transactions."),
1186 NULL((void*)0)
1187 },
1188 &DefaultXactDeferrable,
1189 false((bool) 0),
1190 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1191 },
1192 {
1193 {"transaction_deferrable", PGC_USERSET, CLIENT_CONN_STATEMENT,
1194 gettext_noop("Whether to defer a read-only serializable transaction until it can be executed with no possible serialization failures.")("Whether to defer a read-only serializable transaction until it can be executed with no possible serialization failures."
)
,
1195 NULL((void*)0),
1196 GUC_NO_RESET_ALL0x0008 | GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
1197 },
1198 &XactDeferrable,
1199 false((bool) 0),
1200 check_transaction_deferrable, NULL((void*)0), NULL((void*)0)
1201 },
1202 {
1203 {"check_function_bodies", PGC_USERSET, CLIENT_CONN_STATEMENT,
1204 gettext_noop("Check function bodies during CREATE FUNCTION.")("Check function bodies during CREATE FUNCTION."),
1205 NULL((void*)0)
1206 },
1207 &check_function_bodies,
1208 true((bool) 1),
1209 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1210 },
1211 {
1212 {"array_nulls", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
1213 gettext_noop("Enable input of NULL elements in arrays.")("Enable input of NULL elements in arrays."),
1214 gettext_noop("When turned on, unquoted NULL in an array input "("When turned on, unquoted NULL in an array input " "value means a null value; "
"otherwise it is taken literally.")
1215 "value means a null value; "("When turned on, unquoted NULL in an array input " "value means a null value; "
"otherwise it is taken literally.")
1216 "otherwise it is taken literally.")("When turned on, unquoted NULL in an array input " "value means a null value; "
"otherwise it is taken literally.")
1217 },
1218 &Array_nulls,
1219 true((bool) 1),
1220 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1221 },
1222 {
1223 {"default_with_oids", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
1224 gettext_noop("Create new tables with OIDs by default.")("Create new tables with OIDs by default."),
1225 NULL((void*)0)
1226 },
1227 &default_with_oids,
1228 false((bool) 0),
1229 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1230 },
1231 {
1232 {"logging_collector", PGC_POSTMASTER, LOGGING_WHERE,
1233 gettext_noop("Start a subprocess to capture stderr output and/or csvlogs into log files.")("Start a subprocess to capture stderr output and/or csvlogs into log files."
)
,
1234 NULL((void*)0)
1235 },
1236 &Logging_collector,
1237 false((bool) 0),
1238 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1239 },
1240 {
1241 {"log_truncate_on_rotation", PGC_SIGHUP, LOGGING_WHERE,
1242 gettext_noop("Truncate existing log files of same name during log rotation.")("Truncate existing log files of same name during log rotation."
)
,
1243 NULL((void*)0)
1244 },
1245 &Log_truncate_on_rotation,
1246 false((bool) 0),
1247 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1248 },
1249
1250#ifdef TRACE_SORT1
1251 {
1252 {"trace_sort", PGC_USERSET, DEVELOPER_OPTIONS,
1253 gettext_noop("Emit information about resource usage in sorting.")("Emit information about resource usage in sorting."),
1254 NULL((void*)0),
1255 GUC_NOT_IN_SAMPLE0x0020
1256 },
1257 &trace_sort,
1258 false((bool) 0),
1259 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1260 },
1261#endif
1262
1263#ifdef TRACE_SYNCSCAN
1264 /* this is undocumented because not exposed in a standard build */
1265 {
1266 {"trace_syncscan", PGC_USERSET, DEVELOPER_OPTIONS,
1267 gettext_noop("Generate debugging output for synchronized scanning.")("Generate debugging output for synchronized scanning."),
1268 NULL((void*)0),
1269 GUC_NOT_IN_SAMPLE0x0020
1270 },
1271 &trace_syncscan,
1272 false((bool) 0),
1273 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1274 },
1275#endif
1276
1277#ifdef DEBUG_BOUNDED_SORT
1278 /* this is undocumented because not exposed in a standard build */
1279 {
1280 {
1281 "optimize_bounded_sort", PGC_USERSET, QUERY_TUNING_METHOD,
1282 gettext_noop("Enable bounded sorting using heap sort.")("Enable bounded sorting using heap sort."),
1283 NULL((void*)0),
1284 GUC_NOT_IN_SAMPLE0x0020
1285 },
1286 &optimize_bounded_sort,
1287 true((bool) 1),
1288 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1289 },
1290#endif
1291
1292#ifdef WAL_DEBUG
1293 {
1294 {"wal_debug", PGC_SUSET, DEVELOPER_OPTIONS,
1295 gettext_noop("Emit WAL-related debugging output.")("Emit WAL-related debugging output."),
1296 NULL((void*)0),
1297 GUC_NOT_IN_SAMPLE0x0020
1298 },
1299 &XLOG_DEBUG,
1300 false((bool) 0),
1301 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1302 },
1303#endif
1304
1305 {
1306 {"integer_datetimes", PGC_INTERNAL, PRESET_OPTIONS,
1307 gettext_noop("Datetimes are integer based.")("Datetimes are integer based."),
1308 NULL((void*)0),
1309 GUC_REPORT0x0010 | GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
1310 },
1311 &integer_datetimes,
1312#ifdef HAVE_INT64_TIMESTAMP
1313 true((bool) 1),
1314#else
1315 false((bool) 0),
1316#endif
1317 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1318 },
1319
1320 {
1321 {"krb_caseins_users", PGC_SIGHUP, CONN_AUTH_SECURITY,
1322 gettext_noop("Sets whether Kerberos and GSSAPI user names should be treated as case-insensitive.")("Sets whether Kerberos and GSSAPI user names should be treated as case-insensitive."
)
,
1323 NULL((void*)0)
1324 },
1325 &pg_krb_caseins_users,
1326 false((bool) 0),
1327 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1328 },
1329
1330 {
1331 {"escape_string_warning", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
1332 gettext_noop("Warn about backslash escapes in ordinary string literals.")("Warn about backslash escapes in ordinary string literals."),
1333 NULL((void*)0)
1334 },
1335 &escape_string_warning,
1336 true((bool) 1),
1337 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1338 },
1339
1340 {
1341 {"standard_conforming_strings", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
1342 gettext_noop("Causes '...' strings to treat backslashes literally.")("Causes '...' strings to treat backslashes literally."),
1343 NULL((void*)0),
1344 GUC_REPORT0x0010
1345 },
1346 &standard_conforming_strings,
1347 true((bool) 1),
1348 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1349 },
1350
1351 {
1352 {"synchronize_seqscans", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
1353 gettext_noop("Enable synchronized sequential scans.")("Enable synchronized sequential scans."),
1354 NULL((void*)0)
1355 },
1356 &synchronize_seqscans,
1357 true((bool) 1),
1358 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1359 },
1360
1361 {
1362 {"archive_mode", PGC_POSTMASTER, WAL_ARCHIVING,
1363 gettext_noop("Allows archiving of WAL files using archive_command.")("Allows archiving of WAL files using archive_command."),
1364 NULL((void*)0)
1365 },
1366 &XLogArchiveMode,
1367 false((bool) 0),
1368 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1369 },
1370
1371 {
1372 {"hot_standby", PGC_POSTMASTER, REPLICATION_STANDBY,
1373 gettext_noop("Allows connections and queries during recovery.")("Allows connections and queries during recovery."),
1374 NULL((void*)0)
1375 },
1376 &EnableHotStandby,
1377 false((bool) 0),
1378 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1379 },
1380
1381 {
1382 {"hot_standby_feedback", PGC_SIGHUP, REPLICATION_STANDBY,
1383 gettext_noop("Allows feedback from a hot standby to the primary that will avoid query conflicts.")("Allows feedback from a hot standby to the primary that will avoid query conflicts."
)
,
1384 NULL((void*)0)
1385 },
1386 &hot_standby_feedback,
1387 false((bool) 0),
1388 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1389 },
1390
1391 {
1392 {"allow_system_table_mods", PGC_POSTMASTER, DEVELOPER_OPTIONS,
1393 gettext_noop("Allows modifications of the structure of system tables.")("Allows modifications of the structure of system tables."),
1394 NULL((void*)0),
1395 GUC_NOT_IN_SAMPLE0x0020
1396 },
1397 &allowSystemTableMods,
1398 false((bool) 0),
1399 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1400 },
1401
1402 {
1403 {"ignore_system_indexes", PGC_BACKEND, DEVELOPER_OPTIONS,
1404 gettext_noop("Disables reading from system indexes.")("Disables reading from system indexes."),
1405 gettext_noop("It does not prevent updating the indexes, so it is safe "("It does not prevent updating the indexes, so it is safe " "to use. The worst consequence is slowness."
)
1406 "to use. The worst consequence is slowness.")("It does not prevent updating the indexes, so it is safe " "to use. The worst consequence is slowness."
)
,
1407 GUC_NOT_IN_SAMPLE0x0020
1408 },
1409 &IgnoreSystemIndexes,
1410 false((bool) 0),
1411 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1412 },
1413
1414 {
1415 {"lo_compat_privileges", PGC_SUSET, COMPAT_OPTIONS_PREVIOUS,
1416 gettext_noop("Enables backward compatibility mode for privilege checks on large objects.")("Enables backward compatibility mode for privilege checks on large objects."
)
,
1417 gettext_noop("Skips privilege checks when reading or modifying large objects, "("Skips privilege checks when reading or modifying large objects, "
"for compatibility with PostgreSQL releases prior to 9.0.")
1418 "for compatibility with PostgreSQL releases prior to 9.0.")("Skips privilege checks when reading or modifying large objects, "
"for compatibility with PostgreSQL releases prior to 9.0.")
1419 },
1420 &lo_compat_privileges,
1421 false((bool) 0),
1422 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1423 },
1424
1425 {
1426 {"quote_all_identifiers", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
1427 gettext_noop("When generating SQL fragments, quote all identifiers.")("When generating SQL fragments, quote all identifiers."),
1428 NULL((void*)0),
1429 },
1430 &quote_all_identifiers,
1431 false((bool) 0),
1432 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1433 },
1434
1435 /* End-of-list marker */
1436 {
1437 {NULL((void*)0), 0, 0, NULL((void*)0), NULL((void*)0)}, NULL((void*)0), false((bool) 0), NULL((void*)0), NULL((void*)0), NULL((void*)0)
1438 }
1439};
1440
1441
1442static struct config_int ConfigureNamesInt[] =
1443{
1444 {
1445 {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING,
1446 gettext_noop("Forces a switch to the next xlog file if a "("Forces a switch to the next xlog file if a " "new file has not been started within N seconds."
)
1447 "new file has not been started within N seconds.")("Forces a switch to the next xlog file if a " "new file has not been started within N seconds."
)
,
1448 NULL((void*)0),
1449 GUC_UNIT_S0x2000
1450 },
1451 &XLogArchiveTimeout,
1452 0, 0, INT_MAX2147483647,
1453 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1454 },
1455 {
1456 {"post_auth_delay", PGC_BACKEND, DEVELOPER_OPTIONS,
1457 gettext_noop("Waits N seconds on connection startup after authentication.")("Waits N seconds on connection startup after authentication."
)
,
1458 gettext_noop("This allows attaching a debugger to the process.")("This allows attaching a debugger to the process."),
1459 GUC_NOT_IN_SAMPLE0x0020 | GUC_UNIT_S0x2000
1460 },
1461 &PostAuthDelay,
1462 0, 0, INT_MAX2147483647,
1463 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1464 },
1465 {
1466 {"default_statistics_target", PGC_USERSET, QUERY_TUNING_OTHER,
1467 gettext_noop("Sets the default statistics target.")("Sets the default statistics target."),
1468 gettext_noop("This applies to table columns that have not had a "("This applies to table columns that have not had a " "column-specific target set via ALTER TABLE SET STATISTICS."
)
1469 "column-specific target set via ALTER TABLE SET STATISTICS.")("This applies to table columns that have not had a " "column-specific target set via ALTER TABLE SET STATISTICS."
)
1470 },
1471 &default_statistics_target,
1472 100, 1, 10000,
1473 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1474 },
1475 {
1476 {"from_collapse_limit", PGC_USERSET, QUERY_TUNING_OTHER,
1477 gettext_noop("Sets the FROM-list size beyond which subqueries "("Sets the FROM-list size beyond which subqueries " "are not collapsed."
)
1478 "are not collapsed.")("Sets the FROM-list size beyond which subqueries " "are not collapsed."
)
,
1479 gettext_noop("The planner will merge subqueries into upper "("The planner will merge subqueries into upper " "queries if the resulting FROM list would have no more than "
"this many items.")
1480 "queries if the resulting FROM list would have no more than "("The planner will merge subqueries into upper " "queries if the resulting FROM list would have no more than "
"this many items.")
1481 "this many items.")("The planner will merge subqueries into upper " "queries if the resulting FROM list would have no more than "
"this many items.")
1482 },
1483 &from_collapse_limit,
1484 8, 1, INT_MAX2147483647,
1485 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1486 },
1487 {
1488 {"join_collapse_limit", PGC_USERSET, QUERY_TUNING_OTHER,
1489 gettext_noop("Sets the FROM-list size beyond which JOIN "("Sets the FROM-list size beyond which JOIN " "constructs are not flattened."
)
1490 "constructs are not flattened.")("Sets the FROM-list size beyond which JOIN " "constructs are not flattened."
)
,
1491 gettext_noop("The planner will flatten explicit JOIN "("The planner will flatten explicit JOIN " "constructs into lists of FROM items whenever a "
"list of no more than this many items would result.")
1492 "constructs into lists of FROM items whenever a "("The planner will flatten explicit JOIN " "constructs into lists of FROM items whenever a "
"list of no more than this many items would result.")
1493 "list of no more than this many items would result.")("The planner will flatten explicit JOIN " "constructs into lists of FROM items whenever a "
"list of no more than this many items would result.")
1494 },
1495 &join_collapse_limit,
1496 8, 1, INT_MAX2147483647,
1497 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1498 },
1499 {
1500 {"geqo_threshold", PGC_USERSET, QUERY_TUNING_GEQO,
1501 gettext_noop("Sets the threshold of FROM items beyond which GEQO is used.")("Sets the threshold of FROM items beyond which GEQO is used."
)
,
1502 NULL((void*)0)
1503 },
1504 &geqo_threshold,
1505 12, 2, INT_MAX2147483647,
1506 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1507 },
1508 {
1509 {"geqo_effort", PGC_USERSET, QUERY_TUNING_GEQO,
1510 gettext_noop("GEQO: effort is used to set the default for other GEQO parameters.")("GEQO: effort is used to set the default for other GEQO parameters."
)
,
1511 NULL((void*)0)
1512 },
1513 &Geqo_effort,
1514 DEFAULT_GEQO_EFFORT5, MIN_GEQO_EFFORT1, MAX_GEQO_EFFORT10,
1515 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1516 },
1517 {
1518 {"geqo_pool_size", PGC_USERSET, QUERY_TUNING_GEQO,
1519 gettext_noop("GEQO: number of individuals in the population.")("GEQO: number of individuals in the population."),
1520 gettext_noop("Zero selects a suitable default value.")("Zero selects a suitable default value.")
1521 },
1522 &Geqo_pool_size,
1523 0, 0, INT_MAX2147483647,
1524 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1525 },
1526 {
1527 {"geqo_generations", PGC_USERSET, QUERY_TUNING_GEQO,
1528 gettext_noop("GEQO: number of iterations of the algorithm.")("GEQO: number of iterations of the algorithm."),
1529 gettext_noop("Zero selects a suitable default value.")("Zero selects a suitable default value.")
1530 },
1531 &Geqo_generations,
1532 0, 0, INT_MAX2147483647,
1533 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1534 },
1535
1536 {
1537 /* This is PGC_SIGHUP so all backends have the same value. */
1538 {"deadlock_timeout", PGC_SIGHUP, LOCK_MANAGEMENT,
1539 gettext_noop("Sets the time to wait on a lock before checking for deadlock.")("Sets the time to wait on a lock before checking for deadlock."
)
,
1540 NULL((void*)0),
1541 GUC_UNIT_MS0x1000
1542 },
1543 &DeadlockTimeout,
1544 1000, 1, INT_MAX2147483647,
1545 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1546 },
1547
1548 {
1549 {"max_standby_archive_delay", PGC_SIGHUP, REPLICATION_STANDBY,
1550 gettext_noop("Sets the maximum delay before canceling queries when a hot standby server is processing archived WAL data.")("Sets the maximum delay before canceling queries when a hot standby server is processing archived WAL data."
)
,
1551 NULL((void*)0),
1552 GUC_UNIT_MS0x1000
1553 },
1554 &max_standby_archive_delay,
1555 30 * 1000, -1, INT_MAX2147483647,
1556 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1557 },
1558
1559 {
1560 {"max_standby_streaming_delay", PGC_SIGHUP, REPLICATION_STANDBY,
1561 gettext_noop("Sets the maximum delay before canceling queries when a hot standby server is processing streamed WAL data.")("Sets the maximum delay before canceling queries when a hot standby server is processing streamed WAL data."
)
,
1562 NULL((void*)0),
1563 GUC_UNIT_MS0x1000
1564 },
1565 &max_standby_streaming_delay,
1566 30 * 1000, -1, INT_MAX2147483647,
1567 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1568 },
1569
1570 {
1571 {"wal_receiver_status_interval", PGC_SIGHUP, REPLICATION_STANDBY,
1572 gettext_noop("Sets the maximum interval between WAL receiver status reports to the primary.")("Sets the maximum interval between WAL receiver status reports to the primary."
)
,
1573 NULL((void*)0),
1574 GUC_UNIT_S0x2000
1575 },
1576 &wal_receiver_status_interval,
1577 10, 0, INT_MAX2147483647 / 1000,
1578 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1579 },
1580
1581 {
1582 {"max_connections", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
1583 gettext_noop("Sets the maximum number of concurrent connections.")("Sets the maximum number of concurrent connections."),
1584 NULL((void*)0)
1585 },
1586 &MaxConnections,
1587 100, 1, MAX_BACKENDS0x7fffff,
1588 check_maxconnections, assign_maxconnections, NULL((void*)0)
1589 },
1590
1591 {
1592 {"superuser_reserved_connections", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
1593 gettext_noop("Sets the number of connection slots reserved for superusers.")("Sets the number of connection slots reserved for superusers."
)
,
1594 NULL((void*)0)
1595 },
1596 &ReservedBackends,
1597 3, 0, MAX_BACKENDS0x7fffff,
1598 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1599 },
1600
1601 /*
1602 * We sometimes multiply the number of shared buffers by two without
1603 * checking for overflow, so we mustn't allow more than INT_MAX / 2.
1604 */
1605 {
1606 {"shared_buffers", PGC_POSTMASTER, RESOURCES_MEM,
1607 gettext_noop("Sets the number of shared memory buffers used by the server.")("Sets the number of shared memory buffers used by the server."
)
,
1608 NULL((void*)0),
1609 GUC_UNIT_BLOCKS0x0800
1610 },
1611 &NBuffers,
1612 1024, 16, INT_MAX2147483647 / 2,
1613 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1614 },
1615
1616 {
1617 {"temp_buffers", PGC_USERSET, RESOURCES_MEM,
1618 gettext_noop("Sets the maximum number of temporary buffers used by each session.")("Sets the maximum number of temporary buffers used by each session."
)
,
1619 NULL((void*)0),
1620 GUC_UNIT_BLOCKS0x0800
1621 },
1622 &num_temp_buffers,
1623 1024, 100, INT_MAX2147483647 / 2,
1624 check_temp_buffers, NULL((void*)0), NULL((void*)0)
1625 },
1626
1627 {
1628 {"port", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
1629 gettext_noop("Sets the TCP port the server listens on.")("Sets the TCP port the server listens on."),
1630 NULL((void*)0)
1631 },
1632 &PostPortNumber,
1633 DEF_PGPORT5432, 1, 65535,
1634 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1635 },
1636
1637 {
1638 {"unix_socket_permissions", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
1639 gettext_noop("Sets the access permissions of the Unix-domain socket.")("Sets the access permissions of the Unix-domain socket."),
1640 gettext_noop("Unix-domain sockets use the usual Unix file system "("Unix-domain sockets use the usual Unix file system " "permission set. The parameter value is expected "
"to be a numeric mode specification in the form " "accepted by the chmod and umask system calls. "
"(To use the customary octal format the number must " "start with a 0 (zero).)"
)
1641 "permission set. The parameter value is expected "("Unix-domain sockets use the usual Unix file system " "permission set. The parameter value is expected "
"to be a numeric mode specification in the form " "accepted by the chmod and umask system calls. "
"(To use the customary octal format the number must " "start with a 0 (zero).)"
)
1642 "to be a numeric mode specification in the form "("Unix-domain sockets use the usual Unix file system " "permission set. The parameter value is expected "
"to be a numeric mode specification in the form " "accepted by the chmod and umask system calls. "
"(To use the customary octal format the number must " "start with a 0 (zero).)"
)
1643 "accepted by the chmod and umask system calls. "("Unix-domain sockets use the usual Unix file system " "permission set. The parameter value is expected "
"to be a numeric mode specification in the form " "accepted by the chmod and umask system calls. "
"(To use the customary octal format the number must " "start with a 0 (zero).)"
)
1644 "(To use the customary octal format the number must "("Unix-domain sockets use the usual Unix file system " "permission set. The parameter value is expected "
"to be a numeric mode specification in the form " "accepted by the chmod and umask system calls. "
"(To use the customary octal format the number must " "start with a 0 (zero).)"
)
1645 "start with a 0 (zero).)")("Unix-domain sockets use the usual Unix file system " "permission set. The parameter value is expected "
"to be a numeric mode specification in the form " "accepted by the chmod and umask system calls. "
"(To use the customary octal format the number must " "start with a 0 (zero).)"
)
1646 },
1647 &Unix_socket_permissions,
1648 0777, 0000, 0777,
1649 NULL((void*)0), NULL((void*)0), show_unix_socket_permissions
1650 },
1651
1652 {
1653 {"log_file_mode", PGC_SIGHUP, LOGGING_WHERE,
1654 gettext_noop("Sets the file permissions for log files.")("Sets the file permissions for log files."),
1655 gettext_noop("The parameter value is expected "("The parameter value is expected " "to be a numeric mode specification in the form "
"accepted by the chmod and umask system calls. " "(To use the customary octal format the number must "
"start with a 0 (zero).)")
1656 "to be a numeric mode specification in the form "("The parameter value is expected " "to be a numeric mode specification in the form "
"accepted by the chmod and umask system calls. " "(To use the customary octal format the number must "
"start with a 0 (zero).)")
1657 "accepted by the chmod and umask system calls. "("The parameter value is expected " "to be a numeric mode specification in the form "
"accepted by the chmod and umask system calls. " "(To use the customary octal format the number must "
"start with a 0 (zero).)")
1658 "(To use the customary octal format the number must "("The parameter value is expected " "to be a numeric mode specification in the form "
"accepted by the chmod and umask system calls. " "(To use the customary octal format the number must "
"start with a 0 (zero).)")
1659 "start with a 0 (zero).)")("The parameter value is expected " "to be a numeric mode specification in the form "
"accepted by the chmod and umask system calls. " "(To use the customary octal format the number must "
"start with a 0 (zero).)")
1660 },
1661 &Log_file_mode,
1662 0600, 0000, 0777,
1663 NULL((void*)0), NULL((void*)0), show_log_file_mode
1664 },
1665
1666 {
1667 {"work_mem", PGC_USERSET, RESOURCES_MEM,
1668 gettext_noop("Sets the maximum memory to be used for query workspaces.")("Sets the maximum memory to be used for query workspaces."),
1669 gettext_noop("This much memory can be used by each internal "("This much memory can be used by each internal " "sort operation and hash table before switching to "
"temporary disk files.")
1670 "sort operation and hash table before switching to "("This much memory can be used by each internal " "sort operation and hash table before switching to "
"temporary disk files.")
1671 "temporary disk files.")("This much memory can be used by each internal " "sort operation and hash table before switching to "
"temporary disk files.")
,
1672 GUC_UNIT_KB0x0400
1673 },
1674 &work_mem,
1675 1024, 64, MAX_KILOBYTES2147483647,
1676 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1677 },
1678
1679 {
1680 {"maintenance_work_mem", PGC_USERSET, RESOURCES_MEM,
1681 gettext_noop("Sets the maximum memory to be used for maintenance operations.")("Sets the maximum memory to be used for maintenance operations."
)
,
1682 gettext_noop("This includes operations such as VACUUM and CREATE INDEX.")("This includes operations such as VACUUM and CREATE INDEX."),
1683 GUC_UNIT_KB0x0400
1684 },
1685 &maintenance_work_mem,
1686 16384, 1024, MAX_KILOBYTES2147483647,
1687 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1688 },
1689
1690 /*
1691 * We use the hopefully-safely-small value of 100kB as the compiled-in
1692 * default for max_stack_depth. InitializeGUCOptions will increase it if
1693 * possible, depending on the actual platform-specific stack limit.
1694 */
1695 {
1696 {"max_stack_depth", PGC_SUSET, RESOURCES_MEM,
1697 gettext_noop("Sets the maximum stack depth, in kilobytes.")("Sets the maximum stack depth, in kilobytes."),
1698 NULL((void*)0),
1699 GUC_UNIT_KB0x0400
1700 },
1701 &max_stack_depth,
1702 100, 100, MAX_KILOBYTES2147483647,
1703 check_max_stack_depth, assign_max_stack_depth, NULL((void*)0)
1704 },
1705
1706 {
1707 {"vacuum_cost_page_hit", PGC_USERSET, RESOURCES_VACUUM_DELAY,
1708 gettext_noop("Vacuum cost for a page found in the buffer cache.")("Vacuum cost for a page found in the buffer cache."),
1709 NULL((void*)0)
1710 },
1711 &VacuumCostPageHit,
1712 1, 0, 10000,
1713 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1714 },
1715
1716 {
1717 {"vacuum_cost_page_miss", PGC_USERSET, RESOURCES_VACUUM_DELAY,
1718 gettext_noop("Vacuum cost for a page not found in the buffer cache.")("Vacuum cost for a page not found in the buffer cache."),
1719 NULL((void*)0)
1720 },
1721 &VacuumCostPageMiss,
1722 10, 0, 10000,
1723 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1724 },
1725
1726 {
1727 {"vacuum_cost_page_dirty", PGC_USERSET, RESOURCES_VACUUM_DELAY,
1728 gettext_noop("Vacuum cost for a page dirtied by vacuum.")("Vacuum cost for a page dirtied by vacuum."),
1729 NULL((void*)0)
1730 },
1731 &VacuumCostPageDirty,
1732 20, 0, 10000,
1733 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1734 },
1735
1736 {
1737 {"vacuum_cost_limit", PGC_USERSET, RESOURCES_VACUUM_DELAY,
1738 gettext_noop("Vacuum cost amount available before napping.")("Vacuum cost amount available before napping."),
1739 NULL((void*)0)
1740 },
1741 &VacuumCostLimit,
1742 200, 1, 10000,
1743 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1744 },
1745
1746 {
1747 {"vacuum_cost_delay", PGC_USERSET, RESOURCES_VACUUM_DELAY,
1748 gettext_noop("Vacuum cost delay in milliseconds.")("Vacuum cost delay in milliseconds."),
1749 NULL((void*)0),
1750 GUC_UNIT_MS0x1000
1751 },
1752 &VacuumCostDelay,
1753 0, 0, 100,
1754 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1755 },
1756
1757 {
1758 {"autovacuum_vacuum_cost_delay", PGC_SIGHUP, AUTOVACUUM,
1759 gettext_noop("Vacuum cost delay in milliseconds, for autovacuum.")("Vacuum cost delay in milliseconds, for autovacuum."),
1760 NULL((void*)0),
1761 GUC_UNIT_MS0x1000
1762 },
1763 &autovacuum_vac_cost_delay,
1764 20, -1, 100,
1765 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1766 },
1767
1768 {
1769 {"autovacuum_vacuum_cost_limit", PGC_SIGHUP, AUTOVACUUM,
1770 gettext_noop("Vacuum cost amount available before napping, for autovacuum.")("Vacuum cost amount available before napping, for autovacuum."
)
,
1771 NULL((void*)0)
1772 },
1773 &autovacuum_vac_cost_limit,
1774 -1, -1, 10000,
1775 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1776 },
1777
1778 {
1779 {"max_files_per_process", PGC_POSTMASTER, RESOURCES_KERNEL,
1780 gettext_noop("Sets the maximum number of simultaneously open files for each server process.")("Sets the maximum number of simultaneously open files for each server process."
)
,
1781 NULL((void*)0)
1782 },
1783 &max_files_per_process,
1784 1000, 25, INT_MAX2147483647,
1785 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1786 },
1787
1788 /*
1789 * See also CheckRequiredParameterValues() if this parameter changes
1790 */
1791 {
1792 {"max_prepared_transactions", PGC_POSTMASTER, RESOURCES_MEM,
1793 gettext_noop("Sets the maximum number of simultaneously prepared transactions.")("Sets the maximum number of simultaneously prepared transactions."
)
,
1794 NULL((void*)0)
1795 },
1796 &max_prepared_xacts,
1797 0, 0, MAX_BACKENDS0x7fffff,
1798 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1799 },
1800
1801#ifdef LOCK_DEBUG
1802 {
1803 {"trace_lock_oidmin", PGC_SUSET, DEVELOPER_OPTIONS,
1804 gettext_noop("No description available.")("No description available."),
1805 NULL((void*)0),
1806 GUC_NOT_IN_SAMPLE0x0020
1807 },
1808 &Trace_lock_oidmin,
1809 FirstNormalObjectId16384, 0, INT_MAX2147483647,
1810 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1811 },
1812 {
1813 {"trace_lock_table", PGC_SUSET, DEVELOPER_OPTIONS,
1814 gettext_noop("No description available.")("No description available."),
1815 NULL((void*)0),
1816 GUC_NOT_IN_SAMPLE0x0020
1817 },
1818 &Trace_lock_table,
1819 0, 0, INT_MAX2147483647,
1820 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1821 },
1822#endif
1823
1824 {
1825 {"statement_timeout", PGC_USERSET, CLIENT_CONN_STATEMENT,
1826 gettext_noop("Sets the maximum allowed duration of any statement.")("Sets the maximum allowed duration of any statement."),
1827 gettext_noop("A value of 0 turns off the timeout.")("A value of 0 turns off the timeout."),
1828 GUC_UNIT_MS0x1000
1829 },
1830 &StatementTimeout,
1831 0, 0, INT_MAX2147483647,
1832 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1833 },
1834
1835 {
1836 {"vacuum_freeze_min_age", PGC_USERSET, CLIENT_CONN_STATEMENT,
1837 gettext_noop("Minimum age at which VACUUM should freeze a table row.")("Minimum age at which VACUUM should freeze a table row."),
1838 NULL((void*)0)
1839 },
1840 &vacuum_freeze_min_age,
1841 50000000, 0, 1000000000,
1842 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1843 },
1844
1845 {
1846 {"vacuum_freeze_table_age", PGC_USERSET, CLIENT_CONN_STATEMENT,
1847 gettext_noop("Age at which VACUUM should scan whole table to freeze tuples.")("Age at which VACUUM should scan whole table to freeze tuples."
)
,
1848 NULL((void*)0)
1849 },
1850 &vacuum_freeze_table_age,
1851 150000000, 0, 2000000000,
1852 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1853 },
1854
1855 {
1856 {"vacuum_defer_cleanup_age", PGC_SIGHUP, REPLICATION_MASTER,
1857 gettext_noop("Number of transactions by which VACUUM and HOT cleanup should be deferred, if any.")("Number of transactions by which VACUUM and HOT cleanup should be deferred, if any."
)
,
1858 NULL((void*)0)
1859 },
1860 &vacuum_defer_cleanup_age,
1861 0, 0, 1000000,
1862 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1863 },
1864
1865 /*
1866 * See also CheckRequiredParameterValues() if this parameter changes
1867 */
1868 {
1869 {"max_locks_per_transaction", PGC_POSTMASTER, LOCK_MANAGEMENT,
1870 gettext_noop("Sets the maximum number of locks per transaction.")("Sets the maximum number of locks per transaction."),
1871 gettext_noop("The shared lock table is sized on the assumption that "("The shared lock table is sized on the assumption that " "at most max_locks_per_transaction * max_connections distinct "
"objects will need to be locked at any one time.")
1872 "at most max_locks_per_transaction * max_connections distinct "("The shared lock table is sized on the assumption that " "at most max_locks_per_transaction * max_connections distinct "
"objects will need to be locked at any one time.")
1873 "objects will need to be locked at any one time.")("The shared lock table is sized on the assumption that " "at most max_locks_per_transaction * max_connections distinct "
"objects will need to be locked at any one time.")
1874 },
1875 &max_locks_per_xact,
1876 64, 10, INT_MAX2147483647,
1877 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1878 },
1879
1880 {
1881 {"max_pred_locks_per_transaction", PGC_POSTMASTER, LOCK_MANAGEMENT,
1882 gettext_noop("Sets the maximum number of predicate locks per transaction.")("Sets the maximum number of predicate locks per transaction."
)
,
1883 gettext_noop("The shared predicate lock table is sized on the assumption that "("The shared predicate lock table is sized on the assumption that "
"at most max_pred_locks_per_transaction * max_connections distinct "
"objects will need to be locked at any one time.")
1884 "at most max_pred_locks_per_transaction * max_connections distinct "("The shared predicate lock table is sized on the assumption that "
"at most max_pred_locks_per_transaction * max_connections distinct "
"objects will need to be locked at any one time.")
1885 "objects will need to be locked at any one time.")("The shared predicate lock table is sized on the assumption that "
"at most max_pred_locks_per_transaction * max_connections distinct "
"objects will need to be locked at any one time.")
1886 },
1887 &max_predicate_locks_per_xact,
1888 64, 10, INT_MAX2147483647,
1889 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1890 },
1891
1892 {
1893 {"authentication_timeout", PGC_SIGHUP, CONN_AUTH_SECURITY,
1894 gettext_noop("Sets the maximum allowed time to complete client authentication.")("Sets the maximum allowed time to complete client authentication."
)
,
1895 NULL((void*)0),
1896 GUC_UNIT_S0x2000
1897 },
1898 &AuthenticationTimeout,
1899 60, 1, 600,
1900 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1901 },
1902
1903 {
1904 /* Not for general use */
1905 {"pre_auth_delay", PGC_SIGHUP, DEVELOPER_OPTIONS,
1906 gettext_noop("Waits N seconds on connection startup before authentication.")("Waits N seconds on connection startup before authentication."
)
,
1907 gettext_noop("This allows attaching a debugger to the process.")("This allows attaching a debugger to the process."),
1908 GUC_NOT_IN_SAMPLE0x0020 | GUC_UNIT_S0x2000
1909 },
1910 &PreAuthDelay,
1911 0, 0, 60,
1912 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1913 },
1914
1915 {
1916 {"wal_keep_segments", PGC_SIGHUP, REPLICATION_MASTER,
1917 gettext_noop("Sets the number of WAL files held for standby servers.")("Sets the number of WAL files held for standby servers."),
1918 NULL((void*)0)
1919 },
1920 &wal_keep_segments,
1921 0, 0, INT_MAX2147483647,
1922 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1923 },
1924
1925 {
1926 {"checkpoint_segments", PGC_SIGHUP, WAL_CHECKPOINTS,
1927 gettext_noop("Sets the maximum distance in log segments between automatic WAL checkpoints.")("Sets the maximum distance in log segments between automatic WAL checkpoints."
)
,
1928 NULL((void*)0)
1929 },
1930 &CheckPointSegments,
1931 3, 1, INT_MAX2147483647,
1932 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1933 },
1934
1935 {
1936 {"checkpoint_timeout", PGC_SIGHUP, WAL_CHECKPOINTS,
1937 gettext_noop("Sets the maximum time between automatic WAL checkpoints.")("Sets the maximum time between automatic WAL checkpoints."),
1938 NULL((void*)0),
1939 GUC_UNIT_S0x2000
1940 },
1941 &CheckPointTimeout,
1942 300, 30, 3600,
1943 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1944 },
1945
1946 {
1947 {"checkpoint_warning", PGC_SIGHUP, WAL_CHECKPOINTS,
1948 gettext_noop("Enables warnings if checkpoint segments are filled more "("Enables warnings if checkpoint segments are filled more " "frequently than this."
)
1949 "frequently than this.")("Enables warnings if checkpoint segments are filled more " "frequently than this."
)
,
1950 gettext_noop("Write a message to the server log if checkpoints "("Write a message to the server log if checkpoints " "caused by the filling of checkpoint segment files happens more "
"frequently than this number of seconds. Zero turns off the warning."
)
1951 "caused by the filling of checkpoint segment files happens more "("Write a message to the server log if checkpoints " "caused by the filling of checkpoint segment files happens more "
"frequently than this number of seconds. Zero turns off the warning."
)
1952 "frequently than this number of seconds. Zero turns off the warning.")("Write a message to the server log if checkpoints " "caused by the filling of checkpoint segment files happens more "
"frequently than this number of seconds. Zero turns off the warning."
)
,
1953 GUC_UNIT_S0x2000
1954 },
1955 &CheckPointWarning,
1956 30, 0, INT_MAX2147483647,
1957 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1958 },
1959
1960 {
1961 {"wal_buffers", PGC_POSTMASTER, WAL_SETTINGS,
1962 gettext_noop("Sets the number of disk-page buffers in shared memory for WAL.")("Sets the number of disk-page buffers in shared memory for WAL."
)
,
1963 NULL((void*)0),
1964 GUC_UNIT_XBLOCKS0x0C00
1965 },
1966 &XLOGbuffers,
1967 -1, -1, INT_MAX2147483647,
1968 check_wal_buffers, NULL((void*)0), NULL((void*)0)
1969 },
1970
1971 {
1972 {"wal_writer_delay", PGC_SIGHUP, WAL_SETTINGS,
1973 gettext_noop("WAL writer sleep time between WAL flushes.")("WAL writer sleep time between WAL flushes."),
1974 NULL((void*)0),
1975 GUC_UNIT_MS0x1000
1976 },
1977 &WalWriterDelay,
1978 200, 1, 10000,
1979 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1980 },
1981
1982 {
1983 /* see max_connections */
1984 {"max_wal_senders", PGC_POSTMASTER, REPLICATION_MASTER,
1985 gettext_noop("Sets the maximum number of simultaneously running WAL sender processes.")("Sets the maximum number of simultaneously running WAL sender processes."
)
,
1986 NULL((void*)0)
1987 },
1988 &max_wal_senders,
1989 0, 0, MAX_BACKENDS0x7fffff,
1990 NULL((void*)0), NULL((void*)0), NULL((void*)0)
1991 },
1992
1993 {
1994 {"wal_sender_delay", PGC_SIGHUP, REPLICATION_MASTER,
1995 gettext_noop("WAL sender sleep time between WAL replications.")("WAL sender sleep time between WAL replications."),
1996 NULL((void*)0),
1997 GUC_UNIT_MS0x1000
1998 },
1999 &WalSndDelay,
2000 1000, 1, 10000,
2001 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2002 },
2003
2004 {
2005 {"replication_timeout", PGC_SIGHUP, REPLICATION_MASTER,
2006 gettext_noop("Sets the maximum time to wait for WAL replication.")("Sets the maximum time to wait for WAL replication."),
2007 NULL((void*)0),
2008 GUC_UNIT_MS0x1000
2009 },
2010 &replication_timeout,
2011 60 * 1000, 0, INT_MAX2147483647,
2012 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2013 },
2014
2015 {
2016 {"commit_delay", PGC_USERSET, WAL_SETTINGS,
2017 gettext_noop("Sets the delay in microseconds between transaction commit and "("Sets the delay in microseconds between transaction commit and "
"flushing WAL to disk.")
2018 "flushing WAL to disk.")("Sets the delay in microseconds between transaction commit and "
"flushing WAL to disk.")
,
2019 NULL((void*)0)
2020 },
2021 &CommitDelay,
2022 0, 0, 100000,
2023 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2024 },
2025
2026 {
2027 {"commit_siblings", PGC_USERSET, WAL_SETTINGS,
2028 gettext_noop("Sets the minimum concurrent open transactions before performing "("Sets the minimum concurrent open transactions before performing "
"commit_delay.")
2029 "commit_delay.")("Sets the minimum concurrent open transactions before performing "
"commit_delay.")
,
2030 NULL((void*)0)
2031 },
2032 &CommitSiblings,
2033 5, 0, 1000,
2034 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2035 },
2036
2037 {
2038 {"extra_float_digits", PGC_USERSET, CLIENT_CONN_LOCALE,
2039 gettext_noop("Sets the number of digits displayed for floating-point values.")("Sets the number of digits displayed for floating-point values."
)
,
2040 gettext_noop("This affects real, double precision, and geometric data types. "("This affects real, double precision, and geometric data types. "
"The parameter value is added to the standard number of digits "
"(FLT_DIG or DBL_DIG as appropriate).")
2041 "The parameter value is added to the standard number of digits "("This affects real, double precision, and geometric data types. "
"The parameter value is added to the standard number of digits "
"(FLT_DIG or DBL_DIG as appropriate).")
2042 "(FLT_DIG or DBL_DIG as appropriate).")("This affects real, double precision, and geometric data types. "
"The parameter value is added to the standard number of digits "
"(FLT_DIG or DBL_DIG as appropriate).")
2043 },
2044 &extra_float_digits,
2045 0, -15, 3,
2046 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2047 },
2048
2049 {
2050 {"log_min_duration_statement", PGC_SUSET, LOGGING_WHEN,
2051 gettext_noop("Sets the minimum execution time above which "("Sets the minimum execution time above which " "statements will be logged."
)
2052 "statements will be logged.")("Sets the minimum execution time above which " "statements will be logged."
)
,
2053 gettext_noop("Zero prints all queries. -1 turns this feature off.")("Zero prints all queries. -1 turns this feature off."),
2054 GUC_UNIT_MS0x1000
2055 },
2056 &log_min_duration_statement,
2057 -1, -1, INT_MAX2147483647,
2058 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2059 },
2060
2061 {
2062 {"log_autovacuum_min_duration", PGC_SIGHUP, LOGGING_WHAT,
2063 gettext_noop("Sets the minimum execution time above which "("Sets the minimum execution time above which " "autovacuum actions will be logged."
)
2064 "autovacuum actions will be logged.")("Sets the minimum execution time above which " "autovacuum actions will be logged."
)
,
2065 gettext_noop("Zero prints all actions. -1 turns autovacuum logging off.")("Zero prints all actions. -1 turns autovacuum logging off."),
2066 GUC_UNIT_MS0x1000
2067 },
2068 &Log_autovacuum_min_duration,
2069 -1, -1, INT_MAX2147483647,
2070 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2071 },
2072
2073 {
2074 {"bgwriter_delay", PGC_SIGHUP, RESOURCES_BGWRITER,
2075 gettext_noop("Background writer sleep time between rounds.")("Background writer sleep time between rounds."),
2076 NULL((void*)0),
2077 GUC_UNIT_MS0x1000
2078 },
2079 &BgWriterDelay,
2080 200, 10, 10000,
2081 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2082 },
2083
2084 {
2085 {"bgwriter_lru_maxpages", PGC_SIGHUP, RESOURCES_BGWRITER,
2086 gettext_noop("Background writer maximum number of LRU pages to flush per round.")("Background writer maximum number of LRU pages to flush per round."
)
,
2087 NULL((void*)0)
2088 },
2089 &bgwriter_lru_maxpages,
2090 100, 0, 1000,
2091 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2092 },
2093
2094 {
2095 {"effective_io_concurrency",
2096#ifdef USE_PREFETCH
2097 PGC_USERSET,
2098#else
2099 PGC_INTERNAL,
2100#endif
2101 RESOURCES_ASYNCHRONOUS,
2102 gettext_noop("Number of simultaneous requests that can be handled efficiently by the disk subsystem.")("Number of simultaneous requests that can be handled efficiently by the disk subsystem."
)
,
2103 gettext_noop("For RAID arrays, this should be approximately the number of drive spindles in the array.")("For RAID arrays, this should be approximately the number of drive spindles in the array."
)
2104 },
2105 &effective_io_concurrency,
2106#ifdef USE_PREFETCH
2107 1, 0, 1000,
2108#else
2109 0, 0, 0,
2110#endif
2111 check_effective_io_concurrency, assign_effective_io_concurrency, NULL((void*)0)
2112 },
2113
2114 {
2115 {"log_rotation_age", PGC_SIGHUP, LOGGING_WHERE,
2116 gettext_noop("Automatic log file rotation will occur after N minutes.")("Automatic log file rotation will occur after N minutes."),
2117 NULL((void*)0),
2118 GUC_UNIT_MIN0x4000
2119 },
2120 &Log_RotationAge,
2121 HOURS_PER_DAY24 * MINS_PER_HOUR60, 0, INT_MAX2147483647 / MINS_PER_HOUR60,
2122 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2123 },
2124
2125 {
2126 {"log_rotation_size", PGC_SIGHUP, LOGGING_WHERE,
2127 gettext_noop("Automatic log file rotation will occur after N kilobytes.")("Automatic log file rotation will occur after N kilobytes."),
2128 NULL((void*)0),
2129 GUC_UNIT_KB0x0400
2130 },
2131 &Log_RotationSize,
2132 10 * 1024, 0, INT_MAX2147483647 / 1024,
2133 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2134 },
2135
2136 {
2137 {"max_function_args", PGC_INTERNAL, PRESET_OPTIONS,
2138 gettext_noop("Shows the maximum number of function arguments.")("Shows the maximum number of function arguments."),
2139 NULL((void*)0),
2140 GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2141 },
2142 &max_function_args,
2143 FUNC_MAX_ARGS100, FUNC_MAX_ARGS100, FUNC_MAX_ARGS100,
2144 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2145 },
2146
2147 {
2148 {"max_index_keys", PGC_INTERNAL, PRESET_OPTIONS,
2149 gettext_noop("Shows the maximum number of index keys.")("Shows the maximum number of index keys."),
2150 NULL((void*)0),
2151 GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2152 },
2153 &max_index_keys,
2154 INDEX_MAX_KEYS32, INDEX_MAX_KEYS32, INDEX_MAX_KEYS32,
2155 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2156 },
2157
2158 {
2159 {"max_identifier_length", PGC_INTERNAL, PRESET_OPTIONS,
2160 gettext_noop("Shows the maximum identifier length.")("Shows the maximum identifier length."),
2161 NULL((void*)0),
2162 GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2163 },
2164 &max_identifier_length,
2165 NAMEDATALEN64 - 1, NAMEDATALEN64 - 1, NAMEDATALEN64 - 1,
2166 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2167 },
2168
2169 {
2170 {"block_size", PGC_INTERNAL, PRESET_OPTIONS,
2171 gettext_noop("Shows the size of a disk block.")("Shows the size of a disk block."),
2172 NULL((void*)0),
2173 GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2174 },
2175 &block_size,
2176 BLCKSZ8192, BLCKSZ8192, BLCKSZ8192,
2177 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2178 },
2179
2180 {
2181 {"segment_size", PGC_INTERNAL, PRESET_OPTIONS,
2182 gettext_noop("Shows the number of pages per disk file.")("Shows the number of pages per disk file."),
2183 NULL((void*)0),
2184 GUC_UNIT_BLOCKS0x0800 | GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2185 },
2186 &segment_size,
2187 RELSEG_SIZE131072, RELSEG_SIZE131072, RELSEG_SIZE131072,
2188 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2189 },
2190
2191 {
2192 {"wal_block_size", PGC_INTERNAL, PRESET_OPTIONS,
2193 gettext_noop("Shows the block size in the write ahead log.")("Shows the block size in the write ahead log."),
2194 NULL((void*)0),
2195 GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2196 },
2197 &wal_block_size,
2198 XLOG_BLCKSZ8192, XLOG_BLCKSZ8192, XLOG_BLCKSZ8192,
2199 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2200 },
2201
2202 {
2203 {"wal_segment_size", PGC_INTERNAL, PRESET_OPTIONS,
2204 gettext_noop("Shows the number of pages per write ahead log segment.")("Shows the number of pages per write ahead log segment."),
2205 NULL((void*)0),
2206 GUC_UNIT_XBLOCKS0x0C00 | GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2207 },
2208 &wal_segment_size,
2209 (XLOG_SEG_SIZE(16 * 1024 * 1024) / XLOG_BLCKSZ8192),
2210 (XLOG_SEG_SIZE(16 * 1024 * 1024) / XLOG_BLCKSZ8192),
2211 (XLOG_SEG_SIZE(16 * 1024 * 1024) / XLOG_BLCKSZ8192),
2212 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2213 },
2214
2215 {
2216 {"autovacuum_naptime", PGC_SIGHUP, AUTOVACUUM,
2217 gettext_noop("Time to sleep between autovacuum runs.")("Time to sleep between autovacuum runs."),
2218 NULL((void*)0),
2219 GUC_UNIT_S0x2000
2220 },
2221 &autovacuum_naptime,
2222 60, 1, INT_MAX2147483647 / 1000,
2223 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2224 },
2225 {
2226 {"autovacuum_vacuum_threshold", PGC_SIGHUP, AUTOVACUUM,
2227 gettext_noop("Minimum number of tuple updates or deletes prior to vacuum.")("Minimum number of tuple updates or deletes prior to vacuum."
)
,
2228 NULL((void*)0)
2229 },
2230 &autovacuum_vac_thresh,
2231 50, 0, INT_MAX2147483647,
2232 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2233 },
2234 {
2235 {"autovacuum_analyze_threshold", PGC_SIGHUP, AUTOVACUUM,
2236 gettext_noop("Minimum number of tuple inserts, updates or deletes prior to analyze.")("Minimum number of tuple inserts, updates or deletes prior to analyze."
)
,
2237 NULL((void*)0)
2238 },
2239 &autovacuum_anl_thresh,
2240 50, 0, INT_MAX2147483647,
2241 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2242 },
2243 {
2244 /* see varsup.c for why this is PGC_POSTMASTER not PGC_SIGHUP */
2245 {"autovacuum_freeze_max_age", PGC_POSTMASTER, AUTOVACUUM,
2246 gettext_noop("Age at which to autovacuum a table to prevent transaction ID wraparound.")("Age at which to autovacuum a table to prevent transaction ID wraparound."
)
,
2247 NULL((void*)0)
2248 },
2249 &autovacuum_freeze_max_age,
2250 /* see pg_resetxlog if you change the upper-limit value */
2251 200000000, 100000000, 2000000000,
2252 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2253 },
2254 {
2255 /* see max_connections */
2256 {"autovacuum_max_workers", PGC_POSTMASTER, AUTOVACUUM,
2257 gettext_noop("Sets the maximum number of simultaneously running autovacuum worker processes.")("Sets the maximum number of simultaneously running autovacuum worker processes."
)
,
2258 NULL((void*)0)
2259 },
2260 &autovacuum_max_workers,
2261 3, 1, MAX_BACKENDS0x7fffff,
2262 check_autovacuum_max_workers, assign_autovacuum_max_workers, NULL((void*)0)
2263 },
2264
2265 {
2266 {"tcp_keepalives_idle", PGC_USERSET, CLIENT_CONN_OTHER,
2267 gettext_noop("Time between issuing TCP keepalives.")("Time between issuing TCP keepalives."),
2268 gettext_noop("A value of 0 uses the system default.")("A value of 0 uses the system default."),
2269 GUC_UNIT_S0x2000
2270 },
2271 &tcp_keepalives_idle,
2272 0, 0, INT_MAX2147483647,
2273 NULL((void*)0), assign_tcp_keepalives_idle, show_tcp_keepalives_idle
2274 },
2275
2276 {
2277 {"tcp_keepalives_interval", PGC_USERSET, CLIENT_CONN_OTHER,
2278 gettext_noop("Time between TCP keepalive retransmits.")("Time between TCP keepalive retransmits."),
2279 gettext_noop("A value of 0 uses the system default.")("A value of 0 uses the system default."),
2280 GUC_UNIT_S0x2000
2281 },
2282 &tcp_keepalives_interval,
2283 0, 0, INT_MAX2147483647,
2284 NULL((void*)0), assign_tcp_keepalives_interval, show_tcp_keepalives_interval
2285 },
2286
2287 {
2288 {"ssl_renegotiation_limit", PGC_USERSET, CONN_AUTH_SECURITY,
2289 gettext_noop("Set the amount of traffic to send and receive before renegotiating the encryption keys.")("Set the amount of traffic to send and receive before renegotiating the encryption keys."
)
,
2290 NULL((void*)0),
2291 GUC_UNIT_KB0x0400,
2292 },
2293 &ssl_renegotiation_limit,
2294 512 * 1024, 0, MAX_KILOBYTES2147483647,
2295 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2296 },
2297
2298 {
2299 {"tcp_keepalives_count", PGC_USERSET, CLIENT_CONN_OTHER,
2300 gettext_noop("Maximum number of TCP keepalive retransmits.")("Maximum number of TCP keepalive retransmits."),
2301 gettext_noop("This controls the number of consecutive keepalive retransmits that can be "("This controls the number of consecutive keepalive retransmits that can be "
"lost before a connection is considered dead. A value of 0 uses the "
"system default.")
2302 "lost before a connection is considered dead. A value of 0 uses the "("This controls the number of consecutive keepalive retransmits that can be "
"lost before a connection is considered dead. A value of 0 uses the "
"system default.")
2303 "system default.")("This controls the number of consecutive keepalive retransmits that can be "
"lost before a connection is considered dead. A value of 0 uses the "
"system default.")
,
2304 },
2305 &tcp_keepalives_count,
2306 0, 0, INT_MAX2147483647,
2307 NULL((void*)0), assign_tcp_keepalives_count, show_tcp_keepalives_count
2308 },
2309
2310 {
2311 {"gin_fuzzy_search_limit", PGC_USERSET, CLIENT_CONN_OTHER,
2312 gettext_noop("Sets the maximum allowed result for exact search by GIN.")("Sets the maximum allowed result for exact search by GIN."),
2313 NULL((void*)0),
2314 0
2315 },
2316 &GinFuzzySearchLimit,
2317 0, 0, INT_MAX2147483647,
2318 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2319 },
2320
2321 {
2322 {"effective_cache_size", PGC_USERSET, QUERY_TUNING_COST,
2323 gettext_noop("Sets the planner's assumption about the size of the disk cache.")("Sets the planner's assumption about the size of the disk cache."
)
,
2324 gettext_noop("That is, the portion of the kernel's disk cache that "("That is, the portion of the kernel's disk cache that " "will be used for PostgreSQL data files. This is measured in disk "
"pages, which are normally 8 kB each.")
2325 "will be used for PostgreSQL data files. This is measured in disk "("That is, the portion of the kernel's disk cache that " "will be used for PostgreSQL data files. This is measured in disk "
"pages, which are normally 8 kB each.")
2326 "pages, which are normally 8 kB each.")("That is, the portion of the kernel's disk cache that " "will be used for PostgreSQL data files. This is measured in disk "
"pages, which are normally 8 kB each.")
,
2327 GUC_UNIT_BLOCKS0x0800,
2328 },
2329 &effective_cache_size,
2330 DEFAULT_EFFECTIVE_CACHE_SIZE16384, 1, INT_MAX2147483647,
2331 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2332 },
2333
2334 {
2335 /* Can't be set in postgresql.conf */
2336 {"server_version_num", PGC_INTERNAL, PRESET_OPTIONS,
2337 gettext_noop("Shows the server version as an integer.")("Shows the server version as an integer."),
2338 NULL((void*)0),
2339 GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2340 },
2341 &server_version_num,
2342 PG_VERSION_NUM90100, PG_VERSION_NUM90100, PG_VERSION_NUM90100,
2343 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2344 },
2345
2346 {
2347 {"log_temp_files", PGC_SUSET, LOGGING_WHAT,
2348 gettext_noop("Log the use of temporary files larger than this number of kilobytes.")("Log the use of temporary files larger than this number of kilobytes."
)
,
2349 gettext_noop("Zero logs all files. The default is -1 (turning this feature off).")("Zero logs all files. The default is -1 (turning this feature off)."
)
,
2350 GUC_UNIT_KB0x0400
2351 },
2352 &log_temp_files,
2353 -1, -1, INT_MAX2147483647,
2354 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2355 },
2356
2357 {
2358 {"track_activity_query_size", PGC_POSTMASTER, RESOURCES_MEM,
2359 gettext_noop("Sets the size reserved for pg_stat_activity.current_query, in bytes.")("Sets the size reserved for pg_stat_activity.current_query, in bytes."
)
,
2360 NULL((void*)0),
2361 },
2362 &pgstat_track_activity_query_size,
2363 1024, 100, 102400,
2364 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2365 },
2366
2367 /* End-of-list marker */
2368 {
2369 {NULL((void*)0), 0, 0, NULL((void*)0), NULL((void*)0)}, NULL((void*)0), 0, 0, 0, NULL((void*)0), NULL((void*)0), NULL((void*)0)
2370 }
2371};
2372
2373
2374static struct config_real ConfigureNamesReal[] =
2375{
2376 {
2377 {"seq_page_cost", PGC_USERSET, QUERY_TUNING_COST,
2378 gettext_noop("Sets the planner's estimate of the cost of a "("Sets the planner's estimate of the cost of a " "sequentially fetched disk page."
)
2379 "sequentially fetched disk page.")("Sets the planner's estimate of the cost of a " "sequentially fetched disk page."
)
,
2380 NULL((void*)0)
2381 },
2382 &seq_page_cost,
2383 DEFAULT_SEQ_PAGE_COST1.0, 0, DBL_MAX1.7976931348623157e+308,
2384 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2385 },
2386 {
2387 {"random_page_cost", PGC_USERSET, QUERY_TUNING_COST,
2388 gettext_noop("Sets the planner's estimate of the cost of a "("Sets the planner's estimate of the cost of a " "nonsequentially fetched disk page."
)
2389 "nonsequentially fetched disk page.")("Sets the planner's estimate of the cost of a " "nonsequentially fetched disk page."
)
,
2390 NULL((void*)0)
2391 },
2392 &random_page_cost,
2393 DEFAULT_RANDOM_PAGE_COST4.0, 0, DBL_MAX1.7976931348623157e+308,
2394 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2395 },
2396 {
2397 {"cpu_tuple_cost", PGC_USERSET, QUERY_TUNING_COST,
2398 gettext_noop("Sets the planner's estimate of the cost of "("Sets the planner's estimate of the cost of " "processing each tuple (row)."
)
2399 "processing each tuple (row).")("Sets the planner's estimate of the cost of " "processing each tuple (row)."
)
,
2400 NULL((void*)0)
2401 },
2402 &cpu_tuple_cost,
2403 DEFAULT_CPU_TUPLE_COST0.01, 0, DBL_MAX1.7976931348623157e+308,
2404 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2405 },
2406 {
2407 {"cpu_index_tuple_cost", PGC_USERSET, QUERY_TUNING_COST,
2408 gettext_noop("Sets the planner's estimate of the cost of "("Sets the planner's estimate of the cost of " "processing each index entry during an index scan."
)
2409 "processing each index entry during an index scan.")("Sets the planner's estimate of the cost of " "processing each index entry during an index scan."
)
,
2410 NULL((void*)0)
2411 },
2412 &cpu_index_tuple_cost,
2413 DEFAULT_CPU_INDEX_TUPLE_COST0.005, 0, DBL_MAX1.7976931348623157e+308,
2414 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2415 },
2416 {
2417 {"cpu_operator_cost", PGC_USERSET, QUERY_TUNING_COST,
2418 gettext_noop("Sets the planner's estimate of the cost of "("Sets the planner's estimate of the cost of " "processing each operator or function call."
)
2419 "processing each operator or function call.")("Sets the planner's estimate of the cost of " "processing each operator or function call."
)
,
2420 NULL((void*)0)
2421 },
2422 &cpu_operator_cost,
2423 DEFAULT_CPU_OPERATOR_COST0.0025, 0, DBL_MAX1.7976931348623157e+308,
2424 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2425 },
2426
2427 {
2428 {"cursor_tuple_fraction", PGC_USERSET, QUERY_TUNING_OTHER,
2429 gettext_noop("Sets the planner's estimate of the fraction of "("Sets the planner's estimate of the fraction of " "a cursor's rows that will be retrieved."
)
2430 "a cursor's rows that will be retrieved.")("Sets the planner's estimate of the fraction of " "a cursor's rows that will be retrieved."
)
,
2431 NULL((void*)0)
2432 },
2433 &cursor_tuple_fraction,
2434 DEFAULT_CURSOR_TUPLE_FRACTION0.1, 0.0, 1.0,
2435 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2436 },
2437
2438 {
2439 {"geqo_selection_bias", PGC_USERSET, QUERY_TUNING_GEQO,
2440 gettext_noop("GEQO: selective pressure within the population.")("GEQO: selective pressure within the population."),
2441 NULL((void*)0)
2442 },
2443 &Geqo_selection_bias,
2444 DEFAULT_GEQO_SELECTION_BIAS2.0,
2445 MIN_GEQO_SELECTION_BIAS1.5, MAX_GEQO_SELECTION_BIAS2.0,
2446 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2447 },
2448 {
2449 {"geqo_seed", PGC_USERSET, QUERY_TUNING_GEQO,
2450 gettext_noop("GEQO: seed for random path selection.")("GEQO: seed for random path selection."),
2451 NULL((void*)0)
2452 },
2453 &Geqo_seed,
2454 0.0, 0.0, 1.0,
2455 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2456 },
2457
2458 {
2459 {"bgwriter_lru_multiplier", PGC_SIGHUP, RESOURCES_BGWRITER,
2460 gettext_noop("Multiple of the average buffer usage to free per round.")("Multiple of the average buffer usage to free per round."),
2461 NULL((void*)0)
2462 },
2463 &bgwriter_lru_multiplier,
2464 2.0, 0.0, 10.0,
2465 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2466 },
2467
2468 {
2469 {"seed", PGC_USERSET, UNGROUPED,
2470 gettext_noop("Sets the seed for random-number generation.")("Sets the seed for random-number generation."),
2471 NULL((void*)0),
2472 GUC_NO_SHOW_ALL0x0004 | GUC_NO_RESET_ALL0x0008 | GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2473 },
2474 &phony_random_seed,
2475 0.0, -1.0, 1.0,
2476 check_random_seed, assign_random_seed, show_random_seed
2477 },
2478
2479 {
2480 {"autovacuum_vacuum_scale_factor", PGC_SIGHUP, AUTOVACUUM,
2481 gettext_noop("Number of tuple updates or deletes prior to vacuum as a fraction of reltuples.")("Number of tuple updates or deletes prior to vacuum as a fraction of reltuples."
)
,
2482 NULL((void*)0)
2483 },
2484 &autovacuum_vac_scale,
2485 0.2, 0.0, 100.0,
2486 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2487 },
2488 {
2489 {"autovacuum_analyze_scale_factor", PGC_SIGHUP, AUTOVACUUM,
2490 gettext_noop("Number of tuple inserts, updates or deletes prior to analyze as a fraction of reltuples.")("Number of tuple inserts, updates or deletes prior to analyze as a fraction of reltuples."
)
,
2491 NULL((void*)0)
2492 },
2493 &autovacuum_anl_scale,
2494 0.1, 0.0, 100.0,
2495 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2496 },
2497
2498 {
2499 {"checkpoint_completion_target", PGC_SIGHUP, WAL_CHECKPOINTS,
2500 gettext_noop("Time spent flushing dirty buffers during checkpoint, as fraction of checkpoint interval.")("Time spent flushing dirty buffers during checkpoint, as fraction of checkpoint interval."
)
,
2501 NULL((void*)0)
2502 },
2503 &CheckPointCompletionTarget,
2504 0.5, 0.0, 1.0,
2505 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2506 },
2507
2508 /* End-of-list marker */
2509 {
2510 {NULL((void*)0), 0, 0, NULL((void*)0), NULL((void*)0)}, NULL((void*)0), 0.0, 0.0, 0.0, NULL((void*)0), NULL((void*)0), NULL((void*)0)
2511 }
2512};
2513
2514
2515static struct config_string ConfigureNamesString[] =
2516{
2517 {
2518 {"archive_command", PGC_SIGHUP, WAL_ARCHIVING,
2519 gettext_noop("Sets the shell command that will be called to archive a WAL file.")("Sets the shell command that will be called to archive a WAL file."
)
,
2520 NULL((void*)0)
2521 },
2522 &XLogArchiveCommand,
2523 "",
2524 NULL((void*)0), NULL((void*)0), show_archive_command
2525 },
2526
2527 {
2528 {"client_encoding", PGC_USERSET, CLIENT_CONN_LOCALE,
2529 gettext_noop("Sets the client's character set encoding.")("Sets the client's character set encoding."),
2530 NULL((void*)0),
2531 GUC_IS_NAME0x0200 | GUC_REPORT0x0010
2532 },
2533 &client_encoding_string,
2534 "SQL_ASCII",
2535 check_client_encoding, assign_client_encoding, NULL((void*)0)
2536 },
2537
2538 {
2539 {"log_line_prefix", PGC_SIGHUP, LOGGING_WHAT,
2540 gettext_noop("Controls information prefixed to each log line.")("Controls information prefixed to each log line."),
2541 gettext_noop("If blank, no prefix is used.")("If blank, no prefix is used.")
2542 },
2543 &Log_line_prefix,
2544 "",
2545 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2546 },
2547
2548 {
2549 {"log_timezone", PGC_SIGHUP, LOGGING_WHAT,
2550 gettext_noop("Sets the time zone to use in log messages.")("Sets the time zone to use in log messages."),
2551 NULL((void*)0)
2552 },
2553 &log_timezone_string,
2554 NULL((void*)0),
2555 check_log_timezone, assign_log_timezone, show_log_timezone
2556 },
2557
2558 {
2559 {"DateStyle", PGC_USERSET, CLIENT_CONN_LOCALE,
2560 gettext_noop("Sets the display format for date and time values.")("Sets the display format for date and time values."),
2561 gettext_noop("Also controls interpretation of ambiguous "("Also controls interpretation of ambiguous " "date inputs.")
2562 "date inputs.")("Also controls interpretation of ambiguous " "date inputs."),
2563 GUC_LIST_INPUT0x0001 | GUC_REPORT0x0010
2564 },
2565 &datestyle_string,
2566 "ISO, MDY",
2567 check_datestyle, assign_datestyle, NULL((void*)0)
2568 },
2569
2570 {
2571 {"default_tablespace", PGC_USERSET, CLIENT_CONN_STATEMENT,
2572 gettext_noop("Sets the default tablespace to create tables and indexes in.")("Sets the default tablespace to create tables and indexes in."
)
,
2573 gettext_noop("An empty string selects the database's default tablespace.")("An empty string selects the database's default tablespace."
)
,
2574 GUC_IS_NAME0x0200
2575 },
2576 &default_tablespace,
2577 "",
2578 check_default_tablespace, NULL((void*)0), NULL((void*)0)
2579 },
2580
2581 {
2582 {"temp_tablespaces", PGC_USERSET, CLIENT_CONN_STATEMENT,
2583 gettext_noop("Sets the tablespace(s) to use for temporary tables and sort files.")("Sets the tablespace(s) to use for temporary tables and sort files."
)
,
2584 NULL((void*)0),
2585 GUC_LIST_INPUT0x0001 | GUC_LIST_QUOTE0x0002
2586 },
2587 &temp_tablespaces,
2588 "",
2589 check_temp_tablespaces, assign_temp_tablespaces, NULL((void*)0)
2590 },
2591
2592 {
2593 {"dynamic_library_path", PGC_SUSET, CLIENT_CONN_OTHER,
2594 gettext_noop("Sets the path for dynamically loadable modules.")("Sets the path for dynamically loadable modules."),
2595 gettext_noop("If a dynamically loadable module needs to be opened and "("If a dynamically loadable module needs to be opened and " "the specified name does not have a directory component (i.e., the "
"name does not contain a slash), the system will search this path for "
"the specified file.")
2596 "the specified name does not have a directory component (i.e., the "("If a dynamically loadable module needs to be opened and " "the specified name does not have a directory component (i.e., the "
"name does not contain a slash), the system will search this path for "
"the specified file.")
2597 "name does not contain a slash), the system will search this path for "("If a dynamically loadable module needs to be opened and " "the specified name does not have a directory component (i.e., the "
"name does not contain a slash), the system will search this path for "
"the specified file.")
2598 "the specified file.")("If a dynamically loadable module needs to be opened and " "the specified name does not have a directory component (i.e., the "
"name does not contain a slash), the system will search this path for "
"the specified file.")
,
2599 GUC_SUPERUSER_ONLY0x0100
2600 },
2601 &Dynamic_library_path,
2602 "$libdir",
2603 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2604 },
2605
2606 {
2607 {"krb_server_keyfile", PGC_SIGHUP, CONN_AUTH_SECURITY,
2608 gettext_noop("Sets the location of the Kerberos server key file.")("Sets the location of the Kerberos server key file."),
2609 NULL((void*)0),
2610 GUC_SUPERUSER_ONLY0x0100
2611 },
2612 &pg_krb_server_keyfile,
2613 PG_KRB_SRVTAB"",
2614 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2615 },
2616
2617 {
2618 {"krb_srvname", PGC_SIGHUP, CONN_AUTH_SECURITY,
2619 gettext_noop("Sets the name of the Kerberos service.")("Sets the name of the Kerberos service."),
2620 NULL((void*)0)
2621 },
2622 &pg_krb_srvnam,
2623 PG_KRB_SRVNAM"postgres",
2624 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2625 },
2626
2627 {
2628 {"bonjour_name", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
2629 gettext_noop("Sets the Bonjour service name.")("Sets the Bonjour service name."),
2630 NULL((void*)0)
2631 },
2632 &bonjour_name,
2633 "",
2634 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2635 },
2636
2637 /* See main.c about why defaults for LC_foo are not all alike */
2638
2639 {
2640 {"lc_collate", PGC_INTERNAL, CLIENT_CONN_LOCALE,
2641 gettext_noop("Shows the collation order locale.")("Shows the collation order locale."),
2642 NULL((void*)0),
2643 GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2644 },
2645 &locale_collate,
2646 "C",
2647 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2648 },
2649
2650 {
2651 {"lc_ctype", PGC_INTERNAL, CLIENT_CONN_LOCALE,
2652 gettext_noop("Shows the character classification and case conversion locale.")("Shows the character classification and case conversion locale."
)
,
2653 NULL((void*)0),
2654 GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2655 },
2656 &locale_ctype,
2657 "C",
2658 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2659 },
2660
2661 {
2662 {"lc_messages", PGC_SUSET, CLIENT_CONN_LOCALE,
2663 gettext_noop("Sets the language in which messages are displayed.")("Sets the language in which messages are displayed."),
2664 NULL((void*)0)
2665 },
2666 &locale_messages,
2667 "",
2668 check_locale_messages, assign_locale_messages, NULL((void*)0)
2669 },
2670
2671 {
2672 {"lc_monetary", PGC_USERSET, CLIENT_CONN_LOCALE,
2673 gettext_noop("Sets the locale for formatting monetary amounts.")("Sets the locale for formatting monetary amounts."),
2674 NULL((void*)0)
2675 },
2676 &locale_monetary,
2677 "C",
2678 check_locale_monetary, assign_locale_monetary, NULL((void*)0)
2679 },
2680
2681 {
2682 {"lc_numeric", PGC_USERSET, CLIENT_CONN_LOCALE,
2683 gettext_noop("Sets the locale for formatting numbers.")("Sets the locale for formatting numbers."),
2684 NULL((void*)0)
2685 },
2686 &locale_numeric,
2687 "C",
2688 check_locale_numeric, assign_locale_numeric, NULL((void*)0)
2689 },
2690
2691 {
2692 {"lc_time", PGC_USERSET, CLIENT_CONN_LOCALE,
2693 gettext_noop("Sets the locale for formatting date and time values.")("Sets the locale for formatting date and time values."),
2694 NULL((void*)0)
2695 },
2696 &locale_time,
2697 "C",
2698 check_locale_time, assign_locale_time, NULL((void*)0)
2699 },
2700
2701 {
2702 {"shared_preload_libraries", PGC_POSTMASTER, RESOURCES_KERNEL,
2703 gettext_noop("Lists shared libraries to preload into server.")("Lists shared libraries to preload into server."),
2704 NULL((void*)0),
2705 GUC_LIST_INPUT0x0001 | GUC_LIST_QUOTE0x0002 | GUC_SUPERUSER_ONLY0x0100
2706 },
2707 &shared_preload_libraries_string,
2708 "",
2709 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2710 },
2711
2712 {
2713 {"local_preload_libraries", PGC_BACKEND, CLIENT_CONN_OTHER,
2714 gettext_noop("Lists shared libraries to preload into each backend.")("Lists shared libraries to preload into each backend."),
2715 NULL((void*)0),
2716 GUC_LIST_INPUT0x0001 | GUC_LIST_QUOTE0x0002
2717 },
2718 &local_preload_libraries_string,
2719 "",
2720 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2721 },
2722
2723 {
2724 {"search_path", PGC_USERSET, CLIENT_CONN_STATEMENT,
2725 gettext_noop("Sets the schema search order for names that are not schema-qualified.")("Sets the schema search order for names that are not schema-qualified."
)
,
2726 NULL((void*)0),
2727 GUC_LIST_INPUT0x0001 | GUC_LIST_QUOTE0x0002
2728 },
2729 &namespace_search_path,
2730 "\"$user\",public",
2731 check_search_path, assign_search_path, NULL((void*)0)
2732 },
2733
2734 {
2735 /* Can't be set in postgresql.conf */
2736 {"server_encoding", PGC_INTERNAL, CLIENT_CONN_LOCALE,
2737 gettext_noop("Sets the server (database) character set encoding.")("Sets the server (database) character set encoding."),
2738 NULL((void*)0),
2739 GUC_IS_NAME0x0200 | GUC_REPORT0x0010 | GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2740 },
2741 &server_encoding_string,
2742 "SQL_ASCII",
2743 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2744 },
2745
2746 {
2747 /* Can't be set in postgresql.conf */
2748 {"server_version", PGC_INTERNAL, PRESET_OPTIONS,
2749 gettext_noop("Shows the server version.")("Shows the server version."),
2750 NULL((void*)0),
2751 GUC_REPORT0x0010 | GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2752 },
2753 &server_version_string,
2754 PG_VERSION"9.1rc1",
2755 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2756 },
2757
2758 {
2759 /* Not for general use --- used by SET ROLE */
2760 {"role", PGC_USERSET, UNGROUPED,
2761 gettext_noop("Sets the current role.")("Sets the current role."),
2762 NULL((void*)0),
2763 GUC_IS_NAME0x0200 | GUC_NO_SHOW_ALL0x0004 | GUC_NO_RESET_ALL0x0008 | GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040 | GUC_NOT_WHILE_SEC_REST0x8000
2764 },
2765 &role_string,
2766 "none",
2767 check_role, assign_role, show_role
2768 },
2769
2770 {
2771 /* Not for general use --- used by SET SESSION AUTHORIZATION */
2772 {"session_authorization", PGC_USERSET, UNGROUPED,
2773 gettext_noop("Sets the session user name.")("Sets the session user name."),
2774 NULL((void*)0),
2775 GUC_IS_NAME0x0200 | GUC_REPORT0x0010 | GUC_NO_SHOW_ALL0x0004 | GUC_NO_RESET_ALL0x0008 | GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040 | GUC_NOT_WHILE_SEC_REST0x8000
2776 },
2777 &session_authorization_string,
2778 NULL((void*)0),
2779 check_session_authorization, assign_session_authorization, NULL((void*)0)
2780 },
2781
2782 {
2783 {"log_destination", PGC_SIGHUP, LOGGING_WHERE,
2784 gettext_noop("Sets the destination for server log output.")("Sets the destination for server log output."),
2785 gettext_noop("Valid values are combinations of \"stderr\", "("Valid values are combinations of \"stderr\", " "\"syslog\", \"csvlog\", and \"eventlog\", "
"depending on the platform.")
2786 "\"syslog\", \"csvlog\", and \"eventlog\", "("Valid values are combinations of \"stderr\", " "\"syslog\", \"csvlog\", and \"eventlog\", "
"depending on the platform.")
2787 "depending on the platform.")("Valid values are combinations of \"stderr\", " "\"syslog\", \"csvlog\", and \"eventlog\", "
"depending on the platform.")
,
2788 GUC_LIST_INPUT0x0001
2789 },
2790 &log_destination_string,
2791 "stderr",
2792 check_log_destination, assign_log_destination, NULL((void*)0)
2793 },
2794 {
2795 {"log_directory", PGC_SIGHUP, LOGGING_WHERE,
2796 gettext_noop("Sets the destination directory for log files.")("Sets the destination directory for log files."),
2797 gettext_noop("Can be specified as relative to the data directory "("Can be specified as relative to the data directory " "or as absolute path."
)
2798 "or as absolute path.")("Can be specified as relative to the data directory " "or as absolute path."
)
,
2799 GUC_SUPERUSER_ONLY0x0100
2800 },
2801 &Log_directory,
2802 "pg_log",
2803 check_canonical_path, NULL((void*)0), NULL((void*)0)
2804 },
2805 {
2806 {"log_filename", PGC_SIGHUP, LOGGING_WHERE,
2807 gettext_noop("Sets the file name pattern for log files.")("Sets the file name pattern for log files."),
2808 NULL((void*)0),
2809 GUC_SUPERUSER_ONLY0x0100
2810 },
2811 &Log_filename,
2812 "postgresql-%Y-%m-%d_%H%M%S.log",
2813 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2814 },
2815
2816 {
2817 {"syslog_ident", PGC_SIGHUP, LOGGING_WHERE,
2818 gettext_noop("Sets the program name used to identify PostgreSQL "("Sets the program name used to identify PostgreSQL " "messages in syslog."
)
2819 "messages in syslog.")("Sets the program name used to identify PostgreSQL " "messages in syslog."
)
,
2820 NULL((void*)0)
2821 },
2822 &syslog_ident_str,
2823 "postgres",
2824 NULL((void*)0), assign_syslog_ident, NULL((void*)0)
2825 },
2826
2827 {
2828 {"TimeZone", PGC_USERSET, CLIENT_CONN_LOCALE,
2829 gettext_noop("Sets the time zone for displaying and interpreting time stamps.")("Sets the time zone for displaying and interpreting time stamps."
)
,
2830 NULL((void*)0),
2831 GUC_REPORT0x0010
2832 },
2833 &timezone_string,
2834 NULL((void*)0),
2835 check_timezone, assign_timezone, show_timezone
2836 },
2837 {
2838 {"timezone_abbreviations", PGC_USERSET, CLIENT_CONN_LOCALE,
2839 gettext_noop("Selects a file of time zone abbreviations.")("Selects a file of time zone abbreviations."),
2840 NULL((void*)0)
2841 },
2842 &timezone_abbreviations_string,
2843 NULL((void*)0),
2844 check_timezone_abbreviations, assign_timezone_abbreviations, NULL((void*)0)
2845 },
2846
2847 {
2848 {"transaction_isolation", PGC_USERSET, CLIENT_CONN_STATEMENT,
2849 gettext_noop("Sets the current transaction's isolation level.")("Sets the current transaction's isolation level."),
2850 NULL((void*)0),
2851 GUC_NO_RESET_ALL0x0008 | GUC_NOT_IN_SAMPLE0x0020 | GUC_DISALLOW_IN_FILE0x0040
2852 },
2853 &XactIsoLevel_string,
2854 "default",
2855 check_XactIsoLevel, assign_XactIsoLevel, show_XactIsoLevel
2856 },
2857
2858 {
2859 {"unix_socket_group", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
2860 gettext_noop("Sets the owning group of the Unix-domain socket.")("Sets the owning group of the Unix-domain socket."),
2861 gettext_noop("The owning user of the socket is always the user "("The owning user of the socket is always the user " "that starts the server."
)
2862 "that starts the server.")("The owning user of the socket is always the user " "that starts the server."
)
2863 },
2864 &Unix_socket_group,
2865 "",
2866 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2867 },
2868
2869 {
2870 {"unix_socket_directory", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
2871 gettext_noop("Sets the directory where the Unix-domain socket will be created.")("Sets the directory where the Unix-domain socket will be created."
)
,
2872 NULL((void*)0),
2873 GUC_SUPERUSER_ONLY0x0100
2874 },
2875 &UnixSocketDir,
2876 "",
2877 check_canonical_path, NULL((void*)0), NULL((void*)0)
2878 },
2879
2880 {
2881 {"listen_addresses", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
2882 gettext_noop("Sets the host name or IP address(es) to listen to.")("Sets the host name or IP address(es) to listen to."),
2883 NULL((void*)0),
2884 GUC_LIST_INPUT0x0001
2885 },
2886 &ListenAddresses,
2887 "localhost",
2888 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2889 },
2890
2891 {
2892 {"custom_variable_classes", PGC_SIGHUP, CUSTOM_OPTIONS,
2893 gettext_noop("Sets the list of known custom variable classes.")("Sets the list of known custom variable classes."),
2894 NULL((void*)0),
2895 GUC_LIST_INPUT0x0001 | GUC_LIST_QUOTE0x0002
2896 },
2897 &custom_variable_classes,
2898 NULL((void*)0),
2899 check_custom_variable_classes, NULL((void*)0), NULL((void*)0)
2900 },
2901
2902 {
2903 {"data_directory", PGC_POSTMASTER, FILE_LOCATIONS,
2904 gettext_noop("Sets the server's data directory.")("Sets the server's data directory."),
2905 NULL((void*)0),
2906 GUC_SUPERUSER_ONLY0x0100
2907 },
2908 &data_directory,
2909 NULL((void*)0),
2910 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2911 },
2912
2913 {
2914 {"config_file", PGC_POSTMASTER, FILE_LOCATIONS,
2915 gettext_noop("Sets the server's main configuration file.")("Sets the server's main configuration file."),
2916 NULL((void*)0),
2917 GUC_DISALLOW_IN_FILE0x0040 | GUC_SUPERUSER_ONLY0x0100
2918 },
2919 &ConfigFileName,
2920 NULL((void*)0),
2921 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2922 },
2923
2924 {
2925 {"hba_file", PGC_POSTMASTER, FILE_LOCATIONS,
2926 gettext_noop("Sets the server's \"hba\" configuration file.")("Sets the server's \"hba\" configuration file."),
2927 NULL((void*)0),
2928 GUC_SUPERUSER_ONLY0x0100
2929 },
2930 &HbaFileName,
2931 NULL((void*)0),
2932 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2933 },
2934
2935 {
2936 {"ident_file", PGC_POSTMASTER, FILE_LOCATIONS,
2937 gettext_noop("Sets the server's \"ident\" configuration file.")("Sets the server's \"ident\" configuration file."),
2938 NULL((void*)0),
2939 GUC_SUPERUSER_ONLY0x0100
2940 },
2941 &IdentFileName,
2942 NULL((void*)0),
2943 NULL((void*)0), NULL((void*)0), NULL((void*)0)
2944 },
2945
2946 {
2947 {"external_pid_file", PGC_POSTMASTER, FILE_LOCATIONS,
2948 gettext_noop("Writes the postmaster PID to the specified file.")("Writes the postmaster PID to the specified file."),
2949 NULL((void*)0),
2950 GUC_SUPERUSER_ONLY0x0100
2951 },
2952 &external_pid_file,
2953 NULL((void*)0),
2954 check_canonical_path, NULL((void*)0), NULL((void*)0)
2955 },
2956
2957 {
2958 {"stats_temp_directory", PGC_SIGHUP, STATS_COLLECTOR,
2959 gettext_noop("Writes temporary statistics files to the specified directory.")("Writes temporary statistics files to the specified directory."
)
,
2960 NULL((void*)0),
2961 GUC_SUPERUSER_ONLY0x0100
2962 },
2963 &pgstat_temp_directory,
2964 "pg_stat_tmp",
2965 check_canonical_path, assign_pgstat_temp_directory, NULL((void*)0)
2966 },
2967
2968 {
2969 {"synchronous_standby_names", PGC_SIGHUP, REPLICATION_MASTER,
2970 gettext_noop("List of names of potential synchronous standbys.")("List of names of potential synchronous standbys."),
2971 NULL((void*)0),
2972 GUC_LIST_INPUT0x0001
2973 },
2974 &SyncRepStandbyNames,
2975 "",
2976 check_synchronous_standby_names, NULL((void*)0), NULL((void*)0)
2977 },
2978
2979 {
2980 {"default_text_search_config", PGC_USERSET, CLIENT_CONN_LOCALE,
2981 gettext_noop("Sets default text search configuration.")("Sets default text search configuration."),
2982 NULL((void*)0)
2983 },
2984 &TSCurrentConfig,
2985 "pg_catalog.simple",
2986 check_TSCurrentConfig, assign_TSCurrentConfig, NULL((void*)0)
2987 },
2988
2989 {
2990 {"ssl_ciphers", PGC_POSTMASTER, CONN_AUTH_SECURITY,
2991 gettext_noop("Sets the list of allowed SSL ciphers.")("Sets the list of allowed SSL ciphers."),
2992 NULL((void*)0),
2993 GUC_SUPERUSER_ONLY0x0100
2994 },
2995 &SSLCipherSuites,
2996#ifdef USE_SSL
2997 "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH",
2998#else
2999 "none",
3000#endif
3001 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3002 },
3003
3004 {
3005 {"application_name", PGC_USERSET, LOGGING_WHAT,
3006 gettext_noop("Sets the application name to be reported in statistics and logs.")("Sets the application name to be reported in statistics and logs."
)
,
3007 NULL((void*)0),
3008 GUC_IS_NAME0x0200 | GUC_REPORT0x0010 | GUC_NOT_IN_SAMPLE0x0020
3009 },
3010 &application_name,
3011 "",
3012 check_application_name, assign_application_name, NULL((void*)0)
3013 },
3014
3015 /* End-of-list marker */
3016 {
3017 {NULL((void*)0), 0, 0, NULL((void*)0), NULL((void*)0)}, NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0)
3018 }
3019};
3020
3021
3022static struct config_enum ConfigureNamesEnum[] =
3023{
3024 {
3025 {"backslash_quote", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
3026 gettext_noop("Sets whether \"\\'\" is allowed in string literals.")("Sets whether \"\\'\" is allowed in string literals."),
3027 NULL((void*)0)
3028 },
3029 &backslash_quote,
3030 BACKSLASH_QUOTE_SAFE_ENCODING, backslash_quote_options,
3031 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3032 },
3033
3034 {
3035 {"bytea_output", PGC_USERSET, CLIENT_CONN_STATEMENT,
3036 gettext_noop("Sets the output format for bytea.")("Sets the output format for bytea."),
3037 NULL((void*)0)
3038 },
3039 &bytea_output,
3040 BYTEA_OUTPUT_HEX, bytea_output_options,
3041 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3042 },
3043
3044 {
3045 {"client_min_messages", PGC_USERSET, LOGGING_WHEN,
3046 gettext_noop("Sets the message levels that are sent to the client.")("Sets the message levels that are sent to the client."),
3047 gettext_noop("Each level includes all the levels that follow it. The later"("Each level includes all the levels that follow it. The later"
" the level, the fewer messages are sent.")
3048 " the level, the fewer messages are sent.")("Each level includes all the levels that follow it. The later"
" the level, the fewer messages are sent.")
3049 },
3050 &client_min_messages,
3051 NOTICE18, client_message_level_options,
3052 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3053 },
3054
3055 {
3056 {"constraint_exclusion", PGC_USERSET, QUERY_TUNING_OTHER,
3057 gettext_noop("Enables the planner to use constraints to optimize queries.")("Enables the planner to use constraints to optimize queries."
)
,
3058 gettext_noop("Table scans will be skipped if their constraints"("Table scans will be skipped if their constraints" " guarantee that no rows match the query."
)
3059 " guarantee that no rows match the query.")("Table scans will be skipped if their constraints" " guarantee that no rows match the query."
)
3060 },
3061 &constraint_exclusion,
3062 CONSTRAINT_EXCLUSION_PARTITION, constraint_exclusion_options,
3063 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3064 },
3065
3066 {
3067 {"default_transaction_isolation", PGC_USERSET, CLIENT_CONN_STATEMENT,
3068 gettext_noop("Sets the transaction isolation level of each new transaction.")("Sets the transaction isolation level of each new transaction."
)
,
3069 NULL((void*)0)
3070 },
3071 &DefaultXactIsoLevel,
3072 XACT_READ_COMMITTED1, isolation_level_options,
3073 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3074 },
3075
3076 {
3077 {"IntervalStyle", PGC_USERSET, CLIENT_CONN_LOCALE,
3078 gettext_noop("Sets the display format for interval values.")("Sets the display format for interval values."),
3079 NULL((void*)0),
3080 GUC_REPORT0x0010
3081 },
3082 &IntervalStyle,
3083 INTSTYLE_POSTGRES0, intervalstyle_options,
3084 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3085 },
3086
3087 {
3088 {"log_error_verbosity", PGC_SUSET, LOGGING_WHAT,
3089 gettext_noop("Sets the verbosity of logged messages.")("Sets the verbosity of logged messages."),
3090 NULL((void*)0)
3091 },
3092 &Log_error_verbosity,
3093 PGERROR_DEFAULT, log_error_verbosity_options,
3094 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3095 },
3096
3097 {
3098 {"log_min_messages", PGC_SUSET, LOGGING_WHEN,
3099 gettext_noop("Sets the message levels that are logged.")("Sets the message levels that are logged."),
3100 gettext_noop("Each level includes all the levels that follow it. The later"("Each level includes all the levels that follow it. The later"
" the level, the fewer messages are sent.")
3101 " the level, the fewer messages are sent.")("Each level includes all the levels that follow it. The later"
" the level, the fewer messages are sent.")
3102 },
3103 &log_min_messages,
3104 WARNING19, server_message_level_options,
3105 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3106 },
3107
3108 {
3109 {"log_min_error_statement", PGC_SUSET, LOGGING_WHEN,
3110 gettext_noop("Causes all statements generating error at or above this level to be logged.")("Causes all statements generating error at or above this level to be logged."
)
,
3111 gettext_noop("Each level includes all the levels that follow it. The later"("Each level includes all the levels that follow it. The later"
" the level, the fewer messages are sent.")
3112 " the level, the fewer messages are sent.")("Each level includes all the levels that follow it. The later"
" the level, the fewer messages are sent.")
3113 },
3114 &log_min_error_statement,
3115 ERROR20, server_message_level_options,
3116 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3117 },
3118
3119 {
3120 {"log_statement", PGC_SUSET, LOGGING_WHAT,
3121 gettext_noop("Sets the type of statements logged.")("Sets the type of statements logged."),
3122 NULL((void*)0)
3123 },
3124 &log_statement,
3125 LOGSTMT_NONE, log_statement_options,
3126 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3127 },
3128
3129 {
3130 {"syslog_facility", PGC_SIGHUP, LOGGING_WHERE,
3131 gettext_noop("Sets the syslog \"facility\" to be used when syslog enabled.")("Sets the syslog \"facility\" to be used when syslog enabled."
)
,
3132 NULL((void*)0)
3133 },
3134 &syslog_facility,
3135#ifdef HAVE_SYSLOG1
3136 LOG_LOCAL0(16<<3),
3137#else
3138 0,
3139#endif
3140 syslog_facility_options,
3141 NULL((void*)0), assign_syslog_facility, NULL((void*)0)
3142 },
3143
3144 {
3145 {"session_replication_role", PGC_SUSET, CLIENT_CONN_STATEMENT,
3146 gettext_noop("Sets the session's behavior for triggers and rewrite rules.")("Sets the session's behavior for triggers and rewrite rules."
)
,
3147 NULL((void*)0)
3148 },
3149 &SessionReplicationRole,
3150 SESSION_REPLICATION_ROLE_ORIGIN0, session_replication_role_options,
3151 NULL((void*)0), assign_session_replication_role, NULL((void*)0)
3152 },
3153
3154 {
3155 {"synchronous_commit", PGC_USERSET, WAL_SETTINGS,
3156 gettext_noop("Sets the current transaction's synchronization level.")("Sets the current transaction's synchronization level."),
3157 NULL((void*)0)
3158 },
3159 &synchronous_commit,
3160 SYNCHRONOUS_COMMIT_ONSYNCHRONOUS_COMMIT_REMOTE_FLUSH, synchronous_commit_options,
3161 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3162 },
3163
3164 {
3165 {"trace_recovery_messages", PGC_SIGHUP, DEVELOPER_OPTIONS,
3166 gettext_noop("Enables logging of recovery-related debugging information.")("Enables logging of recovery-related debugging information."
)
,
3167 gettext_noop("Each level includes all the levels that follow it. The later"("Each level includes all the levels that follow it. The later"
" the level, the fewer messages are sent.")
3168 " the level, the fewer messages are sent.")("Each level includes all the levels that follow it. The later"
" the level, the fewer messages are sent.")
3169 },
3170 &trace_recovery_messages,
3171
3172 /*
3173 * client_message_level_options allows too many values, really, but
3174 * it's not worth having a separate options array for this.
3175 */
3176 LOG15, client_message_level_options,
3177 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3178 },
3179
3180 {
3181 {"track_functions", PGC_SUSET, STATS_COLLECTOR,
3182 gettext_noop("Collects function-level statistics on database activity.")("Collects function-level statistics on database activity."),
3183 NULL((void*)0)
3184 },
3185 &pgstat_track_functions,
3186 TRACK_FUNC_OFF, track_function_options,
3187 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3188 },
3189
3190 {
3191 {"wal_level", PGC_POSTMASTER, WAL_SETTINGS,
3192 gettext_noop("Set the level of information written to the WAL.")("Set the level of information written to the WAL."),
3193 NULL((void*)0)
3194 },
3195 &wal_level,
3196 WAL_LEVEL_MINIMAL, wal_level_options,
3197 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3198 },
3199
3200 {
3201 {"wal_sync_method", PGC_SIGHUP, WAL_SETTINGS,
3202 gettext_noop("Selects the method used for forcing WAL updates to disk.")("Selects the method used for forcing WAL updates to disk."),
3203 NULL((void*)0)
3204 },
3205 &sync_method,
3206 DEFAULT_SYNC_METHOD4, sync_method_options,
3207 NULL((void*)0), assign_xlog_sync_method, NULL((void*)0)
3208 },
3209
3210 {
3211 {"xmlbinary", PGC_USERSET, CLIENT_CONN_STATEMENT,
3212 gettext_noop("Sets how binary values are to be encoded in XML.")("Sets how binary values are to be encoded in XML."),
3213 NULL((void*)0)
3214 },
3215 &xmlbinary,
3216 XMLBINARY_BASE64, xmlbinary_options,
3217 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3218 },
3219
3220 {
3221 {"xmloption", PGC_USERSET, CLIENT_CONN_STATEMENT,
3222 gettext_noop("Sets whether XML data in implicit parsing and serialization "("Sets whether XML data in implicit parsing and serialization "
"operations is to be considered as documents or content fragments."
)
3223 "operations is to be considered as documents or content fragments.")("Sets whether XML data in implicit parsing and serialization "
"operations is to be considered as documents or content fragments."
)
,
3224 NULL((void*)0)
3225 },
3226 &xmloption,
3227 XMLOPTION_CONTENT, xmloption_options,
3228 NULL((void*)0), NULL((void*)0), NULL((void*)0)
3229 },
3230
3231
3232 /* End-of-list marker */
3233 {
3234 {NULL((void*)0), 0, 0, NULL((void*)0), NULL((void*)0)}, NULL((void*)0), 0, NULL((void*)0), NULL((void*)0), NULL((void*)0), NULL((void*)0)
3235 }
3236};
3237
3238/******** end of options list ********/
3239
3240
3241/*
3242 * To allow continued support of obsolete names for GUC variables, we apply
3243 * the following mappings to any unrecognized name. Note that an old name
3244 * should be mapped to a new one only if the new variable has very similar
3245 * semantics to the old.
3246 */
3247static const char *const map_old_guc_names[] = {
3248 "sort_mem", "work_mem",
3249 "vacuum_mem", "maintenance_work_mem",
3250 NULL((void*)0)
3251};
3252
3253
3254/*
3255 * Actual lookup of variables is done through this single, sorted array.
3256 */
3257static struct config_generic **guc_variables;
3258
3259/* Current number of variables contained in the vector */
3260static int num_guc_variables;
3261
3262/* Vector capacity */
3263static int size_guc_variables;
3264
3265
3266static bool guc_dirty; /* TRUE if need to do commit/abort work */
3267
3268static bool reporting_enabled; /* TRUE to enable GUC_REPORT */
3269
3270static int GUCNestLevel = 0; /* 1 when in main transaction */
3271
3272
3273static int guc_var_compare(const void *a, const void *b);
3274static int guc_name_compare(const char *namea, const char *nameb);
3275static void InitializeGUCOptionsFromEnvironment(void);
3276static void InitializeOneGUCOption(struct config_generic * gconf);
3277static void push_old_value(struct config_generic * gconf, GucAction action);
3278static void ReportGUCOption(struct config_generic * record);
3279static void ShowGUCConfigOption(const char *name, DestReceiver *dest);
3280static void ShowAllGUCConfig(DestReceiver *dest);
3281static char *_ShowOption(struct config_generic * record, bool use_units);
3282static bool validate_option_array_item(const char *name, const char *value,
3283 bool skipIfNoPermissions);
3284
3285
3286/*
3287 * Some infrastructure for checking malloc/strdup/realloc calls
3288 */
3289static void *
3290guc_malloc(int elevel, size_t size)
3291{
3292 void *data;
3293
3294 data = malloc(size);
3295 if (data == NULL((void*)0))
3296 ereport(elevel,(errstart(elevel, "guc.c", 3298, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('3') - '0') &
0x3F) << 6) + (((('2') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('0') - '0')
& 0x3F) << 24))), errmsg("out of memory"))) : (void
) 0)
3297 (errcode(ERRCODE_OUT_OF_MEMORY),(errstart(elevel, "guc.c", 3298, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('3') - '0') &
0x3F) << 6) + (((('2') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('0') - '0')
& 0x3F) << 24))), errmsg("out of memory"))) : (void
) 0)
3298 errmsg("out of memory")))(errstart(elevel, "guc.c", 3298, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('3') - '0') &
0x3F) << 6) + (((('2') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('0') - '0')
& 0x3F) << 24))), errmsg("out of memory"))) : (void
) 0)
;
3299 return data;
3300}
3301
3302static void *
3303guc_realloc(int elevel, void *old, size_t size)
3304{
3305 void *data;
3306
3307 data = realloc(old, size);
3308 if (data == NULL((void*)0))
3309 ereport(elevel,(errstart(elevel, "guc.c", 3311, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('3') - '0') &
0x3F) << 6) + (((('2') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('0') - '0')
& 0x3F) << 24))), errmsg("out of memory"))) : (void
) 0)
3310 (errcode(ERRCODE_OUT_OF_MEMORY),(errstart(elevel, "guc.c", 3311, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('3') - '0') &
0x3F) << 6) + (((('2') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('0') - '0')
& 0x3F) << 24))), errmsg("out of memory"))) : (void
) 0)
3311 errmsg("out of memory")))(errstart(elevel, "guc.c", 3311, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('3') - '0') &
0x3F) << 6) + (((('2') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('0') - '0')
& 0x3F) << 24))), errmsg("out of memory"))) : (void
) 0)
;
3312 return data;
3313}
3314
3315static char *
3316guc_strdup(int elevel, const char *src)
3317{
3318 char *data;
3319
3320 data = strdup(src);
3321 if (data == NULL((void*)0))
3322 ereport(elevel,(errstart(elevel, "guc.c", 3324, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('3') - '0') &
0x3F) << 6) + (((('2') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('0') - '0')
& 0x3F) << 24))), errmsg("out of memory"))) : (void
) 0)
3323 (errcode(ERRCODE_OUT_OF_MEMORY),(errstart(elevel, "guc.c", 3324, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('3') - '0') &
0x3F) << 6) + (((('2') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('0') - '0')
& 0x3F) << 24))), errmsg("out of memory"))) : (void
) 0)
3324 errmsg("out of memory")))(errstart(elevel, "guc.c", 3324, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('3') - '0') &
0x3F) << 6) + (((('2') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('0') - '0')
& 0x3F) << 24))), errmsg("out of memory"))) : (void
) 0)
;
3325 return data;
3326}
3327
3328
3329/*
3330 * Detect whether strval is referenced anywhere in a GUC string item
3331 */
3332static bool
3333string_field_used(struct config_string * conf, char *strval)
3334{
3335 GucStack *stack;
3336
3337 if (strval == *(conf->variable) ||
3338 strval == conf->reset_val ||
3339 strval == conf->boot_val)
3340 return true((bool) 1);
3341 for (stack = conf->gen.stack; stack; stack = stack->prev)
3342 {
3343 if (strval == stack->prior.val.stringval ||
3344 strval == stack->masked.val.stringval)
3345 return true((bool) 1);
3346 }
3347 return false((bool) 0);
3348}
3349
3350/*
3351 * Support for assigning to a field of a string GUC item. Free the prior
3352 * value if it's not referenced anywhere else in the item (including stacked
3353 * states).
3354 */
3355static void
3356set_string_field(struct config_string * conf, char **field, char *newval)
3357{
3358 char *oldval = *field;
3359
3360 /* Do the assignment */
3361 *field = newval;
3362
3363 /* Free old value if it's not NULL and isn't referenced anymore */
3364 if (oldval && !string_field_used(conf, oldval))
3365 free(oldval);
3366}
3367
3368/*
3369 * Detect whether an "extra" struct is referenced anywhere in a GUC item
3370 */
3371static bool
3372extra_field_used(struct config_generic * gconf, void *extra)
3373{
3374 GucStack *stack;
3375
3376 if (extra == gconf->extra)
3377 return true((bool) 1);
3378 switch (gconf->vartype)
3379 {
3380 case PGC_BOOL:
3381 if (extra == ((struct config_bool *) gconf)->reset_extra)
3382 return true((bool) 1);
3383 break;
3384 case PGC_INT:
3385 if (extra == ((struct config_int *) gconf)->reset_extra)
3386 return true((bool) 1);
3387 break;
3388 case PGC_REAL:
3389 if (extra == ((struct config_real *) gconf)->reset_extra)
3390 return true((bool) 1);
3391 break;
3392 case PGC_STRING:
3393 if (extra == ((struct config_string *) gconf)->reset_extra)
3394 return true((bool) 1);
3395 break;
3396 case PGC_ENUM:
3397 if (extra == ((struct config_enum *) gconf)->reset_extra)
3398 return true((bool) 1);
3399 break;
3400 }
3401 for (stack = gconf->stack; stack; stack = stack->prev)
3402 {
3403 if (extra == stack->prior.extra ||
3404 extra == stack->masked.extra)
3405 return true((bool) 1);
3406 }
3407
3408 return false((bool) 0);
3409}
3410
3411/*
3412 * Support for assigning to an "extra" field of a GUC item. Free the prior
3413 * value if it's not referenced anywhere else in the item (including stacked
3414 * states).
3415 */
3416static void
3417set_extra_field(struct config_generic * gconf, void **field, void *newval)
3418{
3419 void *oldval = *field;
3420
3421 /* Do the assignment */
3422 *field = newval;
3423
3424 /* Free old value if it's not NULL and isn't referenced anymore */
3425 if (oldval && !extra_field_used(gconf, oldval))
3426 free(oldval);
3427}
3428
3429/*
3430 * Support for copying a variable's active value into a stack entry.
3431 * The "extra" field associated with the active value is copied, too.
3432 *
3433 * NB: be sure stringval and extra fields of a new stack entry are
3434 * initialized to NULL before this is used, else we'll try to free() them.
3435 */
3436static void
3437set_stack_value(struct config_generic * gconf, config_var_value *val)
3438{
3439 switch (gconf->vartype)
3440 {
3441 case PGC_BOOL:
3442 val->val.boolval =
3443 *((struct config_bool *) gconf)->variable;
3444 break;
3445 case PGC_INT:
3446 val->val.intval =
3447 *((struct config_int *) gconf)->variable;
3448 break;
3449 case PGC_REAL:
3450 val->val.realval =
3451 *((struct config_real *) gconf)->variable;
3452 break;
3453 case PGC_STRING:
3454 set_string_field((struct config_string *) gconf,
3455 &(val->val.stringval),
3456 *((struct config_string *) gconf)->variable);
3457 break;
3458 case PGC_ENUM:
3459 val->val.enumval =
3460 *((struct config_enum *) gconf)->variable;
3461 break;
3462 }
3463 set_extra_field(gconf, &(val->extra), gconf->extra);
3464}
3465
3466/*
3467 * Support for discarding a no-longer-needed value in a stack entry.
3468 * The "extra" field associated with the stack entry is cleared, too.
3469 */
3470static void
3471discard_stack_value(struct config_generic * gconf, config_var_value *val)
3472{
3473 switch (gconf->vartype)
3474 {
3475 case PGC_BOOL:
3476 case PGC_INT:
3477 case PGC_REAL:
3478 case PGC_ENUM:
3479 /* no need to do anything */
3480 break;
3481 case PGC_STRING:
3482 set_string_field((struct config_string *) gconf,
3483 &(val->val.stringval),
3484 NULL((void*)0));
3485 break;
3486 }
3487 set_extra_field(gconf, &(val->extra), NULL((void*)0));
3488}
3489
3490
3491/*
3492 * Fetch the sorted array pointer (exported for help_config.c's use ONLY)
3493 */
3494struct config_generic **
3495get_guc_variables(void)
3496{
3497 return guc_variables;
3498}
3499
3500
3501/*
3502 * Build the sorted array. This is split out so that it could be
3503 * re-executed after startup (eg, we could allow loadable modules to
3504 * add vars, and then we'd need to re-sort).
3505 */
3506void
3507build_guc_variables(void)
3508{
3509 int size_vars;
3510 int num_vars = 0;
3511 struct config_generic **guc_vars;
3512 int i;
3513
3514 for (i = 0; ConfigureNamesBool[i].gen.name; i++)
3515 {
3516 struct config_bool *conf = &ConfigureNamesBool[i];
3517
3518 /* Rather than requiring vartype to be filled in by hand, do this: */
3519 conf->gen.vartype = PGC_BOOL;
3520 num_vars++;
3521 }
3522
3523 for (i = 0; ConfigureNamesInt[i].gen.name; i++)
3524 {
3525 struct config_int *conf = &ConfigureNamesInt[i];
3526
3527 conf->gen.vartype = PGC_INT;
3528 num_vars++;
3529 }
3530
3531 for (i = 0; ConfigureNamesReal[i].gen.name; i++)
3532 {
3533 struct config_real *conf = &ConfigureNamesReal[i];
3534
3535 conf->gen.vartype = PGC_REAL;
3536 num_vars++;
3537 }
3538
3539 for (i = 0; ConfigureNamesString[i].gen.name; i++)
3540 {
3541 struct config_string *conf = &ConfigureNamesString[i];
3542
3543 conf->gen.vartype = PGC_STRING;
3544 num_vars++;
3545 }
3546
3547 for (i = 0; ConfigureNamesEnum[i].gen.name; i++)
3548 {
3549 struct config_enum *conf = &ConfigureNamesEnum[i];
3550
3551 conf->gen.vartype = PGC_ENUM;
3552 num_vars++;
3553 }
3554
3555 /*
3556 * Create table with 20% slack
3557 */
3558 size_vars = num_vars + num_vars / 4;
3559
3560 guc_vars = (struct config_generic **)
3561 guc_malloc(FATAL21, size_vars * sizeof(struct config_generic *));
3562
3563 num_vars = 0;
3564
3565 for (i = 0; ConfigureNamesBool[i].gen.name; i++)
3566 guc_vars[num_vars++] = &ConfigureNamesBool[i].gen;
3567
3568 for (i = 0; ConfigureNamesInt[i].gen.name; i++)
3569 guc_vars[num_vars++] = &ConfigureNamesInt[i].gen;
3570
3571 for (i = 0; ConfigureNamesReal[i].gen.name; i++)
3572 guc_vars[num_vars++] = &ConfigureNamesReal[i].gen;
3573
3574 for (i = 0; ConfigureNamesString[i].gen.name; i++)
3575 guc_vars[num_vars++] = &ConfigureNamesString[i].gen;
3576
3577 for (i = 0; ConfigureNamesEnum[i].gen.name; i++)
3578 guc_vars[num_vars++] = &ConfigureNamesEnum[i].gen;
3579
3580 if (guc_variables)
3581 free(guc_variables);
3582 guc_variables = guc_vars;
3583 num_guc_variables = num_vars;
3584 size_guc_variables = size_vars;
3585 qsort((void *) guc_variables, num_guc_variables,pg_qsort((void *) guc_variables,num_guc_variables,sizeof(struct
config_generic *),guc_var_compare)
3586 sizeof(struct config_generic *), guc_var_compare)pg_qsort((void *) guc_variables,num_guc_variables,sizeof(struct
config_generic *),guc_var_compare)
;
3587}
3588
3589/*
3590 * Add a new GUC variable to the list of known variables. The
3591 * list is expanded if needed.
3592 */
3593static bool
3594add_guc_variable(struct config_generic * var, int elevel)
3595{
3596 if (num_guc_variables + 1 >= size_guc_variables)
3597 {
3598 /*
3599 * Increase the vector by 25%
3600 */
3601 int size_vars = size_guc_variables + size_guc_variables / 4;
3602 struct config_generic **guc_vars;
3603
3604 if (size_vars == 0)
3605 {
3606 size_vars = 100;
3607 guc_vars = (struct config_generic **)
3608 guc_malloc(elevel, size_vars * sizeof(struct config_generic *));
3609 }
3610 else
3611 {
3612 guc_vars = (struct config_generic **)
3613 guc_realloc(elevel, guc_variables, size_vars * sizeof(struct config_generic *));
3614 }
3615
3616 if (guc_vars == NULL((void*)0))
3617 return false((bool) 0); /* out of memory */
3618
3619 guc_variables = guc_vars;
3620 size_guc_variables = size_vars;
3621 }
3622 guc_variables[num_guc_variables++] = var;
3623 qsort((void *) guc_variables, num_guc_variables,pg_qsort((void *) guc_variables,num_guc_variables,sizeof(struct
config_generic *),guc_var_compare)
3624 sizeof(struct config_generic *), guc_var_compare)pg_qsort((void *) guc_variables,num_guc_variables,sizeof(struct
config_generic *),guc_var_compare)
;
3625 return true((bool) 1);
3626}
3627
3628/*
3629 * Create and add a placeholder variable. It's presumed to belong
3630 * to a valid custom variable class at this point.
3631 */
3632static struct config_generic *
3633add_placeholder_variable(const char *name, int elevel)
3634{
3635 size_t sz = sizeof(struct config_string) + sizeof(char *);
3636 struct config_string *var;
3637 struct config_generic *gen;
3638
3639 var = (struct config_string *) guc_malloc(elevel, sz);
3640 if (var == NULL((void*)0))
3641 return NULL((void*)0);
3642 memset(var, 0, sz)__builtin___memset_chk (var, 0, sz, __builtin_object_size (var
, 0))
;
3643 gen = &var->gen;
3644
3645 gen->name = guc_strdup(elevel, name);
3646 if (gen->name == NULL((void*)0))
3647 {
3648 free(var);
3649 return NULL((void*)0);
3650 }
3651
3652 gen->context = PGC_USERSET;
3653 gen->group = CUSTOM_OPTIONS;
3654 gen->short_desc = "GUC placeholder variable";
3655 gen->flags = GUC_NO_SHOW_ALL0x0004 | GUC_NOT_IN_SAMPLE0x0020 | GUC_CUSTOM_PLACEHOLDER0x0080;
3656 gen->vartype = PGC_STRING;
3657
3658 /*
3659 * The char* is allocated at the end of the struct since we have no
3660 * 'static' place to point to. Note that the current value, as well as
3661 * the boot and reset values, start out NULL.
3662 */
3663 var->variable = (char **) (var + 1);
3664
3665 if (!add_guc_variable((struct config_generic *) var, elevel))
3666 {
3667 free((void *) gen->name);
3668 free(var);
3669 return NULL((void*)0);
3670 }
3671
3672 return gen;
3673}
3674
3675/*
3676 * Detect whether the portion of "name" before dotPos matches any custom
3677 * variable class name listed in custom_var_classes. The latter must be
3678 * formatted the way that assign_custom_variable_classes does it, ie,
3679 * no whitespace. NULL is valid for custom_var_classes.
3680 */
3681static bool
3682is_custom_class(const char *name, int dotPos, const char *custom_var_classes)
3683{
3684 bool result = false((bool) 0);
3685 const char *ccs = custom_var_classes;
3686
3687 if (ccs != NULL((void*)0))
3688 {
3689 const char *start = ccs;
3690
3691 for (;; ++ccs)
3692 {
3693 char c = *ccs;
3694
3695 if (c == '\0' || c == ',')
3696 {
3697 if (dotPos == ccs - start && strncmp(start, name, dotPos) == 0)
3698 {
3699 result = true((bool) 1);
3700 break;
3701 }
3702 if (c == '\0')
3703 break;
3704 start = ccs + 1;
3705 }
3706 }
3707 }
3708 return result;
3709}
3710
3711/*
3712 * Look up option NAME. If it exists, return a pointer to its record,
3713 * else return NULL. If create_placeholders is TRUE, we'll create a
3714 * placeholder record for a valid-looking custom variable name.
3715 */
3716static struct config_generic *
3717find_option(const char *name, bool create_placeholders, int elevel)
3718{
3719 const char **key = &name;
3720 struct config_generic **res;
3721 int i;
3722
3723 Assert(name)do { if ((!(name))) ExceptionalCondition("!(name)", ("FailedAssertion"
), "guc.c", 3723); } while (0)
;
3724
3725 /*
3726 * By equating const char ** with struct config_generic *, we are assuming
3727 * the name field is first in config_generic.
3728 */
3729 res = (struct config_generic **) bsearch((void *) &key,
3730 (void *) guc_variables,
3731 num_guc_variables,
3732 sizeof(struct config_generic *),
3733 guc_var_compare);
3734 if (res)
3735 return *res;
3736
3737 /*
3738 * See if the name is an obsolete name for a variable. We assume that the
3739 * set of supported old names is short enough that a brute-force search is
3740 * the best way.
3741 */
3742 for (i = 0; map_old_guc_names[i] != NULL((void*)0); i += 2)
3743 {
3744 if (guc_name_compare(name, map_old_guc_names[i]) == 0)
3745 return find_option(map_old_guc_names[i + 1], false((bool) 0), elevel);
3746 }
3747
3748 if (create_placeholders)
3749 {
3750 /*
3751 * Check if the name is qualified, and if so, check if the qualifier
3752 * matches any custom variable class. If so, add a placeholder.
3753 */
3754 const char *dot = strchr(name, GUC_QUALIFIER_SEPARATOR'.');
3755
3756 if (dot != NULL((void*)0) &&
3757 is_custom_class(name, dot - name, custom_variable_classes))
3758 return add_placeholder_variable(name, elevel);
3759 }
3760
3761 /* Unknown name */
3762 return NULL((void*)0);
3763}
3764
3765
3766/*
3767 * comparator for qsorting and bsearching guc_variables array
3768 */
3769static int
3770guc_var_compare(const void *a, const void *b)
3771{
3772 struct config_generic *confa = *(struct config_generic **) a;
3773 struct config_generic *confb = *(struct config_generic **) b;
3774
3775 return guc_name_compare(confa->name, confb->name);
3776}
3777
3778/*
3779 * the bare comparison function for GUC names
3780 */
3781static int
3782guc_name_compare(const char *namea, const char *nameb)
3783{
3784 /*
3785 * The temptation to use strcasecmp() here must be resisted, because the
3786 * array ordering has to remain stable across setlocale() calls. So, build
3787 * our own with a simple ASCII-only downcasing.
3788 */
3789 while (*namea && *nameb)
3790 {
3791 char cha = *namea++;
3792 char chb = *nameb++;
3793
3794 if (cha >= 'A' && cha <= 'Z')
3795 cha += 'a' - 'A';
3796 if (chb >= 'A' && chb <= 'Z')
3797 chb += 'a' - 'A';
3798 if (cha != chb)
3799 return cha - chb;
3800 }
3801 if (*namea)
3802 return 1; /* a is longer */
3803 if (*nameb)
3804 return -1; /* b is longer */
3805 return 0;
3806}
3807
3808
3809/*
3810 * Initialize GUC options during program startup.
3811 *
3812 * Note that we cannot read the config file yet, since we have not yet
3813 * processed command-line switches.
3814 */
3815void
3816InitializeGUCOptions(void)
3817{
3818 int i;
3819
3820 /*
3821 * Before log_line_prefix could possibly receive a nonempty setting, make
3822 * sure that timezone processing is minimally alive (see elog.c).
3823 */
3824 pg_timezone_pre_initialize();
3825
3826 /*
3827 * Build sorted array of all GUC variables.
3828 */
3829 build_guc_variables();
3830
3831 /*
3832 * Load all variables with their compiled-in defaults, and initialize
3833 * status fields as needed.
3834 */
3835 for (i = 0; i < num_guc_variables; i++)
3836 {
3837 InitializeOneGUCOption(guc_variables[i]);
3838 }
3839
3840 guc_dirty = false((bool) 0);
3841
3842 reporting_enabled = false((bool) 0);
3843
3844 /*
3845 * Prevent any attempt to override the transaction modes from
3846 * non-interactive sources.
3847 */
3848 SetConfigOption("transaction_isolation", "default",
3849 PGC_POSTMASTER, PGC_S_OVERRIDE);
3850 SetConfigOption("transaction_read_only", "no",
3851 PGC_POSTMASTER, PGC_S_OVERRIDE);
3852 SetConfigOption("transaction_deferrable", "no",
3853 PGC_POSTMASTER, PGC_S_OVERRIDE);
3854
3855 /*
3856 * For historical reasons, some GUC parameters can receive defaults from
3857 * environment variables. Process those settings.
3858 */
3859 InitializeGUCOptionsFromEnvironment();
3860}
3861
3862/*
3863 * Assign any GUC values that can come from the server's environment.
3864 *
3865 * This is called from InitializeGUCOptions, and also from ProcessConfigFile
3866 * to deal with the possibility that a setting has been removed from
3867 * postgresql.conf and should now get a value from the environment.
3868 * (The latter is a kludge that should probably go away someday; if so,
3869 * fold this back into InitializeGUCOptions.)
3870 */
3871static void
3872InitializeGUCOptionsFromEnvironment(void)
3873{
3874 char *env;
3875 long stack_rlimit;
3876
3877 env = getenv("PGPORT");
3878 if (env != NULL((void*)0))
3879 SetConfigOption("port", env, PGC_POSTMASTER, PGC_S_ENV_VAR);
3880
3881 env = getenv("PGDATESTYLE");
3882 if (env != NULL((void*)0))
3883 SetConfigOption("datestyle", env, PGC_POSTMASTER, PGC_S_ENV_VAR);
3884
3885 env = getenv("PGCLIENTENCODING");
3886 if (env != NULL((void*)0))
3887 SetConfigOption("client_encoding", env, PGC_POSTMASTER, PGC_S_ENV_VAR);
3888
3889 /*
3890 * rlimit isn't exactly an "environment variable", but it behaves about
3891 * the same. If we can identify the platform stack depth rlimit, increase
3892 * default stack depth setting up to whatever is safe (but at most 2MB).
3893 */
3894 stack_rlimit = get_stack_depth_rlimit();
3895 if (stack_rlimit > 0)
3896 {
3897 long new_limit = (stack_rlimit - STACK_DEPTH_SLOP(512 * 1024L)) / 1024L;
3898
3899 if (new_limit > 100)
3900 {
3901 char limbuf[16];
3902
3903 new_limit = Min(new_limit, 2048)((new_limit) < (2048) ? (new_limit) : (2048));
3904 sprintf(limbuf, "%ld", new_limit)__builtin___sprintf_chk (limbuf, 0, __builtin_object_size (limbuf
, 2 > 1 ? 1 : 0), "%ld", new_limit)
;
3905 SetConfigOption("max_stack_depth", limbuf,
3906 PGC_POSTMASTER, PGC_S_ENV_VAR);
3907 }
3908 }
3909}
3910
3911/*
3912 * Initialize one GUC option variable to its compiled-in default.
3913 *
3914 * Note: the reason for calling check_hooks is not that we think the boot_val
3915 * might fail, but that the hooks might wish to compute an "extra" struct.
3916 */
3917static void
3918InitializeOneGUCOption(struct config_generic * gconf)
3919{
3920 gconf->status = 0;
3921 gconf->reset_source = PGC_S_DEFAULT;
3922 gconf->source = PGC_S_DEFAULT;
3923 gconf->stack = NULL((void*)0);
3924 gconf->extra = NULL((void*)0);
3925 gconf->sourcefile = NULL((void*)0);
3926 gconf->sourceline = 0;
3927
3928 switch (gconf->vartype)
3929 {
3930 case PGC_BOOL:
3931 {
3932 struct config_bool *conf = (struct config_bool *) gconf;
3933 bool newval = conf->boot_val;
3934 void *extra = NULL((void*)0);
3935
3936 if (!call_bool_check_hook(conf, &newval, &extra,
3937 PGC_S_DEFAULT, LOG15))
3938 elogelog_start("guc.c", 3938, __func__), elog_finish(FATAL21, "failed to initialize %s to %d",
3939 conf->gen.name, (int) newval);
3940 if (conf->assign_hook)
3941 (*conf->assign_hook) (newval, extra);
3942 *conf->variable = conf->reset_val = newval;
3943 conf->gen.extra = conf->reset_extra = extra;
3944 break;
3945 }
3946 case PGC_INT:
3947 {
3948 struct config_int *conf = (struct config_int *) gconf;
3949 int newval = conf->boot_val;
3950 void *extra = NULL((void*)0);
3951
3952 Assert(newval >= conf->min)do { if ((!(newval >= conf->min))) ExceptionalCondition
("!(newval >= conf->min)", ("FailedAssertion"), "guc.c"
, 3952); } while (0)
;
3953 Assert(newval <= conf->max)do { if ((!(newval <= conf->max))) ExceptionalCondition
("!(newval <= conf->max)", ("FailedAssertion"), "guc.c"
, 3953); } while (0)
;
3954 if (!call_int_check_hook(conf, &newval, &extra,
3955 PGC_S_DEFAULT, LOG15))
3956 elogelog_start("guc.c", 3956, __func__), elog_finish(FATAL21, "failed to initialize %s to %d",
3957 conf->gen.name, newval);
3958 if (conf->assign_hook)
3959 (*conf->assign_hook) (newval, extra);
3960 *conf->variable = conf->reset_val = newval;
3961 conf->gen.extra = conf->reset_extra = extra;
3962 break;
3963 }
3964 case PGC_REAL:
3965 {
3966 struct config_real *conf = (struct config_real *) gconf;
3967 double newval = conf->boot_val;
3968 void *extra = NULL((void*)0);
3969
3970 Assert(newval >= conf->min)do { if ((!(newval >= conf->min))) ExceptionalCondition
("!(newval >= conf->min)", ("FailedAssertion"), "guc.c"
, 3970); } while (0)
;
3971 Assert(newval <= conf->max)do { if ((!(newval <= conf->max))) ExceptionalCondition
("!(newval <= conf->max)", ("FailedAssertion"), "guc.c"
, 3971); } while (0)
;
3972 if (!call_real_check_hook(conf, &newval, &extra,
3973 PGC_S_DEFAULT, LOG15))
3974 elogelog_start("guc.c", 3974, __func__), elog_finish(FATAL21, "failed to initialize %s to %g",
3975 conf->gen.name, newval);
3976 if (conf->assign_hook)
3977 (*conf->assign_hook) (newval, extra);
3978 *conf->variable = conf->reset_val = newval;
3979 conf->gen.extra = conf->reset_extra = extra;
3980 break;
3981 }
3982 case PGC_STRING:
3983 {
3984 struct config_string *conf = (struct config_string *) gconf;
3985 char *newval;
3986 void *extra = NULL((void*)0);
3987
3988 /* non-NULL boot_val must always get strdup'd */
3989 if (conf->boot_val != NULL((void*)0))
3990 newval = guc_strdup(FATAL21, conf->boot_val);
3991 else
3992 newval = NULL((void*)0);
3993
3994 if (!call_string_check_hook(conf, &newval, &extra,
3995 PGC_S_DEFAULT, LOG15))
3996 elogelog_start("guc.c", 3996, __func__), elog_finish(FATAL21, "failed to initialize %s to \"%s\"",
3997 conf->gen.name, newval ? newval : "");
3998 if (conf->assign_hook)
3999 (*conf->assign_hook) (newval, extra);
4000 *conf->variable = conf->reset_val = newval;
4001 conf->gen.extra = conf->reset_extra = extra;
4002 break;
4003 }
4004 case PGC_ENUM:
4005 {
4006 struct config_enum *conf = (struct config_enum *) gconf;
4007 int newval = conf->boot_val;
4008 void *extra = NULL((void*)0);
4009
4010 if (!call_enum_check_hook(conf, &newval, &extra,
4011 PGC_S_DEFAULT, LOG15))
4012 elogelog_start("guc.c", 4012, __func__), elog_finish(FATAL21, "failed to initialize %s to %d",
4013 conf->gen.name, newval);
4014 if (conf->assign_hook)
4015 (*conf->assign_hook) (newval, extra);
4016 *conf->variable = conf->reset_val = newval;
4017 conf->gen.extra = conf->reset_extra = extra;
4018 break;
4019 }
4020 }
4021}
4022
4023
4024/*
4025 * Select the configuration files and data directory to be used, and
4026 * do the initial read of postgresql.conf.
4027 *
4028 * This is called after processing command-line switches.
4029 * userDoption is the -D switch value if any (NULL if unspecified).
4030 * progname is just for use in error messages.
4031 *
4032 * Returns true on success; on failure, prints a suitable error message
4033 * to stderr and returns false.
4034 */
4035bool
4036SelectConfigFiles(const char *userDoption, const char *progname)
4037{
4038 char *configdir;
4039 char *fname;
4040 struct stat stat_buf;
4041
4042 /* configdir is -D option, or $PGDATA if no -D */
4043 if (userDoption)
4044 configdir = make_absolute_path(userDoption);
4045 else
4046 configdir = make_absolute_path(getenv("PGDATA"));
4047
4048 /*
4049 * Find the configuration file: if config_file was specified on the
4050 * command line, use it, else use configdir/postgresql.conf. In any case
4051 * ensure the result is an absolute path, so that it will be interpreted
4052 * the same way by future backends.
4053 */
4054 if (ConfigFileName)
4055 fname = make_absolute_path(ConfigFileName);
4056 else if (configdir)
4057 {
4058 fname = guc_malloc(FATAL21,
4059 strlen(configdir) + strlen(CONFIG_FILENAME"postgresql.conf") + 2);
4060 sprintf(fname, "%s/%s", configdir, CONFIG_FILENAME)__builtin___sprintf_chk (fname, 0, __builtin_object_size (fname
, 2 > 1 ? 1 : 0), "%s/%s", configdir, "postgresql.conf")
;
4061 }
4062 else
4063 {
4064 write_stderr("%s does not know where to find the server configuration file.\n"
4065 "You must specify the --config-file or -D invocation "
4066 "option or set the PGDATA environment variable.\n",
4067 progname);
4068 return false((bool) 0);
4069 }
4070
4071 /*
4072 * Set the ConfigFileName GUC variable to its final value, ensuring that
4073 * it can't be overridden later.
4074 */
4075 SetConfigOption("config_file", fname, PGC_POSTMASTER, PGC_S_OVERRIDE);
4076 free(fname);
4077
4078 /*
4079 * Now read the config file for the first time.
4080 */
4081 if (stat(ConfigFileName, &stat_buf) != 0)
4082 {
4083 write_stderr("%s cannot access the server configuration file \"%s\": %s\n",
4084 progname, ConfigFileName, strerror(errno(*__error())));
4085 return false((bool) 0);
4086 }
4087
4088 ProcessConfigFile(PGC_POSTMASTER);
4089
4090 /*
4091 * If the data_directory GUC variable has been set, use that as DataDir;
4092 * otherwise use configdir if set; else punt.
4093 *
4094 * Note: SetDataDir will copy and absolute-ize its argument, so we don't
4095 * have to.
4096 */
4097 if (data_directory)
4098 SetDataDir(data_directory);
4099 else if (configdir)
4100 SetDataDir(configdir);
4101 else
4102 {
4103 write_stderr("%s does not know where to find the database system data.\n"
4104 "This can be specified as \"data_directory\" in \"%s\", "
4105 "or by the -D invocation option, or by the "
4106 "PGDATA environment variable.\n",
4107 progname, ConfigFileName);
4108 return false((bool) 0);
4109 }
4110
4111 /*
4112 * Reflect the final DataDir value back into the data_directory GUC var.
4113 * (If you are wondering why we don't just make them a single variable,
4114 * it's because the EXEC_BACKEND case needs DataDir to be transmitted to
4115 * child backends specially. XXX is that still true? Given that we now
4116 * chdir to DataDir, EXEC_BACKEND can read the config file without knowing
4117 * DataDir in advance.)
4118 */
4119 SetConfigOption("data_directory", DataDir, PGC_POSTMASTER, PGC_S_OVERRIDE);
4120
4121 /*
4122 * Figure out where pg_hba.conf is, and make sure the path is absolute.
4123 */
4124 if (HbaFileName)
4125 fname = make_absolute_path(HbaFileName);
4126 else if (configdir)
4127 {
4128 fname = guc_malloc(FATAL21,
4129 strlen(configdir) + strlen(HBA_FILENAME"pg_hba.conf") + 2);
4130 sprintf(fname, "%s/%s", configdir, HBA_FILENAME)__builtin___sprintf_chk (fname, 0, __builtin_object_size (fname
, 2 > 1 ? 1 : 0), "%s/%s", configdir, "pg_hba.conf")
;
4131 }
4132 else
4133 {
4134 write_stderr("%s does not know where to find the \"hba\" configuration file.\n"
4135 "This can be specified as \"hba_file\" in \"%s\", "
4136 "or by the -D invocation option, or by the "
4137 "PGDATA environment variable.\n",
4138 progname, ConfigFileName);
4139 return false((bool) 0);
4140 }
4141 SetConfigOption("hba_file", fname, PGC_POSTMASTER, PGC_S_OVERRIDE);
4142 free(fname);
4143
4144 /*
4145 * Likewise for pg_ident.conf.
4146 */
4147 if (IdentFileName)
4148 fname = make_absolute_path(IdentFileName);
4149 else if (configdir)
4150 {
4151 fname = guc_malloc(FATAL21,
4152 strlen(configdir) + strlen(IDENT_FILENAME"pg_ident.conf") + 2);
4153 sprintf(fname, "%s/%s", configdir, IDENT_FILENAME)__builtin___sprintf_chk (fname, 0, __builtin_object_size (fname
, 2 > 1 ? 1 : 0), "%s/%s", configdir, "pg_ident.conf")
;
4154 }
4155 else
4156 {
4157 write_stderr("%s does not know where to find the \"ident\" configuration file.\n"
4158 "This can be specified as \"ident_file\" in \"%s\", "
4159 "or by the -D invocation option, or by the "
4160 "PGDATA environment variable.\n",
4161 progname, ConfigFileName);
4162 return false((bool) 0);
4163 }
4164 SetConfigOption("ident_file", fname, PGC_POSTMASTER, PGC_S_OVERRIDE);
4165 free(fname);
4166
4167 free(configdir);
4168
4169 return true((bool) 1);
4170}
4171
4172
4173/*
4174 * Reset all options to their saved default values (implements RESET ALL)
4175 */
4176void
4177ResetAllOptions(void)
4178{
4179 int i;
4180
4181 for (i = 0; i < num_guc_variables; i++)
4182 {
4183 struct config_generic *gconf = guc_variables[i];
4184
4185 /* Don't reset non-SET-able values */
4186 if (gconf->context != PGC_SUSET &&
4187 gconf->context != PGC_USERSET)
4188 continue;
4189 /* Don't reset if special exclusion from RESET ALL */
4190 if (gconf->flags & GUC_NO_RESET_ALL0x0008)
4191 continue;
4192 /* No need to reset if wasn't SET */
4193 if (gconf->source <= PGC_S_OVERRIDE)
4194 continue;
4195
4196 /* Save old value to support transaction abort */
4197 push_old_value(gconf, GUC_ACTION_SET);
4198
4199 switch (gconf->vartype)
4200 {
4201 case PGC_BOOL:
4202 {
4203 struct config_bool *conf = (struct config_bool *) gconf;
4204
4205 if (conf->assign_hook)
4206 (*conf->assign_hook) (conf->reset_val,
4207 conf->reset_extra);
4208 *conf->variable = conf->reset_val;
4209 set_extra_field(&conf->gen, &conf->gen.extra,
4210 conf->reset_extra);
4211 break;
4212 }
4213 case PGC_INT:
4214 {
4215 struct config_int *conf = (struct config_int *) gconf;
4216
4217 if (conf->assign_hook)
4218 (*conf->assign_hook) (conf->reset_val,
4219 conf->reset_extra);
4220 *conf->variable = conf->reset_val;
4221 set_extra_field(&conf->gen, &conf->gen.extra,
4222 conf->reset_extra);
4223 break;
4224 }
4225 case PGC_REAL:
4226 {
4227 struct config_real *conf = (struct config_real *) gconf;
4228
4229 if (conf->assign_hook)
4230 (*conf->assign_hook) (conf->reset_val,
4231 conf->reset_extra);
4232 *conf->variable = conf->reset_val;
4233 set_extra_field(&conf->gen, &conf->gen.extra,
4234 conf->reset_extra);
4235 break;
4236 }
4237 case PGC_STRING:
4238 {
4239 struct config_string *conf = (struct config_string *) gconf;
4240
4241 if (conf->assign_hook)
4242 (*conf->assign_hook) (conf->reset_val,
4243 conf->reset_extra);
4244 set_string_field(conf, conf->variable, conf->reset_val);
4245 set_extra_field(&conf->gen, &conf->gen.extra,
4246 conf->reset_extra);
4247 break;
4248 }
4249 case PGC_ENUM:
4250 {
4251 struct config_enum *conf = (struct config_enum *) gconf;
4252
4253 if (conf->assign_hook)
4254 (*conf->assign_hook) (conf->reset_val,
4255 conf->reset_extra);
4256 *conf->variable = conf->reset_val;
4257 set_extra_field(&conf->gen, &conf->gen.extra,
4258 conf->reset_extra);
4259 break;
4260 }
4261 }
4262
4263 gconf->source = gconf->reset_source;
4264
4265 if (gconf->flags & GUC_REPORT0x0010)
4266 ReportGUCOption(gconf);
4267 }
4268}
4269
4270
4271/*
4272 * push_old_value
4273 * Push previous state during transactional assignment to a GUC variable.
4274 */
4275static void
4276push_old_value(struct config_generic * gconf, GucAction action)
4277{
4278 GucStack *stack;
4279
4280 /* If we're not inside a nest level, do nothing */
4281 if (GUCNestLevel == 0)
4282 return;
4283
4284 /* Do we already have a stack entry of the current nest level? */
4285 stack = gconf->stack;
4286 if (stack && stack->nest_level >= GUCNestLevel)
4287 {
4288 /* Yes, so adjust its state if necessary */
4289 Assert(stack->nest_level == GUCNestLevel)do { if ((!(stack->nest_level == GUCNestLevel))) ExceptionalCondition
("!(stack->nest_level == GUCNestLevel)", ("FailedAssertion"
), "guc.c", 4289); } while (0)
;
4290 switch (action)
4291 {
4292 case GUC_ACTION_SET:
4293 /* SET overrides any prior action at same nest level */
4294 if (stack->state == GUC_SET_LOCAL)
4295 {
4296 /* must discard old masked value */
4297 discard_stack_value(gconf, &stack->masked);
4298 }
4299 stack->state = GUC_SET;
4300 break;
4301 case GUC_ACTION_LOCAL:
4302 if (stack->state == GUC_SET)
4303 {
4304 /* SET followed by SET LOCAL, remember SET's value */
4305 set_stack_value(gconf, &stack->masked);
4306 stack->state = GUC_SET_LOCAL;
4307 }
4308 /* in all other cases, no change to stack entry */
4309 break;
4310 case GUC_ACTION_SAVE:
4311 /* Could only have a prior SAVE of same variable */
4312 Assert(stack->state == GUC_SAVE)do { if ((!(stack->state == GUC_SAVE))) ExceptionalCondition
("!(stack->state == GUC_SAVE)", ("FailedAssertion"), "guc.c"
, 4312); } while (0)
;
4313 break;
4314 }
4315 Assert(guc_dirty)do { if ((!(guc_dirty))) ExceptionalCondition("!(guc_dirty)",
("FailedAssertion"), "guc.c", 4315); } while (0)
; /* must be set already */
4316 return;
4317 }
4318
4319 /*
4320 * Push a new stack entry
4321 *
4322 * We keep all the stack entries in TopTransactionContext for simplicity.
4323 */
4324 stack = (GucStack *) MemoryContextAllocZero(TopTransactionContext,
4325 sizeof(GucStack));
4326
4327 stack->prev = gconf->stack;
4328 stack->nest_level = GUCNestLevel;
4329 switch (action)
4330 {
4331 case GUC_ACTION_SET:
4332 stack->state = GUC_SET;
4333 break;
4334 case GUC_ACTION_LOCAL:
4335 stack->state = GUC_LOCAL;
4336 break;
4337 case GUC_ACTION_SAVE:
4338 stack->state = GUC_SAVE;
4339 break;
4340 }
4341 stack->source = gconf->source;
4342 set_stack_value(gconf, &stack->prior);
4343
4344 gconf->stack = stack;
4345
4346 /* Ensure we remember to pop at end of xact */
4347 guc_dirty = true((bool) 1);
4348}
4349
4350
4351/*
4352 * Do GUC processing at main transaction start.
4353 */
4354void
4355AtStart_GUC(void)
4356{
4357 /*
4358 * The nest level should be 0 between transactions; if it isn't, somebody
4359 * didn't call AtEOXact_GUC, or called it with the wrong nestLevel. We
4360 * throw a warning but make no other effort to clean up.
4361 */
4362 if (GUCNestLevel != 0)
4363 elogelog_start("guc.c", 4363, __func__), elog_finish(WARNING19, "GUC nest level = %d at transaction start",
4364 GUCNestLevel);
4365 GUCNestLevel = 1;
4366}
4367
4368/*
4369 * Enter a new nesting level for GUC values. This is called at subtransaction
4370 * start and when entering a function that has proconfig settings. NOTE that
4371 * we must not risk error here, else subtransaction start will be unhappy.
4372 */
4373int
4374NewGUCNestLevel(void)
4375{
4376 return ++GUCNestLevel;
4377}
4378
4379/*
4380 * Do GUC processing at transaction or subtransaction commit or abort, or
4381 * when exiting a function that has proconfig settings. (The name is thus
4382 * a bit of a misnomer; perhaps it should be ExitGUCNestLevel or some such.)
4383 * During abort, we discard all GUC settings that were applied at nesting
4384 * levels >= nestLevel. nestLevel == 1 corresponds to the main transaction.
4385 */
4386void
4387AtEOXact_GUC(bool isCommit, int nestLevel)
4388{
4389 bool still_dirty;
4390 int i;
4391
4392 /*
4393 * Note: it's possible to get here with GUCNestLevel == nestLevel-1 during
4394 * abort, if there is a failure during transaction start before
4395 * AtStart_GUC is called.
4396 */
4397 Assert(nestLevel > 0 &&do { if ((!(nestLevel > 0 && (nestLevel <= GUCNestLevel
|| (nestLevel == GUCNestLevel + 1 && !isCommit))))) ExceptionalCondition
("!(nestLevel > 0 && (nestLevel <= GUCNestLevel || (nestLevel == GUCNestLevel + 1 && !isCommit)))"
, ("FailedAssertion"), "guc.c", 4399); } while (0)
4398 (nestLevel <= GUCNestLevel ||do { if ((!(nestLevel > 0 && (nestLevel <= GUCNestLevel
|| (nestLevel == GUCNestLevel + 1 && !isCommit))))) ExceptionalCondition
("!(nestLevel > 0 && (nestLevel <= GUCNestLevel || (nestLevel == GUCNestLevel + 1 && !isCommit)))"
, ("FailedAssertion"), "guc.c", 4399); } while (0)
4399 (nestLevel == GUCNestLevel + 1 && !isCommit)))do { if ((!(nestLevel > 0 && (nestLevel <= GUCNestLevel
|| (nestLevel == GUCNestLevel + 1 && !isCommit))))) ExceptionalCondition
("!(nestLevel > 0 && (nestLevel <= GUCNestLevel || (nestLevel == GUCNestLevel + 1 && !isCommit)))"
, ("FailedAssertion"), "guc.c", 4399); } while (0)
;
4400
4401 /* Quick exit if nothing's changed in this transaction */
4402 if (!guc_dirty)
4403 {
4404 GUCNestLevel = nestLevel - 1;
4405 return;
4406 }
4407
4408 still_dirty = false((bool) 0);
4409 for (i = 0; i < num_guc_variables; i++)
4410 {
4411 struct config_generic *gconf = guc_variables[i];
4412 GucStack *stack;
4413
4414 /*
4415 * Process and pop each stack entry within the nest level. To
4416 * simplify fmgr_security_definer(), we allow failure exit from a
4417 * function-with-SET-options to be recovered at the surrounding
4418 * transaction or subtransaction abort; so there could be more than
4419 * one stack entry to pop.
4420 */
4421 while ((stack = gconf->stack) != NULL((void*)0) &&
4422 stack->nest_level >= nestLevel)
4423 {
4424 GucStack *prev = stack->prev;
4425 bool restorePrior = false((bool) 0);
4426 bool restoreMasked = false((bool) 0);
4427 bool changed;
4428
4429 /*
4430 * In this next bit, if we don't set either restorePrior or
4431 * restoreMasked, we must "discard" any unwanted fields of the
4432 * stack entries to avoid leaking memory. If we do set one of
4433 * those flags, unused fields will be cleaned up after restoring.
4434 */
4435 if (!isCommit) /* if abort, always restore prior value */
4436 restorePrior = true((bool) 1);
4437 else if (stack->state == GUC_SAVE)
4438 restorePrior = true((bool) 1);
4439 else if (stack->nest_level == 1)
4440 {
4441 /* transaction commit */
4442 if (stack->state == GUC_SET_LOCAL)
4443 restoreMasked = true((bool) 1);
4444 else if (stack->state == GUC_SET)
4445 {
4446 /* we keep the current active value */
4447 discard_stack_value(gconf, &stack->prior);
4448 }
4449 else /* must be GUC_LOCAL */
4450 restorePrior = true((bool) 1);
4451 }
4452 else if (prev == NULL((void*)0) ||
4453 prev->nest_level < stack->nest_level - 1)
4454 {
4455 /* decrement entry's level and do not pop it */
4456 stack->nest_level--;
4457 continue;
4458 }
4459 else
4460 {
4461 /*
4462 * We have to merge this stack entry into prev. See README for
4463 * discussion of this bit.
4464 */
4465 switch (stack->state)
4466 {
4467 case GUC_SAVE:
4468 Assert(false)do { if ((!(((bool) 0)))) ExceptionalCondition("!(((bool) 0))"
, ("FailedAssertion"), "guc.c", 4468); } while (0)
; /* can't get here */
4469
4470 case GUC_SET:
4471 /* next level always becomes SET */
4472 discard_stack_value(gconf, &stack->prior);
4473 if (prev->state == GUC_SET_LOCAL)
4474 discard_stack_value(gconf, &prev->masked);
4475 prev->state = GUC_SET;
4476 break;
4477
4478 case GUC_LOCAL:
4479 if (prev->state == GUC_SET)
4480 {
4481 /* LOCAL migrates down */
4482 prev->masked = stack->prior;
4483 prev->state = GUC_SET_LOCAL;
4484 }
4485 else
4486 {
4487 /* else just forget this stack level */
4488 discard_stack_value(gconf, &stack->prior);
4489 }
4490 break;
4491
4492 case GUC_SET_LOCAL:
4493 /* prior state at this level no longer wanted */
4494 discard_stack_value(gconf, &stack->prior);
4495 /* copy down the masked state */
4496 if (prev->state == GUC_SET_LOCAL)
4497 discard_stack_value(gconf, &prev->masked);
4498 prev->masked = stack->masked;
4499 prev->state = GUC_SET_LOCAL;
4500 break;
4501 }
4502 }
4503
4504 changed = false((bool) 0);
4505
4506 if (restorePrior || restoreMasked)
4507 {
4508 /* Perform appropriate restoration of the stacked value */
4509 config_var_value newvalue;
4510 GucSource newsource;
4511
4512 if (restoreMasked)
4513 {
4514 newvalue = stack->masked;
4515 newsource = PGC_S_SESSION;
4516 }
4517 else
4518 {
4519 newvalue = stack->prior;
4520 newsource = stack->source;
4521 }
4522
4523 switch (gconf->vartype)
4524 {
4525 case PGC_BOOL:
4526 {
4527 struct config_bool *conf = (struct config_bool *) gconf;
4528 bool newval = newvalue.val.boolval;
4529 void *newextra = newvalue.extra;
4530
4531 if (*conf->variable != newval ||
4532 conf->gen.extra != newextra)
4533 {
4534 if (conf->assign_hook)
4535 (*conf->assign_hook) (newval, newextra);
4536 *conf->variable = newval;
4537 set_extra_field(&conf->gen, &conf->gen.extra,
4538 newextra);
4539 changed = true((bool) 1);
4540 }
4541 break;
4542 }
4543 case PGC_INT:
4544 {
4545 struct config_int *conf = (struct config_int *) gconf;
4546 int newval = newvalue.val.intval;
4547 void *newextra = newvalue.extra;
4548
4549 if (*conf->variable != newval ||
4550 conf->gen.extra != newextra)
4551 {
4552 if (conf->assign_hook)
4553 (*conf->assign_hook) (newval, newextra);
4554 *conf->variable = newval;
4555 set_extra_field(&conf->gen, &conf->gen.extra,
4556 newextra);
4557 changed = true((bool) 1);
4558 }
4559 break;
4560 }
4561 case PGC_REAL:
4562 {
4563 struct config_real *conf = (struct config_real *) gconf;
4564 double newval = newvalue.val.realval;
4565 void *newextra = newvalue.extra;
4566
4567 if (*conf->variable != newval ||
4568 conf->gen.extra != newextra)
4569 {
4570 if (conf->assign_hook)
4571 (*conf->assign_hook) (newval, newextra);
4572 *conf->variable = newval;
4573 set_extra_field(&conf->gen, &conf->gen.extra,
4574 newextra);
4575 changed = true((bool) 1);
4576 }
4577 break;
4578 }
4579 case PGC_STRING:
4580 {
4581 struct config_string *conf = (struct config_string *) gconf;
4582 char *newval = newvalue.val.stringval;
4583 void *newextra = newvalue.extra;
4584
4585 if (*conf->variable != newval ||
4586 conf->gen.extra != newextra)
4587 {
4588 if (conf->assign_hook)
4589 (*conf->assign_hook) (newval, newextra);
4590 set_string_field(conf, conf->variable, newval);
4591 set_extra_field(&conf->gen, &conf->gen.extra,
4592 newextra);
4593 changed = true((bool) 1);
4594 }
4595
4596 /*
4597 * Release stacked values if not used anymore. We
4598 * could use discard_stack_value() here, but since
4599 * we have type-specific code anyway, might as
4600 * well inline it.
4601 */
4602 set_string_field(conf, &stack->prior.val.stringval, NULL((void*)0));
4603 set_string_field(conf, &stack->masked.val.stringval, NULL((void*)0));
4604 break;
4605 }
4606 case PGC_ENUM:
4607 {
4608 struct config_enum *conf = (struct config_enum *) gconf;
4609 int newval = newvalue.val.enumval;
4610 void *newextra = newvalue.extra;
4611
4612 if (*conf->variable != newval ||
4613 conf->gen.extra != newextra)
4614 {
4615 if (conf->assign_hook)
4616 (*conf->assign_hook) (newval, newextra);
4617 *conf->variable = newval;
4618 set_extra_field(&conf->gen, &conf->gen.extra,
4619 newextra);
4620 changed = true((bool) 1);
4621 }
4622 break;
4623 }
4624 }
4625
4626 /*
4627 * Release stacked extra values if not used anymore.
4628 */
4629 set_extra_field(gconf, &(stack->prior.extra), NULL((void*)0));
4630 set_extra_field(gconf, &(stack->masked.extra), NULL((void*)0));
4631
4632 gconf->source = newsource;
4633 }
4634
4635 /* Finish popping the state stack */
4636 gconf->stack = prev;
4637 pfree(stack);
4638
4639 /* Report new value if we changed it */
4640 if (changed && (gconf->flags & GUC_REPORT0x0010))
4641 ReportGUCOption(gconf);
4642 } /* end of stack-popping loop */
4643
4644 if (stack != NULL((void*)0))
4645 still_dirty = true((bool) 1);
4646 }
4647
4648 /* If there are no remaining stack entries, we can reset guc_dirty */
4649 guc_dirty = still_dirty;
4650
4651 /* Update nesting level */
4652 GUCNestLevel = nestLevel - 1;
4653}
4654
4655
4656/*
4657 * Start up automatic reporting of changes to variables marked GUC_REPORT.
4658 * This is executed at completion of backend startup.
4659 */
4660void
4661BeginReportingGUCOptions(void)
4662{
4663 int i;
4664
4665 /*
4666 * Don't do anything unless talking to an interactive frontend of protocol
4667 * 3.0 or later.
4668 */
4669 if (whereToSendOutput != DestRemote ||
4670 PG_PROTOCOL_MAJOR(FrontendProtocol)((FrontendProtocol) >> 16) < 3)
4671 return;
4672
4673 reporting_enabled = true((bool) 1);
4674
4675 /* Transmit initial values of interesting variables */
4676 for (i = 0; i < num_guc_variables; i++)
4677 {
4678 struct config_generic *conf = guc_variables[i];
4679
4680 if (conf->flags & GUC_REPORT0x0010)
4681 ReportGUCOption(conf);
4682 }
4683}
4684
4685/*
4686 * ReportGUCOption: if appropriate, transmit option value to frontend
4687 */
4688static void
4689ReportGUCOption(struct config_generic * record)
4690{
4691 if (reporting_enabled && (record->flags & GUC_REPORT0x0010))
4692 {
4693 char *val = _ShowOption(record, false((bool) 0));
4694 StringInfoData msgbuf;
4695
4696 pq_beginmessage(&msgbuf, 'S');
4697 pq_sendstring(&msgbuf, record->name);
4698 pq_sendstring(&msgbuf, val);
4699 pq_endmessage(&msgbuf);
4700
4701 pfree(val);
4702 }
4703}
4704
4705/*
4706 * Try to parse value as an integer. The accepted formats are the
4707 * usual decimal, octal, or hexadecimal formats, optionally followed by
4708 * a unit name if "flags" indicates a unit is allowed.
4709 *
4710 * If the string parses okay, return true, else false.
4711 * If okay and result is not NULL, return the value in *result.
4712 * If not okay and hintmsg is not NULL, *hintmsg is set to a suitable
4713 * HINT message, or NULL if no hint provided.
4714 */
4715bool
4716parse_int(const char *value, int *result, int flags, const char **hintmsg)
4717{
4718 int64 val;
4719 char *endptr;
4720
4721 /* To suppress compiler warnings, always set output params */
4722 if (result)
4723 *result = 0;
4724 if (hintmsg)
4725 *hintmsg = NULL((void*)0);
4726
4727 /* We assume here that int64 is at least as wide as long */
4728 errno(*__error()) = 0;
4729 val = strtol(value, &endptr, 0);
4730
4731 if (endptr == value)
4732 return false((bool) 0); /* no HINT for integer syntax error */
4733
4734 if (errno(*__error()) == ERANGE34 || val != (int64) ((int32) val))
4735 {
4736 if (hintmsg)
4737 *hintmsg = gettext_noop("Value exceeds integer range.")("Value exceeds integer range.");
4738 return false((bool) 0);
4739 }
4740
4741 /* allow whitespace between integer and unit */
4742 while (isspace((unsigned char) *endptr))
4743 endptr++;
4744
4745 /* Handle possible unit */
4746 if (*endptr != '\0')
4747 {
4748 /*
4749 * Note: the multiple-switch coding technique here is a bit tedious,
4750 * but seems necessary to avoid intermediate-value overflows.
4751 */
4752 if (flags & GUC_UNIT_MEMORY0x0C00)
4753 {
4754 /* Set hint for use if no match or trailing garbage */
4755 if (hintmsg)
4756 *hintmsg = gettext_noop("Valid units for this parameter are \"kB\", \"MB\", and \"GB\".")("Valid units for this parameter are \"kB\", \"MB\", and \"GB\"."
)
;
4757
4758#if BLCKSZ8192 < 1024 || BLCKSZ8192 > (1024*1024)
4759#error BLCKSZ8192 must be between 1KB and 1MB
4760#endif
4761#if XLOG_BLCKSZ8192 < 1024 || XLOG_BLCKSZ8192 > (1024*1024)
4762#error XLOG_BLCKSZ8192 must be between 1KB and 1MB
4763#endif
4764
4765 if (strncmp(endptr, "kB", 2) == 0)
4766 {
4767 endptr += 2;
4768 switch (flags & GUC_UNIT_MEMORY0x0C00)
4769 {
4770 case GUC_UNIT_BLOCKS0x0800:
4771 val /= (BLCKSZ8192 / 1024);
4772 break;
4773 case GUC_UNIT_XBLOCKS0x0C00:
4774 val /= (XLOG_BLCKSZ8192 / 1024);
4775 break;
4776 }
4777 }
4778 else if (strncmp(endptr, "MB", 2) == 0)
4779 {
4780 endptr += 2;
4781 switch (flags & GUC_UNIT_MEMORY0x0C00)
4782 {
4783 case GUC_UNIT_KB0x0400:
4784 val *= KB_PER_MB(1024);
4785 break;
4786 case GUC_UNIT_BLOCKS0x0800:
4787 val *= KB_PER_MB(1024) / (BLCKSZ8192 / 1024);
4788 break;
4789 case GUC_UNIT_XBLOCKS0x0C00:
4790 val *= KB_PER_MB(1024) / (XLOG_BLCKSZ8192 / 1024);
4791 break;
4792 }
4793 }
4794 else if (strncmp(endptr, "GB", 2) == 0)
4795 {
4796 endptr += 2;
4797 switch (flags & GUC_UNIT_MEMORY0x0C00)
4798 {
4799 case GUC_UNIT_KB0x0400:
4800 val *= KB_PER_GB(1024*1024);
4801 break;
4802 case GUC_UNIT_BLOCKS0x0800:
4803 val *= KB_PER_GB(1024*1024) / (BLCKSZ8192 / 1024);
4804 break;
4805 case GUC_UNIT_XBLOCKS0x0C00:
4806 val *= KB_PER_GB(1024*1024) / (XLOG_BLCKSZ8192 / 1024);
4807 break;
4808 }
4809 }
4810 }
4811 else if (flags & GUC_UNIT_TIME0x7000)
4812 {
4813 /* Set hint for use if no match or trailing garbage */
4814 if (hintmsg)
4815 *hintmsg = gettext_noop("Valid units for this parameter are \"ms\", \"s\", \"min\", \"h\", and \"d\".")("Valid units for this parameter are \"ms\", \"s\", \"min\", \"h\", and \"d\"."
)
;
4816
4817 if (strncmp(endptr, "ms", 2) == 0)
4818 {
4819 endptr += 2;
4820 switch (flags & GUC_UNIT_TIME0x7000)
4821 {
4822 case GUC_UNIT_S0x2000:
4823 val /= MS_PER_S1000;
4824 break;
4825 case GUC_UNIT_MIN0x4000:
4826 val /= MS_PER_MIN(1000 * 60);
4827 break;
4828 }
4829 }
4830 else if (strncmp(endptr, "s", 1) == 0)
4831 {
4832 endptr += 1;
4833 switch (flags & GUC_UNIT_TIME0x7000)
4834 {
4835 case GUC_UNIT_MS0x1000:
4836 val *= MS_PER_S1000;
4837 break;
4838 case GUC_UNIT_MIN0x4000:
4839 val /= S_PER_MIN60;
4840 break;
4841 }
4842 }
4843 else if (strncmp(endptr, "min", 3) == 0)
4844 {
4845 endptr += 3;
4846 switch (flags & GUC_UNIT_TIME0x7000)
4847 {
4848 case GUC_UNIT_MS0x1000:
4849 val *= MS_PER_MIN(1000 * 60);
4850 break;
4851 case GUC_UNIT_S0x2000:
4852 val *= S_PER_MIN60;
4853 break;
4854 }
4855 }
4856 else if (strncmp(endptr, "h", 1) == 0)
4857 {
4858 endptr += 1;
4859 switch (flags & GUC_UNIT_TIME0x7000)
4860 {
4861 case GUC_UNIT_MS0x1000:
4862 val *= MS_PER_H(1000 * 60 * 60);
4863 break;
4864 case GUC_UNIT_S0x2000:
4865 val *= S_PER_H(60 * 60);
4866 break;
4867 case GUC_UNIT_MIN0x4000:
4868 val *= MIN_PER_H60;
4869 break;
4870 }
4871 }
4872 else if (strncmp(endptr, "d", 1) == 0)
4873 {
4874 endptr += 1;
4875 switch (flags & GUC_UNIT_TIME0x7000)
4876 {
4877 case GUC_UNIT_MS0x1000:
4878 val *= MS_PER_D(1000 * 60 * 60 * 24);
4879 break;
4880 case GUC_UNIT_S0x2000:
4881 val *= S_PER_D(60 * 60 * 24);
4882 break;
4883 case GUC_UNIT_MIN0x4000:
4884 val *= MIN_PER_D(60 * 24);
4885 break;
4886 }
4887 }
4888 }
4889
4890 /* allow whitespace after unit */
4891 while (isspace((unsigned char) *endptr))
4892 endptr++;
4893
4894 if (*endptr != '\0')
4895 return false((bool) 0); /* appropriate hint, if any, already set */
4896
4897 /* Check for overflow due to units conversion */
4898 if (val != (int64) ((int32) val))
4899 {
4900 if (hintmsg)
4901 *hintmsg = gettext_noop("Value exceeds integer range.")("Value exceeds integer range.");
4902 return false((bool) 0);
4903 }
4904 }
4905
4906 if (result)
4907 *result = (int) val;
4908 return true((bool) 1);
4909}
4910
4911
4912
4913/*
4914 * Try to parse value as a floating point number in the usual format.
4915 * If the string parses okay, return true, else false.
4916 * If okay and result is not NULL, return the value in *result.
4917 */
4918bool
4919parse_real(const char *value, double *result)
4920{
4921 double val;
4922 char *endptr;
4923
4924 if (result)
4925 *result = 0; /* suppress compiler warning */
4926
4927 errno(*__error()) = 0;
4928 val = strtod(value, &endptr);
4929 if (endptr == value || errno(*__error()) == ERANGE34)
4930 return false((bool) 0);
4931
4932 /* allow whitespace after number */
4933 while (isspace((unsigned char) *endptr))
4934 endptr++;
4935 if (*endptr != '\0')
4936 return false((bool) 0);
4937
4938 if (result)
4939 *result = val;
4940 return true((bool) 1);
4941}
4942
4943
4944/*
4945 * Lookup the name for an enum option with the selected value.
4946 * Should only ever be called with known-valid values, so throws
4947 * an elog(ERROR) if the enum option is not found.
4948 *
4949 * The returned string is a pointer to static data and not
4950 * allocated for modification.
4951 */
4952const char *
4953config_enum_lookup_by_value(struct config_enum * record, int val)
4954{
4955 const struct config_enum_entry *entry;
4956
4957 for (entry = record->options; entry && entry->name; entry++)
4958 {
4959 if (entry->val == val)
4960 return entry->name;
4961 }
4962
4963 elogelog_start("guc.c", 4963, __func__), elog_finish(ERROR20, "could not find enum option %d for %s",
4964 val, record->gen.name);
4965 return NULL((void*)0); /* silence compiler */
4966}
4967
4968
4969/*
4970 * Lookup the value for an enum option with the selected name
4971 * (case-insensitive).
4972 * If the enum option is found, sets the retval value and returns
4973 * true. If it's not found, return FALSE and retval is set to 0.
4974 */
4975bool
4976config_enum_lookup_by_name(struct config_enum * record, const char *value,
4977 int *retval)
4978{
4979 const struct config_enum_entry *entry;
4980
4981 for (entry = record->options; entry && entry->name; entry++)
4982 {
4983 if (pg_strcasecmp(value, entry->name) == 0)
4984 {
4985 *retval = entry->val;
4986 return TRUE1;
4987 }
4988 }
4989
4990 *retval = 0;
4991 return FALSE0;
4992}
4993
4994
4995/*
4996 * Return a list of all available options for an enum, excluding
4997 * hidden ones, separated by the given separator.
4998 * If prefix is non-NULL, it is added before the first enum value.
4999 * If suffix is non-NULL, it is added to the end of the string.
5000 */
5001static char *
5002config_enum_get_options(struct config_enum * record, const char *prefix,
5003 const char *suffix, const char *separator)
5004{
5005 const struct config_enum_entry *entry;
5006 StringInfoData retstr;
5007 int seplen;
5008
5009 initStringInfo(&retstr);
5010 appendStringInfoString(&retstr, prefix);
5011
5012 seplen = strlen(separator);
5013 for (entry = record->options; entry && entry->name; entry++)
5014 {
5015 if (!entry->hidden)
5016 {
5017 appendStringInfoString(&retstr, entry->name);
5018 appendBinaryStringInfo(&retstr, separator, seplen);
5019 }
5020 }
5021
5022 /*
5023 * All the entries may have been hidden, leaving the string empty if no
5024 * prefix was given. This indicates a broken GUC setup, since there is no
5025 * use for an enum without any values, so we just check to make sure we
5026 * don't write to invalid memory instead of actually trying to do
5027 * something smart with it.
5028 */
5029 if (retstr.len >= seplen)
5030 {
5031 /* Replace final separator */
5032 retstr.data[retstr.len - seplen] = '\0';
5033 retstr.len -= seplen;
5034 }
5035
5036 appendStringInfoString(&retstr, suffix);
5037
5038 return retstr.data;
5039}
5040
5041
5042/*
5043 * Sets option `name' to given value. The value should be a string
5044 * which is going to be parsed and converted to the appropriate data
5045 * type. The context and source parameters indicate in which context this
5046 * function is being called so it can apply the access restrictions
5047 * properly.
5048 *
5049 * If value is NULL, set the option to its default value (normally the
5050 * reset_val, but if source == PGC_S_DEFAULT we instead use the boot_val).
5051 *
5052 * action indicates whether to set the value globally in the session, locally
5053 * to the current top transaction, or just for the duration of a function call.
5054 *
5055 * If changeVal is false then don't really set the option but do all
5056 * the checks to see if it would work.
5057 *
5058 * If there is an error (non-existing option, invalid value) then an
5059 * ereport(ERROR) is thrown *unless* this is called in a context where we
5060 * don't want to ereport (currently, startup or SIGHUP config file reread).
5061 * In that case we write a suitable error message via ereport(LOG) and
5062 * return false. This is working around the deficiencies in the ereport
5063 * mechanism, so don't blame me. In all other cases, the function
5064 * returns true, including cases where the input is valid but we chose
5065 * not to apply it because of context or source-priority considerations.
5066 *
5067 * See also SetConfigOption for an external interface.
5068 */
5069bool
5070set_config_option(const char *name, const char *value,
5071 GucContext context, GucSource source,
5072 GucAction action, bool changeVal)
5073{
5074 struct config_generic *record;
5075 int elevel;
5076 bool prohibitValueChange = false((bool) 0);
5077 bool makeDefault;
5078
5079 if (context == PGC_SIGHUP || source == PGC_S_DEFAULT)
5080 {
5081 /*
5082 * To avoid cluttering the log, only the postmaster bleats loudly
5083 * about problems with the config file.
5084 */
5085 elevel = IsUnderPostmaster ? DEBUG312 : LOG15;
5086 }
5087 else if (source == PGC_S_DATABASE || source == PGC_S_USER ||
5088 source == PGC_S_DATABASE_USER)
5089 elevel = WARNING19;
5090 else
5091 elevel = ERROR20;
5092
5093 record = find_option(name, true((bool) 1), elevel);
5094 if (record == NULL((void*)0))
5095 {
5096 ereport(elevel,(errstart(elevel, "guc.c", 5098, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('7') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('4') - '0')
& 0x3F) << 24))), errmsg("unrecognized configuration parameter \"%s\""
, name))) : (void) 0)
5097 (errcode(ERRCODE_UNDEFINED_OBJECT),(errstart(elevel, "guc.c", 5098, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('7') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('4') - '0')
& 0x3F) << 24))), errmsg("unrecognized configuration parameter \"%s\""
, name))) : (void) 0)
5098 errmsg("unrecognized configuration parameter \"%s\"", name)))(errstart(elevel, "guc.c", 5098, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('7') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('4') - '0')
& 0x3F) << 24))), errmsg("unrecognized configuration parameter \"%s\""
, name))) : (void) 0)
;
5099 return false((bool) 0);
5100 }
5101
5102 /*
5103 * If source is postgresql.conf, mark the found record with
5104 * GUC_IS_IN_FILE. This is for the convenience of ProcessConfigFile. Note
5105 * that we do it even if changeVal is false, since ProcessConfigFile wants
5106 * the marking to occur during its testing pass.
5107 */
5108 if (source == PGC_S_FILE)
5109 record->status |= GUC_IS_IN_FILE0x0001;
5110
5111 /*
5112 * Check if the option can be set at this time. See guc.h for the precise
5113 * rules.
5114 */
5115 switch (record->context)
5116 {
5117 case PGC_INTERNAL:
5118 if (context == PGC_SIGHUP)
5119 {
5120 /*
5121 * Historically we've just silently ignored attempts to set
5122 * PGC_INTERNAL variables from the config file. Maybe it'd be
5123 * better to use the prohibitValueChange logic for this?
5124 */
5125 return true((bool) 1);
5126 }
5127 else if (context != PGC_INTERNAL)
5128 {
5129 ereport(elevel,(errstart(elevel, "guc.c", 5132, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed"
, name))) : (void) 0)
5130 (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),(errstart(elevel, "guc.c", 5132, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed"
, name))) : (void) 0)
5131 errmsg("parameter \"%s\" cannot be changed",(errstart(elevel, "guc.c", 5132, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed"
, name))) : (void) 0)
5132 name)))(errstart(elevel, "guc.c", 5132, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed"
, name))) : (void) 0)
;
5133 return false((bool) 0);
5134 }
5135 break;
5136 case PGC_POSTMASTER:
5137 if (context == PGC_SIGHUP)
5138 {
5139 /*
5140 * We are re-reading a PGC_POSTMASTER variable from
5141 * postgresql.conf. We can't change the setting, so we should
5142 * give a warning if the DBA tries to change it. However,
5143 * because of variant formats, canonicalization by check
5144 * hooks, etc, we can't just compare the given string directly
5145 * to what's stored. Set a flag to check below after we have
5146 * the final storable value.
5147 *
5148 * During the "checking" pass we just do nothing, to avoid
5149 * printing the warning twice.
5150 */
5151 if (!changeVal)
5152 return true((bool) 1);
5153
5154 prohibitValueChange = true((bool) 1);
5155 }
5156 else if (context != PGC_POSTMASTER)
5157 {
5158 ereport(elevel,(errstart(elevel, "guc.c", 5161, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed without restarting the server"
, name))) : (void) 0)
5159 (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),(errstart(elevel, "guc.c", 5161, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed without restarting the server"
, name))) : (void) 0)
5160 errmsg("parameter \"%s\" cannot be changed without restarting the server",(errstart(elevel, "guc.c", 5161, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed without restarting the server"
, name))) : (void) 0)
5161 name)))(errstart(elevel, "guc.c", 5161, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed without restarting the server"
, name))) : (void) 0)
;
5162 return false((bool) 0);
5163 }
5164 break;
5165 case PGC_SIGHUP:
5166 if (context != PGC_SIGHUP && context != PGC_POSTMASTER)
5167 {
5168 ereport(elevel,(errstart(elevel, "guc.c", 5171, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed now"
, name))) : (void) 0)
5169 (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),(errstart(elevel, "guc.c", 5171, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed now"
, name))) : (void) 0)
5170 errmsg("parameter \"%s\" cannot be changed now",(errstart(elevel, "guc.c", 5171, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed now"
, name))) : (void) 0)
5171 name)))(errstart(elevel, "guc.c", 5171, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed now"
, name))) : (void) 0)
;
5172 return false((bool) 0);
5173 }
5174
5175 /*
5176 * Hmm, the idea of the SIGHUP context is "ought to be global, but
5177 * can be changed after postmaster start". But there's nothing
5178 * that prevents a crafty administrator from sending SIGHUP
5179 * signals to individual backends only.
5180 */
5181 break;
5182 case PGC_BACKEND:
5183 if (context == PGC_SIGHUP)
5184 {
5185 /*
5186 * If a PGC_BACKEND parameter is changed in the config file,
5187 * we want to accept the new value in the postmaster (whence
5188 * it will propagate to subsequently-started backends), but
5189 * ignore it in existing backends. This is a tad klugy, but
5190 * necessary because we don't re-read the config file during
5191 * backend start.
5192 */
5193 if (IsUnderPostmaster)
5194 return true((bool) 1);
5195 }
5196 else if (context != PGC_POSTMASTER && context != PGC_BACKEND &&
5197 source != PGC_S_CLIENT)
5198 {
5199 ereport(elevel,(errstart(elevel, "guc.c", 5202, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be set after connection start"
, name))) : (void) 0)
5200 (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),(errstart(elevel, "guc.c", 5202, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be set after connection start"
, name))) : (void) 0)
5201 errmsg("parameter \"%s\" cannot be set after connection start",(errstart(elevel, "guc.c", 5202, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be set after connection start"
, name))) : (void) 0)
5202 name)))(errstart(elevel, "guc.c", 5202, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be set after connection start"
, name))) : (void) 0)
;
5203 return false((bool) 0);
5204 }
5205 break;
5206 case PGC_SUSET:
5207 if (context == PGC_USERSET || context == PGC_BACKEND)
5208 {
5209 ereport(elevel,(errstart(elevel, "guc.c", 5212, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('5') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('1') - '0')
& 0x3F) << 24))), errmsg("permission denied to set parameter \"%s\""
, name))) : (void) 0)
5210 (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),(errstart(elevel, "guc.c", 5212, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('5') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('1') - '0')
& 0x3F) << 24))), errmsg("permission denied to set parameter \"%s\""
, name))) : (void) 0)
5211 errmsg("permission denied to set parameter \"%s\"",(errstart(elevel, "guc.c", 5212, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('5') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('1') - '0')
& 0x3F) << 24))), errmsg("permission denied to set parameter \"%s\""
, name))) : (void) 0)
5212 name)))(errstart(elevel, "guc.c", 5212, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('5') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('1') - '0')
& 0x3F) << 24))), errmsg("permission denied to set parameter \"%s\""
, name))) : (void) 0)
;
5213 return false((bool) 0);
5214 }
5215 break;
5216 case PGC_USERSET:
5217 /* always okay */
5218 break;
5219 }
5220
5221 /*
5222 * Disallow changing GUC_NOT_WHILE_SEC_REST values if we are inside a
5223 * security restriction context. We can reject this regardless of the GUC
5224 * context or source, mainly because sources that it might be reasonable
5225 * to override for won't be seen while inside a function.
5226 *
5227 * Note: variables marked GUC_NOT_WHILE_SEC_REST should usually be marked
5228 * GUC_NO_RESET_ALL as well, because ResetAllOptions() doesn't check this.
5229 * An exception might be made if the reset value is assumed to be "safe".
5230 *
5231 * Note: this flag is currently used for "session_authorization" and
5232 * "role". We need to prohibit changing these inside a local userid
5233 * context because when we exit it, GUC won't be notified, leaving things
5234 * out of sync. (This could be fixed by forcing a new GUC nesting level,
5235 * but that would change behavior in possibly-undesirable ways.) Also, we
5236 * prohibit changing these in a security-restricted operation because
5237 * otherwise RESET could be used to regain the session user's privileges.
5238 */
5239 if (record->flags & GUC_NOT_WHILE_SEC_REST0x8000)
5240 {
5241 if (InLocalUserIdChange())
5242 {
5243 /*
5244 * Phrasing of this error message is historical, but it's the most
5245 * common case.
5246 */
5247 ereport(elevel,(errstart(elevel, "guc.c", 5250, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('5') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('1') - '0')
& 0x3F) << 24))), errmsg("cannot set parameter \"%s\" within security-definer function"
, name))) : (void) 0)
5248 (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),(errstart(elevel, "guc.c", 5250, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('5') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('1') - '0')
& 0x3F) << 24))), errmsg("cannot set parameter \"%s\" within security-definer function"
, name))) : (void) 0)
5249 errmsg("cannot set parameter \"%s\" within security-definer function",(errstart(elevel, "guc.c", 5250, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('5') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('1') - '0')
& 0x3F) << 24))), errmsg("cannot set parameter \"%s\" within security-definer function"
, name))) : (void) 0)
5250 name)))(errstart(elevel, "guc.c", 5250, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('5') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('1') - '0')
& 0x3F) << 24))), errmsg("cannot set parameter \"%s\" within security-definer function"
, name))) : (void) 0)
;
5251 return false((bool) 0);
5252 }
5253 if (InSecurityRestrictedOperation())
5254 {
5255 ereport(elevel,(errstart(elevel, "guc.c", 5258, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('5') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('1') - '0')
& 0x3F) << 24))), errmsg("cannot set parameter \"%s\" within security-restricted operation"
, name))) : (void) 0)
5256 (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),(errstart(elevel, "guc.c", 5258, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('5') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('1') - '0')
& 0x3F) << 24))), errmsg("cannot set parameter \"%s\" within security-restricted operation"
, name))) : (void) 0)
5257 errmsg("cannot set parameter \"%s\" within security-restricted operation",(errstart(elevel, "guc.c", 5258, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('5') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('1') - '0')
& 0x3F) << 24))), errmsg("cannot set parameter \"%s\" within security-restricted operation"
, name))) : (void) 0)
5258 name)))(errstart(elevel, "guc.c", 5258, __func__, ((void*)0)) ? (errfinish
(errcode((((('4') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('5') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('1') - '0')
& 0x3F) << 24))), errmsg("cannot set parameter \"%s\" within security-restricted operation"
, name))) : (void) 0)
;
5259 return false((bool) 0);
5260 }
5261 }
5262
5263 /*
5264 * Should we set reset/stacked values? (If so, the behavior is not
5265 * transactional.) This is done either when we get a default value from
5266 * the database's/user's/client's default settings or when we reset a
5267 * value to its default.
5268 */
5269 makeDefault = changeVal && (source <= PGC_S_OVERRIDE) &&
5270 ((value != NULL((void*)0)) || source == PGC_S_DEFAULT);
5271
5272 /*
5273 * Ignore attempted set if overridden by previously processed setting.
5274 * However, if changeVal is false then plow ahead anyway since we are
5275 * trying to find out if the value is potentially good, not actually use
5276 * it. Also keep going if makeDefault is true, since we may want to set
5277 * the reset/stacked values even if we can't set the variable itself.
5278 */
5279 if (record->source > source)
5280 {
5281 if (changeVal && !makeDefault)
5282 {
5283 elogelog_start("guc.c", 5283, __func__), elog_finish(DEBUG312, "\"%s\": setting ignored because previous source is higher priority",
5284 name);
5285 return true((bool) 1);
5286 }
5287 changeVal = false((bool) 0);
5288 }
5289
5290 /*
5291 * Evaluate value and set variable.
5292 */
5293 switch (record->vartype)
5294 {
5295 case PGC_BOOL:
5296 {
5297 struct config_bool *conf = (struct config_bool *) record;
5298 bool newval;
5299 void *newextra = NULL((void*)0);
5300
5301 if (value)
5302 {
5303 if (!parse_bool(value, &newval))
5304 {
5305 ereport(elevel,(errstart(elevel, "guc.c", 5308, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" requires a Boolean value"
, name))) : (void) 0)
5306 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),(errstart(elevel, "guc.c", 5308, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" requires a Boolean value"
, name))) : (void) 0)
5307 errmsg("parameter \"%s\" requires a Boolean value",(errstart(elevel, "guc.c", 5308, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" requires a Boolean value"
, name))) : (void) 0)
5308 name)))(errstart(elevel, "guc.c", 5308, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" requires a Boolean value"
, name))) : (void) 0)
;
5309 return false((bool) 0);
5310 }
5311 if (!call_bool_check_hook(conf, &newval, &newextra,
5312 source, elevel))
5313 return false((bool) 0);
5314 }
5315 else if (source == PGC_S_DEFAULT)
5316 {
5317 newval = conf->boot_val;
5318 if (!call_bool_check_hook(conf, &newval, &newextra,
5319 source, elevel))
5320 return false((bool) 0);
5321 }
5322 else
5323 {
5324 newval = conf->reset_val;
5325 newextra = conf->reset_extra;
5326 source = conf->gen.reset_source;
5327 }
5328
5329 if (prohibitValueChange)
5330 {
5331 if (*conf->variable != newval)
5332 ereport(elevel,(errstart(elevel, "guc.c", 5335, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed without restarting the server"
, name))) : (void) 0)
5333 (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),(errstart(elevel, "guc.c", 5335, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed without restarting the server"
, name))) : (void) 0)
5334 errmsg("parameter \"%s\" cannot be changed without restarting the server",(errstart(elevel, "guc.c", 5335, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed without restarting the server"
, name))) : (void) 0)
5335 name)))(errstart(elevel, "guc.c", 5335, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed without restarting the server"
, name))) : (void) 0)
;
5336 return false((bool) 0);
5337 }
5338
5339 if (changeVal)
5340 {
5341 /* Save old value to support transaction abort */
5342 if (!makeDefault)
5343 push_old_value(&conf->gen, action);
5344
5345 if (conf->assign_hook)
5346 (*conf->assign_hook) (newval, newextra);
5347 *conf->variable = newval;
5348 set_extra_field(&conf->gen, &conf->gen.extra,
5349 newextra);
5350 conf->gen.source = source;
5351 }
5352 if (makeDefault)
5353 {
5354 GucStack *stack;
5355
5356 if (conf->gen.reset_source <= source)
5357 {
5358 conf->reset_val = newval;
5359 set_extra_field(&conf->gen, &conf->reset_extra,
5360 newextra);
5361 conf->gen.reset_source = source;
5362 }
5363 for (stack = conf->gen.stack; stack; stack = stack->prev)
5364 {
5365 if (stack->source <= source)
5366 {
5367 stack->prior.val.boolval = newval;
5368 set_extra_field(&conf->gen, &stack->prior.extra,
5369 newextra);
5370 stack->source = source;
5371 }
5372 }
5373 }
5374
5375 /* Perhaps we didn't install newextra anywhere */
5376 if (newextra && !extra_field_used(&conf->gen, newextra))
5377 free(newextra);
5378 break;
5379 }
5380
5381 case PGC_INT:
5382 {
5383 struct config_int *conf = (struct config_int *) record;
5384 int newval;
5385 void *newextra = NULL((void*)0);
5386
5387 if (value)
5388 {
5389 const char *hintmsg;
5390
5391 if (!parse_int(value, &newval, conf->gen.flags, &hintmsg))
5392 {
5393 ereport(elevel,(errstart(elevel, "guc.c", 5397, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("invalid value for parameter \"%s\": \"%s\""
, name, value), hintmsg ? errhint("%s", (hintmsg)) : 0)) : (void
) 0)
5394 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),(errstart(elevel, "guc.c", 5397, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("invalid value for parameter \"%s\": \"%s\""
, name, value), hintmsg ? errhint("%s", (hintmsg)) : 0)) : (void
) 0)
5395 errmsg("invalid value for parameter \"%s\": \"%s\"",(errstart(elevel, "guc.c", 5397, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("invalid value for parameter \"%s\": \"%s\""
, name, value), hintmsg ? errhint("%s", (hintmsg)) : 0)) : (void
) 0)
5396 name, value),(errstart(elevel, "guc.c", 5397, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("invalid value for parameter \"%s\": \"%s\""
, name, value), hintmsg ? errhint("%s", (hintmsg)) : 0)) : (void
) 0)
5397 hintmsg ? errhint("%s", _(hintmsg)) : 0))(errstart(elevel, "guc.c", 5397, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("invalid value for parameter \"%s\": \"%s\""
, name, value), hintmsg ? errhint("%s", (hintmsg)) : 0)) : (void
) 0)
;
5398 return false((bool) 0);
5399 }
5400 if (newval < conf->min || newval > conf->max)
5401 {
5402 ereport(elevel,(errstart(elevel, "guc.c", 5405, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("%d is outside the valid range for parameter \"%s\" (%d .. %d)"
, newval, name, conf->min, conf->max))) : (void) 0)
5403 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),(errstart(elevel, "guc.c", 5405, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("%d is outside the valid range for parameter \"%s\" (%d .. %d)"
, newval, name, conf->min, conf->max))) : (void) 0)
5404 errmsg("%d is outside the valid range for parameter \"%s\" (%d .. %d)",(errstart(elevel, "guc.c", 5405, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("%d is outside the valid range for parameter \"%s\" (%d .. %d)"
, newval, name, conf->min, conf->max))) : (void) 0)
5405 newval, name, conf->min, conf->max)))(errstart(elevel, "guc.c", 5405, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("%d is outside the valid range for parameter \"%s\" (%d .. %d)"
, newval, name, conf->min, conf->max))) : (void) 0)
;
5406 return false((bool) 0);
5407 }
5408 if (!call_int_check_hook(conf, &newval, &newextra,
5409 source, elevel))
5410 return false((bool) 0);
5411 }
5412 else if (source == PGC_S_DEFAULT)
5413 {
5414 newval = conf->boot_val;
5415 if (!call_int_check_hook(conf, &newval, &newextra,
5416 source, elevel))
5417 return false((bool) 0);
5418 }
5419 else
5420 {
5421 newval = conf->reset_val;
5422 newextra = conf->reset_extra;
5423 source = conf->gen.reset_source;
5424 }
5425
5426 if (prohibitValueChange)
5427 {
5428 if (*conf->variable != newval)
5429 ereport(elevel,(errstart(elevel, "guc.c", 5432, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed without restarting the server"
, name))) : (void) 0)
5430 (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM),(errstart(elevel, "guc.c", 5432, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed without restarting the server"
, name))) : (void) 0)
5431 errmsg("parameter \"%s\" cannot be changed without restarting the server",(errstart(elevel, "guc.c", 5432, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed without restarting the server"
, name))) : (void) 0)
5432 name)))(errstart(elevel, "guc.c", 5432, __func__, ((void*)0)) ? (errfinish
(errcode((((('5') - '0') & 0x3F) + (((('5') - '0') &
0x3F) << 6) + (((('P') - '0') & 0x3F) << 12)
+ (((('0') - '0') & 0x3F) << 18) + (((('2') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" cannot be changed without restarting the server"
, name))) : (void) 0)
;
5433 return false((bool) 0);
5434 }
5435
5436 if (changeVal)
5437 {
5438 /* Save old value to support transaction abort */
5439 if (!makeDefault)
5440 push_old_value(&conf->gen, action);
5441
5442 if (conf->assign_hook)
5443 (*conf->assign_hook) (newval, newextra);
5444 *conf->variable = newval;
5445 set_extra_field(&conf->gen, &conf->gen.extra,
5446 newextra);
5447 conf->gen.source = source;
5448 }
5449 if (makeDefault)
5450 {
5451 GucStack *stack;
5452
5453 if (conf->gen.reset_source <= source)
5454 {
5455 conf->reset_val = newval;
5456 set_extra_field(&conf->gen, &conf->reset_extra,
5457 newextra);
5458 conf->gen.reset_source = source;
5459 }
5460 for (stack = conf->gen.stack; stack; stack = stack->prev)
5461 {
5462 if (stack->source <= source)
5463 {
5464 stack->prior.val.intval = newval;
5465 set_extra_field(&conf->gen, &stack->prior.extra,
5466 newextra);
5467 stack->source = source;
5468 }
5469 }
5470 }
5471
5472 /* Perhaps we didn't install newextra anywhere */
5473 if (newextra && !extra_field_used(&conf->gen, newextra))
5474 free(newextra);
5475 break;
5476 }
5477
5478 case PGC_REAL:
5479 {
5480 struct config_real *conf = (struct config_real *) record;
5481 double newval;
5482 void *newextra = NULL((void*)0);
5483
5484 if (value)
5485 {
5486 if (!parse_real(value, &newval))
5487 {
5488 ereport(elevel,(errstart(elevel, "guc.c", 5491, __func__, ((void*)0)) ? (errfinish
(errcode((((('2') - '0') & 0x3F) + (((('2') - '0') &
0x3F) << 6) + (((('0') - '0') & 0x3F) << 12)
+ (((('2') - '0') & 0x3F) << 18) + (((('3') - '0')
& 0x3F) << 24))), errmsg("parameter \"%s\" requires