mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Error message editing in backend/access.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user