Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0c19aab

Browse files
committed
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.
1 parent 078b2ed commit 0c19aab

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/backend/utils/cache/relcache.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,13 @@ do { \
181181
HASH_ENTER, &found); \
182182
if (found) \
183183
{ \
184-
/* this can happen, see comments in RelationBuildDesc */ \
184+
/* see comments in RelationBuildDesc and RelationBuildLocalRelation */ \
185185
Relation _old_rel = hentry->reldesc; \
186186
Assert(replace_allowed); \
187187
hentry->reldesc = (RELATION); \
188188
if (RelationHasReferenceCountZero(_old_rel)) \
189189
RelationDestroyRelation(_old_rel, false); \
190-
else \
190+
else if (!IsBootstrapProcessingMode()) \
191191
elog(WARNING, "leaking still-referenced relcache entry for \"%s\"", \
192192
RelationGetRelationName(_old_rel)); \
193193
} \
@@ -2861,9 +2861,15 @@ RelationBuildLocalRelation(const char *relname,
28612861
RelationInitPhysicalAddr(rel);
28622862

28632863
/*
2864-
* Okay to insert into the relcache hash tables.
2864+
* Okay to insert into the relcache hash table.
2865+
*
2866+
* Ordinarily, there should certainly not be an existing hash entry for
2867+
* the same OID; but during bootstrap, when we create a "real" relcache
2868+
* entry for one of the bootstrap relations, we'll be overwriting the
2869+
* phony one created with formrdesc. So allow that to happen for nailed
2870+
* rels.
28652871
*/
2866-
RelationCacheInsert(rel, false);
2872+
RelationCacheInsert(rel, nailit);
28672873

28682874
/*
28692875
* Flag relation as needing eoxact cleanup (to clear rd_createSubid). We

0 commit comments

Comments
 (0)