forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4c98554
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 parent7871a36 commit4c98554
1 file changed
+14
-4
lines changedLines changed: 14 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9857 | 9857 |
| |
9858 | 9858 |
| |
9859 | 9859 |
| |
9860 |
| - | |
9861 |
| - | |
| 9860 | + | |
9862 | 9861 |
| |
9863 | 9862 |
| |
9864 | 9863 |
| |
| |||
9874 | 9873 |
| |
9875 | 9874 |
| |
9876 | 9875 |
| |
| 9876 | + | |
9877 | 9877 |
| |
9878 | 9878 |
| |
9879 | 9879 |
| |
| |||
9890 | 9890 |
| |
9891 | 9891 |
| |
9892 | 9892 |
| |
| 9893 | + | |
9893 | 9894 |
| |
9894 | 9895 |
| |
9895 | 9896 |
| |
9896 |
| - | |
| 9897 | + | |
9897 | 9898 |
| |
9898 | 9899 |
| |
9899 | 9900 |
| |
| |||
9905 | 9906 |
| |
9906 | 9907 |
| |
9907 | 9908 |
| |
| 9909 | + | |
| 9910 | + | |
| 9911 | + | |
| 9912 | + | |
| 9913 | + | |
| 9914 | + | |
| 9915 | + | |
| 9916 | + | |
| 9917 | + | |
9908 | 9918 |
| |
9909 | 9919 |
| |
9910 | 9920 |
| |
| |||
9920 | 9930 |
| |
9921 | 9931 |
| |
9922 | 9932 |
| |
9923 |
| - | |
| 9933 | + | |
9924 | 9934 |
| |
9925 | 9935 |
| |
9926 | 9936 |
| |
|
0 commit comments
Comments
(0)