forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc03911d
committed
Simplify the logic checking new range partition bounds.
The previous logic, whilst not actually wrong, was overly complex andinvolved doing two binary searches, where only one was reallynecessary. This simplifies that logic and improves the comments.One visible change is that if the new partition overlaps multipleexisting partitions, the error message now always reports the overlapwith the first existing partition (the one with the lowestbounds). The old code would sometimes report the clash with the firstpartition and sometimes with the last one.Original patch idea from Amit Langote, substantially rewritten by me.Discussion:https://postgr.es/m/CAAJ_b947mowpLdxL3jo3YLKngRjrq9+Ej4ymduQTfYR+8=YAYQ@mail.gmail.com1 parentec86af9 commitc03911d
File tree
2 files changed
+40
-54
lines changed- src
- backend/catalog
- test/regress/expected
2 files changed
+40
-54
lines changedLines changed: 39 additions & 53 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
745 | 745 |
| |
746 | 746 |
| |
747 | 747 |
| |
748 |
| - | |
749 |
| - | |
750 |
| - | |
| 748 | + | |
| 749 | + | |
751 | 750 |
| |
752 | 751 |
| |
753 | 752 |
| |
754 | 753 |
| |
755 | 754 |
| |
756 |
| - | |
757 |
| - | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
758 | 768 |
| |
759 |
| - | |
760 |
| - | |
| 769 | + | |
| 770 | + | |
761 | 771 |
| |
762 |
| - | |
763 |
| - | |
764 |
| - | |
765 |
| - | |
766 |
| - | |
767 |
| - | |
768 |
| - | |
769 |
| - | |
770 |
| - | |
771 |
| - | |
| 772 | + | |
772 | 773 |
| |
773 |
| - | |
774 |
| - | |
775 |
| - | |
776 | 774 |
| |
777 |
| - | |
778 |
| - | |
779 |
| - | |
780 |
| - | |
781 |
| - | |
782 |
| - | |
783 |
| - | |
784 |
| - | |
785 |
| - | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
786 | 779 |
| |
787 |
| - | |
| 780 | + | |
788 | 781 |
| |
789 |
| - | |
| 782 | + | |
790 | 783 |
| |
791 |
| - | |
792 |
| - | |
793 |
| - | |
794 |
| - | |
795 |
| - | |
796 |
| - | |
797 |
| - | |
798 |
| - | |
799 |
| - | |
800 |
| - | |
801 |
| - | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
802 | 796 |
| |
803 | 797 |
| |
804 | 798 |
| |
805 | 799 |
| |
806 | 800 |
| |
807 |
| - | |
808 |
| - | |
809 |
| - | |
810 |
| - | |
811 |
| - | |
812 |
| - | |
813 |
| - | |
814 |
| - | |
815 |
| - | |
816 |
| - | |
| 801 | + | |
| 802 | + | |
817 | 803 |
| |
818 | 804 |
| |
819 |
| - | |
| 805 | + | |
820 | 806 |
| |
821 | 807 |
| |
822 | 808 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
589 | 589 |
| |
590 | 590 |
| |
591 | 591 |
| |
592 |
| - | |
| 592 | + | |
593 | 593 |
| |
594 | 594 |
| |
595 | 595 |
| |
|
0 commit comments
Comments
(0)