message refinements

This commit is contained in:
Peter Eisentraut 2001-08-10 15:49:39 +00:00
parent e24b4b2832
commit 8265769c82
6 changed files with 65 additions and 67 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.172 2001/08/09 18:28:16 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.173 2001/08/10 15:49:39 petere Exp $
*
*
* INTERFACE ROUTINES
@ -202,8 +202,8 @@ heap_create(char *relname,
*/
if (relname && !allow_system_table_mods &&
IsSystemRelationName(relname) && IsNormalProcessingMode())
elog(ERROR, "Illegal class name '%s'"
"\n\tThe 'pg_' name prefix is reserved for system catalogs",
elog(ERROR, "invalid relation name \"%s\"; "
"the 'pg_' name prefix is reserved for system catalogs",
relname);
/*
@ -356,8 +356,7 @@ CheckAttributeNames(TupleDesc tupdesc)
if (strcmp(NameStr(SysAtt[j]->attname),
NameStr(tupdesc->attrs[i]->attname)) == 0)
{
elog(ERROR, "Attribute '%s' has a name conflict"
"\n\tName matches an existing system attribute",
elog(ERROR, "name of column \"%s\" conflicts with an existing system column",
NameStr(SysAtt[j]->attname));
}
}
@ -379,7 +378,7 @@ CheckAttributeNames(TupleDesc tupdesc)
if (strcmp(NameStr(tupdesc->attrs[j]->attname),
NameStr(tupdesc->attrs[i]->attname)) == 0)
{
elog(ERROR, "Attribute '%s' is repeated",
elog(ERROR, "column name \"%s\" is duplicated",
NameStr(tupdesc->attrs[j]->attname));
}
}
@ -713,8 +712,7 @@ heap_create_with_catalog(char *relname,
*/
Assert(IsNormalProcessingMode() || IsBootstrapProcessingMode());
if (natts <= 0 || natts > MaxHeapAttributeNumber)
elog(ERROR, "Number of attributes is out of range"
"\n\tFrom 1 to %d attributes may be specified",
elog(ERROR, "Number of columns is out of range (1 to %d)",
MaxHeapAttributeNumber);
CheckAttributeNames(tupdesc);
@ -1072,7 +1070,7 @@ heap_truncate(char *relname)
* anyway).
*/
if (IsTransactionBlock() && !rel->rd_myxactonly)
elog(ERROR, "TRUNCATE TABLE cannot run inside a BEGIN/END block");
elog(ERROR, "TRUNCATE TABLE cannot run inside a transaction block");
/*
* Release any buffers associated with this relation. If they're
@ -1225,7 +1223,7 @@ DeleteTypeTuple(Relation rel)
heap_endscan(pg_type_scan);
heap_close(pg_type_desc, RowExclusiveLock);
elog(ERROR, "DeleteTypeTuple: att of type %s exists in relation %u",
elog(ERROR, "DeleteTypeTuple: column of type %s exists in relation %u",
RelationGetRelationName(rel), relid);
}
heap_endscan(pg_attribute_scan);
@ -1638,15 +1636,15 @@ AddRelationRawConstraints(Relation rel,
* Make sure default expr does not refer to any vars.
*/
if (contain_var_clause(expr))
elog(ERROR, "Cannot use attribute(s) in DEFAULT clause");
elog(ERROR, "cannot use column references in DEFAULT clause");
/*
* No subplans or aggregates, either...
*/
if (contain_subplans(expr))
elog(ERROR, "Cannot use subselect in DEFAULT clause");
elog(ERROR, "cannot use subselects in DEFAULT clause");
if (contain_agg_clause(expr))
elog(ERROR, "Cannot use aggregate in DEFAULT clause");
elog(ERROR, "cannot use aggregate functions in DEFAULT clause");
/*
* Check that it will be possible to coerce the expression to the
@ -1790,23 +1788,23 @@ AddRelationRawConstraints(Relation rel,
* Make sure it yields a boolean result.
*/
if (exprType(expr) != BOOLOID)
elog(ERROR, "CHECK '%s' does not yield boolean result",
elog(ERROR, "CHECK constraint expression '%s' does not yield boolean result",
ccname);
/*
* Make sure no outside relations are referred to.
*/
if (length(pstate->p_rtable) != 1)
elog(ERROR, "Only relation \"%s\" can be referenced in CHECK",
elog(ERROR, "Only relation \"%s\" can be referenced in CHECK constraint expression",
relname);
/*
* No subplans or aggregates, either...
*/
if (contain_subplans(expr))
elog(ERROR, "Cannot use subselect in CHECK clause");
elog(ERROR, "cannot use subselect in CHECK constraint expression");
if (contain_agg_clause(expr))
elog(ERROR, "Cannot use aggregate in CHECK clause");
elog(ERROR, "cannot use aggregate function in CHECK constraint expression");
/*
* Might as well try to reduce any constant expressions.

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.157 2001/07/16 05:06:57 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.158 2001/08/10 15:49:39 petere Exp $
*
*
* INTERFACE ROUTINES
@ -111,13 +111,13 @@ GetHeapRelationOid(char *heapRelationName, char *indexRelationName, bool istemp)
if ((!istemp && OidIsValid(indoid)) ||
(istemp && is_temp_rel_name(indexRelationName)))
elog(ERROR, "Cannot create index: '%s' already exists",
elog(ERROR, "index named \"%s\" already exists",
indexRelationName);
heapoid = RelnameFindRelid(heapRelationName);
if (!OidIsValid(heapoid))
elog(ERROR, "Cannot create index on '%s': relation does not exist",
elog(ERROR, "cannot create index on non-existent relation \"%s\"",
heapRelationName);
return heapoid;
@ -237,7 +237,7 @@ ConstructTupleDescriptor(Relation heapRelation,
* here we are indexing on a normal attribute (1...n)
*/
if (atnum > natts)
elog(ERROR, "Cannot create index: attribute %d does not exist",
elog(ERROR, "cannot create index: column %d does not exist",
atnum);
from = heapTupDesc->attrs[AttrNumberGetAttrOffset(atnum)];
@ -686,7 +686,7 @@ index_create(char *heapRelationName,
*/
if (indexInfo->ii_NumIndexAttrs < 1 ||
indexInfo->ii_NumKeyAttrs < 1)
elog(ERROR, "must index at least one attribute");
elog(ERROR, "must index at least one column");
if (heapRelationName && !allow_system_table_mods &&
IsSystemRelationName(heapRelationName) && IsNormalProcessingMode())
@ -1856,7 +1856,7 @@ reindex_index(Oid indexId, bool force, bool inplace)
* of the index's physical file. Disallow it.
*/
if (IsTransactionBlock())
elog(ERROR, "REINDEX cannot run inside a BEGIN/END block");
elog(ERROR, "REINDEX cannot run inside a transaction block");
old = SetReindexProcessing(true);

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.38 2001/03/22 03:59:20 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.39 2001/08/10 15:49:39 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -72,10 +72,10 @@ AggregateCreate(char *aggName,
/* sanity checks */
if (!aggName)
elog(ERROR, "AggregateCreate: no aggregate name supplied");
elog(ERROR, "no aggregate name supplied");
if (!aggtransfnName)
elog(ERROR, "AggregateCreate: aggregate must have a transition function");
elog(ERROR, "aggregate must have a transition function");
/*
* Handle the aggregate's base type (input data type). This can be
@ -88,7 +88,7 @@ AggregateCreate(char *aggName,
if (!OidIsValid(basetype))
{
if (strcasecmp(aggbasetypeName, "ANY") != 0)
elog(ERROR, "AggregateCreate: Type '%s' undefined",
elog(ERROR, "data type %s does not exist",
aggbasetypeName);
basetype = InvalidOid;
}
@ -99,7 +99,7 @@ AggregateCreate(char *aggName,
ObjectIdGetDatum(basetype),
0, 0))
elog(ERROR,
"AggregateCreate: aggregate '%s' with base type '%s' already exists",
"aggregate function \"%s\" with base type %s already exists",
aggName, aggbasetypeName);
/* handle transtype */
@ -107,7 +107,7 @@ AggregateCreate(char *aggName,
PointerGetDatum(aggtranstypeName),
0, 0, 0);
if (!OidIsValid(transtype))
elog(ERROR, "AggregateCreate: Type '%s' undefined",
elog(ERROR, "data type %s does not exit",
aggtranstypeName);
/* handle transfn */
@ -130,7 +130,7 @@ AggregateCreate(char *aggName,
Assert(OidIsValid(transfn));
proc = (Form_pg_proc) GETSTRUCT(tup);
if (proc->prorettype != transtype)
elog(ERROR, "AggregateCreate: return type of '%s' is not '%s'",
elog(ERROR, "return type of transition function %s is not %s",
aggtransfnName, aggtranstypeName);
/*
@ -143,7 +143,7 @@ AggregateCreate(char *aggName,
{
if (basetype != transtype &&
!IS_BINARY_COMPATIBLE(basetype, transtype))
elog(ERROR, "AggregateCreate: must not omit initval when transfn is strict and transtype is not compatible with input type");
elog(ERROR, "must not omit initval when transfn is strict and transtype is not compatible with input type");
}
ReleaseSysCache(tup);

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.60 2001/07/15 22:48:17 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.61 2001/08/10 15:49:39 petere Exp $
*
* NOTES
* these routines moved here from commands/define.c and somewhat cleaned up.
@ -174,8 +174,8 @@ OperatorGet(char *operatorName,
leftObjectId = TypeGet(leftTypeName, &leftDefined);
if (!OidIsValid(leftObjectId) || !leftDefined)
elog(ERROR, "OperatorGet: left type \"%s\" does not exist",
leftTypeName);
elog(ERROR, "left type \"%s\" of operator %s does not exist",
leftTypeName, operatorName);
}
if (rightTypeName)
@ -183,13 +183,13 @@ OperatorGet(char *operatorName,
rightObjectId = TypeGet(rightTypeName, &rightDefined);
if (!OidIsValid(rightObjectId) || !rightDefined)
elog(ERROR, "OperatorGet: right type \"%s\" does not exist",
rightTypeName);
elog(ERROR, "right type \"%s\" of operator %s does not exist",
rightTypeName, operatorName);
}
if (!((OidIsValid(leftObjectId) && leftDefined) ||
(OidIsValid(rightObjectId) && rightDefined)))
elog(ERROR, "OperatorGet: must have at least one argument type");
elog(ERROR, "operator %s must have at least one operand type", operatorName);
/*
* open the pg_operator relation
@ -330,7 +330,7 @@ OperatorShellMake(char *operatorName,
if (!((OidIsValid(leftObjectId) && leftDefined) ||
(OidIsValid(rightObjectId) && rightDefined)))
elog(ERROR, "OperatorShellMake: no valid argument types??");
elog(ERROR, "OperatorShellMake: the operand types are not valid");
/*
* open pg_operator
@ -494,7 +494,7 @@ OperatorDef(char *operatorName,
leftTypeId = TypeGet(leftTypeName, &leftDefined);
if (!OidIsValid(leftTypeId) || !leftDefined)
elog(ERROR, "OperatorDef: left type \"%s\" does not exist",
elog(ERROR, "left type \"%s\" does not exist",
leftTypeName);
}
@ -503,13 +503,13 @@ OperatorDef(char *operatorName,
rightTypeId = TypeGet(rightTypeName, &rightDefined);
if (!OidIsValid(rightTypeId) || !rightDefined)
elog(ERROR, "OperatorDef: right type \"%s\" does not exist",
elog(ERROR, "right type \"%s\" does not exist",
rightTypeName);
}
if (!((OidIsValid(leftTypeId) && leftDefined) ||
(OidIsValid(rightTypeId) && rightDefined)))
elog(ERROR, "OperatorDef: must have at least one argument type");
elog(ERROR, "operator must have at least one operand type");
for (i = 0; i < Natts_pg_operator; ++i)
{
@ -717,7 +717,7 @@ OperatorDef(char *operatorName,
*/
if (j != 0)
elog(ERROR,
"OperatorDef: operator can't be its own negator or sort op");
"operator cannot be its own negator or sort operator");
selfCommutator = true;
values[i++] = ObjectIdGetDatum(InvalidOid);
}
@ -772,7 +772,7 @@ OperatorDef(char *operatorName,
simple_heap_update(pg_operator_desc, &tup->t_self, tup);
}
else
elog(ERROR, "OperatorDef: no operator %u", operatorObjectId);
elog(ERROR, "OperatorDef: operator %u not found", operatorObjectId);
heap_endscan(pg_operator_scan);
}
@ -1023,19 +1023,19 @@ OperatorCreate(char *operatorName,
char *rightSortName)
{
if (!leftTypeName && !rightTypeName)
elog(ERROR, "OperatorCreate: at least one of leftarg or rightarg must be defined");
elog(ERROR, "at least one of leftarg or rightarg must be specified");
if (!(leftTypeName && rightTypeName))
{
/* If it's not a binary op, these things mustn't be set: */
if (commutatorName)
elog(ERROR, "OperatorCreate: only binary operators can have commutators");
elog(ERROR, "only binary operators can have commutators");
if (joinName)
elog(ERROR, "OperatorCreate: only binary operators can have join selectivity");
elog(ERROR, "only binary operators can have join selectivity");
if (canHash)
elog(ERROR, "OperatorCreate: only binary operators can hash");
elog(ERROR, "only binary operators can hash");
if (leftSortName || rightSortName)
elog(ERROR, "OperatorCreate: only binary operators can have sort links");
elog(ERROR, "only binary operators can have sort links");
}
/*

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.56 2001/08/09 18:28:17 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.57 2001/08/10 15:49:39 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -83,7 +83,7 @@ ProcedureCreate(char *procedureName,
PointerGetDatum(languageName),
0, 0, 0);
if (!OidIsValid(languageObjectId))
elog(ERROR, "ProcedureCreate: no such language '%s'", languageName);
elog(ERROR, "language '%s' does not exist", languageName);
parameterCount = 0;
MemSet(typev, 0, FUNC_MAX_ARGS * sizeof(Oid));
@ -93,13 +93,13 @@ ProcedureCreate(char *procedureName,
char *typnam = TypeNameToInternalName(t);
if (parameterCount >= FUNC_MAX_ARGS)
elog(ERROR, "Procedures cannot take more than %d arguments",
elog(ERROR, "functions cannot have more than %d arguments",
FUNC_MAX_ARGS);
if (strcmp(typnam, "opaque") == 0)
{
if (languageObjectId == SQLlanguageId)
elog(ERROR, "ProcedureCreate: sql functions cannot take type \"opaque\"");
elog(ERROR, "SQL functions cannot have arguments of type \"opaque\"");
toid = InvalidOid;
}
else
@ -107,15 +107,15 @@ ProcedureCreate(char *procedureName,
toid = TypeGet(typnam, &defined);
if (!OidIsValid(toid))
elog(ERROR, "ProcedureCreate: arg type '%s' is not defined",
elog(ERROR, "argument type %s does not exist",
typnam);
if (!defined)
elog(NOTICE, "ProcedureCreate: arg type '%s' is only a shell",
elog(NOTICE, "argument type %s is only a shell",
typnam);
}
if (t->setof)
elog(ERROR, "ProcedureCreate: functions cannot accept set arguments");
elog(ERROR, "functions cannot accept set arguments");
typev[parameterCount++] = toid;
}
@ -126,7 +126,7 @@ ProcedureCreate(char *procedureName,
UInt16GetDatum(parameterCount),
PointerGetDatum(typev),
0))
elog(ERROR, "ProcedureCreate: procedure %s already exists with same arguments",
elog(ERROR, "function %s already exists with same argument types",
procedureName);
if (languageObjectId == SQLlanguageId)
@ -171,7 +171,7 @@ ProcedureCreate(char *procedureName,
if (strcmp(returnTypeName, "opaque") == 0)
{
if (languageObjectId == SQLlanguageId)
elog(ERROR, "ProcedureCreate: sql functions cannot return type \"opaque\"");
elog(ERROR, "SQL functions cannot return type \"opaque\"");
typeObjectId = InvalidOid;
}
else
@ -180,15 +180,15 @@ ProcedureCreate(char *procedureName,
if (!OidIsValid(typeObjectId))
{
elog(NOTICE, "ProcedureCreate: type '%s' is not yet defined",
elog(NOTICE, "ProcedureCreate: type %s is not yet defined",
returnTypeName);
typeObjectId = TypeShellMake(returnTypeName);
if (!OidIsValid(typeObjectId))
elog(ERROR, "ProcedureCreate: could not create type '%s'",
elog(ERROR, "could not create type %s",
returnTypeName);
}
else if (!defined)
elog(NOTICE, "ProcedureCreate: return type '%s' is only a shell",
elog(NOTICE, "return type %s is only a shell",
returnTypeName);
}
@ -236,7 +236,7 @@ ProcedureCreate(char *procedureName,
prosrc = procedureName;
if (fmgr_internal_function(prosrc) == InvalidOid)
elog(ERROR,
"ProcedureCreate: there is no builtin function named \"%s\"",
"there is no built-in function named \"%s\"",
prosrc);
}

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.61 2001/03/22 06:16:11 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.62 2001/08/10 15:49:39 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -304,7 +304,7 @@ TypeCreate(char *typeName,
typeObjectId = TypeGet(typeName, &defined);
if (OidIsValid(typeObjectId) &&
(defined || assignedTypeOid != InvalidOid))
elog(ERROR, "TypeCreate: type %s already defined", typeName);
elog(ERROR, "type named %s already exists", typeName);
/*
* if this type has an associated elementType, then we check that it
@ -314,7 +314,7 @@ TypeCreate(char *typeName,
{
elementObjectId = TypeGet(elementTypeName, &defined);
if (!defined)
elog(ERROR, "TypeCreate: type %s is not defined", elementTypeName);
elog(ERROR, "type %s does not exist", elementTypeName);
}
/*
@ -464,7 +464,7 @@ TypeCreate(char *typeName,
{
/* should not happen given prior test? */
if (assignedTypeOid != InvalidOid)
elog(ERROR, "TypeCreate: type %s already defined", typeName);
elog(ERROR, "type %s already exists", typeName);
tup = heap_modifytuple(tup,
pg_type_desc,
@ -530,12 +530,12 @@ TypeRename(const char *oldTypeName, const char *newTypeName)
PointerGetDatum(oldTypeName),
0, 0, 0);
if (!HeapTupleIsValid(tuple))
elog(ERROR, "TypeRename: type \"%s\" not defined", oldTypeName);
elog(ERROR, "type %s does not exist", oldTypeName);
if (SearchSysCacheExists(TYPENAME,
PointerGetDatum(newTypeName),
0, 0, 0))
elog(ERROR, "TypeRename: type \"%s\" already defined", newTypeName);
elog(ERROR, "type named %s already exists", newTypeName);
namestrcpy(&(((Form_pg_type) GETSTRUCT(tuple))->typname), newTypeName);