From 905ea97489d57240f4c49728f0bc6c305776813a Mon Sep 17 00:00:00 2001
From: Daniel Gustafsson <daniel@yesql.se>
Date: Wed, 13 Apr 2022 11:12:18 +0200
Subject: [PATCH 2/5] pg_log_error and pg_log_error_detail capitalization and
 punctutation

---
 src/bin/pg_dump/pg_backup_db.c |  2 +-
 src/bin/pg_dump/pg_dump.c      |  4 +--
 src/bin/pg_dump/pg_dumpall.c   |  2 +-
 src/bin/pgbench/pgbench.c      |  2 +-
 src/bin/psql/command.c         |  6 ++---
 src/bin/psql/common.c          |  6 ++---
 src/bin/psql/describe.c        | 46 +++++++++++++++++-----------------
 7 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c
index 89cdbf80e0..9a08ce8968 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -51,7 +51,7 @@ _check_database_version(ArchiveHandle *AH)
 			remoteversion > AH->public.maxRemoteVersion))
 	{
 		pg_log_error("aborting because of server version mismatch");
-		pg_log_error_detail("server version: %s; %s version: %s",
+		pg_log_error_detail("Server version: %s; %s version: %s",
 							remoteversion_str, progname, PG_VERSION);
 		exit(1);
 	}
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 969e2a7a46..3557939f59 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -2026,7 +2026,7 @@ dumpTableData_copy(Archive *fout, const void *dcontext)
 	if (ret == -2)
 	{
 		/* copy data transfer failed */
-		pg_log_error("Dumping the contents of table \"%s\" failed: PQgetCopyData() failed.", classname);
+		pg_log_error("dumping the contents of table \"%s\" failed: PQgetCopyData() failed", classname);
 		pg_log_error_detail("Error message from server: %s", PQerrorMessage(conn));
 		pg_log_error_detail("Command was: %s", q->data);
 		exit_nicely(1);
@@ -2036,7 +2036,7 @@ dumpTableData_copy(Archive *fout, const void *dcontext)
 	res = PQgetResult(conn);
 	if (PQresultStatus(res) != PGRES_COMMAND_OK)
 	{
-		pg_log_error("Dumping the contents of table \"%s\" failed: PQgetResult() failed.", classname);
+		pg_log_error("dumping the contents of table \"%s\" failed: PQgetResult() failed", classname);
 		pg_log_error_detail("Error message from server: %s", PQerrorMessage(conn));
 		pg_log_error_detail("Command was: %s", q->data);
 		exit_nicely(1);
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 6ef3d61421..6848b10b27 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -1634,7 +1634,7 @@ connectDatabase(const char *dbname, const char *connection_string,
 			(server_version / 100) > (my_version / 100)))
 	{
 		pg_log_error("aborting because of server version mismatch");
-		pg_log_error_detail("server version: %s; %s version: %s",
+		pg_log_error_detail("Server version: %s; %s version: %s",
 							remoteversion_str, progname, PG_VERSION);
 		exit_nicely(1);
 	}
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index e63cea56a1..8585dfc68d 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -7279,7 +7279,7 @@ main(int argc, char **argv)
 	THREAD_BARRIER_DESTROY(&barrier);
 
 	if (exit_code != 0)
-		pg_log_error("Run was aborted; the above results are incomplete.");
+		pg_log_error("run was aborted; the above results are incomplete");
 
 	return exit_code;
 }
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index b51d28780b..7c49d55ff9 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -2105,7 +2105,7 @@ exec_command_password(PsqlScanState scan_state, bool active_branch)
 		}
 		else if (strcmp(pw1, pw2) != 0)
 		{
-			pg_log_error("Passwords didn't match.");
+			pg_log_error("passwords didn't match");
 			success = false;
 		}
 		else
@@ -3171,7 +3171,7 @@ do_connect(enum trivalue reuse_previous_specification,
 	/* Complain if we have additional arguments after a connection string. */
 	if (has_connection_string && (user || host || port))
 	{
-		pg_log_error("Do not give user, host, or port separately when using a connection string");
+		pg_log_error("do not give user, host, or port separately when using a connection string");
 		return false;
 	}
 
@@ -3206,7 +3206,7 @@ do_connect(enum trivalue reuse_previous_specification,
 		else
 		{
 			/* This is reachable after a non-interactive \connect failure */
-			pg_log_error("No database connection exists to re-use parameters from");
+			pg_log_error("no database connection exists to re-use parameters from");
 			return false;
 		}
 	}
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index feb1d547d4..0055c6f55e 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -559,7 +559,7 @@ PSQLexec(const char *query)
 
 	if (!pset.db)
 	{
-		pg_log_error("You are currently not connected to a database.");
+		pg_log_error("you are currently not connected to a database");
 		return NULL;
 	}
 
@@ -616,7 +616,7 @@ PSQLexecWatch(const char *query, const printQueryOpt *opt, FILE *printQueryFout)
 
 	if (!pset.db)
 	{
-		pg_log_error("You are currently not connected to a database.");
+		pg_log_error("you are currently not connected to a database");
 		return 0;
 	}
 
@@ -1121,7 +1121,7 @@ SendQuery(const char *query)
 
 	if (!pset.db)
 	{
-		pg_log_error("You are currently not connected to a database.");
+		pg_log_error("you are currently not connected to a database");
 		goto sendquery_cleanup;
 	}
 
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index e7377d4583..afe23285c6 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -139,7 +139,7 @@ describeAccessMethods(const char *pattern, bool verbose)
 	{
 		char		sverbuf[32];
 
-		pg_log_error("The server (version %s) does not support access methods.",
+		pg_log_error("the server (version %s) does not support access methods",
 					 formatPGVersionNumber(pset.sversion, false,
 										   sverbuf, sizeof(sverbuf)));
 		return true;
@@ -1400,10 +1400,10 @@ describeTableDetails(const char *pattern, bool verbose, bool showSystem)
 		if (!pset.quiet)
 		{
 			if (pattern)
-				pg_log_error("Did not find any relation named \"%s\".",
+				pg_log_error("did not find any relation named \"%s\"",
 							 pattern);
 			else
-				pg_log_error("Did not find any relations.");
+				pg_log_error("did not find any relations");
 		}
 		PQclear(res);
 		return false;
@@ -1599,7 +1599,7 @@ describeOneTableDetails(const char *schemaname,
 	if (PQntuples(res) == 0)
 	{
 		if (!pset.quiet)
-			pg_log_error("Did not find any relation with OID %s.", oid);
+			pg_log_error("did not find any relation with OID %s", oid);
 		goto error_return;
 	}
 
@@ -3718,13 +3718,13 @@ listDbRoleSettings(const char *pattern, const char *pattern2)
 	if (PQntuples(res) == 0 && !pset.quiet)
 	{
 		if (pattern && pattern2)
-			pg_log_error("Did not find any settings for role \"%s\" and database \"%s\".",
+			pg_log_error("did not find any settings for role \"%s\" and database \"%s\"",
 						 pattern, pattern2);
 		else if (pattern)
-			pg_log_error("Did not find any settings for role \"%s\".",
+			pg_log_error("did not find any settings for role \"%s\"",
 						 pattern);
 		else
-			pg_log_error("Did not find any settings.");
+			pg_log_error("did not find any settings");
 	}
 	else
 	{
@@ -3913,10 +3913,10 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys
 	if (PQntuples(res) == 0 && !pset.quiet)
 	{
 		if (pattern)
-			pg_log_error("Did not find any relation named \"%s\".",
+			pg_log_error("did not find any relation named \"%s\"",
 						 pattern);
 		else
-			pg_log_error("Did not find any relations.");
+			pg_log_error("did not find any relations");
 	}
 	else
 	{
@@ -3969,7 +3969,7 @@ listPartitionedTables(const char *reltypes, const char *pattern, bool verbose)
 	{
 		char		sverbuf[32];
 
-		pg_log_error("The server (version %s) does not support declarative table partitioning.",
+		pg_log_error("the server (version %s) does not support declarative table partitioning",
 					 formatPGVersionNumber(pset.sversion, false,
 										   sverbuf, sizeof(sverbuf)));
 		return true;
@@ -4450,7 +4450,7 @@ listEventTriggers(const char *pattern, bool verbose)
 	{
 		char		sverbuf[32];
 
-		pg_log_error("The server (version %s) does not support event triggers.",
+		pg_log_error("the server (version %s) does not support event triggers",
 					 formatPGVersionNumber(pset.sversion, false,
 										   sverbuf, sizeof(sverbuf)));
 		return true;
@@ -4524,7 +4524,7 @@ listExtendedStats(const char *pattern)
 	{
 		char		sverbuf[32];
 
-		pg_log_error("The server (version %s) does not support extended statistics.",
+		pg_log_error("the server (version %s) does not support extended statistics",
 					 formatPGVersionNumber(pset.sversion, false,
 										   sverbuf, sizeof(sverbuf)));
 		return true;
@@ -5017,10 +5017,10 @@ listTSParsersVerbose(const char *pattern)
 		if (!pset.quiet)
 		{
 			if (pattern)
-				pg_log_error("Did not find any text search parser named \"%s\".",
+				pg_log_error("did not find any text search parser named \"%s\"",
 							 pattern);
 			else
-				pg_log_error("Did not find any text search parsers.");
+				pg_log_error("did not find any text search parsers");
 		}
 		PQclear(res);
 		return false;
@@ -5377,10 +5377,10 @@ listTSConfigsVerbose(const char *pattern)
 		if (!pset.quiet)
 		{
 			if (pattern)
-				pg_log_error("Did not find any text search configuration named \"%s\".",
+				pg_log_error("did not find any text search configuration named \"%s\"",
 							 pattern);
 			else
-				pg_log_error("Did not find any text search configurations.");
+				pg_log_error("did not find any text search configurations");
 		}
 		PQclear(res);
 		return false;
@@ -5825,10 +5825,10 @@ listExtensionContents(const char *pattern)
 		if (!pset.quiet)
 		{
 			if (pattern)
-				pg_log_error("Did not find any extension named \"%s\".",
+				pg_log_error("did not find any extension named \"%s\"",
 							 pattern);
 			else
-				pg_log_error("Did not find any extensions.");
+				pg_log_error("did not find any extensions");
 		}
 		PQclear(res);
 		return false;
@@ -5911,7 +5911,7 @@ listPublications(const char *pattern)
 	{
 		char		sverbuf[32];
 
-		pg_log_error("The server (version %s) does not support publications.",
+		pg_log_error("the server (version %s) does not support publications",
 					 formatPGVersionNumber(pset.sversion, false,
 										   sverbuf, sizeof(sverbuf)));
 		return true;
@@ -6033,7 +6033,7 @@ describePublications(const char *pattern)
 	{
 		char		sverbuf[32];
 
-		pg_log_error("The server (version %s) does not support publications.",
+		pg_log_error("the server (version %s) does not support publications",
 					 formatPGVersionNumber(pset.sversion, false,
 										   sverbuf, sizeof(sverbuf)));
 		return true;
@@ -6075,10 +6075,10 @@ describePublications(const char *pattern)
 		if (!pset.quiet)
 		{
 			if (pattern)
-				pg_log_error("Did not find any publication named \"%s\".",
+				pg_log_error("did not find any publication named \"%s\"",
 							 pattern);
 			else
-				pg_log_error("Did not find any publications.");
+				pg_log_error("did not find any publications");
 		}
 
 		termPQExpBuffer(&buf);
@@ -6211,7 +6211,7 @@ describeSubscriptions(const char *pattern, bool verbose)
 	{
 		char		sverbuf[32];
 
-		pg_log_error("The server (version %s) does not support subscriptions.",
+		pg_log_error("the server (version %s) does not support subscriptions",
 					 formatPGVersionNumber(pset.sversion, false,
 										   sverbuf, sizeof(sverbuf)));
 		return true;
-- 
2.32.0 (Apple Git-132)

