diff options
Diffstat (limited to 'src/backend/utils/cache/syscache.c')
-rw-r--r-- | src/backend/utils/cache/syscache.c | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c index e629bf48e46..dfbcccffbed 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.66 2001/10/25 05:49:46 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.67 2002/02/19 20:11:18 tgl Exp $ * * NOTES * These routines allow the parser/planner/executor to perform @@ -113,6 +113,16 @@ static struct cachedesc cacheinfo[] = { 0, 0 }}, + {AccessMethodRelationName, /* AMOID */ + AmOidIndex, + 0, + 1, + { + ObjectIdAttributeNumber, + 0, + 0, + 0 + }}, {AccessMethodOperatorRelationName, /* AMOPOPID */ AccessMethodOperatorIndex, 0, @@ -365,8 +375,7 @@ static struct cachedesc cacheinfo[] = { }} }; -static CatCache *SysCache[ - lengthof(cacheinfo)]; +static CatCache *SysCache[lengthof(cacheinfo)]; static int SysCacheSize = lengthof(cacheinfo); static bool CacheInitialized = false; @@ -383,7 +392,7 @@ IsCacheInitialized(void) * * Note that no database access is done here; we only allocate memory * and initialize the cache structure. Interrogation of the database - * to complete initialization of a cache happens only upon first use + * to complete initialization of a cache happens upon first use * of that cache. */ void @@ -412,6 +421,32 @@ InitCatalogCache(void) /* + * InitCatalogCachePhase2 - finish initializing the caches + * + * Finish initializing all the caches, including necessary database + * access. + * + * This is *not* essential; normally we allow syscaches to be initialized + * on first use. However, it is useful as a mechanism to preload the + * relcache with entries for the most-commonly-used system catalogs. + * Therefore, we invoke this routine when we need to write a new relcache + * init file. + */ +void +InitCatalogCachePhase2(void) +{ + int cacheId; + + Assert(CacheInitialized); + + for (cacheId = 0; cacheId < SysCacheSize; cacheId++) + { + InitCatCachePhase2(SysCache[cacheId]); + } +} + + +/* * SearchSysCache * * A layer on top of SearchCatCache that does the initialization and |