mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-01 18:21:16 +08:00
Updated invalid input syntax messages to be consistent [skip ci]
This commit is contained in:
@@ -169,7 +169,7 @@ halfvec_in(PG_FUNCTION_ARGS)
|
||||
if (*str != '[')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed halfvec literal: \"%s\"", lit),
|
||||
errmsg("invalid input syntax for type halfvec: \"%s\"", lit),
|
||||
errdetail("Vector contents must start with \"[\".")));
|
||||
|
||||
str++;
|
||||
@@ -231,7 +231,7 @@ halfvec_in(PG_FUNCTION_ARGS)
|
||||
if (stringEnd == NULL || *stringEnd != ']')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed halfvec literal: \"%s\"", lit),
|
||||
errmsg("invalid input syntax for type halfvec: \"%s\"", lit),
|
||||
errdetail("Unexpected end of input.")));
|
||||
|
||||
stringEnd++;
|
||||
@@ -243,7 +243,7 @@ halfvec_in(PG_FUNCTION_ARGS)
|
||||
if (*stringEnd != '\0')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed halfvec literal: \"%s\"", lit),
|
||||
errmsg("invalid input syntax for type halfvec: \"%s\"", lit),
|
||||
errdetail("Junk after closing right brace.")));
|
||||
|
||||
/* Ensure no consecutive delimiters since strtok skips */
|
||||
@@ -252,7 +252,7 @@ halfvec_in(PG_FUNCTION_ARGS)
|
||||
if (pt[-1] == ',' && *pt == ',')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed halfvec literal: \"%s\"", lit)));
|
||||
errmsg("invalid input syntax for type halfvec: \"%s\"", lit)));
|
||||
}
|
||||
|
||||
if (dim < 1)
|
||||
|
||||
@@ -209,7 +209,7 @@ sparsevec_in(PG_FUNCTION_ARGS)
|
||||
if (*str != '{')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed sparsevec literal: \"%s\"", lit),
|
||||
errmsg("invalid input syntax for type sparsevec: \"%s\"", lit),
|
||||
errdetail("Vector contents must start with \"{\".")));
|
||||
|
||||
str++;
|
||||
@@ -305,7 +305,7 @@ sparsevec_in(PG_FUNCTION_ARGS)
|
||||
if (stringEnd == NULL || *stringEnd != '}')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed sparsevec literal: \"%s\"", lit),
|
||||
errmsg("invalid input syntax for type sparsevec: \"%s\"", lit),
|
||||
errdetail("Unexpected end of input.")));
|
||||
|
||||
stringEnd++;
|
||||
@@ -316,7 +316,7 @@ sparsevec_in(PG_FUNCTION_ARGS)
|
||||
if (*stringEnd != '/')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed sparsevec literal: \"%s\"", lit),
|
||||
errmsg("invalid input syntax for type sparsevec: \"%s\"", lit),
|
||||
errdetail("Unexpected end of input.")));
|
||||
|
||||
stringEnd++;
|
||||
@@ -341,7 +341,7 @@ sparsevec_in(PG_FUNCTION_ARGS)
|
||||
if (*stringEnd != '\0')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed sparsevec literal: \"%s\"", lit),
|
||||
errmsg("invalid input syntax for type sparsevec: \"%s\"", lit),
|
||||
errdetail("Junk after closing.")));
|
||||
|
||||
pfree(litcopy);
|
||||
|
||||
@@ -193,7 +193,7 @@ vector_in(PG_FUNCTION_ARGS)
|
||||
if (*str != '[')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed vector literal: \"%s\"", lit),
|
||||
errmsg("invalid input syntax for type vector: \"%s\"", lit),
|
||||
errdetail("Vector contents must start with \"[\".")));
|
||||
|
||||
str++;
|
||||
@@ -254,7 +254,7 @@ vector_in(PG_FUNCTION_ARGS)
|
||||
if (stringEnd == NULL || *stringEnd != ']')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed vector literal: \"%s\"", lit),
|
||||
errmsg("invalid input syntax for type vector: \"%s\"", lit),
|
||||
errdetail("Unexpected end of input.")));
|
||||
|
||||
stringEnd++;
|
||||
@@ -266,7 +266,7 @@ vector_in(PG_FUNCTION_ARGS)
|
||||
if (*stringEnd != '\0')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed vector literal: \"%s\"", lit),
|
||||
errmsg("invalid input syntax for type vector: \"%s\"", lit),
|
||||
errdetail("Junk after closing right brace.")));
|
||||
|
||||
/* Ensure no consecutive delimiters since strtok skips */
|
||||
@@ -275,7 +275,7 @@ vector_in(PG_FUNCTION_ARGS)
|
||||
if (pt[-1] == ',' && *pt == ',')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed vector literal: \"%s\"", lit)));
|
||||
errmsg("invalid input syntax for type vector: \"%s\"", lit)));
|
||||
}
|
||||
|
||||
if (dim < 1)
|
||||
|
||||
Reference in New Issue
Block a user