Revert "Allow units to be specified in relation option setting value."
This reverts commit e23014f3d4
.
As the side effect of the reverted commit, when the unit is
specified, the reloption was stored in the catalog with the unit.
This broke pg_dump (specifically, it prevented pg_dump from
outputting restorable backup regarding the reloption) and
turned the buildfarm red. Revert the commit until the fixed
version is ready.
This commit is contained in:
parent
11a020eb6e
commit
9df492664a
|
@ -97,7 +97,7 @@ static relopt_int intRelOpts[] =
|
||||||
"Packs table pages only to this percentage",
|
"Packs table pages only to this percentage",
|
||||||
RELOPT_KIND_HEAP
|
RELOPT_KIND_HEAP
|
||||||
},
|
},
|
||||||
HEAP_DEFAULT_FILLFACTOR, HEAP_MIN_FILLFACTOR, 100, 0
|
HEAP_DEFAULT_FILLFACTOR, HEAP_MIN_FILLFACTOR, 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -105,7 +105,7 @@ static relopt_int intRelOpts[] =
|
||||||
"Packs btree index pages only to this percentage",
|
"Packs btree index pages only to this percentage",
|
||||||
RELOPT_KIND_BTREE
|
RELOPT_KIND_BTREE
|
||||||
},
|
},
|
||||||
BTREE_DEFAULT_FILLFACTOR, BTREE_MIN_FILLFACTOR, 100, 0
|
BTREE_DEFAULT_FILLFACTOR, BTREE_MIN_FILLFACTOR, 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -113,7 +113,7 @@ static relopt_int intRelOpts[] =
|
||||||
"Packs hash index pages only to this percentage",
|
"Packs hash index pages only to this percentage",
|
||||||
RELOPT_KIND_HASH
|
RELOPT_KIND_HASH
|
||||||
},
|
},
|
||||||
HASH_DEFAULT_FILLFACTOR, HASH_MIN_FILLFACTOR, 100, 0
|
HASH_DEFAULT_FILLFACTOR, HASH_MIN_FILLFACTOR, 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -121,7 +121,7 @@ static relopt_int intRelOpts[] =
|
||||||
"Packs gist index pages only to this percentage",
|
"Packs gist index pages only to this percentage",
|
||||||
RELOPT_KIND_GIST
|
RELOPT_KIND_GIST
|
||||||
},
|
},
|
||||||
GIST_DEFAULT_FILLFACTOR, GIST_MIN_FILLFACTOR, 100, 0
|
GIST_DEFAULT_FILLFACTOR, GIST_MIN_FILLFACTOR, 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -129,7 +129,7 @@ static relopt_int intRelOpts[] =
|
||||||
"Packs spgist index pages only to this percentage",
|
"Packs spgist index pages only to this percentage",
|
||||||
RELOPT_KIND_SPGIST
|
RELOPT_KIND_SPGIST
|
||||||
},
|
},
|
||||||
SPGIST_DEFAULT_FILLFACTOR, SPGIST_MIN_FILLFACTOR, 100, 0
|
SPGIST_DEFAULT_FILLFACTOR, SPGIST_MIN_FILLFACTOR, 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -137,7 +137,7 @@ static relopt_int intRelOpts[] =
|
||||||
"Minimum number of tuple updates or deletes prior to vacuum",
|
"Minimum number of tuple updates or deletes prior to vacuum",
|
||||||
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
||||||
},
|
},
|
||||||
-1, 0, INT_MAX, 0
|
-1, 0, INT_MAX
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -145,7 +145,7 @@ static relopt_int intRelOpts[] =
|
||||||
"Minimum number of tuple inserts, updates or deletes prior to analyze",
|
"Minimum number of tuple inserts, updates or deletes prior to analyze",
|
||||||
RELOPT_KIND_HEAP
|
RELOPT_KIND_HEAP
|
||||||
},
|
},
|
||||||
-1, 0, INT_MAX, 0
|
-1, 0, INT_MAX
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -153,7 +153,7 @@ static relopt_int intRelOpts[] =
|
||||||
"Vacuum cost delay in milliseconds, for autovacuum",
|
"Vacuum cost delay in milliseconds, for autovacuum",
|
||||||
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
||||||
},
|
},
|
||||||
-1, 0, 100, GUC_UNIT_MS
|
-1, 0, 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -161,7 +161,7 @@ static relopt_int intRelOpts[] =
|
||||||
"Vacuum cost amount available before napping, for autovacuum",
|
"Vacuum cost amount available before napping, for autovacuum",
|
||||||
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
||||||
},
|
},
|
||||||
-1, 1, 10000, 0
|
-1, 1, 10000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -169,7 +169,7 @@ static relopt_int intRelOpts[] =
|
||||||
"Minimum age at which VACUUM should freeze a table row, for autovacuum",
|
"Minimum age at which VACUUM should freeze a table row, for autovacuum",
|
||||||
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
||||||
},
|
},
|
||||||
-1, 0, 1000000000, 0
|
-1, 0, 1000000000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -177,7 +177,7 @@ static relopt_int intRelOpts[] =
|
||||||
"Minimum multixact age at which VACUUM should freeze a row multixact's, for autovacuum",
|
"Minimum multixact age at which VACUUM should freeze a row multixact's, for autovacuum",
|
||||||
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
||||||
},
|
},
|
||||||
-1, 0, 1000000000, 0
|
-1, 0, 1000000000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -185,7 +185,7 @@ static relopt_int intRelOpts[] =
|
||||||
"Age at which to autovacuum a table to prevent transaction ID wraparound",
|
"Age at which to autovacuum a table to prevent transaction ID wraparound",
|
||||||
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
||||||
},
|
},
|
||||||
-1, 100000000, 2000000000, 0
|
-1, 100000000, 2000000000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -193,21 +193,21 @@ static relopt_int intRelOpts[] =
|
||||||
"Multixact age at which to autovacuum a table to prevent multixact wraparound",
|
"Multixact age at which to autovacuum a table to prevent multixact wraparound",
|
||||||
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
||||||
},
|
},
|
||||||
-1, 100000000, 2000000000, 0
|
-1, 100000000, 2000000000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
"autovacuum_freeze_table_age",
|
"autovacuum_freeze_table_age",
|
||||||
"Age at which VACUUM should perform a full table sweep to freeze row versions",
|
"Age at which VACUUM should perform a full table sweep to freeze row versions",
|
||||||
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
||||||
}, -1, 0, 2000000000, 0
|
}, -1, 0, 2000000000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
"autovacuum_multixact_freeze_table_age",
|
"autovacuum_multixact_freeze_table_age",
|
||||||
"Age of multixact at which VACUUM should perform a full table sweep to freeze row versions",
|
"Age of multixact at which VACUUM should perform a full table sweep to freeze row versions",
|
||||||
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
|
||||||
}, -1, 0, 2000000000, 0
|
}, -1, 0, 2000000000
|
||||||
},
|
},
|
||||||
|
|
||||||
/* list terminator */
|
/* list terminator */
|
||||||
|
@ -503,7 +503,7 @@ add_bool_reloption(bits32 kinds, char *name, char *desc, bool default_val)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
add_int_reloption(bits32 kinds, char *name, char *desc, int default_val,
|
add_int_reloption(bits32 kinds, char *name, char *desc, int default_val,
|
||||||
int min_val, int max_val, int flags_val)
|
int min_val, int max_val)
|
||||||
{
|
{
|
||||||
relopt_int *newoption;
|
relopt_int *newoption;
|
||||||
|
|
||||||
|
@ -512,7 +512,6 @@ add_int_reloption(bits32 kinds, char *name, char *desc, int default_val,
|
||||||
newoption->default_val = default_val;
|
newoption->default_val = default_val;
|
||||||
newoption->min = min_val;
|
newoption->min = min_val;
|
||||||
newoption->max = max_val;
|
newoption->max = max_val;
|
||||||
newoption->flags = flags_val;
|
|
||||||
|
|
||||||
add_reloption((relopt_gen *) newoption);
|
add_reloption((relopt_gen *) newoption);
|
||||||
}
|
}
|
||||||
|
@ -1001,15 +1000,12 @@ parse_one_reloption(relopt_value *option, char *text_str, int text_len,
|
||||||
case RELOPT_TYPE_INT:
|
case RELOPT_TYPE_INT:
|
||||||
{
|
{
|
||||||
relopt_int *optint = (relopt_int *) option->gen;
|
relopt_int *optint = (relopt_int *) option->gen;
|
||||||
const char *hintmsg;
|
|
||||||
|
|
||||||
parsed = parse_int(value, &option->values.int_val,
|
parsed = parse_int(value, &option->values.int_val, 0, NULL);
|
||||||
optint->flags, &hintmsg);
|
|
||||||
if (validate && !parsed)
|
if (validate && !parsed)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errmsg("invalid value for integer option \"%s\": %s",
|
(errmsg("invalid value for integer option \"%s\": %s",
|
||||||
option->gen->name, value),
|
option->gen->name, value)));
|
||||||
hintmsg ? errhint("%s", _(hintmsg)) : 0));
|
|
||||||
if (validate && (option->values.int_val < optint->min ||
|
if (validate && (option->values.int_val < optint->min ||
|
||||||
option->values.int_val > optint->max))
|
option->values.int_val > optint->max))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
|
|
|
@ -92,7 +92,6 @@ typedef struct relopt_int
|
||||||
int default_val;
|
int default_val;
|
||||||
int min;
|
int min;
|
||||||
int max;
|
int max;
|
||||||
int flags;
|
|
||||||
} relopt_int;
|
} relopt_int;
|
||||||
|
|
||||||
typedef struct relopt_real
|
typedef struct relopt_real
|
||||||
|
@ -245,7 +244,7 @@ extern relopt_kind add_reloption_kind(void);
|
||||||
extern void add_bool_reloption(bits32 kinds, char *name, char *desc,
|
extern void add_bool_reloption(bits32 kinds, char *name, char *desc,
|
||||||
bool default_val);
|
bool default_val);
|
||||||
extern void add_int_reloption(bits32 kinds, char *name, char *desc,
|
extern void add_int_reloption(bits32 kinds, char *name, char *desc,
|
||||||
int default_val, int min_val, int max_val, int flags_val);
|
int default_val, int min_val, int max_val);
|
||||||
extern void add_real_reloption(bits32 kinds, char *name, char *desc,
|
extern void add_real_reloption(bits32 kinds, char *name, char *desc,
|
||||||
double default_val, double min_val, double max_val);
|
double default_val, double min_val, double max_val);
|
||||||
extern void add_string_reloption(bits32 kinds, char *name, char *desc,
|
extern void add_string_reloption(bits32 kinds, char *name, char *desc,
|
||||||
|
|
|
@ -1811,20 +1811,6 @@ Check constraints:
|
||||||
"test_inh_check_a_check" CHECK (a::double precision > 10.2::double precision)
|
"test_inh_check_a_check" CHECK (a::double precision > 10.2::double precision)
|
||||||
Inherits: test_inh_check
|
Inherits: test_inh_check
|
||||||
|
|
||||||
-- Set a storage parameter with unit
|
|
||||||
CREATE TABLE test_param_unit (a text) WITH (autovacuum_vacuum_cost_delay = '80ms');
|
|
||||||
ALTER TABLE test_param_unit SET (autovacuum_vacuum_cost_delay = '3min');
|
|
||||||
ERROR: value 3min out of bounds for option "autovacuum_vacuum_cost_delay"
|
|
||||||
DETAIL: Valid values are between "0" and "100".
|
|
||||||
ALTER TABLE test_param_unit SET (autovacuum_analyze_threshold = '3min'); -- fails
|
|
||||||
ERROR: invalid value for integer option "autovacuum_analyze_threshold": 3min
|
|
||||||
\d+ test_param_unit
|
|
||||||
Table "public.test_param_unit"
|
|
||||||
Column | Type | Modifiers | Storage | Stats target | Description
|
|
||||||
--------+------+-----------+----------+--------------+-------------
|
|
||||||
a | text | | extended | |
|
|
||||||
Options: autovacuum_vacuum_cost_delay=80ms
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- lock levels
|
-- lock levels
|
||||||
--
|
--
|
||||||
|
|
|
@ -1254,12 +1254,6 @@ ALTER TABLE test_inh_check ALTER COLUMN a TYPE numeric;
|
||||||
\d test_inh_check
|
\d test_inh_check
|
||||||
\d test_inh_check_child
|
\d test_inh_check_child
|
||||||
|
|
||||||
-- Set a storage parameter with unit
|
|
||||||
CREATE TABLE test_param_unit (a text) WITH (autovacuum_vacuum_cost_delay = '80ms');
|
|
||||||
ALTER TABLE test_param_unit SET (autovacuum_vacuum_cost_delay = '3min');
|
|
||||||
ALTER TABLE test_param_unit SET (autovacuum_analyze_threshold = '3min'); -- fails
|
|
||||||
\d+ test_param_unit
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- lock levels
|
-- lock levels
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in New Issue