aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2021-08-25 11:43:56 +0900
committerFujii Masao <fujii@postgresql.org>2021-08-25 11:45:20 +0900
commit69b93a0127bc0ccfd7458c32174f5174bcf8524d (patch)
tree2245ac202f70fbdff5b01d4b9cf3ec0e31b62d2d
parent92620e82f6a14d5078c5004feb86d0c99a528626 (diff)
downloadpostgresql-69b93a0127bc0ccfd7458c32174f5174bcf8524d.tar.gz
postgresql-69b93a0127bc0ccfd7458c32174f5174bcf8524d.zip
Improve error message about valid value for distance in phrase operator.
The distance in phrase operator must be an integer value between zero and MAXENTRYPOS inclusive. But previously the error message about its valid value included the information about its upper limit but not lower limit (i.e., zero). This commit improves the error message so that it also includes the information about its lower limit. Back-patch to v9.6 where full-text phrase search was supported. Author: Kyotaro Horiguchi Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/20210819.170315.1413060634876301811.horikyota.ntt@gmail.com
-rw-r--r--src/backend/utils/adt/tsquery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/tsquery.c b/src/backend/utils/adt/tsquery.c
index ab2b49fdc46..43e0f53575c 100644
--- a/src/backend/utils/adt/tsquery.c
+++ b/src/backend/utils/adt/tsquery.c
@@ -197,7 +197,7 @@ parse_phrase_operator(TSQueryParserState pstate, int16 *distance)
else if (errno == ERANGE || l < 0 || l > MAXENTRYPOS)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("distance in phrase operator should not be greater than %d",
+ errmsg("distance in phrase operator must be an integer value between zero and %d inclusive",
MAXENTRYPOS)));
else
{