Re: Inaccurate error message when set fdw batch_size to 0

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)fujitsu(dot)com>, houzj(dot)fnst(at)fujitsu(dot)com, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Inaccurate error message when set fdw batch_size to 0
Date: 2021-05-20 09:13:50
Message-ID: CALj2ACX14QF9Md2sz8k0nX_Z_iKdTKUP3WRu-C0xjRB0TeT60A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 20, 2021 at 1:44 PM Kyotaro Horiguchi
<horikyota(dot)ntt(at)gmail(dot)com> wrote:
>
> 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."

Thanks. That looks better. PSA v4 patch.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
v4-0001-Disambiguate-error-messages-that-use-non-negative.patch application/x-patch 9.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kirill Reshke 2021-05-20 09:16:39 Re: Slow standby snapshot
Previous Message Tomas Vondra 2021-05-20 09:02:56 Re: Adaptive Plan Sharing for PreparedStmt