Re: postgres_fdw - should we tighten up batch_size, fetch_size options against non-numeric values? - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: postgres_fdw - should we tighten up batch_size, fetch_size options against non-numeric values?
Date
Msg-id CAExHW5tTsVwrTORJmix-=41a_KeN2NSaN9hdvvrqANqrKCYpHQ@mail.gmail.com
Whole thread Raw
In response to postgres_fdw - should we tighten up batch_size, fetch_size options against non-numeric values?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: postgres_fdw - should we tighten up batch_size, fetch_size options against non-numeric values?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
On Mon, May 17, 2021 at 3:29 PM Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> wrote:
>
> Hi,
>
> It looks like the values such as '123.456', '789.123' '100$%$#$#',
> '9,223,372,' are accepted and treated as valid integers for
> postgres_fdw options batch_size and fetch_size. Whereas this is not
> the case with fdw_startup_cost and fdw_tuple_cost options for which an
> error is thrown. Attaching a patch to fix that.

This looks like a definite improvement. I wonder if we should modify
defGetInt variants to convert strings into integers, so that there's
consistent error message for such errors. We could define defGetUInt
so that we could mention non-negative in the error message. Whether or
not we do that, this looks good.




-- 
Best Wishes,
Ashutosh Bapat



pgsql-hackers by date:

Previous
From: "osumi.takamichi@fujitsu.com"
Date:
Subject: RE: Forget close an open relation in ReorderBufferProcessTXN()
Next
From: Andrew Dunstan
Date:
Subject: Re: Winflex docs and distro