aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2018-06-26 21:55:59 +0300
committerAlexander Korotkov <akorotkov@postgresql.org>2018-06-26 21:55:59 +0300
commit4d54543efa5eb074ead4d0fadb2af4161c943044 (patch)
treeafc6be6ac496ee9902149e7831cebd3fee985ab4
parenta89357e2f7839f5bc0815f4cf9e565cd3ad7a185 (diff)
downloadpostgresql-4d54543efa5eb074ead4d0fadb2af4161c943044.tar.gz
postgresql-4d54543efa5eb074ead4d0fadb2af4161c943044.zip
Fix upper limit for vacuum_cleanup_index_scale_factor
6ca33a88 sets upper limit for vacuum_cleanup_index_scale_factor to DBL_MAX. DBL_MAX appears to be platform-dependent. That causes many buildfarm animals to fail, because we check boundaries of vacuum_cleanup_index_scale_factor in regression tests. This commit changes upper limit from DBL_MAX to just "large enough" limit, which was arbitrary selected as 1e10. Author: Alexander Korotkov Reported-by: Tom Lane, Darafei Praliaskouski Discussion: https://postgr.es/m/CAPpHfdvewmr4PcpRjrkstoNn1n2_6dL-iHRB21CCfZ0efZdBTg%40mail.gmail.com Discussion: https://postgr.es/m/CAC8Q8tLYFOpKNaPS_E7V8KtPdE%3D_TnAn16t%3DA3LuL%3DXjfOO-BQ%40mail.gmail.com
-rw-r--r--doc/src/sgml/config.sgml3
-rw-r--r--src/backend/access/common/reloptions.c2
-rw-r--r--src/backend/utils/misc/guc.c2
-rw-r--r--src/test/regress/expected/btree_index.out2
4 files changed, 5 insertions, 4 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 574837889b3..cc2873f5363 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -6989,7 +6989,8 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
</para>
<para>
- The value should be non-negative.
+ The value can range from <literal>0</literal> to
+ <literal>10000000000</literal>.
When <varname>vacuum_cleanup_index_scale_factor</varname> is set to
<literal>0</literal>, index scans are never skipped during
<command>VACUUM</command> cleanup. The default value is <literal>0.1</literal>.
diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c
index 5671bb6830d..db84da06789 100644
--- a/src/backend/access/common/reloptions.c
+++ b/src/backend/access/common/reloptions.c
@@ -416,7 +416,7 @@ static relopt_real realRelOpts[] =
RELOPT_KIND_BTREE,
ShareUpdateExclusiveLock
},
- -1, 0.0, DBL_MAX
+ -1, 0.0, 1e10
},
/* list terminator */
{{NULL}}
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index daa2894c5af..b05fb209bba 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -3253,7 +3253,7 @@ static struct config_real ConfigureNamesReal[] =
NULL
},
&vacuum_cleanup_index_scale_factor,
- 0.1, 0.0, DBL_MAX,
+ 0.1, 0.0, 1e10,
NULL, NULL, NULL
},
diff --git a/src/test/regress/expected/btree_index.out b/src/test/regress/expected/btree_index.out
index 1ad33190a28..0bd48dc5a0f 100644
--- a/src/test/regress/expected/btree_index.out
+++ b/src/test/regress/expected/btree_index.out
@@ -165,7 +165,7 @@ select reloptions from pg_class WHERE oid = 'btree_idx1'::regclass;
-- Fail while setting improper values
create index btree_idx_err on btree_test(a) with (vacuum_cleanup_index_scale_factor = -10.0);
ERROR: value -10.0 out of bounds for option "vacuum_cleanup_index_scale_factor"
-DETAIL: Valid values are between "0.000000" and "179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000".
+DETAIL: Valid values are between "0.000000" and "10000000000.000000".
create index btree_idx_err on btree_test(a) with (vacuum_cleanup_index_scale_factor = 100.0);
create index btree_idx_err on btree_test(a) with (vacuum_cleanup_index_scale_factor = 'string');
ERROR: invalid value for floating point option "vacuum_cleanup_index_scale_factor": string