Apply more quoting to GUC names in messages
authorMichael Paquier <[email protected]>
Wed, 4 Sep 2024 04:50:44 +0000 (13:50 +0900)
committerMichael Paquier <[email protected]>
Wed, 4 Sep 2024 04:50:44 +0000 (13:50 +0900)
This is a continuation of 17974ec25946.  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

15 files changed:
contrib/oid2name/oid2name.c
contrib/vacuumlo/vacuumlo.c
src/backend/access/transam/xlog.c
src/backend/archive/shell_archive.c
src/backend/postmaster/bgworker.c
src/backend/postmaster/checkpointer.c
src/backend/replication/logical/launcher.c
src/backend/replication/logical/slotsync.c
src/backend/storage/file/fd.c
src/backend/utils/misc/guc_tables.c
src/bin/pg_archivecleanup/pg_archivecleanup.c
src/bin/pg_basebackup/pg_createsubscriber.c
src/bin/pg_dump/pg_backup_db.c
src/bin/pg_rewind/pg_rewind.c
src/include/libpq/libpq-be-fe-helpers.h

index c2785848f557fb774310bca94cb33e2b243a21f3..51802907138ed93409735dfef686db39cf4ce8b7 100644 (file)
@@ -353,7 +353,7 @@ sql_conn(struct options *my_opts)
    res = PQexec(conn, ALWAYS_SECURE_SEARCH_PATH_SQL);
    if (PQresultStatus(res) != PGRES_TUPLES_OK)
    {
-       pg_log_error("could not clear search_path: %s",
+       pg_log_error("could not clear \"search_path\": %s",
                     PQerrorMessage(conn));
        PQclear(res);
        PQfinish(conn);
index 0d99428dec666f787149d136b52ad2cda0d14234..ce1bbab12eb95efdf5882dbec56b6e2f3220c91d 100644 (file)
@@ -139,7 +139,7 @@ vacuumlo(const char *database, const struct _param *param)
    res = PQexec(conn, ALWAYS_SECURE_SEARCH_PATH_SQL);
    if (PQresultStatus(res) != PGRES_TUPLES_OK)
    {
-       pg_log_error("failed to set search_path: %s", PQerrorMessage(conn));
+       pg_log_error("failed to set \"search_path\": %s", PQerrorMessage(conn));
        PQclear(res);
        PQfinish(conn);
        return -1;
index 5211e4e10889a3b5f736819bbe84d15db96eeb78..c1def6fdf52da4b4b3afaf42c13a5c6e5a8ebeb3 100644 (file)
@@ -9111,7 +9111,7 @@ do_pg_backup_stop(BackupState *state, bool waitforarchive)
        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.")));
 
    /*
     * OK to update backup counter and session-level lock.
index 506c5a30ad20910a46920aaac6b98419f7e6492e..4de7e66f6eb555ab3b96b9eb01d554cf93f35316 100644 (file)
@@ -48,7 +48,7 @@ shell_archive_configured(ArchiveModuleState *state)
    if (XLogArchiveCommand[0] != '\0')
        return true;
 
-   arch_module_check_errdetail("%s is not set.",
+   arch_module_check_errdetail("\"%s\" is not set.",
                                "archive_command");
    return false;
 }
index b83967cda351ed9f74558835f89f5c0d7dc0afad..07bc5517fc2173a2f27dc985df6b542657420548 100644 (file)
@@ -257,7 +257,7 @@ BackgroundWorkerStateChange(bool allow_new_workers)
    if (max_worker_processes != BackgroundWorkerData->total_slots)
    {
        ereport(LOG,
-               (errmsg("inconsistent background worker state (max_worker_processes=%d, total_slots=%d)",
+               (errmsg("inconsistent background worker state (\"max_worker_processes\"=%d, total slots=%d)",
                        max_worker_processes,
                        BackgroundWorkerData->total_slots)));
        return;
index 199f008bcda81fefe8a005c9f7d5a3971da2df91..eeb73c85726c2017a89504391b44a530d4bd1bb9 100644 (file)
@@ -663,7 +663,7 @@ CheckArchiveTimeout(void)
             * assume nothing happened.
             */
            if (XLogSegmentOffset(switchpoint, wal_segment_size) != 0)
-               elog(DEBUG1, "write-ahead log switch forced (archive_timeout=%d)",
+               elog(DEBUG1, "write-ahead log switch forced (\"archive_timeout\"=%d)",
                     XLogArchiveTimeout);
        }
 
index c566d50a072b92bd07f4179100275d0d0b1f4c7c..e5fdca8bbf6eed23eb4abb7ffa7aa93c2534851d 100644 (file)
@@ -337,7 +337,7 @@ logicalrep_worker_launch(LogicalRepWorkerType wtype,
    if (max_replication_slots == 0)
        ereport(ERROR,
                (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
-                errmsg("cannot start logical replication workers when max_replication_slots = 0")));
+                errmsg("cannot start logical replication workers when \"max_replication_slots\"=0")));
 
    /*
     * We need to do the modification of the shared memory under lock so that
index 33378bacea6fa4df1aaeb08d932bc52706e24d1b..f9649eec1a59f80fa7b3a31f4a7b3cfb2a129913 100644 (file)
@@ -962,14 +962,14 @@ validate_remote_info(WalReceiverConn *wrconn)
 
    if (res->status != WALRCV_OK_TUPLES)
        ereport(ERROR,
-               errmsg("could not fetch primary_slot_name \"%s\" info from the primary server: %s",
+               errmsg("could not fetch primary slot name \"%s\" info from the primary server: %s",
                       PrimarySlotName, res->err),
-               errhint("Check if primary_slot_name is configured correctly."));
+               errhint("Check if \"primary_slot_name\" is configured correctly."));
 
    tupslot = MakeSingleTupleTableSlot(res->tupledesc, &TTSOpsMinimalTuple);
    if (!tuplestore_gettupleslot(res->tuplestore, true, false, tupslot))
        elog(ERROR,
-            "failed to fetch tuple for the primary server slot specified by primary_slot_name");
+            "failed to fetch tuple for the primary server slot specified by \"primary_slot_name\"");
 
    remote_in_recovery = DatumGetBool(slot_getattr(tupslot, 1, &isnull));
    Assert(!isnull);
index d5204b1eb910991b0f89a4092345e6bb4fb58166..8df0e2f81a451d2e82a55254fe90a535af1a111e 100644 (file)
@@ -2254,7 +2254,7 @@ FileWriteV(File file, const struct iovec *iov, int iovcnt, off_t offset,
            if (newTotal > (uint64) temp_file_limit * (uint64) 1024)
                ereport(ERROR,
                        (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
-                        errmsg("temporary file size exceeds temp_file_limit (%dkB)",
+                        errmsg("temporary file size exceeds \"temp_file_limit\" (%dkB)",
                                temp_file_limit)));
        }
    }
index 521ec5591c8ffb9d1f613b1f6b899207f6355838..686309db58b983841b8e1b46127a494592a28b67 100644 (file)
@@ -2356,7 +2356,7 @@ struct config_int ConfigureNamesInt[] =
    {
        {"commit_timestamp_buffers", PGC_POSTMASTER, RESOURCES_MEM,
            gettext_noop("Sets the size of the dedicated buffer pool used for the commit timestamp cache."),
-           gettext_noop("Specify 0 to have this value determined as a fraction of shared_buffers."),
+           gettext_noop("Specify 0 to have this value determined as a fraction of \"shared_buffers\"."),
            GUC_UNIT_BLOCKS
        },
        &commit_timestamp_buffers,
@@ -2411,7 +2411,7 @@ struct config_int ConfigureNamesInt[] =
    {
        {"subtransaction_buffers", PGC_POSTMASTER, RESOURCES_MEM,
            gettext_noop("Sets the size of the dedicated buffer pool used for the subtransaction cache."),
-           gettext_noop("Specify 0 to have this value determined as a fraction of shared_buffers."),
+           gettext_noop("Specify 0 to have this value determined as a fraction of \"shared_buffers\"."),
            GUC_UNIT_BLOCKS
        },
        &subtransaction_buffers,
@@ -2422,7 +2422,7 @@ struct config_int ConfigureNamesInt[] =
    {
        {"transaction_buffers", PGC_POSTMASTER, RESOURCES_MEM,
            gettext_noop("Sets the size of the dedicated buffer pool used for the transaction status cache."),
-           gettext_noop("Specify 0 to have this value determined as a fraction of shared_buffers."),
+           gettext_noop("Specify 0 to have this value determined as a fraction of \"shared_buffers\"."),
            GUC_UNIT_BLOCKS
        },
        &transaction_buffers,
@@ -2942,7 +2942,7 @@ struct config_int ConfigureNamesInt[] =
    {
        {"wal_buffers", PGC_POSTMASTER, WAL_SETTINGS,
            gettext_noop("Sets the number of disk-page buffers in shared memory for WAL."),
-           gettext_noop("Specify -1 to have this value determined as a fraction of shared_buffers."),
+           gettext_noop("Specify -1 to have this value determined as a fraction of \"shared_buffers\"."),
            GUC_UNIT_XBLOCKS
        },
        &XLOGbuffers,
@@ -3068,7 +3068,7 @@ struct config_int ConfigureNamesInt[] =
        {"log_min_duration_sample", PGC_SUSET, LOGGING_WHEN,
            gettext_noop("Sets the minimum execution time above which "
                         "a sample of statements will be logged."
-                        " Sampling is determined by log_statement_sample_rate."),
+                        " Sampling is determined by \"log_statement_sample_rate\"."),
            gettext_noop("Zero logs a sample of all queries. -1 turns this feature off."),
            GUC_UNIT_MS
        },
index 5a124385b7cd8208b792fce2a743e54659872a21..c25348bcb85ddb098b8359c4a0034b6a14a891e6 100644 (file)
@@ -270,7 +270,7 @@ usage(void)
             "                              clean up\n"));
    printf(_("  -?, --help                  show this help, then exit\n"));
    printf(_("\n"
-            "For use as archive_cleanup_command in postgresql.conf:\n"
+            "For use as \"archive_cleanup_command\" in postgresql.conf:\n"
             "  archive_cleanup_command = 'pg_archivecleanup [OPTION]... ARCHIVELOCATION %%r'\n"
             "e.g.\n"
             "  archive_cleanup_command = 'pg_archivecleanup /mnt/server/archiverdir %%r'\n"));
index 6b793931f3e84ef1dfc0c37bc63beff0c993c73f..e804b2a63ef30d05b340c2da60c3b39914b11835 100644 (file)
@@ -523,7 +523,7 @@ connect_database(const char *conninfo, bool exit_on_error)
    res = PQexec(conn, ALWAYS_SECURE_SEARCH_PATH_SQL);
    if (PQresultStatus(res) != PGRES_TUPLES_OK)
    {
-       pg_log_error("could not clear search_path: %s",
+       pg_log_error("could not clear \"search_path\": %s",
                     PQresultErrorMessage(res));
        PQclear(res);
        PQfinish(conn);
@@ -911,7 +911,7 @@ check_publisher(const struct LogicalRepInfo *dbinfo)
 
    if (strcmp(wal_level, "logical") != 0)
    {
-       pg_log_error("publisher requires wal_level >= \"logical\"");
+       pg_log_error("publisher requires \"wal_level\" >= \"logical\"");
        failed = true;
    }
 
index a02841c4050262cf6d48acc09004bbfe2d84e409..4d1957a7eb3df4a6e99dfe4cdc4e496b2c71cd78 100644 (file)
@@ -39,7 +39,7 @@ _check_database_version(ArchiveHandle *AH)
    remoteversion_str = PQparameterStatus(AH->connection, "server_version");
    remoteversion = PQserverVersion(AH->connection);
    if (remoteversion == 0 || !remoteversion_str)
-       pg_fatal("could not get server_version from libpq");
+       pg_fatal("could not get \"server_version\" from libpq");
 
    AH->public.remoteVersionStr = pg_strdup(remoteversion_str);
    AH->public.remoteVersion = remoteversion;
index 1027d235dc1d05f20b0771feab9107c2cb3bbdc0..960916a1e86aef88f9eeafbeed3330c2c6bf5426 100644 (file)
@@ -1104,7 +1104,7 @@ getRestoreCommand(const char *argv0)
 
    restore_command = pipe_read_line(postgres_cmd->data);
    if (restore_command == NULL)
-       pg_fatal("could not read restore_command from target cluster");
+       pg_fatal("could not read \"restore_command\" from target cluster");
 
    (void) pg_strip_crlf(restore_command);
 
index fe508292743f6080738b3cc4b8e54c597dda7908..46a90dfb022224796254004f52a7a270aee4f6dc 100644 (file)
@@ -142,13 +142,13 @@ libpqsrv_connect_prepare(void)
                (errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION),
                 errmsg("could not establish connection"),
                 errdetail("There are too many open files on the local server."),
-                errhint("Raise the server's max_files_per_process and/or \"ulimit -n\" limits.")));
+                errhint("Raise the server's \"max_files_per_process\" and/or \"ulimit -n\" limits.")));
 #else
        ereport(ERROR,
                (errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION),
                 errmsg("could not establish connection"),
                 errdetail("There are too many open files on the local server."),
-                errhint("Raise the server's max_files_per_process setting.")));
+                errhint("Raise the server's \"max_files_per_process\" setting.")));
 #endif
    }
 }