Re: Inaccurate error message when set fdw batch_size to 0

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "houzj(dot)fnst(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-19 16:18:56
Message-ID: CALj2ACUNX4dVQ4N0qo4xMtueT5vtSUuwEKUozpfypKy3G4ipiw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 19, 2021 at 5:20 PM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
>
> ereport(ERROR,
> (errcode(ERRCODE_SYNTAX_ERROR),
> - errmsg("%s requires a non-negative numeric value",
> + errmsg("%s must be greater than or equal to zero",
> def->defname)));
> }
> else if (strcmp(def->defname, "extensions") == 0)
> @@ -142,7 +142,7 @@ postgres_fdw_validator(PG_FUNCTION_ARGS)
> if (fetch_size <= 0)
> ereport(ERROR,
> (errcode(ERRCODE_SYNTAX_ERROR),
> - errmsg("%s requires a non-negative integer value",
> + errmsg("%s must be greater than zero",
>
> 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.

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

Attachment Content-Type Size
v3-0001-Disambiguate-error-messages-that-use-non-negative.patch application/octet-stream 9.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2021-05-19 16:53:49 Re: Improve documentation for pg_upgrade, standbys and rsync
Previous Message Yura Sokolov 2021-05-19 16:18:27 Add PortalDrop in exec_execute_message