Inaccurate error message when set fdw batch_size to 0 - Mailing list pgsql-hackers

From houzj.fnst@fujitsu.com
Subject Inaccurate error message when set fdw batch_size to 0
Date
Msg-id OS0PR01MB5716415335A06B489F1B3A8194569@OS0PR01MB5716.jpnprd01.prod.outlook.com
Whole thread Raw
Responses Re: Inaccurate error message when set fdw batch_size to 0  (Dilip Kumar <dilipbalaut@gmail.com>)
RE: Inaccurate error message when set fdw batch_size to 0  ("tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>)
List pgsql-hackers

Hi,

 

When testing the fdw batch insert, I found a possible issue.

 

If I set the batch_size to 0 , it will throw an error:

 

---------------------

CREATE FOREIGN TABLE test(a int, b varchar)

  SERVER testserver

  OPTIONS (table_name 'testlocal', batch_size '0');

ERROR:  fetch_size requires a non-negative integer value

---------------------

 

The error message here seems not accurate, because

I can see from the code batch_size should be positive ( > 0).

 

So, is it better to change the error message to “fetch_size requires a positive integer value” ?

I also found fetch_size has the similar issue, attaching a patch to fix this.

 

Best regards,

houzj

 

Attachment

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Anti-critical-section assertion failure in mcxt.c reached by walsender
Next
From: David Rowley
Date:
Subject: Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays