postgresql/src
Tom Lane e27453bd83 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:13 -04:00
..
backend Fix ALTER COLUMN TYPE to not open a relation without any lock. 2018-10-01 11:39:13 -04:00
bin Correct overflow handling in pgbench. 2018-09-27 21:50:57 -07:00
common Add application_name to connection authorized msg 2018-09-28 19:04:50 -04:00
fe_utils Fix lexing of standard multi-character operators in edge cases. 2018-08-23 21:42:40 +01:00
include Create an RTE field to record the query's lock mode for each relation. 2018-09-30 13:55:51 -04:00
interfaces Tweak MSVC build system to match changes in 7143b3e82. 2018-09-28 15:17:07 -04:00
makefiles Refactor installation of extension headers. 2018-09-07 14:19:14 +01:00
pl Clean up *printf macros to avoid conflict with format archetypes. 2018-09-26 17:35:01 -04:00
port Build src/common files as a library with -fPIC. 2018-09-28 14:28:19 -04:00
template Make some fixes to allow building Postgres on macOS 10.14 ("Mojave"). 2018-09-25 13:23:29 -04:00
test Create an RTE field to record the query's lock mode for each relation. 2018-09-30 13:55:51 -04:00
timezone Update time zone data files to tzdata release 2018e. 2018-05-09 13:56:22 -04:00
tools Tweak MSVC build system to match changes in 7143b3e82. 2018-09-28 15:49:05 -04:00
tutorial Deduplicate "invalid input syntax" messages for various types. 2018-07-22 14:58:01 -07:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Build src/common files as a library with -fPIC. 2018-09-28 14:28:19 -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