summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao2021-08-25 02:43:56 +0000
committerFujii Masao2021-08-25 02:43:56 +0000
commit085400fee9d58d7a97976755ae0627ef072e3776 (patch)
tree3e1f7b48d2137c6119a138e0ab8377f7039c95d8
parent71fee6cfaca35208d266c172e63b76d37df88b77 (diff)
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/[email protected]
-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 b2ca0d2f8a..ded919b39b 100644
--- a/src/backend/utils/adt/tsquery.c
+++ b/src/backend/utils/adt/tsquery.c
@@ -196,7 +196,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
{