Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9df4926

Browse files
committed
Revert "Allow units to be specified in relation option setting value."
This reverts commit e23014f. 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.
1 parent 11a020e commit 9df4926

File tree

4 files changed

+19
-44
lines changed

4 files changed

+19
-44
lines changed

src/backend/access/common/reloptions.c

+18-22
Original file line numberDiff line numberDiff line change
@@ -97,117 +97,117 @@ static relopt_int intRelOpts[] =
9797
"Packs table pages only to this percentage",
9898
RELOPT_KIND_HEAP
9999
},
100-
HEAP_DEFAULT_FILLFACTOR, HEAP_MIN_FILLFACTOR, 100, 0
100+
HEAP_DEFAULT_FILLFACTOR, HEAP_MIN_FILLFACTOR, 100
101101
},
102102
{
103103
{
104104
"fillfactor",
105105
"Packs btree index pages only to this percentage",
106106
RELOPT_KIND_BTREE
107107
},
108-
BTREE_DEFAULT_FILLFACTOR, BTREE_MIN_FILLFACTOR, 100, 0
108+
BTREE_DEFAULT_FILLFACTOR, BTREE_MIN_FILLFACTOR, 100
109109
},
110110
{
111111
{
112112
"fillfactor",
113113
"Packs hash index pages only to this percentage",
114114
RELOPT_KIND_HASH
115115
},
116-
HASH_DEFAULT_FILLFACTOR, HASH_MIN_FILLFACTOR, 100, 0
116+
HASH_DEFAULT_FILLFACTOR, HASH_MIN_FILLFACTOR, 100
117117
},
118118
{
119119
{
120120
"fillfactor",
121121
"Packs gist index pages only to this percentage",
122122
RELOPT_KIND_GIST
123123
},
124-
GIST_DEFAULT_FILLFACTOR, GIST_MIN_FILLFACTOR, 100, 0
124+
GIST_DEFAULT_FILLFACTOR, GIST_MIN_FILLFACTOR, 100
125125
},
126126
{
127127
{
128128
"fillfactor",
129129
"Packs spgist index pages only to this percentage",
130130
RELOPT_KIND_SPGIST
131131
},
132-
SPGIST_DEFAULT_FILLFACTOR, SPGIST_MIN_FILLFACTOR, 100, 0
132+
SPGIST_DEFAULT_FILLFACTOR, SPGIST_MIN_FILLFACTOR, 100
133133
},
134134
{
135135
{
136136
"autovacuum_vacuum_threshold",
137137
"Minimum number of tuple updates or deletes prior to vacuum",
138138
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
139139
},
140-
-1, 0, INT_MAX, 0
140+
-1, 0, INT_MAX
141141
},
142142
{
143143
{
144144
"autovacuum_analyze_threshold",
145145
"Minimum number of tuple inserts, updates or deletes prior to analyze",
146146
RELOPT_KIND_HEAP
147147
},
148-
-1, 0, INT_MAX, 0
148+
-1, 0, INT_MAX
149149
},
150150
{
151151
{
152152
"autovacuum_vacuum_cost_delay",
153153
"Vacuum cost delay in milliseconds, for autovacuum",
154154
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
155155
},
156-
-1, 0, 100, GUC_UNIT_MS
156+
-1, 0, 100
157157
},
158158
{
159159
{
160160
"autovacuum_vacuum_cost_limit",
161161
"Vacuum cost amount available before napping, for autovacuum",
162162
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
163163
},
164-
-1, 1, 10000, 0
164+
-1, 1, 10000
165165
},
166166
{
167167
{
168168
"autovacuum_freeze_min_age",
169169
"Minimum age at which VACUUM should freeze a table row, for autovacuum",
170170
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
171171
},
172-
-1, 0, 1000000000, 0
172+
-1, 0, 1000000000
173173
},
174174
{
175175
{
176176
"autovacuum_multixact_freeze_min_age",
177177
"Minimum multixact age at which VACUUM should freeze a row multixact's, for autovacuum",
178178
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
179179
},
180-
-1, 0, 1000000000, 0
180+
-1, 0, 1000000000
181181
},
182182
{
183183
{
184184
"autovacuum_freeze_max_age",
185185
"Age at which to autovacuum a table to prevent transaction ID wraparound",
186186
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
187187
},
188-
-1, 100000000, 2000000000, 0
188+
-1, 100000000, 2000000000
189189
},
190190
{
191191
{
192192
"autovacuum_multixact_freeze_max_age",
193193
"Multixact age at which to autovacuum a table to prevent multixact wraparound",
194194
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
195195
},
196-
-1, 100000000, 2000000000, 0
196+
-1, 100000000, 2000000000
197197
},
198198
{
199199
{
200200
"autovacuum_freeze_table_age",
201201
"Age at which VACUUM should perform a full table sweep to freeze row versions",
202202
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
203-
}, -1, 0, 2000000000, 0
203+
}, -1, 0, 2000000000
204204
},
205205
{
206206
{
207207
"autovacuum_multixact_freeze_table_age",
208208
"Age of multixact at which VACUUM should perform a full table sweep to freeze row versions",
209209
RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
210-
}, -1, 0, 2000000000, 0
210+
}, -1, 0, 2000000000
211211
},
212212

213213
/* list terminator */
@@ -503,7 +503,7 @@ add_bool_reloption(bits32 kinds, char *name, char *desc, bool default_val)
503503
*/
504504
void
505505
add_int_reloption(bits32 kinds, char *name, char *desc, int default_val,
506-
int min_val, int max_val, int flags_val)
506+
int min_val, int max_val)
507507
{
508508
relopt_int *newoption;
509509

@@ -512,7 +512,6 @@ add_int_reloption(bits32 kinds, char *name, char *desc, int default_val,
512512
newoption->default_val = default_val;
513513
newoption->min = min_val;
514514
newoption->max = max_val;
515-
newoption->flags = flags_val;
516515

517516
add_reloption((relopt_gen *) newoption);
518517
}
@@ -1001,15 +1000,12 @@ parse_one_reloption(relopt_value *option, char *text_str, int text_len,
10011000
case RELOPT_TYPE_INT:
10021001
{
10031002
relopt_int *optint = (relopt_int *) option->gen;
1004-
const char *hintmsg;
10051003

1006-
parsed = parse_int(value, &option->values.int_val,
1007-
optint->flags, &hintmsg);
1004+
parsed = parse_int(value, &option->values.int_val, 0, NULL);
10081005
if (validate && !parsed)
10091006
ereport(ERROR,
10101007
(errmsg("invalid value for integer option \"%s\": %s",
1011-
option->gen->name, value),
1012-
hintmsg ? errhint("%s", _(hintmsg)) : 0));
1008+
option->gen->name, value)));
10131009
if (validate && (option->values.int_val < optint->min ||
10141010
option->values.int_val > optint->max))
10151011
ereport(ERROR,

src/include/access/reloptions.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ typedef struct relopt_int
9292
int default_val;
9393
int min;
9494
int max;
95-
int flags;
9695
} relopt_int;
9796

9897
typedef struct relopt_real
@@ -245,7 +244,7 @@ extern relopt_kind add_reloption_kind(void);
245244
extern void add_bool_reloption(bits32 kinds, char *name, char *desc,
246245
bool default_val);
247246
extern void add_int_reloption(bits32 kinds, char *name, char *desc,
248-
int default_val, int min_val, int max_val, int flags_val);
247+
int default_val, int min_val, int max_val);
249248
extern void add_real_reloption(bits32 kinds, char *name, char *desc,
250249
double default_val, double min_val, double max_val);
251250
extern void add_string_reloption(bits32 kinds, char *name, char *desc,

src/test/regress/expected/alter_table.out

-14
Original file line numberDiff line numberDiff line change
@@ -1811,20 +1811,6 @@ Check constraints:
18111811
"test_inh_check_a_check" CHECK (a::double precision > 10.2::double precision)
18121812
Inherits: test_inh_check
18131813

1814-
-- Set a storage parameter with unit
1815-
CREATE TABLE test_param_unit (a text) WITH (autovacuum_vacuum_cost_delay = '80ms');
1816-
ALTER TABLE test_param_unit SET (autovacuum_vacuum_cost_delay = '3min');
1817-
ERROR: value 3min out of bounds for option "autovacuum_vacuum_cost_delay"
1818-
DETAIL: Valid values are between "0" and "100".
1819-
ALTER TABLE test_param_unit SET (autovacuum_analyze_threshold = '3min'); -- fails
1820-
ERROR: invalid value for integer option "autovacuum_analyze_threshold": 3min
1821-
\d+ test_param_unit
1822-
Table "public.test_param_unit"
1823-
Column | Type | Modifiers | Storage | Stats target | Description
1824-
--------+------+-----------+----------+--------------+-------------
1825-
a | text | | extended | |
1826-
Options: autovacuum_vacuum_cost_delay=80ms
1827-
18281814
--
18291815
-- lock levels
18301816
--

src/test/regress/sql/alter_table.sql

-6
Original file line numberDiff line numberDiff line change
@@ -1254,12 +1254,6 @@ ALTER TABLE test_inh_check ALTER COLUMN a TYPE numeric;
12541254
\d test_inh_check
12551255
\d test_inh_check_child
12561256

1257-
-- Set a storage parameter with unit
1258-
CREATE TABLE test_param_unit (a text) WITH (autovacuum_vacuum_cost_delay = '80ms');
1259-
ALTER TABLE test_param_unit SET (autovacuum_vacuum_cost_delay = '3min');
1260-
ALTER TABLE test_param_unit SET (autovacuum_analyze_threshold = '3min'); -- fails
1261-
\d+ test_param_unit
1262-
12631257
--
12641258
-- lock levels
12651259
--

0 commit comments

Comments
 (0)