Re: Inaccurate error message when set fdw batch_size to 0

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: Inaccurate error message when set fdw batch_size to 0
Дата
Msg-id 20210520.171410.397269392203102426.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Re: Inaccurate error message when set fdw batch_size to 0  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: Inaccurate error message when set fdw batch_size to 0
Список pgsql-hackers
At Wed, 19 May 2021 21:48:56 +0530, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote in 
> On Wed, May 19, 2021 at 5:20 PM Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
> > I'm fine to convert "non-negative" word to "greater than" or "greater than
> > or equal to" in the messages. But this change also seems to get rid of
> > the information about the data type of the option from the message.
> > I'm not sure if this is an improvement. Probably isn't it better to
> > convert "requires a non-negative integer value" to "must be an integer value
> > greater than zero"?
> 
> Thanks for the comments. Done that way. PSA v3 patch.

--- a/src/backend/utils/adt/tsquery_op.c
+++ b/src/backend/utils/adt/tsquery_op.c
@@ -121,7 +121,7 @@ tsquery_phrase_distance(PG_FUNCTION_ARGS)
     if (distance < 0 || distance > MAXENTRYPOS)
         ereport(ERROR,
                 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-                 errmsg("distance in phrase operator should be non-negative and less than %d",
+                 errmsg("distance in phrase operator must be an integer value greater than or equal to zero and less
than%d",
 
                         MAXENTRYPOS)));

Though it is not due to this patch, but the message looks wrong. The condition is suggesting:

"distance in phrase operator must be an integer value greater than or equal to zero and less than or equal to %d"

I'm not sure readers can read it without biting their tongue.  How
about something like the following instead?

"distance in phrase operator must be an integer value between zero and
 %d inclusive."

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "tanghy.fnst@fujitsu.com"
Дата:
Сообщение: RE: "ERROR: deadlock detected" when replicating TRUNCATE
Следующее
От: Dave Page
Дата:
Сообщение: Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.