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

Commit f0bd367

Browse files
committed
small refactorings in test suite
1 parent 0c8cd7f commit f0bd367

File tree

5 files changed

+75
-18
lines changed

5 files changed

+75
-18
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ REGRESS = pathman_array_qual \
4646
pathman_join_clause \
4747
pathman_lateral \
4848
pathman_mergejoin \
49+
pathman_multilevel \
4950
pathman_only \
5051
pathman_param_upd_del \
5152
pathman_permissions \

expected/pathman_basic.out

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,18 +1851,6 @@ ORDER BY partition;
18511851

18521852
DROP TABLE test.provided_part_names CASCADE;
18531853
NOTICE: drop cascades to 2 other objects
1854-
/* Check that multilivel is prohibited */
1855-
CREATE TABLE test.multi(key int NOT NULL);
1856-
SELECT create_hash_partitions('test.multi', 'key', 3);
1857-
create_hash_partitions
1858-
------------------------
1859-
3
1860-
(1 row)
1861-
1862-
SELECT create_hash_partitions('test.multi_1', 'key', 3);
1863-
ERROR: multilevel partitioning is not supported
1864-
DROP TABLE test.multi CASCADE;
1865-
NOTICE: drop cascades to 3 other objects
18661854
DROP SCHEMA test CASCADE;
18671855
NOTICE: drop cascades to 28 other objects
18681856
DROP EXTENSION pg_pathman CASCADE;

expected/pathman_multilevel.out

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
\set VERBOSITY terse
2+
SET search_path = 'public';
3+
CREATE EXTENSION pg_pathman;
4+
CREATE SCHEMA multi;
5+
/* Check that multilevel is prohibited */
6+
CREATE TABLE multi.test(key int NOT NULL);
7+
SELECT create_hash_partitions('multi.test', 'key', 3);
8+
create_hash_partitions
9+
------------------------
10+
3
11+
(1 row)
12+
13+
SELECT create_hash_partitions('multi.test_1', 'key', 3);
14+
ERROR: multilevel partitioning is not supported
15+
DROP TABLE multi.test CASCADE;
16+
NOTICE: drop cascades to 3 other objects
17+
/* Attach partitioned subtree to 'abc' */
18+
CREATE TABLE multi.abc (val int NOT NULL);
19+
CREATE TABLE multi.def (LIKE multi.abc);
20+
SELECT create_hash_partitions('multi.def', 'val', 2);
21+
create_hash_partitions
22+
------------------------
23+
2
24+
(1 row)
25+
26+
ALTER TABLE multi.def INHERIT multi.abc;
27+
/*
28+
* Although multilevel partitioning is not supported,
29+
* we must make sure that pg_pathman won't add
30+
* duplicate relations to the final plan.
31+
*/
32+
EXPLAIN (COSTS OFF) TABLE multi.abc;
33+
QUERY PLAN
34+
-------------------------
35+
Append
36+
-> Seq Scan on abc
37+
-> Seq Scan on def
38+
-> Seq Scan on def_0
39+
-> Seq Scan on def_1
40+
(5 rows)
41+
42+
DROP SCHEMA multi CASCADE;
43+
NOTICE: drop cascades to 4 other objects
44+
DROP EXTENSION pg_pathman;

sql/pathman_basic.sql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -551,12 +551,6 @@ ORDER BY partition;
551551

552552
DROP TABLE test.provided_part_names CASCADE;
553553

554-
/* Check that multilivel is prohibited */
555-
CREATE TABLE test.multi(key int NOT NULL);
556-
SELECT create_hash_partitions('test.multi', 'key', 3);
557-
SELECT create_hash_partitions('test.multi_1', 'key', 3);
558-
DROP TABLE test.multi CASCADE;
559-
560554

561555
DROP SCHEMA test CASCADE;
562556
DROP EXTENSION pg_pathman CASCADE;

sql/pathman_multilevel.sql

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
\set VERBOSITY terse
2+
3+
SET search_path = 'public';
4+
CREATE EXTENSION pg_pathman;
5+
CREATE SCHEMA multi;
6+
7+
8+
/* Check that multilevel is prohibited */
9+
CREATE TABLE multi.test(key int NOT NULL);
10+
SELECT create_hash_partitions('multi.test', 'key', 3);
11+
SELECT create_hash_partitions('multi.test_1', 'key', 3);
12+
DROP TABLE multi.test CASCADE;
13+
14+
15+
/* Attach partitioned subtree to 'abc' */
16+
CREATE TABLE multi.abc (val int NOT NULL);
17+
CREATE TABLE multi.def (LIKE multi.abc);
18+
SELECT create_hash_partitions('multi.def', 'val', 2);
19+
ALTER TABLE multi.def INHERIT multi.abc;
20+
21+
/*
22+
* Although multilevel partitioning is not supported,
23+
* we must make sure that pg_pathman won't add
24+
* duplicate relations to the final plan.
25+
*/
26+
EXPLAIN (COSTS OFF) TABLE multi.abc;
27+
28+
29+
DROP SCHEMA multi CASCADE;
30+
DROP EXTENSION pg_pathman;

0 commit comments

Comments
 (0)