File tree 3 files changed +28
-0
lines changed
3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1851,6 +1851,18 @@ ORDER BY partition;
1851
1851
1852
1852
DROP TABLE test.provided_part_names CASCADE;
1853
1853
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
1854
1866
DROP SCHEMA test CASCADE;
1855
1867
NOTICE: drop cascades to 28 other objects
1856
1868
DROP EXTENSION pg_pathman CASCADE;
Original file line number Diff line number Diff line change @@ -551,6 +551,12 @@ ORDER BY partition;
551
551
552
552
DROP TABLE test .provided_part_names CASCADE;
553
553
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
+
554
560
555
561
DROP SCHEMA test CASCADE;
556
562
DROP EXTENSION pg_pathman CASCADE;
Original file line number Diff line number Diff line change @@ -765,6 +765,7 @@ add_to_pathman_config(PG_FUNCTION_ARGS)
765
765
Datum expr_datum ;
766
766
767
767
PathmanInitState init_state ;
768
+ PartParentSearch parent_search ;
768
769
769
770
if (!PG_ARGISNULL (0 ))
770
771
{
@@ -798,6 +799,15 @@ add_to_pathman_config(PG_FUNCTION_ARGS)
798
799
get_rel_name_or_relid (relid ))));
799
800
}
800
801
802
+ /* Check if it's a partition */
803
+ if (get_parent_of_partition (relid , & parent_search ) &&
804
+ parent_search == PPS_ENTRY_PART_PARENT )
805
+ {
806
+ ereport (ERROR ,
807
+ (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
808
+ errmsg ("multilevel partitioning is not supported" )));
809
+ }
810
+
801
811
/* Select partitioning type */
802
812
switch (PG_NARGS ())
803
813
{
You can’t perform that action at this time.
0 commit comments