1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

RelationCacheInvalidate thought there were 7 nailed-in-cache

system tables, but actually there are only 6 --- see RelationInitialize.
Kinda makes you wonder how long ago this code was last executed...
This commit is contained in:
Tom Lane
1999-09-06 18:13:02 +00:00
parent 7d0a5342a3
commit c5092847e7

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.70 1999/09/04 21:47:23 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.71 1999/09/06 18:13:02 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1462,13 +1462,13 @@ RelationCacheInvalidate(bool onlyFlushReferenceCountZero)
onlyFlushReferenceCountZero); onlyFlushReferenceCountZero);
/* /*
* nailed-in reldescs will still be in the cache... 7 hardwired heaps * nailed-in reldescs will still be in the cache... 6 hardwired heaps
* + 3 hardwired indices == 10 total. * + 3 hardwired indices == 9 total.
*/ */
if (!onlyFlushReferenceCountZero) if (!onlyFlushReferenceCountZero)
{ {
Assert(RelationNameCache->hctl->nkeys == 10); Assert(RelationNameCache->hctl->nkeys == 9);
Assert(RelationIdCache->hctl->nkeys == 10); Assert(RelationIdCache->hctl->nkeys == 9);
} }
} }
@ -1634,6 +1634,8 @@ RelationInitialize(void)
* initialize the cache with pre-made relation descriptors * initialize the cache with pre-made relation descriptors
* for some of the more important system relations. These * for some of the more important system relations. These
* relations should always be in the cache. * relations should always be in the cache.
*
* NB: if you change this list, fix the count in RelationCacheInvalidate!
* ---------------- * ----------------
*/ */
formrdesc(RelationRelationName, Natts_pg_class, Desc_pg_class); formrdesc(RelationRelationName, Natts_pg_class, Desc_pg_class);
@ -2058,11 +2060,14 @@ write_irels(void)
FileSeek(fd, 0L, SEEK_SET); FileSeek(fd, 0L, SEEK_SET);
/* /*
* Build a relation descriptor for pg_attnumind without resort to the * Build relation descriptors for the critical system indexes without
* descriptor cache. In order to do this, we set ProcessingMode to * resort to the descriptor cache. In order to do this, we set
* Bootstrap. The effect of this is to disable indexed relation * ProcessingMode to Bootstrap. The effect of this is to disable indexed
* searches -- a necessary step, since we're trying to instantiate the * relation searches -- a necessary step, since we're trying to
* index relation descriptors here. * instantiate the index relation descriptors here. Once we have the
* descriptors, nail them into cache so we never lose them.
*
* NB: if you change this list, fix the count in RelationCacheInvalidate!
*/ */
oldmode = GetProcessingMode(); oldmode = GetProcessingMode();
@ -2083,7 +2088,9 @@ write_irels(void)
SetProcessingMode(oldmode); SetProcessingMode(oldmode);
/* nail the descriptor in the cache */ /*
* Write out the index reldescs to the special cache file.
*/
for (relno = 0; relno < Num_indices_bootstrap; relno++) for (relno = 0; relno < Num_indices_bootstrap; relno++)
{ {
ird = irel[relno]; ird = irel[relno];