postgresql/src
Tom Lane 680d540502 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 Refactor subscription tests to use PostgresNode's wait_for_catchup 2018-01-11 13:35:38 -05:00
common Update copyright for 2018 2018-01-02 23:30:12 -05:00
fe_utils Update copyright for 2018 2018-01-02 23:30:12 -05:00
include Remove hard-coded schema knowledge about pg_attribute from genbki.pl 2018-01-12 11:21:42 -03:00
interfaces Fix parsing of compatibility mode argument. 2018-01-12 16:00:43 +01:00
makefiles
pl Use portal pinning in PL/Perl and PL/Python 2018-01-10 17:10:32 -05:00
port Update copyright for 2018 2018-01-02 23:30:12 -05:00
template
test Avoid unnecessary failure in SELECT concurrent with ALTER NO INHERIT. 2018-01-12 15:46:37 -05:00
timezone Update copyright for 2018 2018-01-02 23:30:12 -05:00
tools Expression evaluation based aggregate transition invocation. 2018-01-09 13:25:38 -08:00
tutorial Update copyright for 2018 2018-01-02 23:30:12 -05:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in
Makefile.shlib
nls-global.mk