From 4f7f3fa8133086f0efcc6fc458626ec97c831870 Mon Sep 17 00:00:00 2001
From: Mahendra Singh Thalor <mahi6run@gmail.com>
Date: Fri, 11 Apr 2025 22:50:47 +0530
Subject: [PATCH] remove unnecessary type conversion into char for
 appendStringInfoChar function calls.

On head, we are using 3 places appendStringInfoChar call with explicit type
conversion into char.
This is not needed as many places we are using direct character to append.

Ex: appendStringInfoChar(inBuf, (char) '\0');
   appendStringInfoChar(inBuf, '\0');
---
 src/backend/tcop/postgres.c  | 2 +-
 src/bin/pg_dump/pg_restore.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index dc4c600922d..e99fb1c1ff6 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -302,7 +302,7 @@ InteractiveBackend(StringInfo inBuf)
 	 */
 
 	/* Add '\0' to make it look the same as message case. */
-	appendStringInfoChar(inBuf, (char) '\0');
+	appendStringInfoChar(inBuf, '\0');
 
 	/*
 	 * if the query echo flag was given, print the query..
diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index 24a44b81a95..556361dbcc6 100644
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -898,12 +898,12 @@ read_one_statement(StringInfo inBuf, FILE *pfile)
 
 		if (c == ';')
 		{
-			appendStringInfoChar(inBuf, (char) ';');
+			appendStringInfoChar(inBuf, ';');
 			break;
 		}
 
 		if (c == '\n')
-			appendStringInfoChar(inBuf, (char) '\n');
+			appendStringInfoChar(inBuf, '\n');
 	}
 
 	destroyStringInfo(&q);
-- 
2.39.3

