forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commita99922f
committed
Avoid unnecessary failure in SELECT concurrent with ALTER NO INHERIT.
If a query against an inheritance tree runs concurrently with an ALTERTABLE that's disinheriting one of the tree members, it's possible to geta "could not find inherited attribute" error because after obtaining lockon the removed member, make_inh_translation_list sees that its columnshave attinhcount=0 and decides they aren't the columns it's looking for.An ideal fix, perhaps, would avoid including such a just-removed membertable in the query at all; but there seems no way to accomplish thatwithout adding expensive catalog rechecks or creating a likelihood ofdeadlocks. Instead, let's just drop the check on attinhcount. In thisway, a query that's included a just-disinherited child will stillsucceed, which is not a completely unreasonable behavior.This problem has existed for a long time, so back-patch to all supportedbranches. Also add an isolation test verifying related behaviors.Patch by me; the new isolation test is based on Kyotaro Horiguchi's work.Discussion:https://postgr.es/m/20170626.174612.23936762.horiguchi.kyotaro@lab.ntt.co.jp1 parentff99d77 commita99922f
File tree
4 files changed
+97
-2
lines changed- src
- backend/optimizer/prep
- test/isolation
- expected
- specs
4 files changed
+97
-2
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1498 | 1498 |
| |
1499 | 1499 |
| |
1500 | 1500 |
| |
1501 |
| - | |
| 1501 | + | |
1502 | 1502 |
| |
1503 | 1503 |
| |
1504 | 1504 |
| |
1505 | 1505 |
| |
1506 | 1506 |
| |
1507 | 1507 |
| |
1508 | 1508 |
| |
1509 |
| - | |
| 1509 | + | |
1510 | 1510 |
| |
1511 | 1511 |
| |
1512 | 1512 |
| |
|
Lines changed: 57 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + |
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
| 53 | + | |
53 | 54 |
| |
54 | 55 |
|
Lines changed: 37 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + |
0 commit comments
Comments
(0)