@@ -528,95 +528,95 @@ drop table brtrigpartcon;
528
528
drop function brtrigpartcon1trigf();
529
529
-- check multi-column range partitioning with minvalue/maxvalue constraints
530
530
create table mcrparted (a text, b int) partition by range(a, b);
531
- create table mcrparted_lt_b partition of mcrparted for values from (minvalue, 0) to ('b', minvalue);
532
- create table mcrparted_b partition of mcrparted for values from ('b', minvalue) to ('c', minvalue);
533
- create table mcrparted_c_to_common partition of mcrparted for values from ('c', minvalue) to ('common', minvalue);
534
- create table mcrparted_common_lt_0 partition of mcrparted for values from ('common', minvalue) to ('common', 0);
535
- create table mcrparted_common_0_to_10 partition of mcrparted for values from ('common', 0) to ('common', 10);
536
- create table mcrparted_common_ge_10 partition of mcrparted for values from ('common', 10) to ('common', maxvalue);
537
- create table mcrparted_gt_common_lt_d partition of mcrparted for values from ('common', maxvalue) to ('d', minvalue);
538
- create table mcrparted_ge_d partition of mcrparted for values from ('d', minvalue) to (maxvalue, 0);
531
+ create table mcrparted1_lt_b partition of mcrparted for values from (minvalue, 0) to ('b', minvalue);
532
+ create table mcrparted2_b partition of mcrparted for values from ('b', minvalue) to ('c', minvalue);
533
+ create table mcrparted3_c_to_common partition of mcrparted for values from ('c', minvalue) to ('common', minvalue);
534
+ create table mcrparted4_common_lt_0 partition of mcrparted for values from ('common', minvalue) to ('common', 0);
535
+ create table mcrparted5_common_0_to_10 partition of mcrparted for values from ('common', 0) to ('common', 10);
536
+ create table mcrparted6_common_ge_10 partition of mcrparted for values from ('common', 10) to ('common', maxvalue);
537
+ create table mcrparted7_gt_common_lt_d partition of mcrparted for values from ('common', maxvalue) to ('d', minvalue);
538
+ create table mcrparted8_ge_d partition of mcrparted for values from ('d', minvalue) to (maxvalue, 0);
539
539
\d+ mcrparted
540
540
Table "public.mcrparted"
541
541
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
542
542
--------+---------+-----------+----------+---------+----------+--------------+-------------
543
543
a | text | | | | extended | |
544
544
b | integer | | | | plain | |
545
545
Partition key: RANGE (a, b)
546
- Partitions: mcrparted_b FOR VALUES FROM ('b', MINVALUE ) TO ('c ', MINVALUE),
547
- mcrparted_common_0_to_10 FOR VALUES FROM ('common ', 0 ) TO ('common ', 10 ),
548
- mcrparted_common_ge_10 FOR VALUES FROM ('common ', 10 ) TO ('common', MAXVALUE ),
549
- mcrparted_common_lt_0 FOR VALUES FROM ('common', MINVALUE) TO ('common', 0),
550
- mcrparted_c_to_common FOR VALUES FROM ('c ', MINVALUE ) TO ('common', MINVALUE ),
551
- mcrparted_ge_d FOR VALUES FROM ('d ', MINVALUE ) TO (MAXVALUE, 0 ),
552
- mcrparted_gt_common_lt_d FOR VALUES FROM ('common', MAXVALUE) TO ('d', MINVALUE),
553
- mcrparted_lt_b FOR VALUES FROM (MINVALUE, 0 ) TO ('b', MINVALUE )
546
+ Partitions: mcrparted1_lt_b FOR VALUES FROM (MINVALUE, 0 ) TO ('b ', MINVALUE),
547
+ mcrparted2_b FOR VALUES FROM ('b ', MINVALUE ) TO ('c ', MINVALUE ),
548
+ mcrparted3_c_to_common FOR VALUES FROM ('c ', MINVALUE ) TO ('common', MINVALUE ),
549
+ mcrparted4_common_lt_0 FOR VALUES FROM ('common', MINVALUE) TO ('common', 0),
550
+ mcrparted5_common_0_to_10 FOR VALUES FROM ('common ', 0 ) TO ('common', 10 ),
551
+ mcrparted6_common_ge_10 FOR VALUES FROM ('common ', 10 ) TO ('common', MAXVALUE ),
552
+ mcrparted7_gt_common_lt_d FOR VALUES FROM ('common', MAXVALUE) TO ('d', MINVALUE),
553
+ mcrparted8_ge_d FOR VALUES FROM ('d', MINVALUE ) TO (MAXVALUE, 0 )
554
554
555
- \d+ mcrparted_lt_b
556
- Table "public.mcrparted_lt_b "
555
+ \d+ mcrparted1_lt_b
556
+ Table "public.mcrparted1_lt_b "
557
557
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
558
558
--------+---------+-----------+----------+---------+----------+--------------+-------------
559
559
a | text | | | | extended | |
560
560
b | integer | | | | plain | |
561
561
Partition of: mcrparted FOR VALUES FROM (MINVALUE, 0) TO ('b', MINVALUE)
562
562
Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a < 'b'::text))
563
563
564
- \d+ mcrparted_b
565
- Table "public.mcrparted_b "
564
+ \d+ mcrparted2_b
565
+ Table "public.mcrparted2_b "
566
566
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
567
567
--------+---------+-----------+----------+---------+----------+--------------+-------------
568
568
a | text | | | | extended | |
569
569
b | integer | | | | plain | |
570
570
Partition of: mcrparted FOR VALUES FROM ('b', MINVALUE) TO ('c', MINVALUE)
571
571
Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a >= 'b'::text) AND (a < 'c'::text))
572
572
573
- \d+ mcrparted_c_to_common
574
- Table "public.mcrparted_c_to_common "
573
+ \d+ mcrparted3_c_to_common
574
+ Table "public.mcrparted3_c_to_common "
575
575
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
576
576
--------+---------+-----------+----------+---------+----------+--------------+-------------
577
577
a | text | | | | extended | |
578
578
b | integer | | | | plain | |
579
579
Partition of: mcrparted FOR VALUES FROM ('c', MINVALUE) TO ('common', MINVALUE)
580
580
Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a >= 'c'::text) AND (a < 'common'::text))
581
581
582
- \d+ mcrparted_common_lt_0
583
- Table "public.mcrparted_common_lt_0 "
582
+ \d+ mcrparted4_common_lt_0
583
+ Table "public.mcrparted4_common_lt_0 "
584
584
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
585
585
--------+---------+-----------+----------+---------+----------+--------------+-------------
586
586
a | text | | | | extended | |
587
587
b | integer | | | | plain | |
588
588
Partition of: mcrparted FOR VALUES FROM ('common', MINVALUE) TO ('common', 0)
589
589
Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a = 'common'::text) AND (b < 0))
590
590
591
- \d+ mcrparted_common_0_to_10
592
- Table "public.mcrparted_common_0_to_10 "
591
+ \d+ mcrparted5_common_0_to_10
592
+ Table "public.mcrparted5_common_0_to_10 "
593
593
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
594
594
--------+---------+-----------+----------+---------+----------+--------------+-------------
595
595
a | text | | | | extended | |
596
596
b | integer | | | | plain | |
597
597
Partition of: mcrparted FOR VALUES FROM ('common', 0) TO ('common', 10)
598
598
Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a = 'common'::text) AND (b >= 0) AND (b < 10))
599
599
600
- \d+ mcrparted_common_ge_10
601
- Table "public.mcrparted_common_ge_10 "
600
+ \d+ mcrparted6_common_ge_10
601
+ Table "public.mcrparted6_common_ge_10 "
602
602
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
603
603
--------+---------+-----------+----------+---------+----------+--------------+-------------
604
604
a | text | | | | extended | |
605
605
b | integer | | | | plain | |
606
606
Partition of: mcrparted FOR VALUES FROM ('common', 10) TO ('common', MAXVALUE)
607
607
Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a = 'common'::text) AND (b >= 10))
608
608
609
- \d+ mcrparted_gt_common_lt_d
610
- Table "public.mcrparted_gt_common_lt_d "
609
+ \d+ mcrparted7_gt_common_lt_d
610
+ Table "public.mcrparted7_gt_common_lt_d "
611
611
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
612
612
--------+---------+-----------+----------+---------+----------+--------------+-------------
613
613
a | text | | | | extended | |
614
614
b | integer | | | | plain | |
615
615
Partition of: mcrparted FOR VALUES FROM ('common', MAXVALUE) TO ('d', MINVALUE)
616
616
Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a > 'common'::text) AND (a < 'd'::text))
617
617
618
- \d+ mcrparted_ge_d
619
- Table "public.mcrparted_ge_d "
618
+ \d+ mcrparted8_ge_d
619
+ Table "public.mcrparted8_ge_d "
620
620
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
621
621
--------+---------+-----------+----------+---------+----------+--------------+-------------
622
622
a | text | | | | extended | |
@@ -628,19 +628,19 @@ insert into mcrparted values ('aaa', 0), ('b', 0), ('bz', 10), ('c', -10),
628
628
('comm', -10), ('common', -10), ('common', 0), ('common', 10),
629
629
('commons', 0), ('d', -10), ('e', 0);
630
630
select tableoid::regclass, * from mcrparted order by a, b;
631
- tableoid | a | b
632
- --------------------------+---------+-----
633
- mcrparted_lt_b | aaa | 0
634
- mcrparted_b | b | 0
635
- mcrparted_b | bz | 10
636
- mcrparted_c_to_common | c | -10
637
- mcrparted_c_to_common | comm | -10
638
- mcrparted_common_lt_0 | common | -10
639
- mcrparted_common_0_to_10 | common | 0
640
- mcrparted_common_ge_10 | common | 10
641
- mcrparted_gt_common_lt_d | commons | 0
642
- mcrparted_ge_d | d | -10
643
- mcrparted_ge_d | e | 0
631
+ tableoid | a | b
632
+ --------------------------- +---------+-----
633
+ mcrparted1_lt_b | aaa | 0
634
+ mcrparted2_b | b | 0
635
+ mcrparted2_b | bz | 10
636
+ mcrparted3_c_to_common | c | -10
637
+ mcrparted3_c_to_common | comm | -10
638
+ mcrparted4_common_lt_0 | common | -10
639
+ mcrparted5_common_0_to_10 | common | 0
640
+ mcrparted6_common_ge_10 | common | 10
641
+ mcrparted7_gt_common_lt_d | commons | 0
642
+ mcrparted8_ge_d | d | -10
643
+ mcrparted8_ge_d | e | 0
644
644
(11 rows)
645
645
646
646
drop table mcrparted;
0 commit comments