1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Implement reindex command

This commit is contained in:
Hiroshi Inoue
2000-02-18 09:30:20 +00:00
parent e3befe4a66
commit e3a97b370c
29 changed files with 1208 additions and 229 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.53 2000/01/26 05:56:22 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.54 2000/02/18 09:29:57 inoue Exp $
*
*-------------------------------------------------------------------------
*/
@ -48,8 +48,10 @@
#include "catalog/catname.h"
#include "catalog/index.h"
#include "catalog/pg_index.h"
#include "catalog/catalog.h"
#include "executor/execdebug.h"
#include "executor/executor.h"
#include "miscadmin.h"
static void ExecGetIndexKeyInfo(Form_pg_index indexTuple, int *numAttsOutP,
AttrNumber **attsOutP, FuncIndexInfoPtr fInfoP);
@ -770,6 +772,12 @@ ExecOpenIndices(Oid resultRelationOid,
PredInfo *predicate;
int i;
resultRelationInfo->ri_NumIndices = 0;
if (!RelationGetForm(resultRelationInfo->ri_RelationDesc)->relhasindex)
return;
if (IsIgnoringSystemIndexes() &&
IsSystemRelationName(RelationGetRelationName(resultRelationInfo->ri_RelationDesc)))
return;
/* ----------------
* open pg_index
* ----------------

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.46 2000/02/05 23:19:44 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.47 2000/02/18 09:29:57 inoue Exp $
*
*-------------------------------------------------------------------------
*/
@ -1048,6 +1048,10 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
&currentRelation, /* return: rel desc */
(Pointer *) &currentScanDesc); /* return: scan desc */
if (!RelationGetForm(currentRelation)->relhasindex)
{
elog(ERROR, "indexes of the relation %u was inactivated", reloid);
}
scanstate->css_currentRelation = currentRelation;
scanstate->css_currentScanDesc = currentScanDesc;