From: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: Alexander Korotkov <akorotkov@postgresql.org>
Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
Subject: Re: pgsql: Increase upper limit for vacuum_cleanup_index_scale_factor
Date: Tue, 26 Jun 2018 16:11:16 +0300
Message-ID: <CAPpHfdsFBbJAd24F0b_o9TfTtu++jH0bR5XS_e9xbSwk8SJwyQ@mail.gmail.com> (raw)
In-Reply-To: <CAPpHfdvewmr4PcpRjrkstoNn1n2_6dL-iHRB21CCfZ0efZdBTg@mail.gmail.com>
References: <E1fXnBp-0002z6-1o@gemulon.postgresql.org>
<CAPpHfdvewmr4PcpRjrkstoNn1n2_6dL-iHRB21CCfZ0efZdBTg@mail.gmail.com>
On Tue, Jun 26, 2018 at 3:59 PM Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:
>
> On Tue, Jun 26, 2018 at 3:35 PM Alexander Korotkov
> <akorotkov@postgresql.org> wrote:
> > vacuum_cleanup_index_scale_factor is used barely to protect against
> > stalled index statistics. And after detailed consideration it appears
> > that risk of stalled index statistics is low. And it would be nice to
> > allow advanced users setting higher values of
> > vacuum_cleanup_index_scale_factor. So, set upper limit for these
> > GUC and reloption to DBL_MAX.
>
> BTW, this line looks cumbersome.
>
> +DETAIL: Valid values are between "0.000000" and
> "179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000".
>
> It's not something introduced by this patch, because other reloptions
> behave the same. Should we change output format for real reloption
> boundaries to '%g' (as guc.c does). It looks much better.
>
> ERROR: -1 is outside the valid range for parameter "random_page_cost"
> (0 .. 1.79769e+308)
See attached patch changing output format for reloption real
boundaries from "%f" to "%g".
------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Attachments:change-reloption-real-boundaries-output-format.patch (application/octet-stream, 2.9K) downloaddiff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.cindex 5671bb6830..fae865f3f2 100644--- a/src/backend/access/common/reloptions.c+++ b/src/backend/access/common/reloptions.c@@ -1204,7 +1204,7 @@ parse_one_reloption(relopt_value *option, char *text_str, int text_len,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("value %s out of bounds for option \"%s\"",
value, option->gen->name),
- errdetail("Valid values are between \"%f\" and \"%f\".",+ errdetail("Valid values are between \"%g\" and \"%g\".",
optreal->min, optreal->max)));
}
break;
diff --git a/src/test/regress/expected/btree_index.out b/src/test/regress/expected/btree_index.outindex 1ad33190a2..628d9be91b 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" and "1.79769e+308".
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
diff --git a/src/test/regress/expected/reloptions.out b/src/test/regress/expected/reloptions.outindex df3c99d1eb..636151d4a4 100644--- a/src/test/regress/expected/reloptions.out+++ b/src/test/regress/expected/reloptions.out@@ -16,10 +16,10 @@ ERROR: value 110 out of bounds for option "fillfactor"
DETAIL: Valid values are between "10" and "100".
CREATE TABLE reloptions_test2(i INT) WITH (autovacuum_analyze_scale_factor = -10.0);
ERROR: value -10.0 out of bounds for option "autovacuum_analyze_scale_factor"
-DETAIL: Valid values are between "0.000000" and "100.000000".+DETAIL: Valid values are between "0" and "100".
CREATE TABLE reloptions_test2(i INT) WITH (autovacuum_analyze_scale_factor = 110.0);
ERROR: value 110.0 out of bounds for option "autovacuum_analyze_scale_factor"
-DETAIL: Valid values are between "0.000000" and "100.000000".+DETAIL: Valid values are between "0" and "100".
-- Fail when option and namespace do not exist
CREATE TABLE reloptions_test2(i INT) WITH (not_existing_option=2);
ERROR: unrecognized parameter "not_existing_option"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: a.korotkov@postgrespro.ru, akorotkov@postgresql.org
Subject: Re: pgsql: Increase upper limit for vacuum_cleanup_index_scale_factor
In-Reply-To: <CAPpHfdsFBbJAd24F0b_o9TfTtu++jH0bR5XS_e9xbSwk8SJwyQ@mail.gmail.com>
References: <E1fXnBp-0002z6-1o@gemulon.postgresql.org> <CAPpHfdvewmr4PcpRjrkstoNn1n2_6dL-iHRB21CCfZ0efZdBTg@mail.gmail.com> <CAPpHfdsFBbJAd24F0b_o9TfTtu++jH0bR5XS_e9xbSwk8SJwyQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox