postgresql/src
Andres Freund 31912d01d8 Improve relcache invalidation handling of currently invisible relations.
The corner case where a relcache invalidation tried to rebuild the
entry for a referenced relation but couldn't find it in the catalog
wasn't correct.

The code tried to RelationCacheDelete/RelationDestroyRelation the
entry. That didn't work when assertions are enabled because the latter
contains an assertion ensuring the refcount is zero. It's also more
generally a bad idea, because by virtue of being referenced somebody
might actually look at the entry, which is possible if the error is
trapped and handled via a subtransaction abort.

Instead just error out, without deleting the entry. As the entry is
marked invalid, the worst that can happen is that the invalid (and at
some point unused) entry lingers in the relcache.

Discussion: 22459.1418656530@sss.pgh.pa.us

There should be no way to hit this case < 9.4 where logical decoding
introduced a bug that can hit this. But since the code for handling
the corner case is there it should do something halfway sane, so
backpatch all the the way back.  The logical decoding bug will be
handled in a separate commit.
2015-01-07 00:18:00 +01:00
..
backend Improve relcache invalidation handling of currently invisible relations. 2015-01-07 00:18:00 +01:00
bin Update copyright for 2015 2015-01-06 11:43:47 -05:00
common Update copyright for 2015 2015-01-06 11:43:47 -05:00
include Update copyright for 2015 2015-01-06 11:43:47 -05:00
interfaces Update copyright for 2015 2015-01-06 11:43:47 -05:00
makefiles Revert haphazard pgxs makefile changes 2014-12-04 08:07:59 -05:00
pl Fix thinko in plpython error message 2015-01-06 15:16:29 -03:00
port Update copyright for 2015 2015-01-06 11:43:47 -05:00
template Remove Alpha and Tru64 support. 2014-06-28 21:46:15 +02:00
test Update copyright for 2015 2015-01-06 11:43:47 -05:00
timezone Update copyright for 2015 2015-01-06 11:43:47 -05:00
tools Document that Perl's Tie might add a trailing newline 2015-01-06 15:52:15 -05:00
tutorial Update copyright for 2015 2015-01-06 11:43:47 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04: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 Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Fix installcheck case for tap tests 2014-12-24 10:31:36 -05:00
Makefile.shlib Clarify .def file comments. 2014-11-02 21:43:33 -05:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00