forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9653ca2
committed
Fix partitioned index creation with foreign partitions
When a partitioned tables contains foreign tables as partitions, it isnot possible to implement unique or primary key indexes -- but whenregular indexes are created, there is no reason to do anything otherthan ignoring such partitions. We were raising errors upon encounteringthe foreign partitions, which is unfriendly and doesn't protect againstany actual problems.Relax this restriction so that index creation is allowed on partitionedtables containing foreign partitions, becoming a no-op on them. (We maylater want to redefine this so that the FDW is told to create theindexes on the foreign side.) This applies to CREATE INDEX, as well asALTER TABLE / ATTACH PARTITION and CREATE TABLE / PARTITION OF.Backpatch to 11, where indexes on partitioned tables were introduced.Discussion:https://postgr.es/m/15724-d5a58fa9472eef4f@postgresql.orgAuthor: Álvaro HerreraReviewed-by: Amit Langote1 parent0e08a3a commit9653ca2
File tree
7 files changed
+172
-9
lines changed- doc/src/sgml/ref
- src
- backend
- commands
- tcop
- test/regress
- expected
- sql
7 files changed
+172
-9
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
861 | 861 |
| |
862 | 862 |
| |
863 | 863 |
| |
864 |
| - | |
| 864 | + | |
865 | 865 |
| |
866 | 866 |
| |
867 | 867 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
169 | 169 |
| |
170 | 170 |
| |
171 | 171 |
| |
172 |
| - | |
173 |
| - | |
| 172 | + | |
| 173 | + | |
174 | 174 |
| |
175 | 175 |
| |
176 | 176 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
922 | 922 |
| |
923 | 923 |
| |
924 | 924 |
| |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
925 | 945 |
| |
926 | 946 |
| |
927 | 947 |
| |
|
Lines changed: 45 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
939 | 939 |
| |
940 | 940 |
| |
941 | 941 |
| |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
942 | 958 |
| |
943 | 959 |
| |
944 | 960 |
| |
| |||
15013 | 15029 |
| |
15014 | 15030 |
| |
15015 | 15031 |
| |
| 15032 | + | |
| 15033 | + | |
| 15034 | + | |
| 15035 | + | |
| 15036 | + | |
| 15037 | + | |
| 15038 | + | |
| 15039 | + | |
| 15040 | + | |
| 15041 | + | |
| 15042 | + | |
| 15043 | + | |
| 15044 | + | |
| 15045 | + | |
| 15046 | + | |
| 15047 | + | |
| 15048 | + | |
| 15049 | + | |
| 15050 | + | |
| 15051 | + | |
| 15052 | + | |
| 15053 | + | |
| 15054 | + | |
| 15055 | + | |
| 15056 | + | |
| 15057 | + | |
| 15058 | + | |
| 15059 | + | |
15016 | 15060 |
| |
15017 | 15061 |
| |
15018 | 15062 |
| |
| |||
15112 | 15156 |
| |
15113 | 15157 |
| |
15114 | 15158 |
| |
| 15159 | + | |
15115 | 15160 |
| |
15116 | 15161 |
| |
15117 | 15162 |
| |
|
Lines changed: 9 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1342 | 1342 |
| |
1343 | 1343 |
| |
1344 | 1344 |
| |
1345 |
| - | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
1346 | 1352 |
| |
1347 |
| - | |
1348 |
| - | |
| 1353 | + | |
| 1354 | + | |
1349 | 1355 |
| |
1350 | 1356 |
| |
1351 | 1357 |
| |
|
Lines changed: 54 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
752 | 752 |
| |
753 | 753 |
| |
754 | 754 |
| |
755 |
| - | |
756 |
| - | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
757 | 758 |
| |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
758 | 809 |
| |
| 810 | + | |
759 | 811 |
| |
760 | 812 |
| |
761 | 813 |
| |
|
Lines changed: 41 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
319 | 319 |
| |
320 | 320 |
| |
321 | 321 |
| |
322 |
| - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
323 | 325 |
| |
324 | 326 |
| |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
325 | 365 |
| |
326 | 366 |
| |
327 | 367 |
| |
|
0 commit comments
Comments
(0)