Hi Ashutosh, On 2016/09/22 14:42, Ashutosh Bapat wrote: > Hi Amit, > Following sequence of DDLs gets an error > -- > -- multi-leveled partitions > -- > CREATE TABLE prt1_l (a int, b int, c varchar) PARTITION BY RANGE(a); > CREATE TABLE prt1_l_p1 PARTITION OF prt1_l FOR VALUES START (0) END > (250) PARTITION BY RANGE (b); > CREATE TABLE prt1_l_p1_p1 PARTITION OF prt1_l_p1 FOR VALUES START (0) END > (100); > CREATE TABLE prt1_l_p1_p2 PARTITION OF prt1_l_p1 FOR VALUES START > (100) END (250); > CREATE TABLE prt1_l_p2 PARTITION OF prt1_l FOR VALUES START (250) END > (500) PARTITION BY RANGE (c); > CREATE TABLE prt1_l_p2_p1 PARTITION OF prt1_l_p2 FOR VALUES START > ('0250') END ('0400'); > CREATE TABLE prt1_l_p2_p2 PARTITION OF prt1_l_p2 FOR VALUES START > ('0400') END ('0500'); > CREATE TABLE prt1_l_p3 PARTITION OF prt1_l FOR VALUES START (500) END > (600) PARTITION BY RANGE ((b + a)); > ERROR: cannot use column or expression from ancestor partition key > > The last statement is trying create subpartitions by range (b + a), > which contains a partition key from ancestor partition key but is not > exactly same as that. In fact it contains some extra columns other > than the ancestor partition key columns. Why do we want to prohibit > such cases?
Per discussion [1], I am going to remove this ill-considered restriction. Thanks, Amit [1] https://www.postgresql.org/message-id/CA%2BHiwqEXAU_m%2BV%3Db-VGmsDNjoqc-Z_9KQdyPuOGbiQGzNObmVg%40mail.gmail.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers