File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1851,6 +1851,18 @@ ORDER BY partition;
18511851
18521852DROP TABLE test.provided_part_names CASCADE;
18531853NOTICE: 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
18541866DROP SCHEMA test CASCADE;
18551867NOTICE: drop cascades to 28 other objects
18561868DROP EXTENSION pg_pathman CASCADE;
Original file line number Diff line number Diff line change @@ -551,6 +551,12 @@ ORDER BY partition;
551551
552552DROP 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+
554560
555561DROP SCHEMA test CASCADE;
556562DROP 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)
765765 Datum expr_datum ;
766766
767767 PathmanInitState init_state ;
768+ PartParentSearch parent_search ;
768769
769770 if (!PG_ARGISNULL (0 ))
770771 {
@@ -798,6 +799,15 @@ add_to_pathman_config(PG_FUNCTION_ARGS)
798799 get_rel_name_or_relid (relid ))));
799800 }
800801
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+
801811 /* Select partitioning type */
802812 switch (PG_NARGS ())
803813 {
You can’t perform that action at this time.
0 commit comments