postgresql/src
Tom Lane 88fab18a4c Fix the logic for putting relations into the relcache init file.
Commit f3b5565dd4 was a couple of bricks shy
of a load; specifically, it missed putting pg_trigger_tgrelid_tgname_index
into the relcache init file, because that index is not used by any
syscache.  However, we have historically nailed that index into cache for
performance reasons.  The upshot was that load_relcache_init_file always
decided that the init file was busted and silently ignored it, resulting
in a significant hit to backend startup speed.

To fix, reinstantiate RelationIdIsInInitFile() as a wrapper around
RelationSupportsSysCache(), which can know about additional relations
that should be in the init file despite being unknown to syscache.c.

Also install some guards against future mistakes of this type: make
write_relcache_init_file Assert that all nailed relations get written to
the init file, and make load_relcache_init_file emit a WARNING if it takes
the "wrong number of nailed relations" exit path.  Now that we remove the
init files during postmaster startup, that case should never occur in the
field, even if we are starting a minor-version update that added or removed
rels from the nailed set.  So the warning shouldn't ever be seen by end
users, but it will show up in the regression tests if somebody breaks this
logic.

Back-patch to all supported branches, like the previous commit.
2015-06-25 14:39:05 -04:00
..
backend Fix the logic for putting relations into the relcache init file. 2015-06-25 14:39:05 -04:00
bin Translation updates 2015-05-18 08:45:56 -04:00
include Fix the logic for putting relations into the relcache init file. 2015-06-25 14:39:05 -04:00
interfaces Check for out of memory when allocating sqlca. 2015-06-15 14:23:07 +02:00
makefiles Don't use deprecated dllwrap on Cygwin. 2014-02-01 16:13:46 -05:00
pl Revert error-throwing wrappers for the printf family of functions. 2015-05-19 18:17:42 -04:00
port Stamp 9.2.13. 2015-06-09 15:33:16 -04:00
template Remove BSD/OS (BSDi) port. There are no known users upgrading to 2012-05-03 10:58:44 -04:00
test Improve error message and hint for ALTER COLUMN TYPE can't-cast failure. 2015-06-12 11:54:03 -04:00
timezone Update time zone data files to tzdata release 2015d. 2015-05-15 19:36:06 -04:00
tools Revert error-throwing wrappers for the printf family of functions. 2015-05-19 18:17:42 -04:00
tutorial Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +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 Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Revert "Backpatch pgxs vpath build and installation fixes (v2)" 2013-10-07 22:37:26 -04:00
Makefile.shlib Unlink static libraries before rebuilding them. 2015-03-01 13:07:00 -05:00
nls-global.mk Lots of doc corrections. 2012-04-23 22:43:09 -04:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00