From f247d21658ac80262c1ac4d8b07a9bdaebbfe687 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Tue, 11 Jun 2024 11:09:33 +1000
Subject: [PATCH v8] Add quotes foir GUCs - int

---
 src/backend/postmaster/bgworker.c           |  2 +-
 src/backend/postmaster/checkpointer.c       |  2 +-
 src/backend/replication/logical/launcher.c  |  2 +-
 src/backend/storage/file/fd.c               |  2 +-
 src/backend/utils/misc/guc_tables.c         |  8 ++++----
 src/bin/pg_basebackup/pg_createsubscriber.c | 15 ++++++++++-----
 src/include/libpq/libpq-be-fe-helpers.h     |  4 ++--
 7 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c
index fa52b6d..cf5ffb9 100644
--- a/src/backend/postmaster/bgworker.c
+++ b/src/backend/postmaster/bgworker.c
@@ -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;
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c
index 3c68a99..1397335 100644
--- a/src/backend/postmaster/checkpointer.c
+++ b/src/backend/postmaster/checkpointer.c
@@ -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);
 		}
 
diff --git a/src/backend/replication/logical/launcher.c b/src/backend/replication/logical/launcher.c
index 27c3a91..b902b78 100644
--- a/src/backend/replication/logical/launcher.c
+++ b/src/backend/replication/logical/launcher.c
@@ -331,7 +331,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
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index a7c05b0..aa9d5f7 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -2231,7 +2231,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)));
 		}
 	}
diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c
index 46c258b..66ef451 100644
--- a/src/backend/utils/misc/guc_tables.c
+++ b/src/backend/utils/misc/guc_tables.c
@@ -2294,7 +2294,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,
@@ -2349,7 +2349,7 @@ struct config_int ConfigureNamesInt[] =
 	{
 		{"subtransaction_buffers", PGC_POSTMASTER, RESOURCES_MEM,
 			gettext_noop("Sets the size of the dedicated buffer pool used for the sub-transaction 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,
@@ -2360,7 +2360,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,
@@ -2875,7 +2875,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,
diff --git a/src/bin/pg_basebackup/pg_createsubscriber.c b/src/bin/pg_basebackup/pg_createsubscriber.c
index 90cc580..4e2c9ff 100644
--- a/src/bin/pg_basebackup/pg_createsubscriber.c
+++ b/src/bin/pg_basebackup/pg_createsubscriber.c
@@ -932,7 +932,8 @@ check_publisher(const struct LogicalRepInfo *dbinfo)
 	{
 		pg_log_error("publisher requires %d replication slots, but only %d remain",
 					 num_dbs, max_repslots - cur_repslots);
-		pg_log_error_hint("Consider increasing max_replication_slots to at least %d.",
+		pg_log_error_hint("Consider increasing \"%s\" to at least %d.",
+						  "max_replication_slots",
 						  cur_repslots + num_dbs);
 		failed = true;
 	}
@@ -941,7 +942,8 @@ check_publisher(const struct LogicalRepInfo *dbinfo)
 	{
 		pg_log_error("publisher requires %d wal sender processes, but only %d remain",
 					 num_dbs, max_walsenders - cur_walsenders);
-		pg_log_error_hint("Consider increasing max_wal_senders to at least %d.",
+		pg_log_error_hint("Consider increasing \"%s\" to at least %d.",
+						  "max_wal_senders",
 						  cur_walsenders + num_dbs);
 		failed = true;
 	}
@@ -1031,7 +1033,8 @@ check_subscriber(const struct LogicalRepInfo *dbinfo)
 	{
 		pg_log_error("subscriber requires %d replication slots, but only %d remain",
 					 num_dbs, max_repslots);
-		pg_log_error_hint("Consider increasing max_replication_slots to at least %d.",
+		pg_log_error_hint("Consider increasing \"%s\" to at least %d.",
+						  "max_replication_slots",
 						  num_dbs);
 		failed = true;
 	}
@@ -1040,7 +1043,8 @@ check_subscriber(const struct LogicalRepInfo *dbinfo)
 	{
 		pg_log_error("subscriber requires %d logical replication workers, but only %d remain",
 					 num_dbs, max_lrworkers);
-		pg_log_error_hint("Consider increasing max_logical_replication_workers to at least %d.",
+		pg_log_error_hint("Consider increasing \"%s\" to at least %d.",
+						  "max_logical_replication_workers",
 						  num_dbs);
 		failed = true;
 	}
@@ -1049,7 +1053,8 @@ check_subscriber(const struct LogicalRepInfo *dbinfo)
 	{
 		pg_log_error("subscriber requires %d worker processes, but only %d remain",
 					 num_dbs + 1, max_wprocs);
-		pg_log_error_hint("Consider increasing max_worker_processes to at least %d.",
+		pg_log_error_hint("Consider increasing \"%s\" to at least %d.",
+						  "max_worker_processes",
 						  num_dbs + 1);
 		failed = true;
 	}
diff --git a/src/include/libpq/libpq-be-fe-helpers.h b/src/include/libpq/libpq-be-fe-helpers.h
index fe50829..46a90df 100644
--- a/src/include/libpq/libpq-be-fe-helpers.h
+++ b/src/include/libpq/libpq-be-fe-helpers.h
@@ -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
 	}
 }
-- 
1.8.3.1

