Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc509284

Browse files
committed
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...
1 parent7d0a534 commitc509284

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

‎src/backend/utils/cache/relcache.c

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.70 1999/09/04 21:47:23 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.71 1999/09/06 18:13:02 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1462,13 +1462,13 @@ RelationCacheInvalidate(bool onlyFlushReferenceCountZero)
14621462
onlyFlushReferenceCountZero);
14631463

14641464
/*
1465-
* nailed-in reldescs will still be in the cache...7 hardwired heaps
1466-
* + 3 hardwired indices ==10 total.
1465+
* nailed-in reldescs will still be in the cache...6 hardwired heaps
1466+
* + 3 hardwired indices ==9 total.
14671467
*/
14681468
if (!onlyFlushReferenceCountZero)
14691469
{
1470-
Assert(RelationNameCache->hctl->nkeys==10);
1471-
Assert(RelationIdCache->hctl->nkeys==10);
1470+
Assert(RelationNameCache->hctl->nkeys==9);
1471+
Assert(RelationIdCache->hctl->nkeys==9);
14721472
}
14731473
}
14741474

@@ -1634,6 +1634,8 @@ RelationInitialize(void)
16341634
*initialize the cache with pre-made relation descriptors
16351635
*for some of the more important system relations. These
16361636
*relations should always be in the cache.
1637+
*
1638+
*NB: if you change this list, fix the count in RelationCacheInvalidate!
16371639
* ----------------
16381640
*/
16391641
formrdesc(RelationRelationName,Natts_pg_class,Desc_pg_class);
@@ -2058,11 +2060,14 @@ write_irels(void)
20582060
FileSeek(fd,0L,SEEK_SET);
20592061

20602062
/*
2061-
* Build a relation descriptor for pg_attnumind without resort to the
2062-
* descriptor cache. In order to do this, we set ProcessingMode to
2063-
* Bootstrap. The effect of this is to disable indexed relation
2064-
* searches -- a necessary step, since we're trying to instantiate the
2065-
* index relation descriptors here.
2063+
* Build relation descriptors for the critical system indexes without
2064+
* resort to the descriptor cache. In order to do this, we set
2065+
* ProcessingMode to Bootstrap. The effect of this is to disable indexed
2066+
* relation searches -- a necessary step, since we're trying to
2067+
* instantiate the index relation descriptors here. Once we have the
2068+
* descriptors, nail them into cache so we never lose them.
2069+
*
2070+
* NB: if you change this list, fix the count in RelationCacheInvalidate!
20662071
*/
20672072

20682073
oldmode=GetProcessingMode();
@@ -2083,7 +2088,9 @@ write_irels(void)
20832088

20842089
SetProcessingMode(oldmode);
20852090

2086-
/* nail the descriptor in the cache */
2091+
/*
2092+
* Write out the index reldescs to the special cache file.
2093+
*/
20872094
for (relno=0;relno<Num_indices_bootstrap;relno++)
20882095
{
20892096
ird=irel[relno];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp