summaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorHiroshi Inoue <inoue@tpf.co.jp>2000-02-18 09:30:20 +0000
committerHiroshi Inoue <inoue@tpf.co.jp>2000-02-18 09:30:20 +0000
commite3a97b370c2671c05ad95d6a21914c225a0cf32d (patch)
treee20b8bdc9dfedef71dfe1367c3b957cbf16c42c1 /src/backend/executor
parente3befe4a66c68fea03300eadb9d9b2f1c2534dc6 (diff)
downloadpostgresql-e3a97b370c2671c05ad95d6a21914c225a0cf32d.tar.gz
Implement reindex command
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execUtils.c10
-rw-r--r--src/backend/executor/nodeIndexscan.c6
2 files changed, 14 insertions, 2 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c
index 11cde461b4..8f15ac1ed1 100644
--- a/src/backend/executor/execUtils.c
+++ b/src/backend/executor/execUtils.c
@@ -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
* ----------------
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c
index e5f7642c85..b1d1c578f3 100644
--- a/src/backend/executor/nodeIndexscan.c
+++ b/src/backend/executor/nodeIndexscan.c
@@ -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;