@@ -285,6 +285,34 @@ select tableoid::regclass, * from list_parted;
285285 part_ee_ff2 | EE | 10
286286(8 rows)
287287
288+ -- some more tests to exercise tuple-routing with multi-level partitioning
289+ create table part_gg partition of list_parted for values in ('gg') partition by range (b);
290+ create table part_gg1 partition of part_gg for values from (unbounded) to (1);
291+ create table part_gg2 partition of part_gg for values from (1) to (10) partition by range (b);
292+ create table part_gg2_1 partition of part_gg2 for values from (1) to (5);
293+ create table part_gg2_2 partition of part_gg2 for values from (5) to (10);
294+ create table part_ee_ff3 partition of part_ee_ff for values from (20) to (30) partition by range (b);
295+ create table part_ee_ff3_1 partition of part_ee_ff3 for values from (20) to (25);
296+ create table part_ee_ff3_2 partition of part_ee_ff3 for values from (25) to (30);
297+ truncate list_parted;
298+ insert into list_parted values ('aa'), ('cc');
299+ insert into list_parted select 'Ff', s.a from generate_series(1, 29) s(a);
300+ insert into list_parted select 'gg', s.a from generate_series(1, 9) s(a);
301+ insert into list_parted (b) values (1);
302+ select tableoid::regclass::text, a, min(b) as min_b, max(b) as max_b from list_parted group by 1, 2 order by 1;
303+ tableoid | a | min_b | max_b
304+ ---------------+----+-------+-------
305+ part_aa_bb | aa | |
306+ part_cc_dd | cc | |
307+ part_ee_ff1 | Ff | 1 | 9
308+ part_ee_ff2 | Ff | 10 | 19
309+ part_ee_ff3_1 | Ff | 20 | 24
310+ part_ee_ff3_2 | Ff | 25 | 29
311+ part_gg2_1 | gg | 1 | 4
312+ part_gg2_2 | gg | 5 | 9
313+ part_null | | 1 | 1
314+ (9 rows)
315+
288316-- cleanup
289317drop table range_parted cascade;
290318NOTICE: drop cascades to 4 other objects
@@ -293,13 +321,21 @@ drop cascades to table part2
293321drop cascades to table part3
294322drop cascades to table part4
295323drop table list_parted cascade;
296- NOTICE: drop cascades to 6 other objects
324+ NOTICE: drop cascades to 14 other objects
297325DETAIL: drop cascades to table part_aa_bb
298326drop cascades to table part_cc_dd
299327drop cascades to table part_null
300328drop cascades to table part_ee_ff
301329drop cascades to table part_ee_ff1
302330drop cascades to table part_ee_ff2
331+ drop cascades to table part_ee_ff3
332+ drop cascades to table part_ee_ff3_1
333+ drop cascades to table part_ee_ff3_2
334+ drop cascades to table part_gg
335+ drop cascades to table part_gg1
336+ drop cascades to table part_gg2
337+ drop cascades to table part_gg2_1
338+ drop cascades to table part_gg2_2
303339-- more tests for certain multi-level partitioning scenarios
304340create table p (a int, b int) partition by range (a, b);
305341create table p1 (b int, a int not null) partition by range (b);
0 commit comments