diff options
author | Michael Paquier <michael@paquier.xyz> | 2022-10-31 12:44:48 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2022-10-31 12:44:48 +0900 |
commit | d9d873bac67047cfacc9f5ef96ee488f2cb0f1c3 (patch) | |
tree | 5ba639609f866df4c3a3c5b4aa83af75844b6f36 /src/backend/utils/misc/guc_tables.c | |
parent | a9f8ca6005f1441b4e28272f744fb01fbc14b29f (diff) |
Clean up some inconsistencies with GUC declarations
This is similar to 7d25958, and this commit takes care of all the
remaining inconsistencies between the initial value used in the C
variable associated to a GUC and its default value stored in the GUC
tables (as of pg_settings.boot_val).
Some of the initial values of the GUCs updated rely on a compile-time
default. These are refactored so as the GUC table and its C declaration
use the same values. This makes everything consistent with other
places, backend_flush_after, bgwriter_flush_after, port,
checkpoint_flush_after doing so already, for example.
Extracted from a larger patch by Peter Smith. The spots updated in the
modules are from me.
Author: Peter Smith, Michael Paquier
Reviewed-by: Nathan Bossart, Tom Lane, Justin Pryzby
Discussion: https://postgr.es/m/CAHut+PtHE0XSfjjRQ6D4v7+dqzCw=d+1a64ujra4EX8aoc_Z+w@mail.gmail.com
Diffstat (limited to 'src/backend/utils/misc/guc_tables.c')
-rw-r--r-- | src/backend/utils/misc/guc_tables.c | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c index 05ab087934c..836b49484a1 100644 --- a/src/backend/utils/misc/guc_tables.c +++ b/src/backend/utils/misc/guc_tables.c @@ -526,7 +526,7 @@ int ssl_renegotiation_limit; * This really belongs in pg_shmem.c, but is defined here so that it doesn't * need to be duplicated in all the different implementations of pg_shmem.c. */ -int huge_pages; +int huge_pages = HUGE_PAGES_TRY; int huge_page_size; /* @@ -543,7 +543,14 @@ static char *locale_ctype; static char *server_encoding_string; static char *server_version_string; static int server_version_num; -static int syslog_facility; + +#ifdef HAVE_SYSLOG +#define DEFAULT_SYSLOG_FACILITY LOG_LOCAL0 +#else +#define DEFAULT_SYSLOG_FACILITY 0 +#endif +static int syslog_facility = DEFAULT_SYSLOG_FACILITY; + static char *timezone_string; static char *log_timezone_string; static char *timezone_abbreviations_string; @@ -559,7 +566,14 @@ static int shared_memory_size_in_huge_pages; static int wal_block_size; static bool data_checksums; static bool integer_datetimes; -static bool assert_enabled; + +#ifdef USE_ASSERT_CHECKING +#define DEFAULT_ASSERT_ENABLED true +#else +#define DEFAULT_ASSERT_ENABLED false +#endif +static bool assert_enabled = DEFAULT_ASSERT_ENABLED; + static char *recovery_target_timeline_string; static char *recovery_target_string; static char *recovery_target_xid_string; @@ -1181,11 +1195,7 @@ struct config_bool ConfigureNamesBool[] = GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE }, &assert_enabled, -#ifdef USE_ASSERT_CHECKING - true, -#else - false, -#endif + DEFAULT_ASSERT_ENABLED, NULL, NULL, NULL }, @@ -1357,11 +1367,7 @@ struct config_bool ConfigureNamesBool[] = gettext_noop("Enables updating of the process title every time a new SQL command is received by the server.") }, &update_process_title, -#ifdef WIN32 - false, -#else - true, -#endif + DEFAULT_UPDATE_PROCESS_TITLE, NULL, NULL, NULL }, @@ -2888,11 +2894,7 @@ struct config_int ConfigureNamesInt[] = GUC_EXPLAIN }, &effective_io_concurrency, -#ifdef USE_PREFETCH - 1, -#else - 0, -#endif + DEFAULT_EFFECTIVE_IO_CONCURRENCY, 0, MAX_IO_CONCURRENCY, check_effective_io_concurrency, NULL, NULL }, @@ -2906,11 +2908,7 @@ struct config_int ConfigureNamesInt[] = GUC_EXPLAIN }, &maintenance_io_concurrency, -#ifdef USE_PREFETCH - 10, -#else - 0, -#endif + DEFAULT_MAINTENANCE_IO_CONCURRENCY, 0, MAX_IO_CONCURRENCY, check_maintenance_io_concurrency, assign_maintenance_io_concurrency, NULL @@ -4613,11 +4611,7 @@ struct config_enum ConfigureNamesEnum[] = NULL }, &syslog_facility, -#ifdef HAVE_SYSLOG - LOG_LOCAL0, -#else - 0, -#endif + DEFAULT_SYSLOG_FACILITY, syslog_facility_options, NULL, assign_syslog_facility, NULL }, |