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
PG_MODULE_MAGIC;
/* GUC Variables */
-static int auth_delay_milliseconds;
+static int auth_delay_milliseconds = 0;
/* Original Hook */
static ClientAuthentication_hook_type original_client_auth_hook = NULL;
/* GUC variables. */
static bool autoprewarm = true; /* start worker? */
-static int autoprewarm_interval; /* dump interval */
+static int autoprewarm_interval = 300; /* dump interval */
/*
* Module load callback.
{NULL, 0, false}
};
-static int pgss_max; /* max # statements to track */
-static int pgss_track; /* tracking level */
-static bool pgss_track_utility; /* whether to track utility commands */
-static bool pgss_track_planning; /* whether to track planning duration */
-static bool pgss_save; /* whether to save stats across shutdown */
+static int pgss_max = 5000; /* max # statements to track */
+static int pgss_track = PGSS_TRACK_TOP; /* tracking level */
+static bool pgss_track_utility = true; /* whether to track utility commands */
+static bool pgss_track_planning = false; /* whether to track planning
+ * duration */
+static bool pgss_save = true; /* whether to save stats across shutdown */
#define pgss_enabled(level) \
"Sets the threshold used by the % operator.",
"Valid range is 0.0 .. 1.0.",
&similarity_threshold,
- 0.3,
+ 0.3f,
0.0,
1.0,
PGC_USERSET,
"Sets the threshold used by the <% operator.",
"Valid range is 0.0 .. 1.0.",
&word_similarity_threshold,
- 0.6,
+ 0.6f,
0.0,
1.0,
PGC_USERSET,
"Sets the threshold used by the <<% operator.",
"Valid range is 0.0 .. 1.0.",
&strict_word_similarity_threshold,
- 0.5,
+ 0.5f,
0.0,
1.0,
PGC_USERSET,
/*
* GUC: sepgsql.permissive = (on|off)
*/
-static bool sepgsql_permissive;
+static bool sepgsql_permissive = false;
bool
sepgsql_get_permissive(void)
/*
* GUC: sepgsql.debug_audit = (on|off)
*/
-static bool sepgsql_debug_audit;
+static bool sepgsql_debug_audit = false;
bool
sepgsql_get_debug_audit(void)
* User-tweakable parameters
*/
int DefaultXactIsoLevel = XACT_READ_COMMITTED;
-int XactIsoLevel;
+int XactIsoLevel = XACT_READ_COMMITTED;
bool DefaultXactReadOnly = false;
bool XactReadOnly;
bool wal_recycle = true;
bool log_checkpoints = true;
int sync_method = DEFAULT_SYNC_METHOD;
-int wal_level = WAL_LEVEL_MINIMAL;
+int wal_level = WAL_LEVEL_REPLICA;
int CommitDelay = 0; /* precommit delay in microseconds */
int CommitSiblings = 5; /* # concurrent xacts needed to sleep */
int wal_retrieve_retry_interval = 5000;
/* GUC variable: if false, prefer client ciphers */
bool SSLPreferServerCiphers;
-int ssl_min_protocol_version;
-int ssl_max_protocol_version;
+int ssl_min_protocol_version = PG_TLS1_2_VERSION;
+int ssl_max_protocol_version = PG_TLS_ANY;
/* ------------------------------------------------------------ */
/* Procedures common to all secure sessions */
/* The socket number we are listening for connections on */
-int PostPortNumber;
+int PostPortNumber = DEF_PGPORT;
/* The directory names for Unix socket(s) */
char *Unix_socket_directories;
* for buffers not belonging to tablespaces that have their
* effective_io_concurrency parameter set.
*/
-int effective_io_concurrency = 0;
+int effective_io_concurrency = DEFAULT_EFFECTIVE_IO_CONCURRENCY;
/*
* Like effective_io_concurrency, but used by maintenance code paths that might
* benefit from a higher setting because they work on behalf of many sessions.
* Overridden by the tablespace setting of the same name.
*/
-int maintenance_io_concurrency = 0;
+int maintenance_io_concurrency = DEFAULT_MAINTENANCE_IO_CONCURRENCY;
/*
* GUC variables about triggering kernel writeback for buffers written; OS
* dependent defaults are set via the GUC mechanism.
*/
-int checkpoint_flush_after = 0;
-int bgwriter_flush_after = 0;
-int backend_flush_after = 0;
+int checkpoint_flush_after = DEFAULT_CHECKPOINT_FLUSH_AFTER;
+int bgwriter_flush_after = DEFAULT_BGWRITER_FLUSH_AFTER;
+int backend_flush_after = DEFAULT_BACKEND_FLUSH_AFTER;
/* local state for StartBufferIO and related functions */
static BufferDesc *InProgressBuf = NULL;
};
/* Implementation selector. */
-int dynamic_shared_memory_type;
+int dynamic_shared_memory_type = DEFAULT_DYNAMIC_SHARED_MEMORY_TYPE;
/* Amount of space reserved for DSM segments in the main area. */
int min_dynamic_shared_memory;
/* GUC variables */
-int xmlbinary;
-int xmloption;
+int xmlbinary = XMLBINARY_BASE64;
+int xmloption = XMLOPTION_CONTENT;
#ifdef USE_LIBXML
static void PlanCacheSysCallback(Datum arg, int cacheid, uint32 hashvalue);
/* GUC parameter */
-int plan_cache_mode;
+int plan_cache_mode = PLAN_CACHE_MODE_AUTO;
/*
* InitPlanCache: initialize module during InitPostgres.
emit_log_hook_type emit_log_hook = NULL;
/* GUC parameters */
-int Log_error_verbosity = PGERROR_VERBOSE;
+int Log_error_verbosity = PGERROR_DEFAULT;
char *Log_line_prefix = NULL; /* format for extra log line info */
int Log_destination = LOG_DESTINATION_STDERR;
char *Log_destination_string = NULL;
* MaxBackends is computed by PostmasterMain after modules have had a chance to
* register background workers.
*/
-int NBuffers = 1000;
-int MaxConnections = 90;
+int NBuffers = 16384;
+int MaxConnections = 100;
int max_worker_processes = 8;
int max_parallel_workers = 8;
int MaxBackends = 0;
* 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;
/*
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;
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;
GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
},
&assert_enabled,
-#ifdef USE_ASSERT_CHECKING
- true,
-#else
- false,
-#endif
+ DEFAULT_ASSERT_ENABLED,
NULL, NULL, NULL
},
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
},
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
},
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
NULL
},
&syslog_facility,
-#ifdef HAVE_SYSLOG
- LOG_LOCAL0,
-#else
- 0,
-#endif
+ DEFAULT_SYSLOG_FACILITY,
syslog_facility_options,
NULL, assign_syslog_facility, NULL
},
#include "utils/ps_status.h"
extern char **environ;
-bool update_process_title = true;
+/* GUC variable */
+bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;
/*
* Alternative ways of updating ps display:
extern PGDLLIMPORT int bgwriter_lru_maxpages;
extern PGDLLIMPORT double bgwriter_lru_multiplier;
extern PGDLLIMPORT bool track_io_timing;
+
+/* only applicable when prefetching is available */
+#ifdef USE_PREFETCH
+#define DEFAULT_EFFECTIVE_IO_CONCURRENCY 1
+#define DEFAULT_MAINTENANCE_IO_CONCURRENCY 10
+#else
+#define DEFAULT_EFFECTIVE_IO_CONCURRENCY 0
+#define DEFAULT_MAINTENANCE_IO_CONCURRENCY 0
+#endif
extern PGDLLIMPORT int effective_io_concurrency;
extern PGDLLIMPORT int maintenance_io_concurrency;
#ifndef PS_STATUS_H
#define PS_STATUS_H
+/* disabled on Windows as the performance overhead can be significant */
+#ifdef WIN32
+#define DEFAULT_UPDATE_PROCESS_TITLE false
+#else
+#define DEFAULT_UPDATE_PROCESS_TITLE true
+#endif
+
extern PGDLLIMPORT bool update_process_title;
extern char **save_ps_display_args(int argc, char **argv);