Skip to content

Commit 81fa1bc

Browse files
committed
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
1 parent 0711461 commit 81fa1bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/utils/adt/tsquery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ parse_phrase_operator(TSQueryParserState pstate, int16 *distance)
197197
else if (errno == ERANGE || l < 0 || l > MAXENTRYPOS)
198198
ereport(ERROR,
199199
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
200-
errmsg("distance in phrase operator should not be greater than %d",
200+
errmsg("distance in phrase operator must be an integer value between zero and %d inclusive",
201201
MAXENTRYPOS)));
202202
else
203203
{

0 commit comments

Comments
 (0)