message refinements
This commit is contained in:
parent
e24b4b2832
commit
8265769c82
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* INTERFACE ROUTINES
|
||||||
|
@ -202,8 +202,8 @@ heap_create(char *relname,
|
||||||
*/
|
*/
|
||||||
if (relname && !allow_system_table_mods &&
|
if (relname && !allow_system_table_mods &&
|
||||||
IsSystemRelationName(relname) && IsNormalProcessingMode())
|
IsSystemRelationName(relname) && IsNormalProcessingMode())
|
||||||
elog(ERROR, "Illegal class name '%s'"
|
elog(ERROR, "invalid relation name \"%s\"; "
|
||||||
"\n\tThe 'pg_' name prefix is reserved for system catalogs",
|
"the 'pg_' name prefix is reserved for system catalogs",
|
||||||
relname);
|
relname);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -356,8 +356,7 @@ CheckAttributeNames(TupleDesc tupdesc)
|
||||||
if (strcmp(NameStr(SysAtt[j]->attname),
|
if (strcmp(NameStr(SysAtt[j]->attname),
|
||||||
NameStr(tupdesc->attrs[i]->attname)) == 0)
|
NameStr(tupdesc->attrs[i]->attname)) == 0)
|
||||||
{
|
{
|
||||||
elog(ERROR, "Attribute '%s' has a name conflict"
|
elog(ERROR, "name of column \"%s\" conflicts with an existing system column",
|
||||||
"\n\tName matches an existing system attribute",
|
|
||||||
NameStr(SysAtt[j]->attname));
|
NameStr(SysAtt[j]->attname));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -379,7 +378,7 @@ CheckAttributeNames(TupleDesc tupdesc)
|
||||||
if (strcmp(NameStr(tupdesc->attrs[j]->attname),
|
if (strcmp(NameStr(tupdesc->attrs[j]->attname),
|
||||||
NameStr(tupdesc->attrs[i]->attname)) == 0)
|
NameStr(tupdesc->attrs[i]->attname)) == 0)
|
||||||
{
|
{
|
||||||
elog(ERROR, "Attribute '%s' is repeated",
|
elog(ERROR, "column name \"%s\" is duplicated",
|
||||||
NameStr(tupdesc->attrs[j]->attname));
|
NameStr(tupdesc->attrs[j]->attname));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -713,8 +712,7 @@ heap_create_with_catalog(char *relname,
|
||||||
*/
|
*/
|
||||||
Assert(IsNormalProcessingMode() || IsBootstrapProcessingMode());
|
Assert(IsNormalProcessingMode() || IsBootstrapProcessingMode());
|
||||||
if (natts <= 0 || natts > MaxHeapAttributeNumber)
|
if (natts <= 0 || natts > MaxHeapAttributeNumber)
|
||||||
elog(ERROR, "Number of attributes is out of range"
|
elog(ERROR, "Number of columns is out of range (1 to %d)",
|
||||||
"\n\tFrom 1 to %d attributes may be specified",
|
|
||||||
MaxHeapAttributeNumber);
|
MaxHeapAttributeNumber);
|
||||||
|
|
||||||
CheckAttributeNames(tupdesc);
|
CheckAttributeNames(tupdesc);
|
||||||
|
@ -1072,7 +1070,7 @@ heap_truncate(char *relname)
|
||||||
* anyway).
|
* anyway).
|
||||||
*/
|
*/
|
||||||
if (IsTransactionBlock() && !rel->rd_myxactonly)
|
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
|
* Release any buffers associated with this relation. If they're
|
||||||
|
@ -1225,7 +1223,7 @@ DeleteTypeTuple(Relation rel)
|
||||||
heap_endscan(pg_type_scan);
|
heap_endscan(pg_type_scan);
|
||||||
heap_close(pg_type_desc, RowExclusiveLock);
|
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);
|
RelationGetRelationName(rel), relid);
|
||||||
}
|
}
|
||||||
heap_endscan(pg_attribute_scan);
|
heap_endscan(pg_attribute_scan);
|
||||||
|
@ -1638,15 +1636,15 @@ AddRelationRawConstraints(Relation rel,
|
||||||
* Make sure default expr does not refer to any vars.
|
* Make sure default expr does not refer to any vars.
|
||||||
*/
|
*/
|
||||||
if (contain_var_clause(expr))
|
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...
|
* No subplans or aggregates, either...
|
||||||
*/
|
*/
|
||||||
if (contain_subplans(expr))
|
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))
|
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
|
* 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.
|
* Make sure it yields a boolean result.
|
||||||
*/
|
*/
|
||||||
if (exprType(expr) != BOOLOID)
|
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);
|
ccname);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure no outside relations are referred to.
|
* Make sure no outside relations are referred to.
|
||||||
*/
|
*/
|
||||||
if (length(pstate->p_rtable) != 1)
|
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);
|
relname);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* No subplans or aggregates, either...
|
* No subplans or aggregates, either...
|
||||||
*/
|
*/
|
||||||
if (contain_subplans(expr))
|
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))
|
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.
|
* Might as well try to reduce any constant expressions.
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* INTERFACE ROUTINES
|
||||||
|
@ -111,13 +111,13 @@ GetHeapRelationOid(char *heapRelationName, char *indexRelationName, bool istemp)
|
||||||
|
|
||||||
if ((!istemp && OidIsValid(indoid)) ||
|
if ((!istemp && OidIsValid(indoid)) ||
|
||||||
(istemp && is_temp_rel_name(indexRelationName)))
|
(istemp && is_temp_rel_name(indexRelationName)))
|
||||||
elog(ERROR, "Cannot create index: '%s' already exists",
|
elog(ERROR, "index named \"%s\" already exists",
|
||||||
indexRelationName);
|
indexRelationName);
|
||||||
|
|
||||||
heapoid = RelnameFindRelid(heapRelationName);
|
heapoid = RelnameFindRelid(heapRelationName);
|
||||||
|
|
||||||
if (!OidIsValid(heapoid))
|
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);
|
heapRelationName);
|
||||||
|
|
||||||
return heapoid;
|
return heapoid;
|
||||||
|
@ -237,7 +237,7 @@ ConstructTupleDescriptor(Relation heapRelation,
|
||||||
* here we are indexing on a normal attribute (1...n)
|
* here we are indexing on a normal attribute (1...n)
|
||||||
*/
|
*/
|
||||||
if (atnum > natts)
|
if (atnum > natts)
|
||||||
elog(ERROR, "Cannot create index: attribute %d does not exist",
|
elog(ERROR, "cannot create index: column %d does not exist",
|
||||||
atnum);
|
atnum);
|
||||||
|
|
||||||
from = heapTupDesc->attrs[AttrNumberGetAttrOffset(atnum)];
|
from = heapTupDesc->attrs[AttrNumberGetAttrOffset(atnum)];
|
||||||
|
@ -686,7 +686,7 @@ index_create(char *heapRelationName,
|
||||||
*/
|
*/
|
||||||
if (indexInfo->ii_NumIndexAttrs < 1 ||
|
if (indexInfo->ii_NumIndexAttrs < 1 ||
|
||||||
indexInfo->ii_NumKeyAttrs < 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 &&
|
if (heapRelationName && !allow_system_table_mods &&
|
||||||
IsSystemRelationName(heapRelationName) && IsNormalProcessingMode())
|
IsSystemRelationName(heapRelationName) && IsNormalProcessingMode())
|
||||||
|
@ -1856,7 +1856,7 @@ reindex_index(Oid indexId, bool force, bool inplace)
|
||||||
* of the index's physical file. Disallow it.
|
* of the index's physical file. Disallow it.
|
||||||
*/
|
*/
|
||||||
if (IsTransactionBlock())
|
if (IsTransactionBlock())
|
||||||
elog(ERROR, "REINDEX cannot run inside a BEGIN/END block");
|
elog(ERROR, "REINDEX cannot run inside a transaction block");
|
||||||
|
|
||||||
old = SetReindexProcessing(true);
|
old = SetReindexProcessing(true);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 */
|
/* sanity checks */
|
||||||
if (!aggName)
|
if (!aggName)
|
||||||
elog(ERROR, "AggregateCreate: no aggregate name supplied");
|
elog(ERROR, "no aggregate name supplied");
|
||||||
|
|
||||||
if (!aggtransfnName)
|
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
|
* Handle the aggregate's base type (input data type). This can be
|
||||||
|
@ -88,7 +88,7 @@ AggregateCreate(char *aggName,
|
||||||
if (!OidIsValid(basetype))
|
if (!OidIsValid(basetype))
|
||||||
{
|
{
|
||||||
if (strcasecmp(aggbasetypeName, "ANY") != 0)
|
if (strcasecmp(aggbasetypeName, "ANY") != 0)
|
||||||
elog(ERROR, "AggregateCreate: Type '%s' undefined",
|
elog(ERROR, "data type %s does not exist",
|
||||||
aggbasetypeName);
|
aggbasetypeName);
|
||||||
basetype = InvalidOid;
|
basetype = InvalidOid;
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ AggregateCreate(char *aggName,
|
||||||
ObjectIdGetDatum(basetype),
|
ObjectIdGetDatum(basetype),
|
||||||
0, 0))
|
0, 0))
|
||||||
elog(ERROR,
|
elog(ERROR,
|
||||||
"AggregateCreate: aggregate '%s' with base type '%s' already exists",
|
"aggregate function \"%s\" with base type %s already exists",
|
||||||
aggName, aggbasetypeName);
|
aggName, aggbasetypeName);
|
||||||
|
|
||||||
/* handle transtype */
|
/* handle transtype */
|
||||||
|
@ -107,7 +107,7 @@ AggregateCreate(char *aggName,
|
||||||
PointerGetDatum(aggtranstypeName),
|
PointerGetDatum(aggtranstypeName),
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
if (!OidIsValid(transtype))
|
if (!OidIsValid(transtype))
|
||||||
elog(ERROR, "AggregateCreate: Type '%s' undefined",
|
elog(ERROR, "data type %s does not exit",
|
||||||
aggtranstypeName);
|
aggtranstypeName);
|
||||||
|
|
||||||
/* handle transfn */
|
/* handle transfn */
|
||||||
|
@ -130,7 +130,7 @@ AggregateCreate(char *aggName,
|
||||||
Assert(OidIsValid(transfn));
|
Assert(OidIsValid(transfn));
|
||||||
proc = (Form_pg_proc) GETSTRUCT(tup);
|
proc = (Form_pg_proc) GETSTRUCT(tup);
|
||||||
if (proc->prorettype != transtype)
|
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);
|
aggtransfnName, aggtranstypeName);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -143,7 +143,7 @@ AggregateCreate(char *aggName,
|
||||||
{
|
{
|
||||||
if (basetype != transtype &&
|
if (basetype != transtype &&
|
||||||
!IS_BINARY_COMPATIBLE(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);
|
ReleaseSysCache(tup);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* NOTES
|
||||||
* these routines moved here from commands/define.c and somewhat cleaned up.
|
* these routines moved here from commands/define.c and somewhat cleaned up.
|
||||||
|
@ -174,8 +174,8 @@ OperatorGet(char *operatorName,
|
||||||
leftObjectId = TypeGet(leftTypeName, &leftDefined);
|
leftObjectId = TypeGet(leftTypeName, &leftDefined);
|
||||||
|
|
||||||
if (!OidIsValid(leftObjectId) || !leftDefined)
|
if (!OidIsValid(leftObjectId) || !leftDefined)
|
||||||
elog(ERROR, "OperatorGet: left type \"%s\" does not exist",
|
elog(ERROR, "left type \"%s\" of operator %s does not exist",
|
||||||
leftTypeName);
|
leftTypeName, operatorName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rightTypeName)
|
if (rightTypeName)
|
||||||
|
@ -183,13 +183,13 @@ OperatorGet(char *operatorName,
|
||||||
rightObjectId = TypeGet(rightTypeName, &rightDefined);
|
rightObjectId = TypeGet(rightTypeName, &rightDefined);
|
||||||
|
|
||||||
if (!OidIsValid(rightObjectId) || !rightDefined)
|
if (!OidIsValid(rightObjectId) || !rightDefined)
|
||||||
elog(ERROR, "OperatorGet: right type \"%s\" does not exist",
|
elog(ERROR, "right type \"%s\" of operator %s does not exist",
|
||||||
rightTypeName);
|
rightTypeName, operatorName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!((OidIsValid(leftObjectId) && leftDefined) ||
|
if (!((OidIsValid(leftObjectId) && leftDefined) ||
|
||||||
(OidIsValid(rightObjectId) && rightDefined)))
|
(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
|
* open the pg_operator relation
|
||||||
|
@ -330,7 +330,7 @@ OperatorShellMake(char *operatorName,
|
||||||
|
|
||||||
if (!((OidIsValid(leftObjectId) && leftDefined) ||
|
if (!((OidIsValid(leftObjectId) && leftDefined) ||
|
||||||
(OidIsValid(rightObjectId) && rightDefined)))
|
(OidIsValid(rightObjectId) && rightDefined)))
|
||||||
elog(ERROR, "OperatorShellMake: no valid argument types??");
|
elog(ERROR, "OperatorShellMake: the operand types are not valid");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* open pg_operator
|
* open pg_operator
|
||||||
|
@ -494,7 +494,7 @@ OperatorDef(char *operatorName,
|
||||||
leftTypeId = TypeGet(leftTypeName, &leftDefined);
|
leftTypeId = TypeGet(leftTypeName, &leftDefined);
|
||||||
|
|
||||||
if (!OidIsValid(leftTypeId) || !leftDefined)
|
if (!OidIsValid(leftTypeId) || !leftDefined)
|
||||||
elog(ERROR, "OperatorDef: left type \"%s\" does not exist",
|
elog(ERROR, "left type \"%s\" does not exist",
|
||||||
leftTypeName);
|
leftTypeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -503,13 +503,13 @@ OperatorDef(char *operatorName,
|
||||||
rightTypeId = TypeGet(rightTypeName, &rightDefined);
|
rightTypeId = TypeGet(rightTypeName, &rightDefined);
|
||||||
|
|
||||||
if (!OidIsValid(rightTypeId) || !rightDefined)
|
if (!OidIsValid(rightTypeId) || !rightDefined)
|
||||||
elog(ERROR, "OperatorDef: right type \"%s\" does not exist",
|
elog(ERROR, "right type \"%s\" does not exist",
|
||||||
rightTypeName);
|
rightTypeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!((OidIsValid(leftTypeId) && leftDefined) ||
|
if (!((OidIsValid(leftTypeId) && leftDefined) ||
|
||||||
(OidIsValid(rightTypeId) && rightDefined)))
|
(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)
|
for (i = 0; i < Natts_pg_operator; ++i)
|
||||||
{
|
{
|
||||||
|
@ -717,7 +717,7 @@ OperatorDef(char *operatorName,
|
||||||
*/
|
*/
|
||||||
if (j != 0)
|
if (j != 0)
|
||||||
elog(ERROR,
|
elog(ERROR,
|
||||||
"OperatorDef: operator can't be its own negator or sort op");
|
"operator cannot be its own negator or sort operator");
|
||||||
selfCommutator = true;
|
selfCommutator = true;
|
||||||
values[i++] = ObjectIdGetDatum(InvalidOid);
|
values[i++] = ObjectIdGetDatum(InvalidOid);
|
||||||
}
|
}
|
||||||
|
@ -772,7 +772,7 @@ OperatorDef(char *operatorName,
|
||||||
simple_heap_update(pg_operator_desc, &tup->t_self, tup);
|
simple_heap_update(pg_operator_desc, &tup->t_self, tup);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
elog(ERROR, "OperatorDef: no operator %u", operatorObjectId);
|
elog(ERROR, "OperatorDef: operator %u not found", operatorObjectId);
|
||||||
|
|
||||||
heap_endscan(pg_operator_scan);
|
heap_endscan(pg_operator_scan);
|
||||||
}
|
}
|
||||||
|
@ -1023,19 +1023,19 @@ OperatorCreate(char *operatorName,
|
||||||
char *rightSortName)
|
char *rightSortName)
|
||||||
{
|
{
|
||||||
if (!leftTypeName && !rightTypeName)
|
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 (!(leftTypeName && rightTypeName))
|
||||||
{
|
{
|
||||||
/* If it's not a binary op, these things mustn't be set: */
|
/* If it's not a binary op, these things mustn't be set: */
|
||||||
if (commutatorName)
|
if (commutatorName)
|
||||||
elog(ERROR, "OperatorCreate: only binary operators can have commutators");
|
elog(ERROR, "only binary operators can have commutators");
|
||||||
if (joinName)
|
if (joinName)
|
||||||
elog(ERROR, "OperatorCreate: only binary operators can have join selectivity");
|
elog(ERROR, "only binary operators can have join selectivity");
|
||||||
if (canHash)
|
if (canHash)
|
||||||
elog(ERROR, "OperatorCreate: only binary operators can hash");
|
elog(ERROR, "only binary operators can hash");
|
||||||
if (leftSortName || rightSortName)
|
if (leftSortName || rightSortName)
|
||||||
elog(ERROR, "OperatorCreate: only binary operators can have sort links");
|
elog(ERROR, "only binary operators can have sort links");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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),
|
PointerGetDatum(languageName),
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
if (!OidIsValid(languageObjectId))
|
if (!OidIsValid(languageObjectId))
|
||||||
elog(ERROR, "ProcedureCreate: no such language '%s'", languageName);
|
elog(ERROR, "language '%s' does not exist", languageName);
|
||||||
|
|
||||||
parameterCount = 0;
|
parameterCount = 0;
|
||||||
MemSet(typev, 0, FUNC_MAX_ARGS * sizeof(Oid));
|
MemSet(typev, 0, FUNC_MAX_ARGS * sizeof(Oid));
|
||||||
|
@ -93,13 +93,13 @@ ProcedureCreate(char *procedureName,
|
||||||
char *typnam = TypeNameToInternalName(t);
|
char *typnam = TypeNameToInternalName(t);
|
||||||
|
|
||||||
if (parameterCount >= FUNC_MAX_ARGS)
|
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);
|
FUNC_MAX_ARGS);
|
||||||
|
|
||||||
if (strcmp(typnam, "opaque") == 0)
|
if (strcmp(typnam, "opaque") == 0)
|
||||||
{
|
{
|
||||||
if (languageObjectId == SQLlanguageId)
|
if (languageObjectId == SQLlanguageId)
|
||||||
elog(ERROR, "ProcedureCreate: sql functions cannot take type \"opaque\"");
|
elog(ERROR, "SQL functions cannot have arguments of type \"opaque\"");
|
||||||
toid = InvalidOid;
|
toid = InvalidOid;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -107,15 +107,15 @@ ProcedureCreate(char *procedureName,
|
||||||
toid = TypeGet(typnam, &defined);
|
toid = TypeGet(typnam, &defined);
|
||||||
|
|
||||||
if (!OidIsValid(toid))
|
if (!OidIsValid(toid))
|
||||||
elog(ERROR, "ProcedureCreate: arg type '%s' is not defined",
|
elog(ERROR, "argument type %s does not exist",
|
||||||
typnam);
|
typnam);
|
||||||
if (!defined)
|
if (!defined)
|
||||||
elog(NOTICE, "ProcedureCreate: arg type '%s' is only a shell",
|
elog(NOTICE, "argument type %s is only a shell",
|
||||||
typnam);
|
typnam);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t->setof)
|
if (t->setof)
|
||||||
elog(ERROR, "ProcedureCreate: functions cannot accept set arguments");
|
elog(ERROR, "functions cannot accept set arguments");
|
||||||
|
|
||||||
typev[parameterCount++] = toid;
|
typev[parameterCount++] = toid;
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ ProcedureCreate(char *procedureName,
|
||||||
UInt16GetDatum(parameterCount),
|
UInt16GetDatum(parameterCount),
|
||||||
PointerGetDatum(typev),
|
PointerGetDatum(typev),
|
||||||
0))
|
0))
|
||||||
elog(ERROR, "ProcedureCreate: procedure %s already exists with same arguments",
|
elog(ERROR, "function %s already exists with same argument types",
|
||||||
procedureName);
|
procedureName);
|
||||||
|
|
||||||
if (languageObjectId == SQLlanguageId)
|
if (languageObjectId == SQLlanguageId)
|
||||||
|
@ -171,7 +171,7 @@ ProcedureCreate(char *procedureName,
|
||||||
if (strcmp(returnTypeName, "opaque") == 0)
|
if (strcmp(returnTypeName, "opaque") == 0)
|
||||||
{
|
{
|
||||||
if (languageObjectId == SQLlanguageId)
|
if (languageObjectId == SQLlanguageId)
|
||||||
elog(ERROR, "ProcedureCreate: sql functions cannot return type \"opaque\"");
|
elog(ERROR, "SQL functions cannot return type \"opaque\"");
|
||||||
typeObjectId = InvalidOid;
|
typeObjectId = InvalidOid;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -180,15 +180,15 @@ ProcedureCreate(char *procedureName,
|
||||||
|
|
||||||
if (!OidIsValid(typeObjectId))
|
if (!OidIsValid(typeObjectId))
|
||||||
{
|
{
|
||||||
elog(NOTICE, "ProcedureCreate: type '%s' is not yet defined",
|
elog(NOTICE, "ProcedureCreate: type %s is not yet defined",
|
||||||
returnTypeName);
|
returnTypeName);
|
||||||
typeObjectId = TypeShellMake(returnTypeName);
|
typeObjectId = TypeShellMake(returnTypeName);
|
||||||
if (!OidIsValid(typeObjectId))
|
if (!OidIsValid(typeObjectId))
|
||||||
elog(ERROR, "ProcedureCreate: could not create type '%s'",
|
elog(ERROR, "could not create type %s",
|
||||||
returnTypeName);
|
returnTypeName);
|
||||||
}
|
}
|
||||||
else if (!defined)
|
else if (!defined)
|
||||||
elog(NOTICE, "ProcedureCreate: return type '%s' is only a shell",
|
elog(NOTICE, "return type %s is only a shell",
|
||||||
returnTypeName);
|
returnTypeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ ProcedureCreate(char *procedureName,
|
||||||
prosrc = procedureName;
|
prosrc = procedureName;
|
||||||
if (fmgr_internal_function(prosrc) == InvalidOid)
|
if (fmgr_internal_function(prosrc) == InvalidOid)
|
||||||
elog(ERROR,
|
elog(ERROR,
|
||||||
"ProcedureCreate: there is no builtin function named \"%s\"",
|
"there is no built-in function named \"%s\"",
|
||||||
prosrc);
|
prosrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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);
|
typeObjectId = TypeGet(typeName, &defined);
|
||||||
if (OidIsValid(typeObjectId) &&
|
if (OidIsValid(typeObjectId) &&
|
||||||
(defined || assignedTypeOid != InvalidOid))
|
(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
|
* if this type has an associated elementType, then we check that it
|
||||||
|
@ -314,7 +314,7 @@ TypeCreate(char *typeName,
|
||||||
{
|
{
|
||||||
elementObjectId = TypeGet(elementTypeName, &defined);
|
elementObjectId = TypeGet(elementTypeName, &defined);
|
||||||
if (!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? */
|
/* should not happen given prior test? */
|
||||||
if (assignedTypeOid != InvalidOid)
|
if (assignedTypeOid != InvalidOid)
|
||||||
elog(ERROR, "TypeCreate: type %s already defined", typeName);
|
elog(ERROR, "type %s already exists", typeName);
|
||||||
|
|
||||||
tup = heap_modifytuple(tup,
|
tup = heap_modifytuple(tup,
|
||||||
pg_type_desc,
|
pg_type_desc,
|
||||||
|
@ -530,12 +530,12 @@ TypeRename(const char *oldTypeName, const char *newTypeName)
|
||||||
PointerGetDatum(oldTypeName),
|
PointerGetDatum(oldTypeName),
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
if (!HeapTupleIsValid(tuple))
|
if (!HeapTupleIsValid(tuple))
|
||||||
elog(ERROR, "TypeRename: type \"%s\" not defined", oldTypeName);
|
elog(ERROR, "type %s does not exist", oldTypeName);
|
||||||
|
|
||||||
if (SearchSysCacheExists(TYPENAME,
|
if (SearchSysCacheExists(TYPENAME,
|
||||||
PointerGetDatum(newTypeName),
|
PointerGetDatum(newTypeName),
|
||||||
0, 0, 0))
|
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);
|
namestrcpy(&(((Form_pg_type) GETSTRUCT(tuple))->typname), newTypeName);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue