Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao2021-07-07 02:13:40 +0000
committerFujii Masao2021-07-07 02:13:40 +0000
commitd854720df6df68cfe1432342e33c9e3020572a51 (patch)
treee49ce01a1da0c4db69e04f5b6a857a07ab6c96e7 /doc/src/sgml/postgres-fdw.sgml
parent9fd85570d179f10f93344d722005f7086b3c31ca (diff)
postgres_fdw: Tighten up allowed values for batch_size, fetch_size options.
Previously the values such as '100$%$#$#', '9,223,372,' were 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. This was because endptr was not used while converting strings to integers using strtol. This commit changes the logic so that it uses parse_int function instead of strtol as it serves the purpose by returning false in case if it is unable to convert the string to integer. Note that this function also rounds off the values such as '100.456' to 100 and '100.567' or '100.678' to 101. While on this, use parse_real for fdw_startup_cost and fdw_tuple_cost options. Since parse_int and parse_real are being used for reloptions and GUCs, it is more appropriate to use in postgres_fdw rather than using strtol and strtod directly. Back-patch to v14. Author: Bharath Rupireddy Reviewed-by: Ashutosh Bapat, Tom Lane, Kyotaro Horiguchi, Fujii Masao Discussion: https://postgr.es/m/CALj2ACVMO6wY5Pc4oe1OCgUOAtdjHuFsBDw8R5uoYR86eWFQDA@mail.gmail.com
Diffstat (limited to 'doc/src/sgml/postgres-fdw.sgml')
-rw-r--r--doc/src/sgml/postgres-fdw.sgml14
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/src/sgml/postgres-fdw.sgml b/doc/src/sgml/postgres-fdw.sgml
index d7d2baafc96..c9fce775997 100644
--- a/doc/src/sgml/postgres-fdw.sgml
+++ b/doc/src/sgml/postgres-fdw.sgml
@@ -266,11 +266,11 @@ OPTIONS (ADD password_required 'false');
<term><literal>fdw_startup_cost</literal> (<type>floating point</type>)</term>
<listitem>
<para>
- This option, which can be specified for a foreign server, is a numeric
- value that is added to the estimated startup cost of any foreign-table
- scan on that server. This represents the additional overhead of
- establishing a connection, parsing and planning the query on the
- remote side, etc.
+ This option, which can be specified for a foreign server, is a floating
+ point value that is added to the estimated startup cost of any
+ foreign-table scan on that server. This represents the additional
+ overhead of establishing a connection, parsing and planning the query on
+ the remote side, etc.
The default value is <literal>100</literal>.
</para>
</listitem>
@@ -280,8 +280,8 @@ OPTIONS (ADD password_required 'false');
<term><literal>fdw_tuple_cost</literal> (<type>floating point</type>)</term>
<listitem>
<para>
- This option, which can be specified for a foreign server, is a numeric
- value that is used as extra cost per-tuple for foreign-table
+ This option, which can be specified for a foreign server, is a floating
+ point value that is used as extra cost per-tuple for foreign-table
scans on that server. This represents the additional overhead of
data transfer between servers. You might increase or decrease this
number to reflect higher or lower network delay to the remote server.