mirror of
https://github.com/postgres/postgres.git
synced 2025-11-04 20:11:56 +03:00
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 supersedesa243569bf6and8d9978a717, which had moved things a bit in the opposite direction but which then were abandoned in a partial state. Author: Peter Smith <smithpb2250@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CAHut%2BPv-kSN8SkxSdoHano_wPubqcg5789ejhCDZAcLFceBR-w%40mail.gmail.com
This commit is contained in:
@@ -42,7 +42,7 @@ ginCombineData(RBTNode *existing, const RBTNode *newdata, void *arg)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
|
||||
errmsg("posting list is too long"),
|
||||
errhint("Reduce maintenance_work_mem.")));
|
||||
errhint("Reduce \"maintenance_work_mem\".")));
|
||||
|
||||
accum->allocatedMemory -= GetMemoryChunkSpace(eo->list);
|
||||
eo->maxcount *= 2;
|
||||
|
||||
@@ -2327,7 +2327,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 */
|
||||
|
||||
@@ -106,14 +106,14 @@ check_default_table_access_method(char **newval, void **extra, GucSource source)
|
||||
{
|
||||
if (**newval == '\0')
|
||||
{
|
||||
GUC_check_errdetail("%s cannot be empty.",
|
||||
GUC_check_errdetail("\"%s\" cannot be empty.",
|
||||
"default_table_access_method");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (strlen(*newval) >= NAMEDATALEN)
|
||||
{
|
||||
GUC_check_errdetail("%s is too long (maximum %d characters).",
|
||||
GUC_check_errdetail("\"%s\" is too long (maximum %d characters).",
|
||||
"default_table_access_method", NAMEDATALEN - 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -384,9 +384,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")));
|
||||
}
|
||||
|
||||
|
||||
@@ -1151,7 +1151,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
|
||||
MultiXactState->offsetStopLimit - nextOffset - 1,
|
||||
nmembers,
|
||||
MultiXactState->offsetStopLimit - nextOffset - 1),
|
||||
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.",
|
||||
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.",
|
||||
MultiXactState->oldestMultiXactDB)));
|
||||
}
|
||||
|
||||
@@ -1187,7 +1187,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
|
||||
MultiXactState->offsetStopLimit - nextOffset + nmembers,
|
||||
MultiXactState->oldestMultiXactDB,
|
||||
MultiXactState->offsetStopLimit - nextOffset + nmembers),
|
||||
errhint("Execute a database-wide VACUUM in that database with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings.")));
|
||||
errhint("Execute a database-wide VACUUM in that database with reduced \"vacuum_multixact_freeze_min_age\" and \"vacuum_multixact_freeze_table_age\" settings.")));
|
||||
|
||||
ExtendMultiXactMember(nextOffset, nmembers);
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ void
|
||||
RmgrNotFound(RmgrId rmid)
|
||||
{
|
||||
ereport(ERROR, (errmsg("resource manager with ID %d not registered", rmid),
|
||||
errhint("Include the extension module that implements this resource manager in shared_preload_libraries.")));
|
||||
errhint("Include the extension module that implements this resource manager in \"shared_preload_libraries\".")));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -118,7 +118,7 @@ RegisterCustomRmgr(RmgrId rmid, const RmgrData *rmgr)
|
||||
if (!process_shared_preload_libraries_in_progress)
|
||||
ereport(ERROR,
|
||||
(errmsg("failed to register custom resource manager \"%s\" with ID %d", rmgr->rm_name, rmid),
|
||||
errdetail("Custom resource manager must be registered while initializing modules in shared_preload_libraries.")));
|
||||
errdetail("Custom resource manager must be registered while initializing modules in \"shared_preload_libraries\".")));
|
||||
|
||||
if (RmgrTable[rmid].rm_name != NULL)
|
||||
ereport(ERROR,
|
||||
|
||||
@@ -373,7 +373,7 @@ MarkAsPreparing(TransactionId xid, const char *gid,
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("prepared transactions are disabled"),
|
||||
errhint("Set max_prepared_transactions to a nonzero value.")));
|
||||
errhint("Set \"max_prepared_transactions\" to a nonzero value.")));
|
||||
|
||||
/* on first call, register the exit hook */
|
||||
if (!twophaseExitRegistered)
|
||||
@@ -402,7 +402,7 @@ MarkAsPreparing(TransactionId xid, const char *gid,
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OUT_OF_MEMORY),
|
||||
errmsg("maximum number of prepared transactions reached"),
|
||||
errhint("Increase max_prepared_transactions (currently %d).",
|
||||
errhint("Increase \"max_prepared_transactions\" (currently %d).",
|
||||
max_prepared_xacts)));
|
||||
gxact = TwoPhaseState->freeGXacts;
|
||||
TwoPhaseState->freeGXacts = gxact->next;
|
||||
@@ -2539,7 +2539,7 @@ PrepareRedoAdd(char *buf, XLogRecPtr start_lsn,
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OUT_OF_MEMORY),
|
||||
errmsg("maximum number of prepared transactions reached"),
|
||||
errhint("Increase max_prepared_transactions (currently %d).",
|
||||
errhint("Increase \"max_prepared_transactions\" (currently %d).",
|
||||
max_prepared_xacts)));
|
||||
gxact = TwoPhaseState->freeGXacts;
|
||||
TwoPhaseState->freeGXacts = gxact->next;
|
||||
|
||||
@@ -4501,11 +4501,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) -
|
||||
@@ -5351,9 +5351,9 @@ CheckRequiredParameterValues(void)
|
||||
{
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("WAL was generated with wal_level=minimal, cannot continue recovering"),
|
||||
errdetail("This happens if you temporarily set wal_level=minimal on the server."),
|
||||
errhint("Use a backup taken after setting wal_level to higher than minimal.")));
|
||||
errmsg("WAL was generated with \"wal_level=minimal\", cannot continue recovering"),
|
||||
errdetail("This happens if you temporarily set \"wal_level=minimal\" on the server."),
|
||||
errhint("Use a backup taken after setting \"wal_level\" to higher than \"minimal\".")));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8549,7 +8549,7 @@ get_sync_bit(int method)
|
||||
#endif
|
||||
default:
|
||||
/* can't happen (unless we are out of sync with option array) */
|
||||
elog(ERROR, "unrecognized wal_sync_method: %d", method);
|
||||
elog(ERROR, "unrecognized \"wal_sync_method\": %d", method);
|
||||
return 0; /* silence warning */
|
||||
}
|
||||
}
|
||||
@@ -8647,7 +8647,7 @@ issue_xlog_fsync(int fd, XLogSegNo segno, TimeLineID tli)
|
||||
default:
|
||||
ereport(PANIC,
|
||||
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg_internal("unrecognized wal_sync_method: %d", wal_sync_method));
|
||||
errmsg_internal("unrecognized \"wal_sync_method\": %d", wal_sync_method));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -8725,7 +8725,7 @@ do_pg_backup_start(const char *backupidstr, bool fast, List **tablespaces,
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("WAL level not sufficient for making an online backup"),
|
||||
errhint("wal_level must be set to \"replica\" or \"logical\" at server start.")));
|
||||
errhint("\"wal_level\" must be set to \"replica\" or \"logical\" at server start.")));
|
||||
|
||||
if (strlen(backupidstr) > MAXPGPATH)
|
||||
ereport(ERROR,
|
||||
@@ -8851,11 +8851,11 @@ do_pg_backup_start(const char *backupidstr, bool fast, List **tablespaces,
|
||||
if (!checkpointfpw || state->startpoint <= recptr)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("WAL generated with full_page_writes=off was replayed "
|
||||
errmsg("WAL generated with \"full_page_writes=off\" was replayed "
|
||||
"since last restartpoint"),
|
||||
errhint("This means that the backup being taken on the standby "
|
||||
"is corrupt and should not be used. "
|
||||
"Enable full_page_writes and run CHECKPOINT on the primary, "
|
||||
"Enable \"full_page_writes\" and run CHECKPOINT on the primary, "
|
||||
"and then try an online backup again.")));
|
||||
|
||||
/*
|
||||
@@ -9147,11 +9147,11 @@ do_pg_backup_stop(BackupState *state, bool waitforarchive)
|
||||
if (state->startpoint <= recptr)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("WAL generated with full_page_writes=off was replayed "
|
||||
errmsg("WAL generated with \"full_page_writes=off\" was replayed "
|
||||
"during online backup"),
|
||||
errhint("This means that the backup being taken on the standby "
|
||||
"is corrupt and should not be used. "
|
||||
"Enable full_page_writes and run CHECKPOINT on the primary, "
|
||||
"Enable \"full_page_writes\" and run CHECKPOINT on the primary, "
|
||||
"and then try an online backup again.")));
|
||||
|
||||
|
||||
@@ -9279,7 +9279,7 @@ do_pg_backup_stop(BackupState *state, bool waitforarchive)
|
||||
ereport(WARNING,
|
||||
(errmsg("still waiting for all required WAL segments to be archived (%d seconds elapsed)",
|
||||
waits),
|
||||
errhint("Check that your archive_command is executing properly. "
|
||||
errhint("Check that your \"archive_command\" is executing properly. "
|
||||
"You can safely cancel this backup, "
|
||||
"but the database backup will not be usable without all the WAL segments.")));
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ RestoreArchivedFile(char *path, const char *xlogfname,
|
||||
ereport(elevel,
|
||||
(errcode_for_file_access(),
|
||||
errmsg("could not stat file \"%s\": %m", xlogpath),
|
||||
errdetail("restore_command returned a zero exit status, but stat() failed.")));
|
||||
errdetail("\"restore_command\" returned a zero exit status, but stat() failed.")));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ pg_log_standby_snapshot(PG_FUNCTION_ARGS)
|
||||
if (!XLogStandbyInfoActive())
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("pg_log_standby_snapshot() can only be used if wal_level >= replica")));
|
||||
errmsg("pg_log_standby_snapshot() can only be used if \"wal_level\" >= \"replica\"")));
|
||||
|
||||
recptr = LogStandbySnapshot();
|
||||
|
||||
@@ -245,7 +245,7 @@ pg_create_restore_point(PG_FUNCTION_ARGS)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("WAL level not sufficient for creating a restore point"),
|
||||
errhint("wal_level must be set to \"replica\" or \"logical\" at server start.")));
|
||||
errhint("\"wal_level\" must be set to \"replica\" or \"logical\" at server start.")));
|
||||
|
||||
restore_name_str = text_to_cstring(restore_name);
|
||||
|
||||
|
||||
@@ -1085,7 +1085,7 @@ check_recovery_prefetch(int *new_value, void **extra, GucSource source)
|
||||
#ifndef USE_PREFETCH
|
||||
if (*new_value == RECOVERY_PREFETCH_ON)
|
||||
{
|
||||
GUC_check_errdetail("recovery_prefetch is not supported on platforms that lack posix_fadvise().");
|
||||
GUC_check_errdetail("\"recovery_prefetch\" is not supported on platforms that lack posix_fadvise().");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1119,7 +1119,7 @@ validateRecoveryParameters(void)
|
||||
if ((PrimaryConnInfo == NULL || strcmp(PrimaryConnInfo, "") == 0) &&
|
||||
(recoveryRestoreCommand == NULL || strcmp(recoveryRestoreCommand, "") == 0))
|
||||
ereport(WARNING,
|
||||
(errmsg("specified neither primary_conninfo nor restore_command"),
|
||||
(errmsg("specified neither \"primary_conninfo\" nor \"restore_command\""),
|
||||
errhint("The database server will regularly poll the pg_wal subdirectory to check for files placed there.")));
|
||||
}
|
||||
else
|
||||
@@ -1128,7 +1128,7 @@ validateRecoveryParameters(void)
|
||||
strcmp(recoveryRestoreCommand, "") == 0)
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("must specify restore_command when standby mode is not enabled")));
|
||||
errmsg("must specify \"restore_command\" when standby mode is not enabled")));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2162,7 +2162,7 @@ CheckTablespaceDirectory(void)
|
||||
errmsg("unexpected directory entry \"%s\" found in %s",
|
||||
de->d_name, "pg_tblspc/"),
|
||||
errdetail("All directory entries in pg_tblspc/ should be symbolic links."),
|
||||
errhint("Remove those directories, or set allow_in_place_tablespaces to ON transiently to let recovery complete.")));
|
||||
errhint("Remove those directories, or set \"allow_in_place_tablespaces\" to ON transiently to let recovery complete.")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4771,7 +4771,7 @@ error_multiple_recovery_targets(void)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("multiple recovery targets specified"),
|
||||
errdetail("At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set.")));
|
||||
errdetail("At most one of \"recovery_target\", \"recovery_target_lsn\", \"recovery_target_name\", \"recovery_target_time\", \"recovery_target_xid\" may be set.")));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4855,7 +4855,7 @@ check_recovery_target_name(char **newval, void **extra, GucSource source)
|
||||
/* Use the value of newval directly */
|
||||
if (strlen(*newval) >= MAXFNAMELEN)
|
||||
{
|
||||
GUC_check_errdetail("%s is too long (maximum %d characters).",
|
||||
GUC_check_errdetail("\"%s\" is too long (maximum %d characters).",
|
||||
"recovery_target_name", MAXFNAMELEN - 1);
|
||||
return false;
|
||||
}
|
||||
@@ -4979,7 +4979,7 @@ check_recovery_target_timeline(char **newval, void **extra, GucSource source)
|
||||
strtoul(*newval, NULL, 0);
|
||||
if (errno == EINVAL || errno == ERANGE)
|
||||
{
|
||||
GUC_check_errdetail("recovery_target_timeline is not a valid number.");
|
||||
GUC_check_errdetail("\"recovery_target_timeline\" is not a valid number.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user