Fix LOAD_CRIT_INDEX() macro to take out AccessShareLock on the system index

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 95b7a876f6cc29f871a9cae0d66cea91bb76b504
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2008-04-16T18:23:12Z
Releases: 8.3.2
Fix LOAD_CRIT_INDEX() macro to take out AccessShareLock on the system index
it is trying to build a relcache entry for.  This is an oversight in my 8.2
patch that tried to ensure we always took a lock on a relation before trying
to build its relcache entry.  The implication is that if someone committed a
reindex of a critical system index at about the same time that some other
backend were starting up without a valid pg_internal.init file, the second one
might PANIC due to not seeing any valid version of the index's pg_class row.
Improbable case, but definitely not impossible.

Files

PathChange+/−
src/backend/utils/cache/relcache.c modified +18 −6