- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit00d00b5
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 parent08aad3c commit00d00b5
1 file changed
+12
-2
lines changedLines changed: 12 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7949 | 7949 |
| |
7950 | 7950 |
| |
7951 | 7951 |
| |
7952 |
| - | |
7953 |
| - | |
| 7952 | + | |
7954 | 7953 |
| |
7955 | 7954 |
| |
7956 | 7955 |
| |
| |||
7966 | 7965 |
| |
7967 | 7966 |
| |
7968 | 7967 |
| |
| 7968 | + | |
7969 | 7969 |
| |
7970 | 7970 |
| |
7971 | 7971 |
| |
| |||
7974 | 7974 |
| |
7975 | 7975 |
| |
7976 | 7976 |
| |
| 7977 | + | |
7977 | 7978 |
| |
7978 | 7979 |
| |
7979 | 7980 |
| |
| |||
7986 | 7987 |
| |
7987 | 7988 |
| |
7988 | 7989 |
| |
| 7990 | + | |
| 7991 | + | |
| 7992 | + | |
| 7993 | + | |
| 7994 | + | |
| 7995 | + | |
| 7996 | + | |
| 7997 | + | |
| 7998 | + | |
7989 | 7999 |
| |
7990 | 8000 |
| |
7991 | 8001 |
| |
|
0 commit comments
Comments
(0)