8000 Clean up some inconsistencies with GUC declarations · postgrespro/postgres@d9d873b · GitHub
[go: up one dir, main page]

Skip to content

Commit d9d873b

Browse files
committed
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
1 parent a9f8ca6 commit d9d873b

File tree

19 files changed

+70
-58
lines changed

19 files changed

+70
-58
lines changed

contrib/auth_delay/auth_delay.c

Lines chan 6D40 ged: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
PG_MODULE_MAGIC;
2222

2323
/* GUC Variables */
24-
static int auth_delay_milliseconds;
24+
static int auth_delay_milliseconds = 0;
2525

2626
/* Original Hook */
2727
static ClientAuthentication_hook_type original_client_auth_hook = NULL;

contrib/pg_prewarm/autoprewarm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static AutoPrewarmSharedState *apw_state = NULL;
103103

104104
/* GUC variables. */
105105
static bool autoprewarm = true; /* start worker? */
106-
static int autoprewarm_interval; /* dump interval */
106+
static int autoprewarm_interval = 300; /* dump interval */
107107

108108
/*
109109
* Module load callback.

contrib/pg_stat_statements/pg_stat_statements.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,12 @@ static const struct config_enum_entry track_options[] =
283283
{NULL, 0, false}
284284
};
285285

286-
static int pgss_max; /* max # statements to track */
287-
static int pgss_track; /* tracking level */
288-
static bool pgss_track_utility; /* whether to track utility commands */
289-
static bool pgss_track_planning; /* whether to track planning duration */
290-
static bool pgss_save; /* whether to save stats across shutdown */
286+
static int pgss_max = 5000; /* max # statements to track */
287+
static int pgss_track = PGSS_TRACK_TOP; /* tracking level */
288+
static bool pgss_track_utility = true; /* whether to track utility commands */
289+
static bool pgss_track_planning = false; /* whether to track planning
290+
* duration */
291+
static bool pgss_save = true; /* whether to save stats across shutdown */
291292

292293

293294
#define pgss_enabled(level) \

contrib/pg_trgm/trgm_op.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ _PG_init(void)
6868
"Sets the threshold used by the % operator.",
6969
"Valid range is 0.0 .. 1.0.",
7070
&similarity_threshold,
71-
0.3,
71+
0.3f,
7272
0.0,
7373
1.0,
7474
PGC_USERSET,
@@ -80,7 +80,7 @@ _PG_init(void)
8080
"Sets the threshold used by the <% operator.",
8181
"Valid range is 0.0 .. 1.0.",
8282
&word_similarity_threshold,
83-
0.6,
83+
0.6f,
8484
0.0,
8585
1.0,
8686
PGC_USERSET,
@@ -92,7 +92,7 @@ _PG_init(void)
9292
"Sets the threshold used by the <<% operator.",
9393
"Valid range is 0.0 .. 1.0.",
9494
&strict_word_similarity_threshold,
95-
0.5,
95+
0.5f,
9696
0.0,
9797
1.0,
9898
PGC_USERSET,

contrib/sepgsql/hooks.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static sepgsql_context_info_t sepgsql_context_info;
5757
/*
5858
* GUC: sepgsql.permissive = (on|off)
5959
*/
60-
static bool sepgsql_permissive;
60+
static bool sepgsql_permissive = false;
6161

6262
bool
6363
sepgsql_get_permissive(void)
@@ -68,7 +68,7 @@ sepgsql_get_permissive(void)
6868
/*
6969
* GUC: sepgsql.debug_audit = (on|off)
7070
*/
71-
static bool sepgsql_debug_audit;
71+
static bool sepgsql_debug_audit = false;
7272

7373
bool
7474
sepgsql_get_debug_audit(void)

src/backend/access/transam/xact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
* User-tweakable parameters
7676
*/
7777
int DefaultXactIsoLevel = XACT_READ_COMMITTED;
78-
int XactIsoLevel;
78+
int XactIsoLevel = XACT_READ_COMMITTED;
7979

8080
bool DefaultXactReadOnly = false;
8181
bool XactReadOnly;

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ bool wal_init_zero = true;
131131
bool wal_recycle = true;
132132
bool log_checkpoints = true;
133133
int sync_method = DEFAULT_SYNC_METHOD;
134-
int wal_level = WAL_LEVEL_MINIMAL;
134+
int wal_level = WAL_LEVEL_REPLICA;
135135
int CommitDelay = 0; /* precommit delay in microseconds */
136136
int CommitSiblings = 5; /* # concurrent xacts needed to sleep */
137137
int wal_retrieve_retry_interval = 5000;

src/backend/libpq/be-secure.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ char *SSLECDHCurve;
5858
/* GUC variable: if false, prefer client ciphers */
5959
bool SSLPreferServerCiphers;
6060

61-
int ssl_min_protocol_version;
62-
int ssl_max_protocol_version;
61+
int ssl_min_protocol_version = PG_TLS1_2_VERSION;
62+
int ssl_max_protocol_version = PG_TLS_ANY;
6363

6464
/* ------------------------------------------------------------ */
6565
/* Procedures common to all secure sessions */

src/backend/postmaster/postmaster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ BackgroundWorker *MyBgworkerEntry = NULL;
196196

197197

198198
/* The socket number we are listening for connections on */
199-
int PostPortNumber;
199+
int PostPortNumber = DEF_PGPORT;
200200

201201
/* The directory names for Unix socket(s) */
202202
char *Unix_socket_directories;

src/backend/storage/buffer/bufmgr.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,22 +142,22 @@ bool track_io_timing = false;
142142
* for buffers not belonging to tablespaces that have their
143143
* effective_io_concurrency parameter set.
144144
*/
145-
int effective_io_concurrency = 0;
145+
int effective_io_concurrency = DEFAULT_EFFECTIVE_IO_CONCURRENCY;
146146

147147
/*
148148
* Like effective_io_concurrency, but used by maintenance code paths that might
149149
* benefit from a higher setting because they work on behalf of many sessions.
150150
* Overridden by the tablespace setting of the same name.
151151
*/
152-
int maintenance_io_concurrency = 0;
152+
int maintenance_io_concurrency = DEFAULT_MAINTENANCE_IO_CONCURRENCY;
153153

154154
/*
155155
* GUC variables about triggering kernel writeback for buffers written; OS
156156
* dependent defaults are set via the GUC mechanism.
157157
*/
158-
int checkpoint_flush_after = 0;
159-
int bgwriter_flush_after = 0;
160-
int backend_flush_after = 0;
158+
int checkpoint_flush_after = DEFAULT_CHECKPOINT_FLUSH_AFTER;
159+
int bgwriter_flush_after = DEFAULT_BGWRITER_FLUSH_AFTER;
160+
int backend_flush_after = DEFAULT_BACKEND_FLUSH_AFTER;
161161

162162
/* local state for StartBufferIO and related functions */
163163
static BufferDesc *InProgressBuf = NULL;

0 commit comments

Comments
 (0)
0