forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit55ed3de
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 parent65e6d42 commit55ed3de
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 | |
---|---|---|---|
| |||
845 | 845 |
| |
846 | 846 |
| |
847 | 847 |
| |
848 |
| - | |
| 848 | + | |
849 | 849 |
| |
850 | 850 |
| |
851 | 851 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
170 | 170 |
| |
171 | 171 |
| |
172 | 172 |
| |
173 |
| - | |
174 |
| - | |
| 173 | + | |
| 174 | + | |
175 | 175 |
| |
176 | 176 |
| |
177 | 177 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1085 | 1085 |
| |
1086 | 1086 |
| |
1087 | 1087 |
| |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
1088 | 1108 |
| |
1089 | 1109 |
| |
1090 | 1110 |
| |
|
Lines changed: 45 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1069 | 1069 |
| |
1070 | 1070 |
| |
1071 | 1071 |
| |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
1072 | 1088 |
| |
1073 | 1089 |
| |
1074 | 1090 |
| |
| |||
15722 | 15738 |
| |
15723 | 15739 |
| |
15724 | 15740 |
| |
| 15741 | + | |
| 15742 | + | |
| 15743 | + | |
| 15744 | + | |
| 15745 | + | |
| 15746 | + | |
| 15747 | + | |
| 15748 | + | |
| 15749 | + | |
| 15750 | + | |
| 15751 | + | |
| 15752 | + | |
| 15753 | + | |
| 15754 | + | |
| 15755 | + | |
| 15756 | + | |
| 15757 | + | |
| 15758 | + | |
| 15759 | + | |
| 15760 | + | |
| 15761 | + | |
| 15762 | + | |
| 15763 | + | |
| 15764 | + | |
| 15765 | + | |
| 15766 | + | |
| 15767 | + | |
| 15768 | + | |
15725 | 15769 |
| |
15726 | 15770 |
| |
15727 | 15771 |
| |
| |||
15824 | 15868 |
| |
15825 | 15869 |
| |
15826 | 15870 |
| |
| 15871 | + | |
15827 | 15872 |
| |
15828 | 15873 |
| |
15829 | 15874 |
| |
|
Lines changed: 9 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1347 | 1347 |
| |
1348 | 1348 |
| |
1349 | 1349 |
| |
1350 |
| - | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1351 | 1357 |
| |
1352 |
| - | |
1353 |
| - | |
| 1358 | + | |
| 1359 | + | |
1354 | 1360 |
| |
1355 | 1361 |
| |
1356 | 1362 |
| |
|
Lines changed: 54 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
748 | 748 |
| |
749 | 749 |
| |
750 | 750 |
| |
751 |
| - | |
752 |
| - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
753 | 754 |
| |
| 755 | + | |
| 756 | + | |
| 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 | + | |
754 | 805 |
| |
| 806 | + | |
755 | 807 |
| |
756 | 808 |
| |
757 | 809 |
| |
|
Lines changed: 41 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
318 | 318 |
| |
319 | 319 |
| |
320 | 320 |
| |
321 |
| - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
322 | 324 |
| |
323 | 325 |
| |
| 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 | + | |
324 | 364 |
| |
325 | 365 |
| |
326 | 366 |
| |
|
0 commit comments
Comments
(0)