mirror of
https://github.com/postgres/postgres.git
synced 2025-05-31 03:21:24 +03:00
init_irels() is changed to be called in RelationCacheInitializePhase2()
so that transactional control could guarantee the consistency.
This commit is contained in:
parent
682b128993
commit
4451ed3dfe
23
src/backend/utils/cache/relcache.c
vendored
23
src/backend/utils/cache/relcache.c
vendored
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.123 2001/01/04 02:24:22 inoue Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.124 2001/01/06 01:48:59 inoue Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -2104,15 +2104,11 @@ RelationCacheInitialize(void)
|
|||||||
formrdesc(LogRelationName, Natts_pg_log, Desc_pg_log);
|
formrdesc(LogRelationName, Natts_pg_log, Desc_pg_log);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this isn't initdb time, then we want to initialize some index
|
* init_irels() used to be called here. It is changed to be called
|
||||||
* relation descriptors, as well. The descriptors are for
|
* in RelationCacheInitializePhase2() now so that transactional
|
||||||
* pg_attnumind (to make building relation descriptors fast) and
|
* control could guarantee the consistency.
|
||||||
* possibly others, as they're added.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!IsBootstrapProcessingMode())
|
|
||||||
init_irels();
|
|
||||||
|
|
||||||
MemoryContextSwitchTo(oldcxt);
|
MemoryContextSwitchTo(oldcxt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2134,6 +2130,17 @@ RelationCacheInitializePhase2(void)
|
|||||||
*/
|
*/
|
||||||
if (!IsBootstrapProcessingMode())
|
if (!IsBootstrapProcessingMode())
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Initialize critical system index relation descriptors, first.
|
||||||
|
* They are to make building relation descriptors fast.
|
||||||
|
* init_irels() used to be called in RelationCacheInitialize().
|
||||||
|
* It is changed to be called here to be transaction safe.
|
||||||
|
*/
|
||||||
|
MemoryContext oldcxt = MemoryContextSwitchTo(CacheMemoryContext);
|
||||||
|
init_irels();
|
||||||
|
MemoryContextSwitchTo(oldcxt);
|
||||||
|
|
||||||
|
/* fix nailed-in-cache relations */
|
||||||
fixrdesc(RelationRelationName);
|
fixrdesc(RelationRelationName);
|
||||||
fixrdesc(AttributeRelationName);
|
fixrdesc(AttributeRelationName);
|
||||||
fixrdesc(ProcedureRelationName);
|
fixrdesc(ProcedureRelationName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user