forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0360c53
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 parent2855421 commit0360c53
1 file changed
+12
-2
lines changedLines changed: 12 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8686 | 8686 |
| |
8687 | 8687 |
| |
8688 | 8688 |
| |
8689 |
| - | |
8690 |
| - | |
| 8689 | + | |
8691 | 8690 |
| |
8692 | 8691 |
| |
8693 | 8692 |
| |
| |||
8703 | 8702 |
| |
8704 | 8703 |
| |
8705 | 8704 |
| |
| 8705 | + | |
8706 | 8706 |
| |
8707 | 8707 |
| |
8708 | 8708 |
| |
| |||
8711 | 8711 |
| |
8712 | 8712 |
| |
8713 | 8713 |
| |
| 8714 | + | |
8714 | 8715 |
| |
8715 | 8716 |
| |
8716 | 8717 |
| |
| |||
8723 | 8724 |
| |
8724 | 8725 |
| |
8725 | 8726 |
| |
| 8727 | + | |
| 8728 | + | |
| 8729 | + | |
| 8730 | + | |
| 8731 | + | |
| 8732 | + | |
| 8733 | + | |
| 8734 | + | |
| 8735 | + | |
8726 | 8736 |
| |
8727 | 8737 |
| |
8728 | 8738 |
| |
|
0 commit comments
Comments
(0)