mirror of
https://github.com/postgres/postgres.git
synced 2025-05-11 05:41:32 +03:00
ABORT to ERROR in catalog/.
This commit is contained in:
parent
845f82e541
commit
f439eb35b8
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.11 1998/01/05 03:30:22 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.12 1998/01/06 19:42:26 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -132,7 +132,7 @@ newoid()
|
|||||||
|
|
||||||
GetNewObjectId(&lastoid);
|
GetNewObjectId(&lastoid);
|
||||||
if (!OidIsValid(lastoid))
|
if (!OidIsValid(lastoid))
|
||||||
elog(ABORT, "newoid: GetNewObjectId returns invalid oid");
|
elog(ERROR, "newoid: GetNewObjectId returns invalid oid");
|
||||||
return lastoid;
|
return lastoid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ fillatt(TupleDesc tupleDesc)
|
|||||||
AttributeTupleForm *att = tupleDesc->attrs;
|
AttributeTupleForm *att = tupleDesc->attrs;
|
||||||
|
|
||||||
if (natts < 0 || natts > MaxHeapAttributeNumber)
|
if (natts < 0 || natts > MaxHeapAttributeNumber)
|
||||||
elog(ABORT, "fillatt: %d attributes is too large", natts);
|
elog(ERROR, "fillatt: %d attributes is too large", natts);
|
||||||
if (natts == 0)
|
if (natts == 0)
|
||||||
{
|
{
|
||||||
elog(DEBUG, "fillatt: called with natts == 0");
|
elog(DEBUG, "fillatt: called with natts == 0");
|
||||||
@ -178,7 +178,7 @@ fillatt(TupleDesc tupleDesc)
|
|||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
if (!HeapTupleIsValid(tuple))
|
if (!HeapTupleIsValid(tuple))
|
||||||
{
|
{
|
||||||
elog(ABORT, "fillatt: unknown atttypid %ld",
|
elog(ERROR, "fillatt: unknown atttypid %ld",
|
||||||
(*attributeP)->atttypid);
|
(*attributeP)->atttypid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.42 1998/01/05 03:30:27 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.43 1998/01/06 19:42:27 momjian Exp $
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
* heap_create() - Create an uncataloged heap relation
|
* heap_create() - Create an uncataloged heap relation
|
||||||
@ -194,7 +194,7 @@ heap_create(char *name,
|
|||||||
|
|
||||||
if (IsSystemRelationName(relname) && IsNormalProcessingMode())
|
if (IsSystemRelationName(relname) && IsNormalProcessingMode())
|
||||||
{
|
{
|
||||||
elog(ABORT,
|
elog(ERROR,
|
||||||
"Illegal class name: %s -- pg_ is reserved for system catalogs",
|
"Illegal class name: %s -- pg_ is reserved for system catalogs",
|
||||||
relname);
|
relname);
|
||||||
}
|
}
|
||||||
@ -396,7 +396,7 @@ heap_create(char *name,
|
|||||||
*
|
*
|
||||||
* this is used to make certain the tuple descriptor contains a
|
* this is used to make certain the tuple descriptor contains a
|
||||||
* valid set of attribute names. a problem simply generates
|
* valid set of attribute names. a problem simply generates
|
||||||
* elog(ABORT) which aborts the current transaction.
|
* elog(ERROR) which aborts the current transaction.
|
||||||
* --------------------------------
|
* --------------------------------
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
@ -421,7 +421,7 @@ CheckAttributeNames(TupleDesc tupdesc)
|
|||||||
if (nameeq(&(HeapAtt[j]->attname),
|
if (nameeq(&(HeapAtt[j]->attname),
|
||||||
&(tupdesc->attrs[i]->attname)))
|
&(tupdesc->attrs[i]->attname)))
|
||||||
{
|
{
|
||||||
elog(ABORT,
|
elog(ERROR,
|
||||||
"create: system attribute named \"%s\"",
|
"create: system attribute named \"%s\"",
|
||||||
HeapAtt[j]->attname.data);
|
HeapAtt[j]->attname.data);
|
||||||
}
|
}
|
||||||
@ -445,7 +445,7 @@ CheckAttributeNames(TupleDesc tupdesc)
|
|||||||
if (nameeq(&(tupdesc->attrs[j]->attname),
|
if (nameeq(&(tupdesc->attrs[j]->attname),
|
||||||
&(tupdesc->attrs[i]->attname)))
|
&(tupdesc->attrs[i]->attname)))
|
||||||
{
|
{
|
||||||
elog(ABORT,
|
elog(ERROR,
|
||||||
"create: repeated attribute \"%s\"",
|
"create: repeated attribute \"%s\"",
|
||||||
tupdesc->attrs[j]->attname.data);
|
tupdesc->attrs[j]->attname.data);
|
||||||
}
|
}
|
||||||
@ -762,7 +762,7 @@ heap_create_with_catalog(char relname[],
|
|||||||
*/
|
*/
|
||||||
AssertState(IsNormalProcessingMode() || IsBootstrapProcessingMode());
|
AssertState(IsNormalProcessingMode() || IsBootstrapProcessingMode());
|
||||||
if (natts == 0 || natts > MaxHeapAttributeNumber)
|
if (natts == 0 || natts > MaxHeapAttributeNumber)
|
||||||
elog(ABORT, "amcreate: from 1 to %d attributes must be specified",
|
elog(ERROR, "amcreate: from 1 to %d attributes must be specified",
|
||||||
MaxHeapAttributeNumber);
|
MaxHeapAttributeNumber);
|
||||||
|
|
||||||
CheckAttributeNames(tupdesc);
|
CheckAttributeNames(tupdesc);
|
||||||
@ -777,7 +777,7 @@ heap_create_with_catalog(char relname[],
|
|||||||
if (RelationAlreadyExists(pg_class_desc, relname))
|
if (RelationAlreadyExists(pg_class_desc, relname))
|
||||||
{
|
{
|
||||||
heap_close(pg_class_desc);
|
heap_close(pg_class_desc);
|
||||||
elog(ABORT, "amcreate: %s relation already exists", relname);
|
elog(ERROR, "amcreate: %s relation already exists", relname);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
@ -910,7 +910,7 @@ RelationRemoveInheritance(Relation relation)
|
|||||||
heap_endscan(scan);
|
heap_endscan(scan);
|
||||||
heap_close(catalogRelation);
|
heap_close(catalogRelation);
|
||||||
|
|
||||||
elog(ABORT, "relation <%d> inherits \"%s\"",
|
elog(ERROR, "relation <%d> inherits \"%s\"",
|
||||||
((InheritsTupleForm) GETSTRUCT(tuple))->inhrel,
|
((InheritsTupleForm) GETSTRUCT(tuple))->inhrel,
|
||||||
RelationGetRelationName(relation));
|
RelationGetRelationName(relation));
|
||||||
}
|
}
|
||||||
@ -1054,7 +1054,7 @@ DeletePgRelationTuple(Relation rdesc)
|
|||||||
{
|
{
|
||||||
heap_endscan(pg_class_scan);
|
heap_endscan(pg_class_scan);
|
||||||
heap_close(pg_class_desc);
|
heap_close(pg_class_desc);
|
||||||
elog(ABORT, "DeletePgRelationTuple: %s relation nonexistent",
|
elog(ERROR, "DeletePgRelationTuple: %s relation nonexistent",
|
||||||
&rdesc->rd_rel->relname);
|
&rdesc->rd_rel->relname);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1187,7 +1187,7 @@ DeletePgTypeTuple(Relation rdesc)
|
|||||||
{
|
{
|
||||||
heap_endscan(pg_type_scan);
|
heap_endscan(pg_type_scan);
|
||||||
heap_close(pg_type_desc);
|
heap_close(pg_type_desc);
|
||||||
elog(ABORT, "DeletePgTypeTuple: %s type nonexistent",
|
elog(ERROR, "DeletePgTypeTuple: %s type nonexistent",
|
||||||
&rdesc->rd_rel->relname);
|
&rdesc->rd_rel->relname);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1229,7 +1229,7 @@ DeletePgTypeTuple(Relation rdesc)
|
|||||||
heap_endscan(pg_attribute_scan);
|
heap_endscan(pg_attribute_scan);
|
||||||
heap_close(pg_attribute_desc);
|
heap_close(pg_attribute_desc);
|
||||||
|
|
||||||
elog(ABORT, "DeletePgTypeTuple: att of type %s exists in relation %d",
|
elog(ERROR, "DeletePgTypeTuple: att of type %s exists in relation %d",
|
||||||
&rdesc->rd_rel->relname, relid);
|
&rdesc->rd_rel->relname, relid);
|
||||||
}
|
}
|
||||||
heap_endscan(pg_attribute_scan);
|
heap_endscan(pg_attribute_scan);
|
||||||
@ -1265,7 +1265,7 @@ heap_destroy_with_catalog(char *relname)
|
|||||||
*/
|
*/
|
||||||
rdesc = heap_openr(relname);
|
rdesc = heap_openr(relname);
|
||||||
if (rdesc == NULL)
|
if (rdesc == NULL)
|
||||||
elog(ABORT, "Relation %s Does Not Exist!", relname);
|
elog(ERROR, "Relation %s Does Not Exist!", relname);
|
||||||
|
|
||||||
RelationSetLockForWrite(rdesc);
|
RelationSetLockForWrite(rdesc);
|
||||||
rid = rdesc->rd_id;
|
rid = rdesc->rd_id;
|
||||||
@ -1275,7 +1275,7 @@ heap_destroy_with_catalog(char *relname)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
if (IsSystemRelationName(RelationGetRelationName(rdesc)->data))
|
if (IsSystemRelationName(RelationGetRelationName(rdesc)->data))
|
||||||
elog(ABORT, "amdestroy: cannot destroy %s relation",
|
elog(ERROR, "amdestroy: cannot destroy %s relation",
|
||||||
&rdesc->rd_rel->relname);
|
&rdesc->rd_rel->relname);
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
@ -1516,7 +1516,7 @@ start:;
|
|||||||
|
|
||||||
if (length(query->rtable) > 1 ||
|
if (length(query->rtable) > 1 ||
|
||||||
flatten_tlist(query->targetList) != NIL)
|
flatten_tlist(query->targetList) != NIL)
|
||||||
elog(ABORT, "DEFAULT: cannot use attribute(s)");
|
elog(ERROR, "DEFAULT: cannot use attribute(s)");
|
||||||
te = (TargetEntry *) lfirst(query->targetList);
|
te = (TargetEntry *) lfirst(query->targetList);
|
||||||
resdom = te->resdom;
|
resdom = te->resdom;
|
||||||
expr = te->expr;
|
expr = te->expr;
|
||||||
@ -1526,13 +1526,13 @@ start:;
|
|||||||
if (((Const *) expr)->consttype != atp->atttypid)
|
if (((Const *) expr)->consttype != atp->atttypid)
|
||||||
{
|
{
|
||||||
if (*cast != 0)
|
if (*cast != 0)
|
||||||
elog(ABORT, "DEFAULT: const type mismatched");
|
elog(ERROR, "DEFAULT: const type mismatched");
|
||||||
sprintf(cast, ":: %s", typeidTypeName(atp->atttypid));
|
sprintf(cast, ":: %s", typeidTypeName(atp->atttypid));
|
||||||
goto start;
|
goto start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (exprType(expr) != atp->atttypid)
|
else if (exprType(expr) != atp->atttypid)
|
||||||
elog(ABORT, "DEFAULT: type mismatched");
|
elog(ERROR, "DEFAULT: type mismatched");
|
||||||
|
|
||||||
adbin = nodeToString(expr);
|
adbin = nodeToString(expr);
|
||||||
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
|
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
|
||||||
@ -1585,7 +1585,7 @@ StoreRelCheck(Relation rel, ConstrCheck *check)
|
|||||||
query = (Query *) (queryTree_list->qtrees[0]);
|
query = (Query *) (queryTree_list->qtrees[0]);
|
||||||
|
|
||||||
if (length(query->rtable) > 1)
|
if (length(query->rtable) > 1)
|
||||||
elog(ABORT, "CHECK: only relation %.*s can be referenced",
|
elog(ERROR, "CHECK: only relation %.*s can be referenced",
|
||||||
NAMEDATALEN, rel->rd_rel->relname.data);
|
NAMEDATALEN, rel->rd_rel->relname.data);
|
||||||
|
|
||||||
plan = (Plan *) lfirst(planTree_list);
|
plan = (Plan *) lfirst(planTree_list);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.32 1998/01/05 03:30:30 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.33 1998/01/06 19:42:29 momjian Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
@ -237,7 +237,7 @@ GetHeapRelationOid(char *heapRelationName, char *indexRelationName)
|
|||||||
false);
|
false);
|
||||||
|
|
||||||
if (OidIsValid(indoid))
|
if (OidIsValid(indoid))
|
||||||
elog(ABORT, "Cannot create index: '%s' already exists",
|
elog(ERROR, "Cannot create index: '%s' already exists",
|
||||||
indexRelationName);
|
indexRelationName);
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
@ -253,7 +253,7 @@ GetHeapRelationOid(char *heapRelationName, char *indexRelationName)
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
if (!OidIsValid(heapoid))
|
if (!OidIsValid(heapoid))
|
||||||
elog(ABORT, "Cannot create index on '%s': relation does not exist",
|
elog(ERROR, "Cannot create index on '%s': relation does not exist",
|
||||||
heapRelationName);
|
heapRelationName);
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
@ -306,7 +306,7 @@ BuildFuncTupleDesc(FuncIndexInfo *funcInfo)
|
|||||||
ObjectIdGetDatum(retType),
|
ObjectIdGetDatum(retType),
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
if (!HeapTupleIsValid(tuple))
|
if (!HeapTupleIsValid(tuple))
|
||||||
elog(ABORT, "Function %s return type does not exist", FIgetname(funcInfo));
|
elog(ERROR, "Function %s return type does not exist", FIgetname(funcInfo));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Assign some of the attributes values. Leave the rest as 0.
|
* Assign some of the attributes values. Leave the rest as 0.
|
||||||
@ -374,7 +374,7 @@ ConstructTupleDescriptor(Oid heapoid,
|
|||||||
*/
|
*/
|
||||||
atnum = attNums[i];
|
atnum = attNums[i];
|
||||||
if (atnum > natts)
|
if (atnum > natts)
|
||||||
elog(ABORT, "Cannot create index: attribute %d does not exist",
|
elog(ERROR, "Cannot create index: attribute %d does not exist",
|
||||||
atnum);
|
atnum);
|
||||||
if (attributeList)
|
if (attributeList)
|
||||||
{
|
{
|
||||||
@ -404,7 +404,7 @@ ConstructTupleDescriptor(Oid heapoid,
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
if (atnum <= FirstLowInvalidHeapAttributeNumber || atnum >= 0)
|
if (atnum <= FirstLowInvalidHeapAttributeNumber || atnum >= 0)
|
||||||
elog(ABORT, "Cannot create index on system attribute: attribute number out of range (%d)", atnum);
|
elog(ERROR, "Cannot create index on system attribute: attribute number out of range (%d)", atnum);
|
||||||
atind = (-atnum) - 1;
|
atind = (-atnum) - 1;
|
||||||
|
|
||||||
from = (char *) (&sysatts[atind]);
|
from = (char *) (&sysatts[atind]);
|
||||||
@ -450,7 +450,7 @@ ConstructTupleDescriptor(Oid heapoid,
|
|||||||
PointerGetDatum(IndexKeyType->name),
|
PointerGetDatum(IndexKeyType->name),
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
if (!HeapTupleIsValid(tup))
|
if (!HeapTupleIsValid(tup))
|
||||||
elog(ABORT, "create index: type '%s' undefined",
|
elog(ERROR, "create index: type '%s' undefined",
|
||||||
IndexKeyType->name);
|
IndexKeyType->name);
|
||||||
((AttributeTupleForm) to)->atttypid = tup->t_oid;
|
((AttributeTupleForm) to)->atttypid = tup->t_oid;
|
||||||
((AttributeTupleForm) to)->attbyval =
|
((AttributeTupleForm) to)->attbyval =
|
||||||
@ -1082,7 +1082,7 @@ index_create(char *heapRelationName,
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
if (numatts < 1)
|
if (numatts < 1)
|
||||||
elog(ABORT, "must index at least one attribute");
|
elog(ERROR, "must index at least one attribute");
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* get heap relation oid and open the heap relation
|
* get heap relation oid and open the heap relation
|
||||||
@ -1297,7 +1297,7 @@ index_destroy(Oid indexId)
|
|||||||
* physically remove the file
|
* physically remove the file
|
||||||
*/
|
*/
|
||||||
if (FileNameUnlink(relpath(indexRelation->rd_rel->relname.data)) < 0)
|
if (FileNameUnlink(relpath(indexRelation->rd_rel->relname.data)) < 0)
|
||||||
elog(ABORT, "amdestroyr: unlink: %m");
|
elog(ERROR, "amdestroyr: unlink: %m");
|
||||||
|
|
||||||
index_close(indexRelation);
|
index_close(indexRelation);
|
||||||
}
|
}
|
||||||
@ -1398,7 +1398,7 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
|
|||||||
whichRel = RelationIdGetRelation(relid);
|
whichRel = RelationIdGetRelation(relid);
|
||||||
|
|
||||||
if (!RelationIsValid(whichRel))
|
if (!RelationIsValid(whichRel))
|
||||||
elog(ABORT, "UpdateStats: cannot open relation id %d", relid);
|
elog(ERROR, "UpdateStats: cannot open relation id %d", relid);
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* Find the RELATION relation tuple for the given relation.
|
* Find the RELATION relation tuple for the given relation.
|
||||||
@ -1407,7 +1407,7 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
|
|||||||
pg_class = heap_openr(RelationRelationName);
|
pg_class = heap_openr(RelationRelationName);
|
||||||
if (!RelationIsValid(pg_class))
|
if (!RelationIsValid(pg_class))
|
||||||
{
|
{
|
||||||
elog(ABORT, "UpdateStats: could not open RELATION relation");
|
elog(ERROR, "UpdateStats: could not open RELATION relation");
|
||||||
}
|
}
|
||||||
key[0].sk_argument = ObjectIdGetDatum(relid);
|
key[0].sk_argument = ObjectIdGetDatum(relid);
|
||||||
|
|
||||||
@ -1417,7 +1417,7 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
|
|||||||
if (!HeapScanIsValid(pg_class_scan))
|
if (!HeapScanIsValid(pg_class_scan))
|
||||||
{
|
{
|
||||||
heap_close(pg_class);
|
heap_close(pg_class);
|
||||||
elog(ABORT, "UpdateStats: cannot scan RELATION relation");
|
elog(ERROR, "UpdateStats: cannot scan RELATION relation");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if the heap_open above succeeded, then so will this heap_getnext() */
|
/* if the heap_open above succeeded, then so will this heap_getnext() */
|
||||||
@ -1784,7 +1784,7 @@ IndexIsUnique(Oid indexId)
|
|||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
if (!HeapTupleIsValid(tuple))
|
if (!HeapTupleIsValid(tuple))
|
||||||
{
|
{
|
||||||
elog(ABORT, "IndexIsUnique: can't find index id %d",
|
elog(ERROR, "IndexIsUnique: can't find index id %d",
|
||||||
indexId);
|
indexId);
|
||||||
}
|
}
|
||||||
index = (IndexTupleForm) GETSTRUCT(tuple);
|
index = (IndexTupleForm) GETSTRUCT(tuple);
|
||||||
@ -1827,7 +1827,7 @@ IndexIsUniqueNoCache(Oid indexId)
|
|||||||
tuple = heap_getnext(scandesc, 0, NULL);
|
tuple = heap_getnext(scandesc, 0, NULL);
|
||||||
if (!HeapTupleIsValid(tuple))
|
if (!HeapTupleIsValid(tuple))
|
||||||
{
|
{
|
||||||
elog(ABORT, "IndexIsUniqueNoCache: can't find index id %d",
|
elog(ERROR, "IndexIsUniqueNoCache: can't find index id %d",
|
||||||
indexId);
|
indexId);
|
||||||
}
|
}
|
||||||
index = (IndexTupleForm) GETSTRUCT(tuple);
|
index = (IndexTupleForm) GETSTRUCT(tuple);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.10 1998/01/05 03:30:32 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.11 1998/01/06 19:42:30 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -84,16 +84,16 @@ AggregateCreate(char *aggName,
|
|||||||
|
|
||||||
/* sanity checks */
|
/* sanity checks */
|
||||||
if (!aggName)
|
if (!aggName)
|
||||||
elog(ABORT, "AggregateCreate: no aggregate name supplied");
|
elog(ERROR, "AggregateCreate: no aggregate name supplied");
|
||||||
|
|
||||||
if (!aggtransfn1Name && !aggtransfn2Name)
|
if (!aggtransfn1Name && !aggtransfn2Name)
|
||||||
elog(ABORT, "AggregateCreate: aggregate must have at least one transition function");
|
elog(ERROR, "AggregateCreate: aggregate must have at least one transition function");
|
||||||
|
|
||||||
tup = SearchSysCacheTuple(TYPNAME,
|
tup = SearchSysCacheTuple(TYPNAME,
|
||||||
PointerGetDatum(aggbasetypeName),
|
PointerGetDatum(aggbasetypeName),
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
if (!HeapTupleIsValid(tup))
|
if (!HeapTupleIsValid(tup))
|
||||||
elog(ABORT, "AggregateCreate: Type '%s' undefined", aggbasetypeName);
|
elog(ERROR, "AggregateCreate: Type '%s' undefined", aggbasetypeName);
|
||||||
xbase = tup->t_oid;
|
xbase = tup->t_oid;
|
||||||
|
|
||||||
if (aggtransfn1Name)
|
if (aggtransfn1Name)
|
||||||
@ -102,7 +102,7 @@ AggregateCreate(char *aggName,
|
|||||||
PointerGetDatum(aggtransfn1typeName),
|
PointerGetDatum(aggtransfn1typeName),
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
if (!HeapTupleIsValid(tup))
|
if (!HeapTupleIsValid(tup))
|
||||||
elog(ABORT, "AggregateCreate: Type '%s' undefined",
|
elog(ERROR, "AggregateCreate: Type '%s' undefined",
|
||||||
aggtransfn1typeName);
|
aggtransfn1typeName);
|
||||||
xret1 = tup->t_oid;
|
xret1 = tup->t_oid;
|
||||||
|
|
||||||
@ -114,16 +114,16 @@ AggregateCreate(char *aggName,
|
|||||||
PointerGetDatum(fnArgs),
|
PointerGetDatum(fnArgs),
|
||||||
0);
|
0);
|
||||||
if (!HeapTupleIsValid(tup))
|
if (!HeapTupleIsValid(tup))
|
||||||
elog(ABORT, "AggregateCreate: '%s('%s', '%s') does not exist",
|
elog(ERROR, "AggregateCreate: '%s('%s', '%s') does not exist",
|
||||||
aggtransfn1Name, aggtransfn1typeName, aggbasetypeName);
|
aggtransfn1Name, aggtransfn1typeName, aggbasetypeName);
|
||||||
if (((Form_pg_proc) GETSTRUCT(tup))->prorettype != xret1)
|
if (((Form_pg_proc) GETSTRUCT(tup))->prorettype != xret1)
|
||||||
elog(ABORT, "AggregateCreate: return type of '%s' is not '%s'",
|
elog(ERROR, "AggregateCreate: return type of '%s' is not '%s'",
|
||||||
aggtransfn1Name,
|
aggtransfn1Name,
|
||||||
aggtransfn1typeName);
|
aggtransfn1typeName);
|
||||||
xfn1 = tup->t_oid;
|
xfn1 = tup->t_oid;
|
||||||
if (!OidIsValid(xfn1) || !OidIsValid(xret1) ||
|
if (!OidIsValid(xfn1) || !OidIsValid(xret1) ||
|
||||||
!OidIsValid(xbase))
|
!OidIsValid(xbase))
|
||||||
elog(ABORT, "AggregateCreate: bogus function '%s'", aggfinalfnName);
|
elog(ERROR, "AggregateCreate: bogus function '%s'", aggfinalfnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aggtransfn2Name)
|
if (aggtransfn2Name)
|
||||||
@ -132,7 +132,7 @@ AggregateCreate(char *aggName,
|
|||||||
PointerGetDatum(aggtransfn2typeName),
|
PointerGetDatum(aggtransfn2typeName),
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
if (!HeapTupleIsValid(tup))
|
if (!HeapTupleIsValid(tup))
|
||||||
elog(ABORT, "AggregateCreate: Type '%s' undefined",
|
elog(ERROR, "AggregateCreate: Type '%s' undefined",
|
||||||
aggtransfn2typeName);
|
aggtransfn2typeName);
|
||||||
xret2 = tup->t_oid;
|
xret2 = tup->t_oid;
|
||||||
|
|
||||||
@ -144,30 +144,30 @@ AggregateCreate(char *aggName,
|
|||||||
PointerGetDatum(fnArgs),
|
PointerGetDatum(fnArgs),
|
||||||
0);
|
0);
|
||||||
if (!HeapTupleIsValid(tup))
|
if (!HeapTupleIsValid(tup))
|
||||||
elog(ABORT, "AggregateCreate: '%s'('%s') does not exist",
|
elog(ERROR, "AggregateCreate: '%s'('%s') does not exist",
|
||||||
aggtransfn2Name, aggtransfn2typeName);
|
aggtransfn2Name, aggtransfn2typeName);
|
||||||
if (((Form_pg_proc) GETSTRUCT(tup))->prorettype != xret2)
|
if (((Form_pg_proc) GETSTRUCT(tup))->prorettype != xret2)
|
||||||
elog(ABORT, "AggregateCreate: return type of '%s' is not '%s'",
|
elog(ERROR, "AggregateCreate: return type of '%s' is not '%s'",
|
||||||
aggtransfn2Name, aggtransfn2typeName);
|
aggtransfn2Name, aggtransfn2typeName);
|
||||||
xfn2 = tup->t_oid;
|
xfn2 = tup->t_oid;
|
||||||
if (!OidIsValid(xfn2) || !OidIsValid(xret2))
|
if (!OidIsValid(xfn2) || !OidIsValid(xret2))
|
||||||
elog(ABORT, "AggregateCreate: bogus function '%s'", aggfinalfnName);
|
elog(ERROR, "AggregateCreate: bogus function '%s'", aggfinalfnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
tup = SearchSysCacheTuple(AGGNAME, PointerGetDatum(aggName),
|
tup = SearchSysCacheTuple(AGGNAME, PointerGetDatum(aggName),
|
||||||
ObjectIdGetDatum(xbase),
|
ObjectIdGetDatum(xbase),
|
||||||
0, 0);
|
0, 0);
|
||||||
if (HeapTupleIsValid(tup))
|
if (HeapTupleIsValid(tup))
|
||||||
elog(ABORT,
|
elog(ERROR,
|
||||||
"AggregateCreate: aggregate '%s' with base type '%s' already exists",
|
"AggregateCreate: aggregate '%s' with base type '%s' already exists",
|
||||||
aggName, aggbasetypeName);
|
aggName, aggbasetypeName);
|
||||||
|
|
||||||
/* more sanity checks */
|
/* more sanity checks */
|
||||||
if (aggtransfn1Name && aggtransfn2Name && !aggfinalfnName)
|
if (aggtransfn1Name && aggtransfn2Name && !aggfinalfnName)
|
||||||
elog(ABORT, "AggregateCreate: Aggregate must have final function with both transition functions");
|
elog(ERROR, "AggregateCreate: Aggregate must have final function with both transition functions");
|
||||||
|
|
||||||
if ((!aggtransfn1Name || !aggtransfn2Name) && aggfinalfnName)
|
if ((!aggtransfn1Name || !aggtransfn2Name) && aggfinalfnName)
|
||||||
elog(ABORT, "AggregateCreate: Aggregate cannot have final function without both transition functions");
|
elog(ERROR, "AggregateCreate: Aggregate cannot have final function without both transition functions");
|
||||||
|
|
||||||
if (aggfinalfnName)
|
if (aggfinalfnName)
|
||||||
{
|
{
|
||||||
@ -179,13 +179,13 @@ AggregateCreate(char *aggName,
|
|||||||
PointerGetDatum(fnArgs),
|
PointerGetDatum(fnArgs),
|
||||||
0);
|
0);
|
||||||
if (!HeapTupleIsValid(tup))
|
if (!HeapTupleIsValid(tup))
|
||||||
elog(ABORT, "AggregateCreate: '%s'('%s','%s') does not exist",
|
elog(ERROR, "AggregateCreate: '%s'('%s','%s') does not exist",
|
||||||
aggfinalfnName, aggtransfn1typeName, aggtransfn2typeName);
|
aggfinalfnName, aggtransfn1typeName, aggtransfn2typeName);
|
||||||
ffn = tup->t_oid;
|
ffn = tup->t_oid;
|
||||||
proc = (Form_pg_proc) GETSTRUCT(tup);
|
proc = (Form_pg_proc) GETSTRUCT(tup);
|
||||||
fret = proc->prorettype;
|
fret = proc->prorettype;
|
||||||
if (!OidIsValid(ffn) || !OidIsValid(fret))
|
if (!OidIsValid(ffn) || !OidIsValid(fret))
|
||||||
elog(ABORT, "AggregateCreate: bogus function '%s'", aggfinalfnName);
|
elog(ERROR, "AggregateCreate: bogus function '%s'", aggfinalfnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -194,7 +194,7 @@ AggregateCreate(char *aggName,
|
|||||||
* aggregates to return NULL if they are evaluated on empty sets.
|
* aggregates to return NULL if they are evaluated on empty sets.
|
||||||
*/
|
*/
|
||||||
if (OidIsValid(xfn2) && !agginitval2)
|
if (OidIsValid(xfn2) && !agginitval2)
|
||||||
elog(ABORT, "AggregateCreate: transition function 2 MUST have an initial value");
|
elog(ERROR, "AggregateCreate: transition function 2 MUST have an initial value");
|
||||||
|
|
||||||
/* initialize nulls and values */
|
/* initialize nulls and values */
|
||||||
for (i = 0; i < Natts_pg_aggregate; i++)
|
for (i = 0; i < Natts_pg_aggregate; i++)
|
||||||
@ -253,16 +253,16 @@ AggregateCreate(char *aggName,
|
|||||||
nulls[Anum_pg_aggregate_agginitval2 - 1] = 'n';
|
nulls[Anum_pg_aggregate_agginitval2 - 1] = 'n';
|
||||||
|
|
||||||
if (!RelationIsValid(aggdesc = heap_openr(AggregateRelationName)))
|
if (!RelationIsValid(aggdesc = heap_openr(AggregateRelationName)))
|
||||||
elog(ABORT, "AggregateCreate: could not open '%s'",
|
elog(ERROR, "AggregateCreate: could not open '%s'",
|
||||||
AggregateRelationName);
|
AggregateRelationName);
|
||||||
|
|
||||||
tupDesc = aggdesc->rd_att;
|
tupDesc = aggdesc->rd_att;
|
||||||
if (!HeapTupleIsValid(tup = heap_formtuple(tupDesc,
|
if (!HeapTupleIsValid(tup = heap_formtuple(tupDesc,
|
||||||
values,
|
values,
|
||||||
nulls)))
|
nulls)))
|
||||||
elog(ABORT, "AggregateCreate: heap_formtuple failed");
|
elog(ERROR, "AggregateCreate: heap_formtuple failed");
|
||||||
if (!OidIsValid(heap_insert(aggdesc, tup)))
|
if (!OidIsValid(heap_insert(aggdesc, tup)))
|
||||||
elog(ABORT, "AggregateCreate: heap_insert failed");
|
elog(ERROR, "AggregateCreate: heap_insert failed");
|
||||||
heap_close(aggdesc);
|
heap_close(aggdesc);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -287,7 +287,7 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
|
|||||||
PointerGetDatum(basetype),
|
PointerGetDatum(basetype),
|
||||||
0, 0);
|
0, 0);
|
||||||
if (!HeapTupleIsValid(tup))
|
if (!HeapTupleIsValid(tup))
|
||||||
elog(ABORT, "AggNameGetInitVal: cache lookup failed for aggregate '%s'",
|
elog(ERROR, "AggNameGetInitVal: cache lookup failed for aggregate '%s'",
|
||||||
aggName);
|
aggName);
|
||||||
if (xfuncno == 1)
|
if (xfuncno == 1)
|
||||||
{
|
{
|
||||||
@ -303,7 +303,7 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
|
|||||||
|
|
||||||
aggRel = heap_openr(AggregateRelationName);
|
aggRel = heap_openr(AggregateRelationName);
|
||||||
if (!RelationIsValid(aggRel))
|
if (!RelationIsValid(aggRel))
|
||||||
elog(ABORT, "AggNameGetInitVal: could not open \"%-.*s\"",
|
elog(ERROR, "AggNameGetInitVal: could not open \"%-.*s\"",
|
||||||
AggregateRelationName);
|
AggregateRelationName);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -328,7 +328,7 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
|
|||||||
if (!HeapTupleIsValid(tup))
|
if (!HeapTupleIsValid(tup))
|
||||||
{
|
{
|
||||||
pfree(strInitVal);
|
pfree(strInitVal);
|
||||||
elog(ABORT, "AggNameGetInitVal: cache lookup failed on aggregate transition function return type");
|
elog(ERROR, "AggNameGetInitVal: cache lookup failed on aggregate transition function return type");
|
||||||
}
|
}
|
||||||
initVal = fmgr(((TypeTupleForm) GETSTRUCT(tup))->typinput, strInitVal, -1);
|
initVal = fmgr(((TypeTupleForm) GETSTRUCT(tup))->typinput, strInitVal, -1);
|
||||||
pfree(strInitVal);
|
pfree(strInitVal);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.18 1998/01/05 03:30:32 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.19 1998/01/06 19:42:31 momjian 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.
|
||||||
@ -171,7 +171,7 @@ OperatorGet(char *operatorName,
|
|||||||
leftObjectId = TypeGet(leftTypeName, &leftDefined);
|
leftObjectId = TypeGet(leftTypeName, &leftDefined);
|
||||||
|
|
||||||
if (!OidIsValid(leftObjectId) || !leftDefined)
|
if (!OidIsValid(leftObjectId) || !leftDefined)
|
||||||
elog(ABORT, "OperatorGet: left type '%s' nonexistent", leftTypeName);
|
elog(ERROR, "OperatorGet: left type '%s' nonexistent", leftTypeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rightTypeName)
|
if (rightTypeName)
|
||||||
@ -179,13 +179,13 @@ OperatorGet(char *operatorName,
|
|||||||
rightObjectId = TypeGet(rightTypeName, &rightDefined);
|
rightObjectId = TypeGet(rightTypeName, &rightDefined);
|
||||||
|
|
||||||
if (!OidIsValid(rightObjectId) || !rightDefined)
|
if (!OidIsValid(rightObjectId) || !rightDefined)
|
||||||
elog(ABORT, "OperatorGet: right type '%s' nonexistent",
|
elog(ERROR, "OperatorGet: right type '%s' nonexistent",
|
||||||
rightTypeName);
|
rightTypeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!((OidIsValid(leftObjectId) && leftDefined) ||
|
if (!((OidIsValid(leftObjectId) && leftDefined) ||
|
||||||
(OidIsValid(rightObjectId) && rightDefined)))
|
(OidIsValid(rightObjectId) && rightDefined)))
|
||||||
elog(ABORT, "OperatorGet: no argument types??");
|
elog(ERROR, "OperatorGet: no argument types??");
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* open the pg_operator relation
|
* open the pg_operator relation
|
||||||
@ -327,7 +327,7 @@ OperatorShellMake(char *operatorName,
|
|||||||
|
|
||||||
if (!((OidIsValid(leftObjectId) && leftDefined) ||
|
if (!((OidIsValid(leftObjectId) && leftDefined) ||
|
||||||
(OidIsValid(rightObjectId) && rightDefined)))
|
(OidIsValid(rightObjectId) && rightDefined)))
|
||||||
elog(ABORT, "OperatorShellMake: no valid argument types??");
|
elog(ERROR, "OperatorShellMake: no valid argument types??");
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* open pg_operator
|
* open pg_operator
|
||||||
@ -494,7 +494,7 @@ OperatorDef(char *operatorName,
|
|||||||
rightTypeName);
|
rightTypeName);
|
||||||
|
|
||||||
if (OidIsValid(operatorObjectId) && !definedOK)
|
if (OidIsValid(operatorObjectId) && !definedOK)
|
||||||
elog(ABORT, "OperatorDef: operator \"%s\" already defined",
|
elog(ERROR, "OperatorDef: operator \"%s\" already defined",
|
||||||
operatorName);
|
operatorName);
|
||||||
|
|
||||||
if (leftTypeName)
|
if (leftTypeName)
|
||||||
@ -505,7 +505,7 @@ OperatorDef(char *operatorName,
|
|||||||
|
|
||||||
if (!((OidIsValid(leftTypeId && leftDefined)) ||
|
if (!((OidIsValid(leftTypeId && leftDefined)) ||
|
||||||
(OidIsValid(rightTypeId && rightDefined))))
|
(OidIsValid(rightTypeId && rightDefined))))
|
||||||
elog(ABORT, "OperatorGet: no argument types??");
|
elog(ERROR, "OperatorGet: no argument types??");
|
||||||
|
|
||||||
for (i = 0; i < Natts_pg_operator; ++i)
|
for (i = 0; i < Natts_pg_operator; ++i)
|
||||||
{
|
{
|
||||||
@ -668,7 +668,7 @@ OperatorDef(char *operatorName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!OidIsValid(other_oid))
|
if (!OidIsValid(other_oid))
|
||||||
elog(ABORT,
|
elog(ERROR,
|
||||||
"OperatorDef: can't create operator '%s'",
|
"OperatorDef: can't create operator '%s'",
|
||||||
name[j]);
|
name[j]);
|
||||||
values[i++] = ObjectIdGetDatum(other_oid);
|
values[i++] = ObjectIdGetDatum(other_oid);
|
||||||
@ -719,7 +719,7 @@ OperatorDef(char *operatorName,
|
|||||||
setheapoverride(false);
|
setheapoverride(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
elog(ABORT, "OperatorDef: no operator %d", other_oid);
|
elog(ERROR, "OperatorDef: no operator %d", other_oid);
|
||||||
|
|
||||||
heap_endscan(pg_operator_scan);
|
heap_endscan(pg_operator_scan);
|
||||||
|
|
||||||
@ -994,7 +994,7 @@ OperatorCreate(char *operatorName,
|
|||||||
int definedOK;
|
int definedOK;
|
||||||
|
|
||||||
if (!leftTypeName && !rightTypeName)
|
if (!leftTypeName && !rightTypeName)
|
||||||
elog(ABORT, "OperatorCreate : at least one of leftarg or rightarg must be defined");
|
elog(ERROR, "OperatorCreate : at least one of leftarg or rightarg must be defined");
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* get the oid's of the operator's associated operators, if possible.
|
* get the oid's of the operator's associated operators, if possible.
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.12 1998/01/05 03:30:33 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.13 1998/01/06 19:42:32 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -87,13 +87,13 @@ ProcedureCreate(char *procedureName,
|
|||||||
Value *t = lfirst(x);
|
Value *t = lfirst(x);
|
||||||
|
|
||||||
if (parameterCount == 8)
|
if (parameterCount == 8)
|
||||||
elog(ABORT, "Procedures cannot take more than 8 arguments");
|
elog(ERROR, "Procedures cannot take more than 8 arguments");
|
||||||
|
|
||||||
if (strcmp(strVal(t), "opaque") == 0)
|
if (strcmp(strVal(t), "opaque") == 0)
|
||||||
{
|
{
|
||||||
if (strcmp(languageName, "sql") == 0)
|
if (strcmp(languageName, "sql") == 0)
|
||||||
{
|
{
|
||||||
elog(ABORT, "ProcedureDefine: sql functions cannot take type \"opaque\"");
|
elog(ERROR, "ProcedureDefine: sql functions cannot take type \"opaque\"");
|
||||||
}
|
}
|
||||||
toid = 0;
|
toid = 0;
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ ProcedureCreate(char *procedureName,
|
|||||||
|
|
||||||
if (!OidIsValid(toid))
|
if (!OidIsValid(toid))
|
||||||
{
|
{
|
||||||
elog(ABORT, "ProcedureCreate: arg type '%s' is not defined",
|
elog(ERROR, "ProcedureCreate: arg type '%s' is not defined",
|
||||||
strVal(t));
|
strVal(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ ProcedureCreate(char *procedureName,
|
|||||||
0);
|
0);
|
||||||
|
|
||||||
if (HeapTupleIsValid(tup))
|
if (HeapTupleIsValid(tup))
|
||||||
elog(ABORT, "ProcedureCreate: procedure %s already exists with same arguments",
|
elog(ERROR, "ProcedureCreate: procedure %s already exists with same arguments",
|
||||||
procedureName);
|
procedureName);
|
||||||
|
|
||||||
if (!strcmp(languageName, "sql"))
|
if (!strcmp(languageName, "sql"))
|
||||||
@ -152,7 +152,7 @@ ProcedureCreate(char *procedureName,
|
|||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
|
|
||||||
if (!HeapTupleIsValid(tup))
|
if (!HeapTupleIsValid(tup))
|
||||||
elog(ABORT, "ProcedureCreate: no such language %s",
|
elog(ERROR, "ProcedureCreate: no such language %s",
|
||||||
languageName);
|
languageName);
|
||||||
|
|
||||||
languageObjectId = tup->t_oid;
|
languageObjectId = tup->t_oid;
|
||||||
@ -161,7 +161,7 @@ ProcedureCreate(char *procedureName,
|
|||||||
{
|
{
|
||||||
if (strcmp(languageName, "sql") == 0)
|
if (strcmp(languageName, "sql") == 0)
|
||||||
{
|
{
|
||||||
elog(ABORT, "ProcedureCreate: sql functions cannot return type \"opaque\"");
|
elog(ERROR, "ProcedureCreate: sql functions cannot return type \"opaque\"");
|
||||||
}
|
}
|
||||||
typeObjectId = 0;
|
typeObjectId = 0;
|
||||||
}
|
}
|
||||||
@ -181,7 +181,7 @@ ProcedureCreate(char *procedureName,
|
|||||||
typeObjectId = TypeShellMake(returnTypeName);
|
typeObjectId = TypeShellMake(returnTypeName);
|
||||||
if (!OidIsValid(typeObjectId))
|
if (!OidIsValid(typeObjectId))
|
||||||
{
|
{
|
||||||
elog(ABORT, "ProcedureCreate: could not create type '%s'",
|
elog(ERROR, "ProcedureCreate: could not create type '%s'",
|
||||||
returnTypeName);
|
returnTypeName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -202,7 +202,7 @@ ProcedureCreate(char *procedureName,
|
|||||||
defined &&
|
defined &&
|
||||||
(relid = typeidTypeRelid(toid)) != 0 &&
|
(relid = typeidTypeRelid(toid)) != 0 &&
|
||||||
get_attnum(relid, procedureName) != InvalidAttrNumber)
|
get_attnum(relid, procedureName) != InvalidAttrNumber)
|
||||||
elog(ABORT, "method %s already an attribute of type %s",
|
elog(ERROR, "method %s already an attribute of type %s",
|
||||||
procedureName, strVal(lfirst(argList)));
|
procedureName, strVal(lfirst(argList)));
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.16 1998/01/05 03:30:35 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.17 1998/01/06 19:42:33 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -334,7 +334,7 @@ TypeCreate(char *typeName,
|
|||||||
typeObjectId = TypeGet(typeName, &defined);
|
typeObjectId = TypeGet(typeName, &defined);
|
||||||
if (OidIsValid(typeObjectId) && defined)
|
if (OidIsValid(typeObjectId) && defined)
|
||||||
{
|
{
|
||||||
elog(ABORT, "TypeCreate: type %s already defined", typeName);
|
elog(ERROR, "TypeCreate: type %s already defined", typeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
@ -347,7 +347,7 @@ TypeCreate(char *typeName,
|
|||||||
elementObjectId = TypeGet(elementTypeName, &defined);
|
elementObjectId = TypeGet(elementTypeName, &defined);
|
||||||
if (!defined)
|
if (!defined)
|
||||||
{
|
{
|
||||||
elog(ABORT, "TypeCreate: type %s is not defined", elementTypeName);
|
elog(ERROR, "TypeCreate: type %s is not defined", elementTypeName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -558,7 +558,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
|
|||||||
type_oid = TypeGet(newTypeName, &defined);
|
type_oid = TypeGet(newTypeName, &defined);
|
||||||
if (OidIsValid(type_oid) && defined)
|
if (OidIsValid(type_oid) && defined)
|
||||||
{
|
{
|
||||||
elog(ABORT, "TypeRename: type %s already defined", newTypeName);
|
elog(ERROR, "TypeRename: type %s already defined", newTypeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the type tuple from the catalog index scan manager */
|
/* get the type tuple from the catalog index scan manager */
|
||||||
@ -591,7 +591,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
elog(ABORT, "TypeRename: type %s not defined", oldTypeName);
|
elog(ERROR, "TypeRename: type %s not defined", oldTypeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* finish up */
|
/* finish up */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user