forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit37798a8
committed
Don't mark partitioned indexes invalid unnecessarily
When an indexes is created on a partitioned table using ONLY (don'trecurse to partitions), it gets marked invalid until index partitionsare attached for each table partition. But there's no reason to do thisif there are no partitions ... and moreover, there's no way to get theindex to become valid afterwards, because all partitions that getcreated/attached get their own index partition already attached to theparent index, so there's no chance to do ALTER INDEX ... ATTACH PARTITIONthat would make the parent index valid.Fix by not marking the index as invalid to begin with.This is very similar to9139aa1, but the pg_dump aspect does notappear to be relevant until we add FKs that can point to PKs onpartitioned tables. (I tried to cause the pg_upgrade test to break byleaving some of these bogus tables around, but wasn't able to.)Making this change means that an index that was supposed to be invalidin the insert_conflict regression test is no longer invalid; reorder theDDL so that the test continues to verify the behavior we want it to.Author: Álvaro HerreraReviewed-by: Amit LangoteDiscussion:https://postgr.es/m/20181203225019.2vvdef2ybnkxt364@alvherre.pgsql1 parent367f362 commit37798a8
File tree
3 files changed
+13
-3
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+13
-3
lines changedLines changed: 11 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
834 | 834 |
| |
835 | 835 |
| |
836 | 836 |
| |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
837 | 842 |
| |
838 |
| - | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
839 | 849 |
| |
840 | 850 |
| |
841 | 851 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
876 | 876 |
| |
877 | 877 |
| |
878 | 878 |
| |
| 879 | + | |
879 | 880 |
| |
880 | 881 |
| |
881 | 882 |
| |
882 |
| - | |
883 | 883 |
| |
884 | 884 |
| |
885 | 885 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
551 | 551 |
| |
552 | 552 |
| |
553 | 553 |
| |
| 554 | + | |
554 | 555 |
| |
555 | 556 |
| |
556 | 557 |
| |
557 |
| - | |
558 | 558 |
| |
559 | 559 |
| |
560 | 560 |
| |
|
0 commit comments
Comments
(0)