Re: Inaccurate error message when set fdw batch_size to 0

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: bharath(dot)rupireddyforpostgres(at)gmail(dot)com
Cc: masao(dot)fujii(at)oss(dot)nttdata(dot)com, amit(dot)kapila16(at)gmail(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, tsunakawa(dot)takay(at)fujitsu(dot)com, houzj(dot)fnst(at)fujitsu(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Inaccurate error message when set fdw batch_size to 0
Date: 2021-05-20 08:14:10
Message-ID: 20210520.171410.397269392203102426.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Wed, 19 May 2021 21:48:56 +0530, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote in
> On Wed, May 19, 2021 at 5:20 PM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2021-05-20 08:34:20 Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.
Previous Message tanghy.fnst@fujitsu.com 2021-05-20 07:16:13 RE: "ERROR: deadlock detected" when replicating TRUNCATE