summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2022-09-28 17:14:53 +0200
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2022-09-28 17:14:53 +0200
commitd84a7b290f866b3f16cbefb0fca31b69ebace98a (patch)
treea966b86fd39d18e06d7d1306ef735d50e6f89aa8 /src/backend/utils/adt
parent7188b9b0fdbb4dd99915626f171d820a56b98514 (diff)
downloadpostgresql-d84a7b290f866b3f16cbefb0fca31b69ebace98a.tar.gz
Change some errdetail() to errdetail_internal()
This prevents marking the argument string for translation for gettext, and it also prevents the given string (which is already translated) from being translated at runtime. Also, mark the strings used as arguments to check_rolespec_name for translation. Backpatch all the way back as appropriate. None of this is caught by any tests (necessarily so), so I verified it manually.
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r--src/backend/utils/adt/acl.c4
-rw-r--r--src/backend/utils/adt/jsonfuncs.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index fd71a9b13e..4fac402e5b 100644
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -5291,7 +5291,7 @@ get_rolespec_name(const RoleSpec *role)
/*
* Given a RoleSpec, throw an error if the name is reserved, using detail_msg,
- * if provided.
+ * if provided (which must be already translated).
*
* If node is NULL, no error is thrown. If detail_msg is NULL then no detail
* message is provided.
@@ -5312,7 +5312,7 @@ check_rolespec_name(const RoleSpec *role, const char *detail_msg)
(errcode(ERRCODE_RESERVED_NAME),
errmsg("role name \"%s\" is reserved",
role->rolename),
- errdetail("%s", detail_msg)));
+ errdetail_internal("%s", detail_msg)));
else
ereport(ERROR,
(errcode(ERRCODE_RESERVED_NAME),
diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c
index 82c43617d8..fd0d355789 100644
--- a/src/backend/utils/adt/jsonfuncs.c
+++ b/src/backend/utils/adt/jsonfuncs.c
@@ -615,13 +615,13 @@ json_ereport_error(JsonParseErrorType error, JsonLexContext *lex)
ereport(ERROR,
(errcode(ERRCODE_UNTRANSLATABLE_CHARACTER),
errmsg("unsupported Unicode escape sequence"),
- errdetail("%s", json_errdetail(error, lex)),
+ errdetail_internal("%s", json_errdetail(error, lex)),
report_json_context(lex)));
else
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type %s", "json"),
- errdetail("%s", json_errdetail(error, lex)),
+ errdetail_internal("%s", json_errdetail(error, lex)),
report_json_context(lex)));
}