8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.123 2001/01/04 02:24:22 inoue Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.124 2001/01/06 01:48:59 inoue Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -2104,15 +2104,11 @@ RelationCacheInitialize(void)
2104
2104
formrdesc (LogRelationName , Natts_pg_log , Desc_pg_log );
2105
2105
2106
2106
/*
2107
- * If this isn't initdb time, then we want to initialize some index
2108
- * relation descriptors, as well. The descriptors are for
2109
- * pg_attnumind (to make building relation descriptors fast) and
2110
- * possibly others, as they're added.
2107
+ * init_irels() used to be called here. It is changed to be called
2108
+ * in RelationCacheInitializePhase2() now so that transactional
2109
+ * control could guarantee the consistency.
2111
2110
*/
2112
2111
2113
- if (!IsBootstrapProcessingMode ())
2114
- init_irels ();
2115
-
2116
2112
MemoryContextSwitchTo (oldcxt );
2117
2113
}
2118
2114
@@ -2134,6 +2130,17 @@ RelationCacheInitializePhase2(void)
2134
2130
*/
2135
2131
if (!IsBootstrapProcessingMode ())
2136
2132
{
2133
+ /*
2134
+ * Initialize critical system index relation descriptors, first.
2135
+ * They are to make building relation descriptors fast.
2136
+ * init_irels() used to be called in RelationCacheInitialize().
2137
+ * It is changed to be called here to be transaction safe.
2138
+ */
2139
+ MemoryContext oldcxt = MemoryContextSwitchTo (CacheMemoryContext );
2140
+ init_irels ();
2141
+ MemoryContextSwitchTo (oldcxt );
2142
+
2143
+ /* fix nailed-in-cache relations */
2137
2144
fixrdesc (RelationRelationName );
2138
2145
fixrdesc (AttributeRelationName );
2139
2146
fixrdesc (ProcedureRelationName );
0 commit comments