postgresql/src
Tom Lane a99922f966 Avoid unnecessary failure in SELECT concurrent with ALTER NO INHERIT.
If a query against an inheritance tree runs concurrently with an ALTER
TABLE that's disinheriting one of the tree members, it's possible to get
a "could not find inherited attribute" error because after obtaining lock
on the removed member, make_inh_translation_list sees that its columns
have attinhcount=0 and decides they aren't the columns it's looking for.

An ideal fix, perhaps, would avoid including such a just-removed member
table in the query at all; but there seems no way to accomplish that
without adding expensive catalog rechecks or creating a likelihood of
deadlocks.  Instead, let's just drop the check on attinhcount.  In this
way, a query that's included a just-disinherited child will still
succeed, which is not a completely unreasonable behavior.

This problem has existed for a long time, so back-patch to all supported
branches.  Also add an isolation test verifying related behaviors.

Patch by me; the new isolation test is based on Kyotaro Horiguchi's work.

Discussion: https://postgr.es/m/20170626.174612.23936762.horiguchi.kyotaro@lab.ntt.co.jp
2018-01-12 15:46:37 -05:00
..
backend Avoid unnecessary failure in SELECT concurrent with ALTER NO INHERIT. 2018-01-12 15:46:37 -05:00
bin pg_upgrade: simplify code layout in a few places 2018-01-05 14:11:14 -05:00
common pgindent run for 9.5 2015-05-23 21:35:49 -04:00
include Fix failure to delete spill files of aborted transactions 2018-01-05 12:17:10 -03:00
interfaces Add post-2010 ecpg tests to checktcp. 2017-11-11 14:40:24 -08:00
makefiles Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:56 -04:00
pl Support linking with MinGW-built Perl. 2017-11-23 20:25:08 -08:00
port Stamp 9.5.10. 2017-11-06 17:11:00 -05:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:01:29 -04:00
test Avoid unnecessary failure in SELECT concurrent with ALTER NO INHERIT. 2018-01-12 15:46:37 -05:00
timezone Replace raw timezone source data with IANA's new compact format. 2017-11-25 15:30:39 -05:00
tools Fix use of config-specific libraries for Windows OpenSSL 2018-01-03 15:33:47 -05:00
tutorial Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
.gitignore
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in PL/Perl portability fix: absorb relevant -D switches from Perl. 2017-07-31 12:38:35 -04:00
Makefile.shlib Fix typos in comments. 2017-02-06 11:34:18 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00