Skip to content

Commit

Permalink
Apply quotes more consistently to GUC names in logs
Browse files Browse the repository at this point in the history
Quotes are applied to GUCs in a very inconsistent way across the code
base, with a mix of double quotes or no quotes used.  This commit
removes double quotes around all the GUC names that are obviously
referred to as parameters with non-English words (use of underscore,
mixed case, etc).

This is the result of a discussion with Álvaro Herrera, Nathan Bossart,
Laurenz Albe, Peter Eisentraut, Tom Lane and Daniel Gustafsson.

Author: Peter Smith
Discussion: https://postgr.es/m/CAHut+Pv-kSN8SkxSdoHano_wPubqcg5789ejhCDZAcLFceBR-w@mail.gmail.com
  • Loading branch information
michaelpq committed Nov 30, 2023
1 parent 334f512 commit 8d9978a
Show file tree
Hide file tree
Showing 22 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion contrib/pg_prewarm/autoprewarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ apw_start_database_worker(void)
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_RESOURCES),
errmsg("registering dynamic bgworker autoprewarm failed"),
errhint("Consider increasing configuration parameter \"max_worker_processes\".")));
errhint("Consider increasing configuration parameter max_worker_processes.")));

/*
* Ignore return value; if it fails, postmaster has died, but we have
Expand Down
2 changes: 1 addition & 1 deletion src/backend/access/heap/vacuumlazy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2658,7 +2658,7 @@ lazy_check_wraparound_failsafe(LVRelState *vacrel)
vacrel->dbname, vacrel->relnamespace, vacrel->relname,
vacrel->num_index_scans),
errdetail("The table's relfrozenxid or relminmxid is too far in the past."),
errhint("Consider increasing configuration parameter \"maintenance_work_mem\" or \"autovacuum_work_mem\".\n"
errhint("Consider increasing configuration parameter maintenance_work_mem or autovacuum_work_mem.\n"
"You might also need to consider other ways for VACUUM to keep up with the allocation of transaction IDs.")));

/* Stop applying cost limits from this point on */
Expand Down
4 changes: 2 additions & 2 deletions src/backend/access/transam/commit_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,9 @@ error_commit_ts_disabled(void)
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("could not get commit timestamp data"),
RecoveryInProgress() ?
errhint("Make sure the configuration parameter \"%s\" is set on the primary server.",
errhint("Make sure the configuration parameter %s is set on the primary server.",
"track_commit_timestamp") :
errhint("Make sure the configuration parameter \"%s\" is set.",
errhint("Make sure the configuration parameter %s is set.",
"track_commit_timestamp")));
}

Expand Down
4 changes: 2 additions & 2 deletions src/backend/access/transam/xlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -4258,11 +4258,11 @@ ReadControlFile(void)
/* check and update variables dependent on wal_segment_size */
if (ConvertToXSegs(min_wal_size_mb, wal_segment_size) < 2)
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("\"min_wal_size\" must be at least twice \"wal_segment_size\"")));
errmsg("min_wal_size must be at least twice wal_segment_size")));

if (ConvertToXSegs(max_wal_size_mb, wal_segment_size) < 2)
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("\"max_wal_size\" must be at least twice \"wal_segment_size\"")));
errmsg("max_wal_size must be at least twice wal_segment_size")));

UsableBytesInSegment =
(wal_segment_size / XLOG_BLCKSZ * UsableBytesInPage) -
Expand Down
2 changes: 1 addition & 1 deletion src/backend/commands/vacuum.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ check_vacuum_buffer_usage_limit(int *newval, void **extra,
return true;

/* Value does not fall within any allowable range */
GUC_check_errdetail("\"vacuum_buffer_usage_limit\" must be 0 or between %d kB and %d kB",
GUC_check_errdetail("vacuum_buffer_usage_limit must be 0 or between %d kB and %d kB",
MIN_BAS_VAC_RING_SIZE_KB, MAX_BAS_VAC_RING_SIZE_KB);

return false;
Expand Down
2 changes: 1 addition & 1 deletion src/backend/commands/variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ check_client_encoding(char **newval, void **extra, GucSource source)
else
{
/* Provide a useful complaint */
GUC_check_errdetail("Cannot change \"client_encoding\" now.");
GUC_check_errdetail("Cannot change client_encoding now.");
}
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions src/backend/libpq/be-secure-openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ be_tls_init(bool isServerStart)
{
ereport(isServerStart ? FATAL : LOG,
/*- translator: first %s is a GUC option name, second %s is its value */
(errmsg("\"%s\" setting \"%s\" not supported by this build",
(errmsg("%s setting \"%s\" not supported by this build",
"ssl_min_protocol_version",
GetConfigOption("ssl_min_protocol_version",
false, false))));
Expand All @@ -218,7 +218,7 @@ be_tls_init(bool isServerStart)
{
ereport(isServerStart ? FATAL : LOG,
/*- translator: first %s is a GUC option name, second %s is its value */
(errmsg("\"%s\" setting \"%s\" not supported by this build",
(errmsg("%s setting \"%s\" not supported by this build",
"ssl_max_protocol_version",
GetConfigOption("ssl_max_protocol_version",
false, false))));
Expand All @@ -245,7 +245,7 @@ be_tls_init(bool isServerStart)
{
ereport(isServerStart ? FATAL : LOG,
(errmsg("could not set SSL protocol version range"),
errdetail("\"%s\" cannot be higher than \"%s\"",
errdetail("%s cannot be higher than %s",
"ssl_min_protocol_version",
"ssl_max_protocol_version")));
goto error;
Expand Down
2 changes: 1 addition & 1 deletion src/backend/postmaster/bgworker.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ RegisterBackgroundWorker(BackgroundWorker *worker)
"Up to %d background workers can be registered with the current settings.",
max_worker_processes,
max_worker_processes),
errhint("Consider increasing the configuration parameter \"max_worker_processes\".")));
errhint("Consider increasing the configuration parameter max_worker_processes.")));
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/backend/postmaster/checkpointer.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ CheckpointerMain(void)
"checkpoints are occurring too frequently (%d seconds apart)",
elapsed_secs,
elapsed_secs),
errhint("Consider increasing the configuration parameter \"max_wal_size\".")));
errhint("Consider increasing the configuration parameter max_wal_size.")));

/*
* Initialize checkpointer-private variables used during
Expand Down
2 changes: 1 addition & 1 deletion src/backend/postmaster/pgarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ HandlePgArchInterrupts(void)
*/
ereport(LOG,
(errmsg("restarting archiver process because value of "
"\"archive_library\" was changed")));
"archive_library was changed")));

proc_exit(0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/backend/storage/buffer/localbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ check_temp_buffers(int *newval, void **extra, GucSource source)
*/
if (source != PGC_S_TEST && NLocBuffer && NLocBuffer != *newval)
{
GUC_check_errdetail("\"temp_buffers\" cannot be changed after any temporary tables have been accessed in the session.");
GUC_check_errdetail("temp_buffers cannot be changed after any temporary tables have been accessed in the session.");
return false;
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/backend/storage/file/fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3931,7 +3931,7 @@ check_debug_io_direct(char **newval, void **extra, GucSource source)

if (!SplitGUCList(rawstring, ',', &elemlist))
{
GUC_check_errdetail("invalid list syntax in parameter \"%s\"",
GUC_check_errdetail("invalid list syntax in parameter %s",
"debug_io_direct");
pfree(rawstring);
list_free(elemlist);
Expand Down
2 changes: 1 addition & 1 deletion src/backend/storage/lmgr/predicate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,7 @@ GetSerializableTransactionSnapshot(Snapshot snapshot)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("cannot use serializable mode in a hot standby"),
errdetail("\"default_transaction_isolation\" is set to \"serializable\"."),
errdetail("default_transaction_isolation is set to \"serializable\"."),
errhint("You can use \"SET default_transaction_isolation = 'repeatable read'\" to change the default.")));

/*
Expand Down
10 changes: 5 additions & 5 deletions src/backend/tcop/postgres.c
Original file line number Diff line number Diff line change
Expand Up @@ -3524,7 +3524,7 @@ check_stack_depth(void)
ereport(ERROR,
(errcode(ERRCODE_STATEMENT_TOO_COMPLEX),
errmsg("stack depth limit exceeded"),
errhint("Increase the configuration parameter \"max_stack_depth\" (currently %dkB), "
errhint("Increase the configuration parameter max_stack_depth (currently %dkB), "
"after ensuring the platform's stack depth limit is adequate.",
max_stack_depth)));
}
Expand Down Expand Up @@ -3571,7 +3571,7 @@ check_max_stack_depth(int *newval, void **extra, GucSource source)

if (stack_rlimit > 0 && newval_bytes > stack_rlimit - STACK_DEPTH_SLOP)
{
GUC_check_errdetail("\"max_stack_depth\" must not exceed %ldkB.",
GUC_check_errdetail("max_stack_depth must not exceed %ldkB.",
(stack_rlimit - STACK_DEPTH_SLOP) / 1024L);
GUC_check_errhint("Increase the platform's stack depth limit via \"ulimit -s\" or local equivalent.");
return false;
Expand Down Expand Up @@ -3632,9 +3632,9 @@ check_log_stats(bool *newval, void **extra, GucSource source)
if (*newval &&
(log_parser_stats || log_planner_stats || log_executor_stats))
{
GUC_check_errdetail("Cannot enable \"log_statement_stats\" when "
"\"log_parser_stats\", \"log_planner_stats\", "
"or \"log_executor_stats\" is true.");
GUC_check_errdetail("Cannot enable log_statement_stats when "
"log_parser_stats, log_planner_stats, "
"or log_executor_stats is true.");
return false;
}
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/backend/utils/adt/pg_locale.c
Original file line number Diff line number Diff line change
Expand Up @@ -2875,7 +2875,7 @@ icu_validate_locale(const char *loc_str)
ereport(elevel,
(errmsg("could not get language from ICU locale \"%s\": %s",
loc_str, u_errorName(status)),
errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".",
errhint("To disable ICU locale validation, set the parameter %s to \"%s\".",
"icu_validation_level", "disabled")));
return;
}
Expand Down Expand Up @@ -2904,7 +2904,7 @@ icu_validate_locale(const char *loc_str)
ereport(elevel,
(errmsg("ICU locale \"%s\" has unknown language \"%s\"",
loc_str, lang),
errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".",
errhint("To disable ICU locale validation, set the parameter %s to \"%s\".",
"icu_validation_level", "disabled")));

/* check that it can be opened */
Expand Down
4 changes: 2 additions & 2 deletions src/backend/utils/fmgr/dfmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ find_in_dynamic_libpath(const char *basename)
if (piece == p)
ereport(ERROR,
(errcode(ERRCODE_INVALID_NAME),
errmsg("zero-length component in parameter \"dynamic_library_path\"")));
errmsg("zero-length component in parameter dynamic_library_path")));

if (piece == NULL)
len = strlen(p);
Expand All @@ -574,7 +574,7 @@ find_in_dynamic_libpath(const char *basename)
if (!is_absolute_path(mangled))
ereport(ERROR,
(errcode(ERRCODE_INVALID_NAME),
errmsg("component in parameter \"dynamic_library_path\" is not an absolute path")));
errmsg("component in parameter dynamic_library_path is not an absolute path")));

full = palloc(strlen(mangled) + 1 + baselen + 1);
sprintf(full, "%s/%s", mangled, basename);
Expand Down
2 changes: 1 addition & 1 deletion src/backend/utils/misc/guc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,7 @@ SelectConfigFiles(const char *userDoption, const char *progname)
else
{
write_stderr("%s does not know where to find the database system data.\n"
"This can be specified as \"data_directory\" in \"%s\", "
"This can be specified as data_directory in \"%s\", "
"or by the -D invocation option, or by the "
"PGDATA environment variable.\n",
progname, ConfigFileName);
Expand Down
4 changes: 2 additions & 2 deletions src/backend/utils/misc/guc_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -3821,7 +3821,7 @@ struct config_string ConfigureNamesString[] =
{
{"archive_command", PGC_SIGHUP, WAL_ARCHIVING,
gettext_noop("Sets the shell command that will be called to archive a WAL file."),
gettext_noop("This is used only if \"archive_library\" is not set.")
gettext_noop("This is used only if archive_library is not set.")
},
&XLogArchiveCommand,
"",
Expand All @@ -3831,7 +3831,7 @@ struct config_string ConfigureNamesString[] =
{
{"archive_library", PGC_SIGHUP, WAL_ARCHIVING,
gettext_noop("Sets the library that will be called to archive a WAL file."),
gettext_noop("An empty string indicates that \"archive_command\" should be used.")
gettext_noop("An empty string indicates that archive_command should be used.")
},
&XLogArchiveLibrary,
"",
Expand Down
12 changes: 6 additions & 6 deletions src/test/modules/commit_ts/expected/commit_timestamp_1.out
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SELECT id,
FROM committs_test
ORDER BY id;
ERROR: could not get commit timestamp data
HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
HINT: Make sure the configuration parameter track_commit_timestamp is set.
DROP TABLE committs_test;
SELECT pg_xact_commit_timestamp('0'::xid);
ERROR: cannot retrieve commit timestamp for transaction 0
Expand All @@ -40,7 +40,7 @@ SELECT x.xid::text::bigint > 0 as xid_valid,
roident != 0 AS valid_roident
FROM pg_last_committed_xact() x;
ERROR: could not get commit timestamp data
HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
HINT: Make sure the configuration parameter track_commit_timestamp is set.
-- Test non-normal transaction ids.
SELECT * FROM pg_xact_commit_timestamp_origin(NULL); -- ok, NULL
timestamp | roident
Expand Down Expand Up @@ -69,13 +69,13 @@ SELECT x.timestamp > '-infinity'::timestamptz AS ts_low,
roident != 0 AS valid_roident
FROM pg_last_committed_xact() x;
ERROR: could not get commit timestamp data
HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
HINT: Make sure the configuration parameter track_commit_timestamp is set.
SELECT x.timestamp > '-infinity'::timestamptz AS ts_low,
x.timestamp <= now() AS ts_high,
roident != 0 AS valid_roident
FROM pg_xact_commit_timestamp_origin(:'txid_no_origin') x;
ERROR: could not get commit timestamp data
HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
HINT: Make sure the configuration parameter track_commit_timestamp is set.
-- Test transaction with replication origin
SELECT pg_replication_origin_create('regress_commit_ts: get_origin') != 0
AS valid_roident;
Expand All @@ -97,14 +97,14 @@ SELECT x.timestamp > '-infinity'::timestamptz AS ts_low,
FROM pg_last_committed_xact() x, pg_replication_origin r
WHERE r.roident = x.roident;
ERROR: could not get commit timestamp data
HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
HINT: Make sure the configuration parameter track_commit_timestamp is set.
SELECT x.timestamp > '-infinity'::timestamptz AS ts_low,
x.timestamp <= now() AS ts_high,
r.roname
FROM pg_xact_commit_timestamp_origin(:'txid_with_origin') x, pg_replication_origin r
WHERE r.roident = x.roident;
ERROR: could not get commit timestamp data
HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
HINT: Make sure the configuration parameter track_commit_timestamp is set.
SELECT pg_replication_origin_session_reset();
pg_replication_origin_session_reset
-------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/test/regress/expected/collate.icu.utf8.out
Original file line number Diff line number Diff line change
Expand Up @@ -1042,15 +1042,15 @@ ERROR: parameter "locale" must be specified
SET icu_validation_level = ERROR;
CREATE COLLATION testx (provider = icu, locale = 'nonsense-nowhere'); -- fails
ERROR: ICU locale "nonsense-nowhere" has unknown language "nonsense"
HINT: To disable ICU locale validation, set the parameter "icu_validation_level" to "disabled".
HINT: To disable ICU locale validation, set the parameter icu_validation_level to "disabled".
CREATE COLLATION testx (provider = icu, locale = '@colStrength=primary;nonsense=yes'); -- fails
ERROR: could not convert locale name "@colStrength=primary;nonsense=yes" to language tag: U_ILLEGAL_ARGUMENT_ERROR
RESET icu_validation_level;
CREATE COLLATION testx (provider = icu, locale = '@colStrength=primary;nonsense=yes'); DROP COLLATION testx;
WARNING: could not convert locale name "@colStrength=primary;nonsense=yes" to language tag: U_ILLEGAL_ARGUMENT_ERROR
CREATE COLLATION testx (provider = icu, locale = 'nonsense-nowhere'); DROP COLLATION testx;
WARNING: ICU locale "nonsense-nowhere" has unknown language "nonsense"
HINT: To disable ICU locale validation, set the parameter "icu_validation_level" to "disabled".
HINT: To disable ICU locale validation, set the parameter icu_validation_level to "disabled".
CREATE COLLATION test4 FROM nonsense;
ERROR: collation "nonsense" for encoding "UTF8" does not exist
CREATE COLLATION test5 FROM test0;
Expand Down
4 changes: 2 additions & 2 deletions src/test/regress/expected/json.out
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ CONTEXT: JSON data, line 1: {"abc":1,3...
SET max_stack_depth = '100kB';
SELECT repeat('[', 10000)::json;
ERROR: stack depth limit exceeded
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate.
SELECT repeat('{"a":', 10000)::json;
ERROR: stack depth limit exceeded
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate.
RESET max_stack_depth;
-- Miscellaneous stuff.
SELECT 'true'::json; -- OK
Expand Down
4 changes: 2 additions & 2 deletions src/test/regress/expected/jsonb.out
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ CONTEXT: JSON data, line 1: {"abc":1,3...
SET max_stack_depth = '100kB';
SELECT repeat('[', 10000)::jsonb;
ERROR: stack depth limit exceeded
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate.
SELECT repeat('{"a":', 10000)::jsonb;
ERROR: stack depth limit exceeded
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate.
RESET max_stack_depth;
-- Miscellaneous stuff.
SELECT 'true'::jsonb; -- OK
Expand Down

0 comments on commit 8d9978a

Please sign in to comment.