Subject: [PATCH 6/6] Fix double quoting in extended statistics error message

From: Kyotaro Horiguchi <[email-masked]>
Date: Mon, 9 Feb 2026 16:16:06 +0900

Remove extra quoting for identifiers already quoted by
quote_identifier().
---
 src/backend/statistics/extended_stats_funcs.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/backend/statistics/extended_stats_funcs.c b/src/backend/statistics/extended_stats_funcs.c
index b640941a9cc..c718ffa95c6 100644
--- a/src/backend/statistics/extended_stats_funcs.c
+++ b/src/backend/statistics/extended_stats_funcs.c
@@ -347,7 +347,7 @@ extended_statistics_update(FunctionCallInfo fcinfo)
 	{
 		ereport(WARNING,
 				errcode(ERRCODE_UNDEFINED_OBJECT),
-				errmsg("could not find extended statistics object \"%s\".\"%s\"",
+				errmsg("could not find extended statistics object %s.%s",
 					   quote_identifier(nspname),
 					   quote_identifier(stxname)));
 		success = false;
@@ -420,7 +420,7 @@ extended_statistics_update(FunctionCallInfo fcinfo)
 				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
 				errmsg("cannot specify parameter \"%s\"",
 					   extarginfo[NDISTINCT_ARG].argname),
-				errhint("Extended statistics object \"%s\".\"%s\" does not support statistics of this type.",
+				errhint("Extended statistics object %s.%s does not support statistics of this type.",
 						quote_identifier(nspname),
 						quote_identifier(stxname)));
 
@@ -904,9 +904,11 @@ pg_clear_extended_stats(PG_FUNCTION_ARGS)
 		table_close(pg_stext, RowExclusiveLock);
 		ereport(WARNING,
 				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				errmsg("could not clear extended statistics object \"%s\".\"%s\": incorrect relation \"%s\".\"%s\" specified",
-					   get_namespace_name(nspoid), stxname,
-					   relnspname, relname));
+				errmsg("could not clear extended statistics object %s.%s: incorrect relation %s.%s specified",
+					   quote_identifier(get_namespace_name(nspoid)),
+					   quote_identifier(stxname),
+					   quote_identifier(relnspname),
+					   quote_identifier(relname)));
 		PG_RETURN_VOID();
 	}
 
-- 
2.47.3

----Next_Part(Tue_Feb_10_14_37_52_2026_180)----