summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2014-08-28 15:55:50 +0900
committerFujii Masao <fujii@postgresql.org>2014-08-28 15:55:50 +0900
commite23014f3d40f7d2c23bc97207fd28efbe5ba102b (patch)
tree2c5120b892ab6407306600ccc59412c2834b28b4 /src/test
parent8167a3883a3c49f2f77785f8e5f638920c9f14ef (diff)
Allow units to be specified in relation option setting value.
This introduces an infrastructure which allows us to specify the units like ms (milliseconds) in integer relation option, like GUC parameter. Currently only autovacuum_vacuum_cost_delay reloption can accept the units. Reviewed by Michael Paquier
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/alter_table.out14
-rw-r--r--src/test/regress/sql/alter_table.sql6
2 files changed, 20 insertions, 0 deletions
diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out
index 10f45f25a5e..1d31b81456f 100644
--- a/src/test/regress/expected/alter_table.out
+++ b/src/test/regress/expected/alter_table.out
@@ -1811,6 +1811,20 @@ Check constraints:
"test_inh_check_a_check" CHECK (a::double precision > 10.2::double precision)
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
--
diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql
index 12fd7c2321b..2c21006615f 100644
--- a/src/test/regress/sql/alter_table.sql
+++ b/src/test/regress/sql/alter_table.sql
@@ -1254,6 +1254,12 @@ ALTER TABLE test_inh_check ALTER COLUMN a TYPE numeric;
\d test_inh_check
\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
--