postgres.git / summary / log / commit / refs

commit    5d1c36fd204bc680745263c3f9f41978b368fa0a
Author:   Fujii Masao <fujii@postgresql.org>
Date:     Wed Aug 25 02:43:56 2021 +0000
First released in: 15.0, 9.6.24, 10.19, 11.14, 12.9, 13.5, 14.0

    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


src/backend/utils/adt/tsquery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/utils/adt/tsquery.c b/src/backend/utils/adt/tsquery.c index df75ee4f1ec..73396413425 100644 --- a/src/backend/utils/adt/tsquery.c +++ b/src/backend/utils/adt/tsquery.c @@ -163,7 +163,7 @@ parse_phrase_operator(char *buf, 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 { [parent: 7e75fe390b68]