forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdb01fc9
committed
Fix ALTER COLUMN TYPE to not open a relation without any lock.
If the column being modified is referenced by a foreign key constraintof another table, ALTER TABLE would open the other table (to re-parsethe constraint's definition) without having first obtained a lock on it.This was evidently intentional, but that doesn't mean it's really safe.It's especially not safe in 9.3, which pre-dates use of MVCC scans forcatalog reads, but even in current releases it doesn't seem like a goodidea.We know we'll need AccessExclusiveLock shortly to drop the obsoletedconstraint, so just get that a little sooner to close the hole.Per testing with a patch that complains if we open a relation withoutholding any lock on it. I don't plan to back-patch that patch, but weshould close the holes it identifies in all supported branches.Discussion:https://postgr.es/m/2038.1538335244@sss.pgh.pa.us1 parent0aa1e0e commitdb01fc9
1 file changed
+12
-2
lines changedLines changed: 12 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9513 | 9513 |
| |
9514 | 9514 |
| |
9515 | 9515 |
| |
9516 |
| - | |
9517 |
| - | |
| 9516 | + | |
9518 | 9517 |
| |
9519 | 9518 |
| |
9520 | 9519 |
| |
| |||
9530 | 9529 |
| |
9531 | 9530 |
| |
9532 | 9531 |
| |
| 9532 | + | |
9533 | 9533 |
| |
9534 | 9534 |
| |
9535 | 9535 |
| |
| |||
9538 | 9538 |
| |
9539 | 9539 |
| |
9540 | 9540 |
| |
| 9541 | + | |
9541 | 9542 |
| |
9542 | 9543 |
| |
9543 | 9544 |
| |
| |||
9550 | 9551 |
| |
9551 | 9552 |
| |
9552 | 9553 |
| |
| 9554 | + | |
| 9555 | + | |
| 9556 | + | |
| 9557 | + | |
| 9558 | + | |
| 9559 | + | |
| 9560 | + | |
| 9561 | + | |
| 9562 | + | |
9553 | 9563 |
| |
9554 | 9564 |
| |
9555 | 9565 |
| |
|
0 commit comments
Comments
(0)