forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb538003
committed
Fix dependencies generated during ALTER TABLE ADD CONSTRAINT USING INDEX.
This command generated new pg_depend entries linking the index to theconstraint and the constraint to the table, which match the entries madewhen a unique or primary key constraint is built de novo. However, it didnot bother to get rid of the entries linking the index directly to thetable. We had considered the issue when the ADD CONSTRAINT USING INDEXpatch was written, and concluded that we didn't need to get rid of theextra entries. But this is wrong: ALTER COLUMN TYPE wasn't expecting suchredundant dependencies to exist, as reported by Hubert Depesz Lubaczewski.On reflection it seems rather likely to break other things as well, sincethere are many bits of code that crawl pg_depend for one purpose oranother, and most of them are pretty naive about what relationships they'reexpecting to find. Fortunately it's not that hard to get rid of the extradependency entries, so let's do that.Back-patch to 9.1, where ALTER TABLE ADD CONSTRAINT USING INDEX was added.1 parenta67d6d9 commitb538003
File tree
3 files changed
+22
-7
lines changed- src
- backend
- catalog
- commands
- include/catalog
3 files changed
+22
-7
lines changedLines changed: 19 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
923 | 923 |
| |
924 | 924 |
| |
925 | 925 |
| |
| 926 | + | |
926 | 927 |
| |
927 | 928 |
| |
928 | 929 |
| |
| |||
1090 | 1091 |
| |
1091 | 1092 |
| |
1092 | 1093 |
| |
| 1094 | + | |
| 1095 | + | |
1093 | 1096 |
| |
1094 | 1097 |
| |
1095 | 1098 |
| |
| |||
1102 | 1105 |
| |
1103 | 1106 |
| |
1104 | 1107 |
| |
| 1108 | + | |
1105 | 1109 |
| |
1106 | 1110 |
| |
1107 | 1111 |
| |
| |||
1125 | 1129 |
| |
1126 | 1130 |
| |
1127 | 1131 |
| |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1128 | 1145 |
| |
1129 | 1146 |
| |
1130 | 1147 |
| |
| |||
1159 | 1176 |
| |
1160 | 1177 |
| |
1161 | 1178 |
| |
1162 |
| - | |
1163 |
| - | |
1164 |
| - | |
1165 |
| - | |
1166 |
| - | |
1167 |
| - | |
| 1179 | + | |
| 1180 | + | |
1168 | 1181 |
| |
1169 | 1182 |
| |
1170 | 1183 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5487 | 5487 |
| |
5488 | 5488 |
| |
5489 | 5489 |
| |
5490 |
| - | |
| 5490 | + | |
| 5491 | + | |
5491 | 5492 |
| |
5492 | 5493 |
| |
5493 | 5494 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
| 64 | + | |
64 | 65 |
| |
65 | 66 |
| |
66 | 67 |
| |
|
0 commit comments
Comments
(0)