提交 32dd73d7 编写于 作者: H Heikki Linnakangas

Remove uninteresting and duplicated tests on ALTER TABLE TEMPLATE syntax.

We have these exact same tests twice, with and without scema-qualifying
the table name. That's hardly a meaningful difference, when testing the
grammar of the SUBPARTITION TEMPLATE part. Remove the duplicated tests.
(I'm not convinced it's useful to have even a single copy of these tests,
but keep for now.)
上级 9b838fab
......@@ -3761,180 +3761,7 @@ select schemaname, tablename, attname, null_frac, avg_width, n_distinct, most_c
(10 rows)
drop table mpp3487;
-- Negative Test for Alter subpartition template
CREATE TABLE qa147sales (trans_id int, date date, amount
decimal(9,2), region text)
DISTRIBUTED BY (trans_id)
PARTITION BY RANGE (date)
SUBPARTITION BY LIST (region)
SUBPARTITION TEMPLATE
( SUBPARTITION usa VALUES ('usa'),
SUBPARTITION asia VALUES ('asia'),
SUBPARTITION europe VALUES ('europe') )
( START (date '2008-01-01') INCLUSIVE
END (date '2009-01-01') EXCLUSIVE
EVERY (INTERVAL '1 month') );
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_1" for table "qa147sales"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_1_2_prt_usa" for table "qa147sales_1_prt_1"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_1_2_prt_asia" for table "qa147sales_1_prt_1"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_1_2_prt_europe" for table "qa147sales_1_prt_1"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_2" for table "qa147sales"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_2_2_prt_usa" for table "qa147sales_1_prt_2"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_2_2_prt_asia" for table "qa147sales_1_prt_2"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_2_2_prt_europe" for table "qa147sales_1_prt_2"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_3" for table "qa147sales"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_3_2_prt_usa" for table "qa147sales_1_prt_3"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_3_2_prt_asia" for table "qa147sales_1_prt_3"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_3_2_prt_europe" for table "qa147sales_1_prt_3"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_4" for table "qa147sales"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_4_2_prt_usa" for table "qa147sales_1_prt_4"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_4_2_prt_asia" for table "qa147sales_1_prt_4"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_4_2_prt_europe" for table "qa147sales_1_prt_4"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_5" for table "qa147sales"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_5_2_prt_usa" for table "qa147sales_1_prt_5"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_5_2_prt_asia" for table "qa147sales_1_prt_5"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_5_2_prt_europe" for table "qa147sales_1_prt_5"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_6" for table "qa147sales"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_6_2_prt_usa" for table "qa147sales_1_prt_6"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_6_2_prt_asia" for table "qa147sales_1_prt_6"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_6_2_prt_europe" for table "qa147sales_1_prt_6"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_7" for table "qa147sales"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_7_2_prt_usa" for table "qa147sales_1_prt_7"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_7_2_prt_asia" for table "qa147sales_1_prt_7"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_7_2_prt_europe" for table "qa147sales_1_prt_7"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_8" for table "qa147sales"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_8_2_prt_usa" for table "qa147sales_1_prt_8"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_8_2_prt_asia" for table "qa147sales_1_prt_8"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_8_2_prt_europe" for table "qa147sales_1_prt_8"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_9" for table "qa147sales"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_9_2_prt_usa" for table "qa147sales_1_prt_9"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_9_2_prt_asia" for table "qa147sales_1_prt_9"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_9_2_prt_europe" for table "qa147sales_1_prt_9"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_10" for table "qa147sales"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_10_2_prt_usa" for table "qa147sales_1_prt_10"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_10_2_prt_asia" for table "qa147sales_1_prt_10"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_10_2_prt_europe" for table "qa147sales_1_prt_10"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_11" for table "qa147sales"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_11_2_prt_usa" for table "qa147sales_1_prt_11"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_11_2_prt_asia" for table "qa147sales_1_prt_11"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_11_2_prt_europe" for table "qa147sales_1_prt_11"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_12" for table "qa147sales"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_12_2_prt_usa" for table "qa147sales_1_prt_12"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_12_2_prt_asia" for table "qa147sales_1_prt_12"
NOTICE: CREATE TABLE will create partition "qa147sales_1_prt_12_2_prt_europe" for table "qa147sales_1_prt_12"
-- Invalid TEMPLATE
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (NULL);
ERROR: syntax error at or near "NULL"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (NULL);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (-1);
ERROR: syntax error at or near "-"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (-1);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (10000);
ERROR: syntax error at or near "10000"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (10000);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE ('');
ERROR: syntax error at or near "''"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE ('');
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE ("");
ERROR: zero-length delimited identifier at or near """"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE ("");
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (*);
ERROR: syntax error at or near "*"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (*);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (1*);
ERROR: syntax error at or near "1"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (1*);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE ("1*");
ERROR: syntax error at or near ""1*""
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE ("1*");
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (ABC);
ERROR: syntax error at or near "ABC"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (ABC);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE ($);
ERROR: syntax error at or near "$"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE ($);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (%%);
ERROR: syntax error at or near "%%"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (%%);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (#);
ERROR: syntax error at or near "#"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (#);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (!);
ERROR: syntax error at or near "!"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (!);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (&);
ERROR: syntax error at or near "&"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (&);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (^);
ERROR: syntax error at or near "^"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (^);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (@);
ERROR: syntax error at or near "@"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (@);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (<);
ERROR: syntax error at or near "<"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (<);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (>);
ERROR: syntax error at or near ">"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (>);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (.);
ERROR: syntax error at or near "."
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (.);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (?);
ERROR: syntax error at or near "?"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (?);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (/);
ERROR: syntax error at or near "/"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (/);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (|);
ERROR: syntax error at or near "|"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (|);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (~);
ERROR: syntax error at or near "~"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (~);
^
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (`);
ERROR: syntax error at or near "`"
LINE 1: ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (`);
^
select * from pg_partition_templates where tablename='qa147sales';
schemaname | tablename | partitionname | partitiontype | partitionlevel | partitionrank | partitionposition | partitionlistvalues | partitionrangestart | partitionstartinclusive | partitionrangeend | partitionendinclusive | partitioneveryclause | partitionisdefault | partitionboundary
---------------+------------+---------------+---------------+----------------+---------------+-------------------+---------------------+---------------------+-------------------------+-------------------+-----------------------+----------------------+--------------------+--------------------------------------
bfv_partition | qa147sales | usa | list | 1 | | 1 | 'usa'::text | | | | | | f | SUBPARTITION usa VALUES('usa')
bfv_partition | qa147sales | asia | list | 1 | | 2 | 'asia'::text | | | | | | f | SUBPARTITION asia VALUES('asia')
bfv_partition | qa147sales | europe | list | 1 | | 3 | 'europe'::text | | | | | | f | SUBPARTITION europe VALUES('europe')
(3 rows)
drop table qa147sales;
select * from pg_partition_templates where tablename='qa147sales';;
schemaname | tablename | partitionname | partitiontype | partitionlevel | partitionrank | partitionposition | partitionlistvalues | partitionrangestart | partitionstartinclusive | partitionrangeend | partitionendinclusive | partitioneveryclause | partitionisdefault | partitionboundary
------------+-----------+---------------+---------------+----------------+---------------+-------------------+---------------------+---------------------+-------------------------+-------------------+-----------------------+----------------------+--------------------+-------------------
(0 rows)
-- Now with Schema
-- Negative Test for alter subpartition template with Schema
-- Negative Tests for alter subpartition template syntax with Schema
create schema qa147;
CREATE TABLE qa147.sales (trans_id int, date date, amount
decimal(9,2), region text)
......
......@@ -1229,54 +1229,8 @@ insert into mpp3487 select i from generate_series(1, 9) i;
vacuum analyze mpp3487;
select schemaname, tablename, attname, null_frac, avg_width, n_distinct, most_common_freqs, histogram_bounds from pg_stats where tablename like 'mpp3487%' order by 2;
drop table mpp3487;
-- Negative Test for Alter subpartition template
CREATE TABLE qa147sales (trans_id int, date date, amount
decimal(9,2), region text)
DISTRIBUTED BY (trans_id)
PARTITION BY RANGE (date)
SUBPARTITION BY LIST (region)
SUBPARTITION TEMPLATE
( SUBPARTITION usa VALUES ('usa'),
SUBPARTITION asia VALUES ('asia'),
SUBPARTITION europe VALUES ('europe') )
( START (date '2008-01-01') INCLUSIVE
END (date '2009-01-01') EXCLUSIVE
EVERY (INTERVAL '1 month') );
-- Invalid TEMPLATE
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (NULL);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (-1);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (10000);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE ('');
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE ("");
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (*);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (1*);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE ("1*");
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (ABC);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE ($);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (%%);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (#);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (!);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (&);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (^);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (@);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (<);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (>);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (.);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (?);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (/);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (|);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (~);
ALTER TABLE qa147sales SET SUBPARTITION TEMPLATE (`);
select * from pg_partition_templates where tablename='qa147sales';
drop table qa147sales;
select * from pg_partition_templates where tablename='qa147sales';;
-- Now with Schema
-- Negative Test for alter subpartition template with Schema
-- Negative Tests for alter subpartition template syntax with Schema
create schema qa147;
CREATE TABLE qa147.sales (trans_id int, date date, amount
decimal(9,2), region text)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册