summaryrefslogtreecommitdiff
path: root/src/backend/access/index
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/index')
-rw-r--r--src/backend/access/index/genam.c8
-rw-r--r--src/backend/access/index/indexam.c26
-rw-r--r--src/backend/access/index/istrat.c12
3 files changed, 23 insertions, 23 deletions
diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c
index a99b02c3c6..96acee2d21 100644
--- a/src/backend/access/index/genam.c
+++ b/src/backend/access/index/genam.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/index/genam.c,v 1.38 2003/03/24 21:42:33 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/index/genam.c,v 1.39 2003/07/21 20:29:39 tgl Exp $
*
* NOTES
* many of the old access method routines have been turned into
@@ -70,9 +70,6 @@ RelationGetIndexScan(Relation indexRelation,
{
IndexScanDesc scan;
- if (!RelationIsValid(indexRelation))
- elog(ERROR, "RelationGetIndexScan: relation invalid");
-
scan = (IndexScanDesc) palloc(sizeof(IndexScanDescData));
scan->heapRelation = NULL; /* may be set later */
@@ -135,9 +132,6 @@ RelationGetIndexScan(Relation indexRelation,
void
IndexScanEnd(IndexScanDesc scan)
{
- if (!IndexScanIsValid(scan))
- elog(ERROR, "IndexScanEnd: invalid scan");
-
if (scan->keyData != NULL)
pfree(scan->keyData);
diff --git a/src/backend/access/index/indexam.c b/src/backend/access/index/indexam.c
index 90e9af63c2..731c34b3ab 100644
--- a/src/backend/access/index/indexam.c
+++ b/src/backend/access/index/indexam.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.66 2003/03/24 21:42:33 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.67 2003/07/21 20:29:39 tgl Exp $
*
* INTERFACE ROUTINES
* index_open - open an index relation by relation OID
@@ -90,7 +90,7 @@
procedure = indexRelation->rd_am->y, \
(!RegProcedureIsValid(procedure)) ? \
elog(ERROR, "index_%s: invalid %s regproc", \
- CppAsString(x), CppAsString(y)) \
+ CppAsString(x), CppAsString(y)) \
: (void)NULL \
)
@@ -99,7 +99,7 @@
procedure = scan->indexRelation->rd_am->y, \
(!RegProcedureIsValid(procedure)) ? \
elog(ERROR, "index_%s: invalid %s regproc", \
- CppAsString(x), CppAsString(y)) \
+ CppAsString(x), CppAsString(y)) \
: (void)NULL \
)
@@ -129,8 +129,10 @@ index_open(Oid relationId)
r = relation_open(relationId, NoLock);
if (r->rd_rel->relkind != RELKIND_INDEX)
- elog(ERROR, "%s is not an index relation",
- RelationGetRelationName(r));
+ ereport(ERROR,
+ (errcode(ERRCODE_WRONG_OBJECT_TYPE),
+ errmsg("\"%s\" is not an index relation",
+ RelationGetRelationName(r))));
pgstat_initstats(&r->pgstat_info, r);
@@ -152,8 +154,10 @@ index_openrv(const RangeVar *relation)
r = relation_openrv(relation, NoLock);
if (r->rd_rel->relkind != RELKIND_INDEX)
- elog(ERROR, "%s is not an index relation",
- RelationGetRelationName(r));
+ ereport(ERROR,
+ (errcode(ERRCODE_WRONG_OBJECT_TYPE),
+ errmsg("\"%s\" is not an index relation",
+ RelationGetRelationName(r))));
pgstat_initstats(&r->pgstat_info, r);
@@ -175,8 +179,10 @@ index_openr(const char *sysRelationName)
r = relation_openr(sysRelationName, NoLock);
if (r->rd_rel->relkind != RELKIND_INDEX)
- elog(ERROR, "%s is not an index relation",
- RelationGetRelationName(r));
+ ereport(ERROR,
+ (errcode(ERRCODE_WRONG_OBJECT_TYPE),
+ errmsg("\"%s\" is not an index relation",
+ RelationGetRelationName(r))));
pgstat_initstats(&r->pgstat_info, r);
@@ -753,7 +759,7 @@ index_getprocinfo(Relation irel,
* use index_getprocid.)
*/
if (!RegProcedureIsValid(procId))
- elog(ERROR, "Missing support function %d for attribute %d of index %s",
+ elog(ERROR, "missing support function %d for attribute %d of index \"%s\"",
procnum, attnum, RelationGetRelationName(irel));
fmgr_info_cxt(procId, locinfo, irel->rd_indexcxt);
diff --git a/src/backend/access/index/istrat.c b/src/backend/access/index/istrat.c
index 00be395535..66eb7e4a08 100644
--- a/src/backend/access/index/istrat.c
+++ b/src/backend/access/index/istrat.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.58 2002/06/20 20:29:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.59 2003/07/21 20:29:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -235,7 +235,7 @@ StrategyTermEvaluate(StrategyTerm term,
break;
default:
- elog(ERROR, "StrategyTermEvaluate: impossible case %d",
+ elog(ERROR, "impossible strategy case: %d",
operator->flags ^ entry->sk_flags);
}
if (!result)
@@ -310,13 +310,14 @@ RelationGetStrategy(Relation relation,
break;
default:
- elog(FATAL, "RelationGetStrategy: impossible case %d", entry->sk_flags);
+ elog(ERROR, "impossible strategy case: %d",
+ entry->sk_flags);
}
if (!StrategyNumberIsInBounds(strategy, evaluation->maxStrategy))
{
if (!StrategyNumberIsValid(strategy))
- elog(ERROR, "RelationGetStrategy: corrupted evaluation");
+ elog(ERROR, "corrupted strategy evaluation");
}
return strategy;
@@ -435,8 +436,7 @@ RelationInvokeStrategy(Relation relation,
}
}
- elog(ERROR, "RelationInvokeStrategy: cannot evaluate strategy %d",
- strategy);
+ elog(ERROR, "cannot evaluate strategy %d", strategy);
/* not reached, just to make compiler happy */
return FALSE;