Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b4db642

Browse files
committed
Apply more quoting to GUC names in messages
This is a continuation of 17974ec. More quotes are applied to GUC names in error messages and hints, taking care of what seems to be all the remaining holes currently in the tree for the GUCs. Author: Peter Smith Discussion: https://postgr.es/m/CAHut+Pv-kSN8SkxSdoHano_wPubqcg5789ejhCDZAcLFceBR-w@mail.gmail.com
1 parent 6c2b5ed commit b4db642

File tree

15 files changed

+23
-23
lines changed

15 files changed

+23
-23
lines changed

contrib/oid2name/oid2name.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ sql_conn(struct options *my_opts)
353353
res = PQexec(conn, ALWAYS_SECURE_SEARCH_PATH_SQL);
354354
if (PQresultStatus(res) != PGRES_TUPLES_OK)
355355
{
356-
pg_log_error("could not clear search_path: %s",
356+
pg_log_error("could not clear \"search_path\": %s",
357357
PQerrorMessage(conn));
358358
PQclear(res);
359359
PQfinish(conn);

contrib/vacuumlo/vacuumlo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ vacuumlo(const char *database, const struct _param *param)
139139
res = PQexec(conn, ALWAYS_SECURE_SEARCH_PATH_SQL);
140140
if (PQresultStatus(res) != PGRES_TUPLES_OK)
141141
{
142-
pg_log_error("failed to set search_path: %s", PQerrorMessage(conn));
142+
pg_log_error("failed to set \"search_path\": %s", PQerrorMessage(conn));
143143
PQclear(res);
144144
PQfinish(conn);
145145
return -1;

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9111,7 +9111,7 @@ do_pg_backup_stop(BackupState *state, bool waitforarchive)
91119111
ereport(ERROR,
91129112
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
91139113
errmsg("WAL level not sufficient for making an online backup"),
9114-
errhint("wal_level must be set to \"replica\" or \"logical\" at server start.")));
9114+
errhint("\"wal_level\" must be set to \"replica\" or \"logical\" at server start.")));
91159115

91169116
/*
91179117
* OK to update backup counter and session-level lock.

src/backend/archive/shell_archive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ shell_archive_configured(ArchiveModuleState *state)
4848
if (XLogArchiveCommand[0] != '\0')
4949
return true;
5050

51-
arch_module_check_errdetail("%s is not set.",
51+
arch_module_check_errdetail("\"%s\" is not set.",
5252
"archive_command");
5353
return false;
5454
}

src/backend/postmaster/bgworker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ BackgroundWorkerStateChange(bool allow_new_workers)
257257
if (max_worker_processes != BackgroundWorkerData->total_slots)
258258
{
259259
ereport(LOG,
260-
(errmsg("inconsistent background worker state (max_worker_processes=%d, total_slots=%d)",
260+
(errmsg("inconsistent background worker state (\"max_worker_processes\"=%d, total slots=%d)",
261261
max_worker_processes,
262262
BackgroundWorkerData->total_slots)));
263263
return;

src/backend/postmaster/checkpointer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ CheckArchiveTimeout(void)
663663
* assume nothing happened.
664664
*/
665665
if (XLogSegmentOffset(switchpoint, wal_segment_size) != 0)
666-
elog(DEBUG1, "write-ahead log switch forced (archive_timeout=%d)",
666+
elog(DEBUG1, "write-ahead log switch forced (\"archive_timeout\"=%d)",
667667
XLogArchiveTimeout);
668668
}
669669

src/backend/replication/logical/launcher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ logicalrep_worker_launch(LogicalRepWorkerType wtype,
337337
if (max_replication_slots == 0)
338338
ereport(ERROR,
339339
(errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
340-
errmsg("cannot start logical replication workers when max_replication_slots = 0")));
340+
errmsg("cannot start logical replication workers when \"max_replication_slots\"=0")));
341341

342342
/*
343343
* We need to do the modification of the shared memory under lock so that

src/backend/replication/logical/slotsync.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -962,14 +962,14 @@ validate_remote_info(WalReceiverConn *wrconn)
962962

963963
if (res->status != WALRCV_OK_TUPLES)
964964
ereport(ERROR,
965-
errmsg("could not fetch primary_slot_name \"%s\" info from the primary server: %s",
965+
errmsg("could not fetch primary slot name \"%s\" info from the primary server: %s",
966966
PrimarySlotName, res->err),
967-
errhint("Check if primary_slot_name is configured correctly."));
967+
errhint("Check if \"primary_slot_name\" is configured correctly."));
968968

969969
tupslot = MakeSingleTupleTableSlot(res->tupledesc, &TTSOpsMinimalTuple);
970970
if (!tuplestore_gettupleslot(res->tuplestore, true, false, tupslot))
971971
elog(ERROR,
972-
"failed to fetch tuple for the primary server slot specified by primary_slot_name");
972+
"failed to fetch tuple for the primary server slot specified by \"primary_slot_name\"");
973973

974974
remote_in_recovery = DatumGetBool(slot_getattr(tupslot, 1, &isnull));
975975
Assert(!isnull);

src/backend/storage/file/fd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2254,7 +2254,7 @@ FileWriteV(File file, const struct iovec *iov, int iovcnt, off_t offset,
22542254
if (newTotal > (uint64) temp_file_limit * (uint64) 1024)
22552255
ereport(ERROR,
22562256
(errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
2257-
errmsg("temporary file size exceeds temp_file_limit (%dkB)",
2257+
errmsg("temporary file size exceeds \"temp_file_limit\" (%dkB)",
22582258
temp_file_limit)));
22592259
}
22602260
}

src/backend/utils/misc/guc_tables.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,7 +2356,7 @@ struct config_int ConfigureNamesInt[] =
23562356
{
23572357
{"commit_timestamp_buffers", PGC_POSTMASTER, RESOURCES_MEM,
23582358
gettext_noop("Sets the size of the dedicated buffer pool used for the commit timestamp cache."),
2359-
gettext_noop("Specify 0 to have this value determined as a fraction of shared_buffers."),
2359+
gettext_noop("Specify 0 to have this value determined as a fraction of \"shared_buffers\"."),
23602360
GUC_UNIT_BLOCKS
23612361
},
23622362
&commit_timestamp_buffers,
@@ -2411,7 +2411,7 @@ struct config_int ConfigureNamesInt[] =
24112411
{
24122412
{"subtransaction_buffers", PGC_POSTMASTER, RESOURCES_MEM,
24132413
gettext_noop("Sets the size of the dedicated buffer pool used for the subtransaction cache."),
2414-
gettext_noop("Specify 0 to have this value determined as a fraction of shared_buffers."),
2414+
gettext_noop("Specify 0 to have this value determined as a fraction of \"shared_buffers\"."),
24152415
GUC_UNIT_BLOCKS
24162416
},
24172417
&subtransaction_buffers,
@@ -2422,7 +2422,7 @@ struct config_int ConfigureNamesInt[] =
24222422
{
24232423
{"transaction_buffers", PGC_POSTMASTER, RESOURCES_MEM,
24242424
gettext_noop("Sets the size of the dedicated buffer pool used for the transaction status cache."),
2425-
gettext_noop("Specify 0 to have this value determined as a fraction of shared_buffers."),
2425+
gettext_noop("Specify 0 to have this value determined as a fraction of \"shared_buffers\"."),
24262426
GUC_UNIT_BLOCKS
24272427
},
24282428
&transaction_buffers,
@@ -2942,7 +2942,7 @@ struct config_int ConfigureNamesInt[] =
29422942
{
29432943
{"wal_buffers", PGC_POSTMASTER, WAL_SETTINGS,
29442944
gettext_noop("Sets the number of disk-page buffers in shared memory for WAL."),
2945-
gettext_noop("Specify -1 to have this value determined as a fraction of shared_buffers."),
2945+
gettext_noop("Specify -1 to have this value determined as a fraction of \"shared_buffers\"."),
29462946
GUC_UNIT_XBLOCKS
29472947
},
29482948
&XLOGbuffers,
@@ -3068,7 +3068,7 @@ struct config_int ConfigureNamesInt[] =
30683068
{"log_min_duration_sample", PGC_SUSET, LOGGING_WHEN,
30693069
gettext_noop("Sets the minimum execution time above which "
30703070
"a sample of statements will be logged."
3071-
" Sampling is determined by log_statement_sample_rate."),
3071+
" Sampling is determined by \"log_statement_sample_rate\"."),
30723072
gettext_noop("Zero logs a sample of all queries. -1 turns this feature off."),
30733073
GUC_UNIT_MS
30743074
},

src/bin/pg_archivecleanup/pg_archivecleanup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ usage(void)
270270
" clean up\n"));
271271
printf(_(" -?, --help show this help, then exit\n"));
272272
printf(_("\n"
273-
"For use as archive_cleanup_command in postgresql.conf:\n"
273+
"For use as \"archive_cleanup_command\" in postgresql.conf:\n"
274274
" archive_cleanup_command = 'pg_archivecleanup [OPTION]... ARCHIVELOCATION %%r'\n"
275275
"e.g.\n"
276276
" archive_cleanup_command = 'pg_archivecleanup /mnt/server/archiverdir %%r'\n"));

src/bin/pg_basebackup/pg_createsubscriber.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ connect_database(const char *conninfo, bool exit_on_error)
523523
res = PQexec(conn, ALWAYS_SECURE_SEARCH_PATH_SQL);
524524
if (PQresultStatus(res) != PGRES_TUPLES_OK)
525525
{
526-
pg_log_error("could not clear search_path: %s",
526+
pg_log_error("could not clear \"search_path\": %s",
527527
PQresultErrorMessage(res));
528528
PQclear(res);
529529
PQfinish(conn);
@@ -911,7 +911,7 @@ check_publisher(const struct LogicalRepInfo *dbinfo)
911911

912912
if (strcmp(wal_level, "logical") != 0)
913913
{
914-
pg_log_error("publisher requires wal_level >= \"logical\"");
914+
pg_log_error("publisher requires \"wal_level\" >= \"logical\"");
915915
failed = true;
916916
}
917917

src/bin/pg_dump/pg_backup_db.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ _check_database_version(ArchiveHandle *AH)
3939
remoteversion_str = PQparameterStatus(AH->connection, "server_version");
4040
remoteversion = PQserverVersion(AH->connection);
4141
if (remoteversion == 0 || !remoteversion_str)
42-
pg_fatal("could not get server_version from libpq");
42+
pg_fatal("could not get \"server_version\" from libpq");
4343

4444
AH->public.remoteVersionStr = pg_strdup(remoteversion_str);
4545
AH->public.remoteVersion = remoteversion;

src/bin/pg_rewind/pg_rewind.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ getRestoreCommand(const char *argv0)
11041104

11051105
restore_command = pipe_read_line(postgres_cmd->data);
11061106
if (restore_command == NULL)
1107-
pg_fatal("could not read restore_command from target cluster");
1107+
pg_fatal("could not read \"restore_command\" from target cluster");
11081108

11091109
(void) pg_strip_crlf(restore_command);
11101110

src/include/libpq/libpq-be-fe-helpers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@ libpqsrv_connect_prepare(void)
142142
(errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION),
143143
errmsg("could not establish connection"),
144144
errdetail("There are too many open files on the local server."),
145-
errhint("Raise the server's max_files_per_process and/or \"ulimit -n\" limits.")));
145+
errhint("Raise the server's \"max_files_per_process\" and/or \"ulimit -n\" limits.")));
146146
#else
147147
ereport(ERROR,
148148
(errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION),
149149
errmsg("could not establish connection"),
150150
errdetail("There are too many open files on the local server."),
151-
errhint("Raise the server's max_files_per_process setting.")));
151+
errhint("Raise the server's \"max_files_per_process\" setting.")));
152152
#endif
153153
}
154154
}

0 commit comments

Comments
 (0)