forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0d18852
committed
Disallow CREATE INDEX if table is already in use in current session.
If we allow this, whatever outer command has the table open will not knowabout the new index and may fail to update it as needed, as shown in areport from Laurenz Albe. We already had such a prohibition in place forALTER TABLE, but the CREATE INDEX syntax missed the check.Fixing it requires an API change for DefineIndex(), which conceivablywould break third-party extensions if we were to back-patch it. Givenhow long this problem has existed without being noticed, fixing it inthe back branches doesn't seem worth that risk.Discussion:https://postgr.es/m/A737B7A37273E048B164557ADEF4A58B53A4DC9A@ntex2010i.host.magwien.gv.at1 parent55a70a0 commit0d18852
File tree
7 files changed
+78
-0
lines changed- src
- backend
- bootstrap
- commands
- tcop
- include/commands
- test/regress
- expected
- sql
7 files changed
+78
-0
lines changedLines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
323 | 323 |
| |
324 | 324 |
| |
325 | 325 |
| |
| 326 | + | |
326 | 327 |
| |
327 | 328 |
| |
328 | 329 |
| |
| |||
366 | 367 |
| |
367 | 368 |
| |
368 | 369 |
| |
| 370 | + | |
369 | 371 |
| |
370 | 372 |
| |
371 | 373 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
295 | 295 |
| |
296 | 296 |
| |
297 | 297 |
| |
| 298 | + | |
| 299 | + | |
| 300 | + | |
298 | 301 |
| |
299 | 302 |
| |
300 | 303 |
| |
| |||
307 | 310 |
| |
308 | 311 |
| |
309 | 312 |
| |
| 313 | + | |
310 | 314 |
| |
311 | 315 |
| |
312 | 316 |
| |
| |||
404 | 408 |
| |
405 | 409 |
| |
406 | 410 |
| |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
407 | 420 |
| |
408 | 421 |
| |
409 | 422 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6679 | 6679 |
| |
6680 | 6680 |
| |
6681 | 6681 |
| |
| 6682 | + | |
6682 | 6683 |
| |
6683 | 6684 |
| |
6684 | 6685 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1329 | 1329 |
| |
1330 | 1330 |
| |
1331 | 1331 |
| |
| 1332 | + | |
1332 | 1333 |
| |
1333 | 1334 |
| |
1334 | 1335 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
30 | 31 |
| |
31 | 32 |
| |
32 | 33 |
| |
|
Lines changed: 29 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1674 | 1674 |
| |
1675 | 1675 |
| |
1676 | 1676 |
| |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
1677 | 1706 |
| |
1678 | 1707 |
| |
1679 | 1708 |
| |
|
Lines changed: 31 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1183 | 1183 |
| |
1184 | 1184 |
| |
1185 | 1185 |
| |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
1186 | 1217 |
| |
1187 | 1218 |
| |
1188 | 1219 |
| |
|
0 commit comments
Comments
(0)