diff options
author | Tom Lane | 2003-09-24 18:54:02 +0000 |
---|---|---|
committer | Tom Lane | 2003-09-24 18:54:02 +0000 |
commit | a56a016ceb612cdee1ddc5990682f36d541e5b07 (patch) | |
tree | c496319424e0445562dd42ee7229e6d87567996f /src/include/utils | |
parent | 5f78c6a886a22209dee62de0c13edd6a68453011 (diff) |
Repair some REINDEX problems per recent discussions. The relcache is
now able to cope with assigning new relfilenode values to nailed-in-cache
indexes, so they can be reindexed using the fully crash-safe method. This
leaves only shared system indexes as special cases. Remove the 'index
deactivation' code, since it provides no useful protection in the shared-
index case. Require reindexing of shared indexes to be done in standalone
mode, but remove other restrictions on REINDEX. -P (IgnoreSystemIndexes)
now prevents using indexes for lookups, but does not disable index updates.
It is therefore safe to allow from PGOPTIONS. Upshot: reindexing system catalogs
can be done without a standalone backend for all cases except
shared catalogs.
Diffstat (limited to 'src/include/utils')
-rw-r--r-- | src/include/utils/errcodes.h | 3 | ||||
-rw-r--r-- | src/include/utils/rel.h | 8 | ||||
-rw-r--r-- | src/include/utils/relcache.h | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/include/utils/errcodes.h b/src/include/utils/errcodes.h index 13e42cf1b9d..fa1cd254a4f 100644 --- a/src/include/utils/errcodes.h +++ b/src/include/utils/errcodes.h @@ -11,7 +11,7 @@ * * Copyright (c) 2003, PostgreSQL Global Development Group * - * $Id: errcodes.h,v 1.5 2003/08/26 21:15:27 tgl Exp $ + * $Id: errcodes.h,v 1.6 2003/09/24 18:54:01 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -281,7 +281,6 @@ /* Class 55 - Object Not In Prerequisite State (class borrowed from DB2) */ #define ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE MAKE_SQLSTATE('5','5', '0','0','0') #define ERRCODE_OBJECT_IN_USE MAKE_SQLSTATE('5','5', '0','0','6') -#define ERRCODE_INDEXES_DEACTIVATED MAKE_SQLSTATE('5','5', 'P','0','1') #define ERRCODE_CANT_CHANGE_RUNTIME_PARAM MAKE_SQLSTATE('5','5', 'P','0','2') /* Class 57 - Operator Intervention (class borrowed from DB2) */ diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 0971abf000a..377822afc69 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: rel.h,v 1.67 2003/08/04 02:40:15 momjian Exp $ + * $Id: rel.h,v 1.68 2003/09/24 18:54:01 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -119,8 +119,10 @@ typedef struct RelationData * it is possible for new-ness to be "forgotten" (eg, after CLUSTER). */ bool rd_istemp; /* rel uses the local buffer mgr */ - bool rd_isnailed; /* rel is nailed in cache */ - bool rd_indexfound; /* true if rd_indexlist is valid */ + char rd_isnailed; /* rel is nailed in cache: 0 = no, 1 = yes, + * 2 = yes but possibly invalid */ + char rd_indexvalid; /* state of rd_indexlist: 0 = not valid, + * 1 = valid, 2 = temporarily forced */ Form_pg_class rd_rel; /* RELATION tuple */ TupleDesc rd_att; /* tuple descriptor */ Oid rd_id; /* relation's object id */ diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h index 5d08e9b0256..61e09c38461 100644 --- a/src/include/utils/relcache.h +++ b/src/include/utils/relcache.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: relcache.h,v 1.36 2003/08/04 02:40:15 momjian Exp $ + * $Id: relcache.h,v 1.37 2003/09/24 18:54:02 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -35,6 +35,8 @@ extern List *RelationGetIndexList(Relation relation); extern List *RelationGetIndexExpressions(Relation relation); extern List *RelationGetIndexPredicate(Relation relation); +extern void RelationSetIndexList(Relation relation, List *indexIds); + extern void RelationInitIndexAccessInfo(Relation relation); /* |