Improved error message and tests for sparsevec_in

This commit is contained in:
Andrew Kane
2024-04-13 15:50:40 -07:00
parent 1c791480ff
commit 96b30fd25d
3 changed files with 69 additions and 4 deletions

View File

@@ -284,7 +284,7 @@ sparsevec_in(PG_FUNCTION_ARGS)
if (errno == ERANGE && (value == 0 || isinf(value)))
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("\"%s\" is out of range for type sparsevec", pt)));
errmsg("\"%s\" is out of range for type sparsevec", pnstrdup(pt, stringEnd - pt))));
/* Do not store zero values */
if (value != 0)