aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/scansup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/parser/scansup.c')
-rw-r--r--src/backend/parser/scansup.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/backend/parser/scansup.c b/src/backend/parser/scansup.c
index 18169ec4f4c..cac70d5df7a 100644
--- a/src/backend/parser/scansup.c
+++ b/src/backend/parser/scansup.c
@@ -189,20 +189,10 @@ truncate_identifier(char *ident, int len, bool warn)
{
len = pg_mbcliplen(ident, len, NAMEDATALEN - 1);
if (warn)
- {
- /*
- * We avoid using %.*s here because it can misbehave if the data
- * is not valid in what libc thinks is the prevailing encoding.
- */
- char buf[NAMEDATALEN];
-
- memcpy(buf, ident, len);
- buf[len] = '\0';
ereport(NOTICE,
(errcode(ERRCODE_NAME_TOO_LONG),
- errmsg("identifier \"%s\" will be truncated to \"%s\"",
- ident, buf)));
- }
+ errmsg("identifier \"%s\" will be truncated to \"%.*s\"",
+ ident, len, ident)));
ident[len] = '\0';
}
}