aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-05-18 18:17:55 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2014-05-18 18:17:55 -0400
commit0c19aaba22c4d904f7259ef11f7d6db7b5dd36a0 (patch)
tree47c2904880466cab5c95bc2d881f96063cb5cf62 /src
parent078b2ed291c758e7125d72c3a235f128d40a232b (diff)
downloadpostgresql-0c19aaba22c4d904f7259ef11f7d6db7b5dd36a0.tar.gz
postgresql-0c19aaba22c4d904f7259ef11f7d6db7b5dd36a0.zip
Ooops, I broke initdb with that last patch.
That's what I get for not fully retesting the final version of the patch. The replace_allowed cross-check needs an additional special case for bootstrapping.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/cache/relcache.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index e6fc6a00589..10d300a3e88 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -181,13 +181,13 @@ do { \
HASH_ENTER, &found); \
if (found) \
{ \
- /* this can happen, see comments in RelationBuildDesc */ \
+ /* see comments in RelationBuildDesc and RelationBuildLocalRelation */ \
Relation _old_rel = hentry->reldesc; \
Assert(replace_allowed); \
hentry->reldesc = (RELATION); \
if (RelationHasReferenceCountZero(_old_rel)) \
RelationDestroyRelation(_old_rel, false); \
- else \
+ else if (!IsBootstrapProcessingMode()) \
elog(WARNING, "leaking still-referenced relcache entry for \"%s\"", \
RelationGetRelationName(_old_rel)); \
} \
@@ -2861,9 +2861,15 @@ RelationBuildLocalRelation(const char *relname,
RelationInitPhysicalAddr(rel);
/*
- * Okay to insert into the relcache hash tables.
+ * Okay to insert into the relcache hash table.
+ *
+ * Ordinarily, there should certainly not be an existing hash entry for
+ * the same OID; but during bootstrap, when we create a "real" relcache
+ * entry for one of the bootstrap relations, we'll be overwriting the
+ * phony one created with formrdesc. So allow that to happen for nailed
+ * rels.
*/
- RelationCacheInsert(rel, false);
+ RelationCacheInsert(rel, nailit);
/*
* Flag relation as needing eoxact cleanup (to clear rd_createSubid). We