|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.140 2001/01/29 00:39:16 tgl Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.141 2001/02/23 09:26:14 inoue Exp $ |
12 | 12 | *
|
13 | 13 | *
|
14 | 14 | * INTERFACE ROUTINES
|
@@ -2087,7 +2087,12 @@ reindex_index(Oid indexId, bool force, bool inplace)
|
2087 | 2087 |
|
2088 | 2088 | #ifndef OLD_FILE_NAMING
|
2089 | 2089 | if (!inplace)
|
2090 |
| - setNewRelfilenode(iRel); |
| 2090 | + { |
| 2091 | + inplace = IsSharedSystemRelationName(NameStr(iRel->rd_rel->relna |
| 2092 | +me)); |
| 2093 | + if (!inplace) |
| 2094 | + setNewRelfilenode(iRel); |
| 2095 | + } |
2091 | 2096 | #endif /* OLD_FILE_NAMING */
|
2092 | 2097 | /* Obtain exclusive lock on it, just to be sure */
|
2093 | 2098 | LockRelation(iRel, AccessExclusiveLock);
|
@@ -2196,6 +2201,20 @@ reindex_relation(Oid relid, bool force)
|
2196 | 2201 | elog(ERROR, "the target relation %u is nailed", relid);
|
2197 | 2202 | }
|
2198 | 2203 | #endif /* ENABLE_REINDEX_NAILED_RELATIONS */
|
| 2204 | + /* |
| 2205 | + * Shared system indexes must be overwritten because it's |
| 2206 | + * impossible to update pg_class tuples of all databases. |
| 2207 | + */ |
| 2208 | + if (IsSharedSystemRelationName(NameStr(rel->rd_rel->relname))) |
| 2209 | + { |
| 2210 | + if (IsIgnoringSystemIndexes()) |
| 2211 | + { |
| 2212 | + overwrite = true; |
| 2213 | + deactivate_needed = true; |
| 2214 | + } |
| 2215 | + else |
| 2216 | + elog(ERROR, "the target relation %u is shared", relid); |
| 2217 | + } |
2199 | 2218 | RelationClose(rel);
|
2200 | 2219 | #endif /* OLD_FILE_NAMING */
|
2201 | 2220 | old = SetReindexProcessing(true);
|
|
0 commit comments