postgresql/src
Tom Lane db01fc97ad Fix ALTER COLUMN TYPE to not open a relation without any lock.
If the column being modified is referenced by a foreign key constraint
of another table, ALTER TABLE would open the other table (to re-parse
the 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 for
catalog reads, but even in current releases it doesn't seem like a good
idea.

We know we'll need AccessExclusiveLock shortly to drop the obsoleted
constraint, so just get that a little sooner to close the hole.

Per testing with a patch that complains if we open a relation without
holding any lock on it.  I don't plan to back-patch that patch, but we
should close the holes it identifies in all supported branches.

Discussion: https://postgr.es/m/2038.1538335244@sss.pgh.pa.us
2018-10-01 11:39:14 -04:00
..
backend Fix ALTER COLUMN TYPE to not open a relation without any lock. 2018-10-01 11:39:14 -04:00
bin Ignore publication tables when --no-publications is used 2018-09-25 11:05:29 +09:00
common Minor cleanup/future-proofing for pg_saslprep(). 2018-09-08 18:20:36 -04:00
fe_utils Fix lexing of standard multi-character operators in edge cases. 2018-08-23 21:43:55 +01:00
include Fix detection of the result type of strerror_r(). 2018-09-30 16:24:56 -04:00
interfaces ecpg: Change --version output to common style 2018-09-12 14:34:53 +02:00
makefiles Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-07-09 17:23:31 -04:00
pl Make some fixes to allow building Postgres on macOS 10.14 ("Mojave"). 2018-09-25 13:23:29 -04:00
port Make snprintf.c follow the C99 standard for snprintf's result value. 2018-08-15 17:25:50 -04:00
template Make some fixes to allow building Postgres on macOS 10.14 ("Mojave"). 2018-09-25 13:23:29 -04:00
test Fix failure in WHERE CURRENT OF after rewinding the referenced cursor. 2018-09-23 16:05:45 -04:00
timezone Update time zone data files to tzdata release 2018e. 2018-05-09 13:55:42 -04:00
tools pgtest: run clean, build, and check stages separately 2018-07-28 15:34:06 -04:00
tutorial Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Build src/test/isolation during "make" and "make install". 2017-11-22 20:18:52 -08:00
Makefile.global.in Make some fixes to allow building Postgres on macOS 10.14 ("Mojave"). 2018-09-25 13:23:29 -04:00
Makefile.shlib Use -Bsymbolic for shared libraries on HP-UX and Solaris. 2018-09-10 22:22:12 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00