diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index ef21b7e426..63e773c4c1 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -2539,17 +2539,11 @@ from_char_seq_search(int *dest, const char **src, const char *const *array, if (len <= 0) { - char copy[DCH_MAX_ITEM_SIZ + 1]; - - /* Use multibyte-aware truncation to avoid generating a bogus string */ - max = pg_mbcliplen(*src, strlen(*src), max); - strlcpy(copy, *src, max + 1); - RETURN_ERROR(ereport(ERROR, (errcode(ERRCODE_INVALID_DATETIME_FORMAT), errmsg("invalid value \"%s\" for \"%s\"", - copy, node->key->name), - errdetail("The given value did not match any of " + *src, node->key->name), + errdetail("The remaining value did not match any of " "the allowed values for this field.")))); } *src += len;