postgresql/src
Tom Lane 55e5eb4d97 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: prevent check on live cluster from generating error 2018-01-08 22:43:51 -05:00
common Update copyright in recently added files 2017-07-26 18:17:18 -04:00
fe_utils Phase 3 of pgindent updates. 2017-06-21 15:35:54 -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:35:36 -08:00
makefiles Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:55 -04:00
pl Support linking with MinGW-built Perl. 2017-11-23 20:22:24 -08:00
port Stamp 10.1. 2017-11-06 17:06:17 -05:00
template Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -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:27 -05:00
tools Fix use of config-specific libraries for Windows OpenSSL 2018-01-03 15:33:12 -05: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 Be more thorough about cleaning out gcov litter. 2017-08-11 17:39:27 -04:00
Makefile.shlib Remove support for bcc and msvc standalone libpq builds 2017-04-11 15:22:21 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00