*
*
* 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
*/
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);
/*
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));
}
}
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));
}
}
*/
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);
* 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
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);
* 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
* 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.
*
*
* 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
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;
* 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)];
*/
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())
* 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);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
/* 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
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;
}
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 */
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 */
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);
/*
{
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);
*
*
* 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.
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)
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
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
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);
}
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)
{
*/
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);
}
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);
}
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");
}
/*
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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));
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
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;
}
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)
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
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);
}
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);
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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
{
elementObjectId = TypeGet(elementTypeName, &defined);
if (!defined)
- elog(ERROR, "TypeCreate: type %s is not defined", elementTypeName);
+ elog(ERROR, "type %s does not exist", elementTypeName);
}
/*
{
/* 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,
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);