Skip to content

Commit 17974ec

Browse files
committed
Revise GUC names quoting in messages again
After further review, we want to move in the direction of always quoting GUC names in error messages, rather than the previous (PG16) wildly mixed practice or the intermittent (mid-PG17) idea of doing this depending on how possibly confusing the GUC name is. This commit applies appropriate quotes to (almost?) all mentions of GUC names in error messages. It partially supersedes a243569 and 8d9978a, which had moved things a bit in the opposite direction but which then were abandoned in a partial state. Author: Peter Smith <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/CAHut%2BPv-kSN8SkxSdoHano_wPubqcg5789ejhCDZAcLFceBR-w%40mail.gmail.com
1 parent be5942a commit 17974ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+208
-215
lines changed

contrib/pg_prewarm/autoprewarm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ apw_start_leader_worker(void)
831831
ereport(ERROR,
832832
(errcode(ERRCODE_INSUFFICIENT_RESOURCES),
833833
errmsg("could not register background process"),
834-
errhint("You may need to increase max_worker_processes.")));
834+
errhint("You may need to increase \"max_worker_processes\".")));
835835

836836
status = WaitForBackgroundWorkerStartup(handle, &pid);
837837
if (status != BGWH_STARTED)
@@ -867,7 +867,7 @@ apw_start_database_worker(void)
867867
ereport(ERROR,
868868
(errcode(ERRCODE_INSUFFICIENT_RESOURCES),
869869
errmsg("registering dynamic bgworker autoprewarm failed"),
870-
errhint("Consider increasing configuration parameter max_worker_processes.")));
870+
errhint("Consider increasing configuration parameter \"max_worker_processes\".")));
871871

872872
/*
873873
* Ignore return value; if it fails, postmaster has died, but we have

contrib/pg_stat_statements/pg_stat_statements.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,7 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
16601660
if (!pgss || !pgss_hash)
16611661
ereport(ERROR,
16621662
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1663-
errmsg("pg_stat_statements must be loaded via shared_preload_libraries")));
1663+
errmsg("pg_stat_statements must be loaded via \"shared_preload_libraries\"")));
16641664

16651665
InitMaterializedSRF(fcinfo, 0);
16661666

@@ -1989,7 +1989,7 @@ pg_stat_statements_info(PG_FUNCTION_ARGS)
19891989
if (!pgss || !pgss_hash)
19901990
ereport(ERROR,
19911991
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1992-
errmsg("pg_stat_statements must be loaded via shared_preload_libraries")));
1992+
errmsg("pg_stat_statements must be loaded via \"shared_preload_libraries\"")));
19931993

19941994
/* Build a tuple descriptor for our result type */
19951995
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
@@ -2671,7 +2671,7 @@ entry_reset(Oid userid, Oid dbid, uint64 queryid, bool minmax_only)
26712671
if (!pgss || !pgss_hash)
26722672
ereport(ERROR,
26732673
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
2674-
errmsg("pg_stat_statements must be loaded via shared_preload_libraries")));
2674+
errmsg("pg_stat_statements must be loaded via \"shared_preload_libraries\"")));
26752675

26762676
LWLockAcquire(pgss->lock, LW_EXCLUSIVE);
26772677
num_entries = hash_get_num_entries(pgss_hash);

contrib/sepgsql/hooks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ _PG_init(void)
406406
if (IsUnderPostmaster)
407407
ereport(ERROR,
408408
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
409-
errmsg("sepgsql must be loaded via shared_preload_libraries")));
409+
errmsg("sepgsql must be loaded via \"shared_preload_libraries\"")));
410410

411411
/*
412412
* Check availability of SELinux on the platform. If disabled, we cannot

contrib/test_decoding/expected/slot.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ ORDER BY o.slot_name, c.slot_name;
220220
-- released even when raise error during creating the target slot.
221221
SELECT 'copy' FROM pg_copy_logical_replication_slot('orig_slot1', 'failed'); -- error
222222
ERROR: all replication slots are in use
223-
HINT: Free one or increase max_replication_slots.
223+
HINT: Free one or increase "max_replication_slots".
224224
-- temporary slots were dropped automatically
225225
SELECT pg_drop_replication_slot('orig_slot1');
226226
pg_drop_replication_slot

doc/src/sgml/sources.sgml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -533,17 +533,10 @@ Hint: The addendum, written as a complete sentence.
533533
<title>Use of Quotes</title>
534534

535535
<para>
536-
Always use quotes to delimit file names, user-supplied identifiers, and
537-
other variables that might contain words. Do not use them to mark up
538-
variables that will not contain words (for example, operator names).
539-
</para>
540-
541-
<para>
542-
In messages containing configuration variable names, do not include quotes
543-
when the names are visibly not natural English words, such as when they
544-
have underscores, are all-uppercase or have mixed case. Otherwise, quotes
545-
must be added. Do include quotes in a message where an arbitrary variable
546-
name is to be expanded.
536+
Always use quotes to delimit file names, user-supplied identifiers,
537+
configuration variable names, and other variables that might contain
538+
words. Do not use them to mark up variables that will not contain words
539+
(for example, operator names).
547540
</para>
548541

549542
<para>

src/backend/access/gin/ginbulk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ginCombineData(RBTNode *existing, const RBTNode *newdata, void *arg)
4242
ereport(ERROR,
4343
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
4444
errmsg("posting list is too long"),
45-
errhint("Reduce maintenance_work_mem.")));
45+
errhint("Reduce \"maintenance_work_mem\".")));
4646

4747
accum->allocatedMemory -= GetMemoryChunkSpace(eo->list);
4848
eo->maxcount *= 2;

src/backend/access/heap/vacuumlazy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2327,7 +2327,7 @@ lazy_check_wraparound_failsafe(LVRelState *vacrel)
23272327
vacrel->dbname, vacrel->relnamespace, vacrel->relname,
23282328
vacrel->num_index_scans),
23292329
errdetail("The table's relfrozenxid or relminmxid is too far in the past."),
2330-
errhint("Consider increasing configuration parameter maintenance_work_mem or autovacuum_work_mem.\n"
2330+
errhint("Consider increasing configuration parameter \"maintenance_work_mem\" or \"autovacuum_work_mem\".\n"
23312331
"You might also need to consider other ways for VACUUM to keep up with the allocation of transaction IDs.")));
23322332

23332333
/* Stop applying cost limits from this point on */

src/backend/access/table/tableamapi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ check_default_table_access_method(char **newval, void **extra, GucSource source)
106106
{
107107
if (**newval == '\0')
108108
{
109-
GUC_check_errdetail("%s cannot be empty.",
109+
GUC_check_errdetail("\"%s\" cannot be empty.",
110110
"default_table_access_method");
111111
return false;
112112
}
113113

114114
if (strlen(*newval) >= NAMEDATALEN)
115115
{
116-
GUC_check_errdetail("%s is too long (maximum %d characters).",
116+
GUC_check_errdetail("\"%s\" is too long (maximum %d characters).",
117117
"default_table_access_method", NAMEDATALEN - 1);
118118
return false;
119119
}

src/backend/access/transam/commit_ts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ error_commit_ts_disabled(void)
384384
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
385385
errmsg("could not get commit timestamp data"),
386386
RecoveryInProgress() ?
387-
errhint("Make sure the configuration parameter %s is set on the primary server.",
387+
errhint("Make sure the configuration parameter \"%s\" is set on the primary server.",
388388
"track_commit_timestamp") :
389-
errhint("Make sure the configuration parameter %s is set.",
389+
errhint("Make sure the configuration parameter \"%s\" is set.",
390390
"track_commit_timestamp")));
391391
}
392392

src/backend/access/transam/multixact.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
11511151
MultiXactState->offsetStopLimit - nextOffset - 1,
11521152
nmembers,
11531153
MultiXactState->offsetStopLimit - nextOffset - 1),
1154-
errhint("Execute a database-wide VACUUM in database with OID %u with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings.",
1154+
errhint("Execute a database-wide VACUUM in database with OID %u with reduced \"vacuum_multixact_freeze_min_age\" and \"vacuum_multixact_freeze_table_age\" settings.",
11551155
MultiXactState->oldestMultiXactDB)));
11561156
}
11571157

@@ -1187,7 +1187,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
11871187
MultiXactState->offsetStopLimit - nextOffset + nmembers,
11881188
MultiXactState->oldestMultiXactDB,
11891189
MultiXactState->offsetStopLimit - nextOffset + nmembers),
1190-
errhint("Execute a database-wide VACUUM in that database with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings.")));
1190+
errhint("Execute a database-wide VACUUM in that database with reduced \"vacuum_multixact_freeze_min_age\" and \"vacuum_multixact_freeze_table_age\" settings.")));
11911191

11921192
ExtendMultiXactMember(nextOffset, nmembers);
11931193

0 commit comments

Comments
 (0)