Commit deea69b9 authored by Bruce Momjian's avatar Bruce Momjian

Change some ABORTS to ERROR. Add line number when COPY Failure.

parent 3d8820a3
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.10 1998/01/05 03:30:58 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.11 1998/01/05 16:39:07 momjian Exp $
* *
* NOTES * NOTES
* At the point the version is defined, 2 physical relations are created * At the point the version is defined, 2 physical relations are created
...@@ -195,7 +195,7 @@ setAttrList(char *bname) ...@@ -195,7 +195,7 @@ setAttrList(char *bname)
rdesc = heap_openr(bname); rdesc = heap_openr(bname);
if (rdesc == NULL) if (rdesc == NULL)
{ {
elog(ABORT, "Unable to expand all -- amopenr failed "); elog(ERROR, "Unable to expand all -- amopenr failed ");
return; return;
} }
maxattrs = RelationGetNumberOfAttributes(rdesc); maxattrs = RelationGetNumberOfAttributes(rdesc);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.20 1998/01/05 03:30:38 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.21 1998/01/05 16:38:42 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -125,7 +125,7 @@ cluster(char oldrelname[], char oldindexname[]) ...@@ -125,7 +125,7 @@ cluster(char oldrelname[], char oldindexname[])
OldHeap = heap_openr(oldrelname); OldHeap = heap_openr(oldrelname);
if (!RelationIsValid(OldHeap)) if (!RelationIsValid(OldHeap))
{ {
elog(ABORT, "cluster: unknown relation: \"%s\"", elog(ERROR, "cluster: unknown relation: \"%s\"",
oldrelname); oldrelname);
} }
OIDOldHeap = OldHeap->rd_id;/* Get OID for the index scan */ OIDOldHeap = OldHeap->rd_id;/* Get OID for the index scan */
...@@ -133,7 +133,7 @@ cluster(char oldrelname[], char oldindexname[]) ...@@ -133,7 +133,7 @@ cluster(char oldrelname[], char oldindexname[])
OldIndex = index_openr(oldindexname); /* Open old index relation */ OldIndex = index_openr(oldindexname); /* Open old index relation */
if (!RelationIsValid(OldIndex)) if (!RelationIsValid(OldIndex))
{ {
elog(ABORT, "cluster: unknown index: \"%s\"", elog(ERROR, "cluster: unknown index: \"%s\"",
oldindexname); oldindexname);
} }
OIDOldIndex = OldIndex->rd_id; /* OID for the index scan */ OIDOldIndex = OldIndex->rd_id; /* OID for the index scan */
...@@ -218,7 +218,7 @@ copy_heap(Oid OIDOldHeap) ...@@ -218,7 +218,7 @@ copy_heap(Oid OIDOldHeap)
OIDNewHeap = heap_create_with_catalog(NewName, tupdesc); OIDNewHeap = heap_create_with_catalog(NewName, tupdesc);
if (!OidIsValid(OIDNewHeap)) if (!OidIsValid(OIDNewHeap))
elog(ABORT, "clusterheap: cannot create temporary heap relation\n"); elog(ERROR, "clusterheap: cannot create temporary heap relation\n");
NewHeap = heap_open(OIDNewHeap); NewHeap = heap_open(OIDNewHeap);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.22 1998/01/05 03:30:39 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.23 1998/01/05 16:38:44 momjian Exp $
* *
* NOTES * NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated * The PortalExecutorHeapMemory crap needs to be eliminated
...@@ -294,11 +294,11 @@ PerformAddAttribute(char *relationName, ...@@ -294,11 +294,11 @@ PerformAddAttribute(char *relationName,
* normally, only the owner of a class can change its schema. * normally, only the owner of a class can change its schema.
*/ */
if (IsSystemRelationName(relationName)) if (IsSystemRelationName(relationName))
elog(ABORT, "PerformAddAttribute: class \"%s\" is a system catalog", elog(ERROR, "PerformAddAttribute: class \"%s\" is a system catalog",
relationName); relationName);
#ifndef NO_SECURITY #ifndef NO_SECURITY
if (!pg_ownercheck(userName, relationName, RELNAME)) if (!pg_ownercheck(userName, relationName, RELNAME))
elog(ABORT, "PerformAddAttribute: you do not own class \"%s\"", elog(ERROR, "PerformAddAttribute: you do not own class \"%s\"",
relationName); relationName);
#endif #endif
...@@ -306,9 +306,9 @@ PerformAddAttribute(char *relationName, ...@@ -306,9 +306,9 @@ PerformAddAttribute(char *relationName,
* we can't add a not null attribute * we can't add a not null attribute
*/ */
if (colDef->is_not_null) if (colDef->is_not_null)
elog(ABORT, "Can't add a NOT NULL attribute to an existing relation"); elog(ERROR, "Can't add a NOT NULL attribute to an existing relation");
if (colDef->defval) if (colDef->defval)
elog(ABORT, "ADD ATTRIBUTE: DEFAULT not yet implemented"); elog(ERROR, "ADD ATTRIBUTE: DEFAULT not yet implemented");
/* /*
* if the first element in the 'schema' list is a "*" then we are * if the first element in the 'schema' list is a "*" then we are
...@@ -331,7 +331,7 @@ PerformAddAttribute(char *relationName, ...@@ -331,7 +331,7 @@ PerformAddAttribute(char *relationName,
relrdesc = heap_openr(relationName); relrdesc = heap_openr(relationName);
if (!RelationIsValid(relrdesc)) if (!RelationIsValid(relrdesc))
{ {
elog(ABORT, "PerformAddAttribute: unknown relation: \"%s\"", elog(ERROR, "PerformAddAttribute: unknown relation: \"%s\"",
relationName); relationName);
} }
myrelid = relrdesc->rd_id; myrelid = relrdesc->rd_id;
...@@ -353,7 +353,7 @@ PerformAddAttribute(char *relationName, ...@@ -353,7 +353,7 @@ PerformAddAttribute(char *relationName,
relrdesc = heap_open(childrelid); relrdesc = heap_open(childrelid);
if (!RelationIsValid(relrdesc)) if (!RelationIsValid(relrdesc))
{ {
elog(ABORT, "PerformAddAttribute: can't find catalog entry for inheriting class with oid %d", elog(ERROR, "PerformAddAttribute: can't find catalog entry for inheriting class with oid %d",
childrelid); childrelid);
} }
PerformAddAttribute((relrdesc->rd_rel->relname).data, PerformAddAttribute((relrdesc->rd_rel->relname).data,
...@@ -369,7 +369,7 @@ PerformAddAttribute(char *relationName, ...@@ -369,7 +369,7 @@ PerformAddAttribute(char *relationName,
if (!PointerIsValid(reltup)) if (!PointerIsValid(reltup))
{ {
heap_close(relrdesc); heap_close(relrdesc);
elog(ABORT, "PerformAddAttribute: relation \"%s\" not found", elog(ERROR, "PerformAddAttribute: relation \"%s\" not found",
relationName); relationName);
} }
...@@ -378,7 +378,7 @@ PerformAddAttribute(char *relationName, ...@@ -378,7 +378,7 @@ PerformAddAttribute(char *relationName,
*/ */
if (((Form_pg_class) GETSTRUCT(reltup))->relkind == RELKIND_INDEX) if (((Form_pg_class) GETSTRUCT(reltup))->relkind == RELKIND_INDEX)
{ {
elog(ABORT, "PerformAddAttribute: index relation \"%s\" not changed", elog(ERROR, "PerformAddAttribute: index relation \"%s\" not changed",
relationName); relationName);
return; return;
} }
...@@ -389,7 +389,7 @@ PerformAddAttribute(char *relationName, ...@@ -389,7 +389,7 @@ PerformAddAttribute(char *relationName,
{ {
pfree(reltup); /* XXX temp */ pfree(reltup); /* XXX temp */
heap_close(relrdesc); /* XXX temp */ heap_close(relrdesc); /* XXX temp */
elog(ABORT, "PerformAddAttribute: relations limited to %d attributes", elog(ERROR, "PerformAddAttribute: relations limited to %d attributes",
MaxHeapAttributeNumber); MaxHeapAttributeNumber);
return; return;
} }
...@@ -450,7 +450,7 @@ PerformAddAttribute(char *relationName, ...@@ -450,7 +450,7 @@ PerformAddAttribute(char *relationName,
heap_endscan(attsdesc); /* XXX temp */ heap_endscan(attsdesc); /* XXX temp */
heap_close(attrdesc); /* XXX temp */ heap_close(attrdesc); /* XXX temp */
heap_close(relrdesc); /* XXX temp */ heap_close(relrdesc); /* XXX temp */
elog(ABORT, "PerformAddAttribute: attribute \"%s\" already exists in class \"%s\"", elog(ERROR, "PerformAddAttribute: attribute \"%s\" already exists in class \"%s\"",
key[1].sk_argument, key[1].sk_argument,
relationName); relationName);
return; return;
...@@ -478,7 +478,7 @@ PerformAddAttribute(char *relationName, ...@@ -478,7 +478,7 @@ PerformAddAttribute(char *relationName,
if (!HeapTupleIsValid(typeTuple)) if (!HeapTupleIsValid(typeTuple))
{ {
elog(ABORT, "Add: type \"%s\" nonexistent", p); elog(ERROR, "Add: type \"%s\" nonexistent", p);
} }
namestrcpy(&(attribute->attname), (char *) key[1].sk_argument); namestrcpy(&(attribute->attname), (char *) key[1].sk_argument);
attribute->atttypid = typeTuple->t_oid; attribute->atttypid = typeTuple->t_oid;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.36 1998/01/05 03:30:41 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.37 1998/01/05 16:38:46 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -67,11 +67,8 @@ static int CountTuples(Relation relation); ...@@ -67,11 +67,8 @@ static int CountTuples(Relation relation);
extern FILE *Pfout, extern FILE *Pfout,
*Pfin; *Pfin;
#ifdef COPY_DEBUG
static int lineno; static int lineno;
#endif
/* /*
* DoCopy executes a the SQL COPY statement. * DoCopy executes a the SQL COPY statement.
*/ */
...@@ -115,15 +112,15 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe, ...@@ -115,15 +112,15 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
rel = heap_openr(relname); rel = heap_openr(relname);
if (rel == NULL) if (rel == NULL)
elog(ABORT, "COPY command failed. Class %s " elog(ERROR, "COPY command failed. Class %s "
"does not exist.", relname); "does not exist.", relname);
result = pg_aclcheck(relname, UserName, required_access); result = pg_aclcheck(relname, UserName, required_access);
if (result != ACLCHECK_OK) if (result != ACLCHECK_OK)
elog(ABORT, "%s: %s", relname, aclcheck_error_strings[result]); elog(ERROR, "%s: %s", relname, aclcheck_error_strings[result]);
/* Above should not return */ /* Above should not return */
else if (!superuser() && !pipe) else if (!superuser() && !pipe)
elog(ABORT, "You must have Postgres superuser privilege to do a COPY " elog(ERROR, "You must have Postgres superuser privilege to do a COPY "
"directly to or from a file. Anyone can COPY to stdout or " "directly to or from a file. Anyone can COPY to stdout or "
"from stdin. Psql's \\copy command also works for anyone."); "from stdin. Psql's \\copy command also works for anyone.");
/* Above should not return. */ /* Above should not return. */
...@@ -132,7 +129,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe, ...@@ -132,7 +129,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
if (from) if (from)
{ /* copy from file to database */ { /* copy from file to database */
if (rel->rd_rel->relkind == RELKIND_SEQUENCE) if (rel->rd_rel->relkind == RELKIND_SEQUENCE)
elog(ABORT, "You can't change sequence relation %s", relname); elog(ERROR, "You can't change sequence relation %s", relname);
if (pipe) if (pipe)
{ {
if (IsUnderPostmaster) if (IsUnderPostmaster)
...@@ -147,7 +144,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe, ...@@ -147,7 +144,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
{ {
fp = AllocateFile(filename, "r"); fp = AllocateFile(filename, "r");
if (fp == NULL) if (fp == NULL)
elog(ABORT, "COPY command, running in backend with " elog(ERROR, "COPY command, running in backend with "
"effective uid %d, could not open file '%s' for " "effective uid %d, could not open file '%s' for "
"reading. Errno = %s (%d).", "reading. Errno = %s (%d).",
geteuid(), filename, strerror(errno), errno); geteuid(), filename, strerror(errno), errno);
...@@ -175,7 +172,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe, ...@@ -175,7 +172,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
fp = AllocateFile(filename, "w"); fp = AllocateFile(filename, "w");
umask(oumask); umask(oumask);
if (fp == NULL) if (fp == NULL)
elog(ABORT, "COPY command, running in backend with " elog(ERROR, "COPY command, running in backend with "
"effective uid %d, could not open file '%s' for " "effective uid %d, could not open file '%s' for "
"writing. Errno = %s (%d).", "writing. Errno = %s (%d).",
geteuid(), filename, strerror(errno), errno); geteuid(), filename, strerror(errno), errno);
...@@ -532,9 +529,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim) ...@@ -532,9 +529,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
byval[i] = (bool) IsTypeByVal(attr[i]->atttypid); byval[i] = (bool) IsTypeByVal(attr[i]->atttypid);
} }
#ifdef COPY_DEBUG
lineno = 0; lineno = 0;
#endif
while (!done) while (!done)
{ {
if (!binary) if (!binary)
...@@ -543,10 +538,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim) ...@@ -543,10 +538,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
int newline = 0; int newline = 0;
#endif #endif
#ifdef COPY_DEBUG
lineno++; lineno++;
elog(DEBUG, "line %d", lineno);
#endif
if (oids) if (oids)
{ {
#ifdef COPY_PATCH #ifdef COPY_PATCH
...@@ -560,7 +552,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim) ...@@ -560,7 +552,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
{ {
loaded_oid = oidin(string); loaded_oid = oidin(string);
if (loaded_oid < BootstrapObjectIdData) if (loaded_oid < BootstrapObjectIdData)
elog(ABORT, "COPY TEXT: Invalid Oid"); elog(ERROR, "COPY TEXT: Invalid Oid");
} }
} }
for (i = 0; i < attr_count && !done; i++) for (i = 0; i < attr_count && !done; i++)
...@@ -593,12 +585,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim) ...@@ -593,12 +585,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
if (!PointerIsValid(values[i]) && if (!PointerIsValid(values[i]) &&
!(rel->rd_att->attrs[i]->attbyval)) !(rel->rd_att->attrs[i]->attbyval))
{ {
#ifdef COPY_DEBUG elog(ERROR, "copy from line %d: Bad file format",lineno);
elog(ABORT,
"copy from: line %d - Bad file format", lineno);
#else
elog(ABORT, "copy from: Bad file format");
#endif
} }
} }
} }
...@@ -622,7 +609,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim) ...@@ -622,7 +609,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
{ {
fread(&loaded_oid, sizeof(int32), 1, fp); fread(&loaded_oid, sizeof(int32), 1, fp);
if (loaded_oid < BootstrapObjectIdData) if (loaded_oid < BootstrapObjectIdData)
elog(ABORT, "COPY BINARY: Invalid Oid"); elog(ERROR, "COPY BINARY: Invalid Oid");
} }
fread(&null_ct, sizeof(int32), 1, fp); fread(&null_ct, sizeof(int32), 1, fp);
if (null_ct > 0) if (null_ct > 0)
...@@ -661,7 +648,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim) ...@@ -661,7 +648,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
ptr += sizeof(int32); ptr += sizeof(int32);
break; break;
default: default:
elog(ABORT, "COPY BINARY: impossible size!"); elog(ERROR, "COPY BINARY: impossible size!");
break; break;
} }
} }
...@@ -837,7 +824,7 @@ GetOutputFunction(Oid type) ...@@ -837,7 +824,7 @@ GetOutputFunction(Oid type)
if (HeapTupleIsValid(typeTuple)) if (HeapTupleIsValid(typeTuple))
return ((int) ((TypeTupleForm) GETSTRUCT(typeTuple))->typoutput); return ((int) ((TypeTupleForm) GETSTRUCT(typeTuple))->typoutput);
elog(ABORT, "GetOutputFunction: Cache lookup of type %d failed", type); elog(ERROR, "GetOutputFunction: Cache lookup of type %d failed", type);
return (InvalidOid); return (InvalidOid);
} }
...@@ -854,7 +841,7 @@ GetTypeElement(Oid type) ...@@ -854,7 +841,7 @@ GetTypeElement(Oid type)
if (HeapTupleIsValid(typeTuple)) if (HeapTupleIsValid(typeTuple))
return ((int) ((TypeTupleForm) GETSTRUCT(typeTuple))->typelem); return ((int) ((TypeTupleForm) GETSTRUCT(typeTuple))->typelem);
elog(ABORT, "GetOutputFunction: Cache lookup of type %d failed", type); elog(ERROR, "GetOutputFunction: Cache lookup of type %d failed", type);
return (InvalidOid); return (InvalidOid);
} }
...@@ -870,7 +857,7 @@ GetInputFunction(Oid type) ...@@ -870,7 +857,7 @@ GetInputFunction(Oid type)
if (HeapTupleIsValid(typeTuple)) if (HeapTupleIsValid(typeTuple))
return ((int) ((TypeTupleForm) GETSTRUCT(typeTuple))->typinput); return ((int) ((TypeTupleForm) GETSTRUCT(typeTuple))->typinput);
elog(ABORT, "GetInputFunction: Cache lookup of type %d failed", type); elog(ERROR, "GetInputFunction: Cache lookup of type %d failed", type);
return (InvalidOid); return (InvalidOid);
} }
...@@ -886,7 +873,7 @@ IsTypeByVal(Oid type) ...@@ -886,7 +873,7 @@ IsTypeByVal(Oid type)
if (HeapTupleIsValid(typeTuple)) if (HeapTupleIsValid(typeTuple))
return ((int) ((TypeTupleForm) GETSTRUCT(typeTuple))->typbyval); return ((int) ((TypeTupleForm) GETSTRUCT(typeTuple))->typbyval);
elog(ABORT, "GetInputFunction: Cache lookup of type %d failed", type); elog(ERROR, "GetInputFunction: Cache lookup of type %d failed", type);
return (InvalidOid); return (InvalidOid);
} }
...@@ -1005,12 +992,7 @@ CopyReadNewline(FILE *fp, int *newline) ...@@ -1005,12 +992,7 @@ CopyReadNewline(FILE *fp, int *newline)
{ {
if (!*newline) if (!*newline)
{ {
#ifdef COPY_DEBUG elog(NOTICE, "CopyReadNewline: line %d - extra fields ignored", lineno);
elog(NOTICE, "CopyReadNewline: line %d - extra fields ignored",
lineno);
#else
elog(NOTICE, "CopyReadNewline: line - extra fields ignored");
#endif
while (!feof(fp) && (getc(fp) != '\n')); while (!feof(fp) && (getc(fp) != '\n'));
} }
*newline = 0; *newline = 0;
...@@ -1125,7 +1107,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim) ...@@ -1125,7 +1107,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
case '.': case '.':
c = getc(fp); c = getc(fp);
if (c != '\n') if (c != '\n')
elog(ABORT, "CopyReadAttribute - end of record marker corrupted"); elog(ERROR, "CopyReadAttribute - end of record marker corrupted");
return (NULL); return (NULL);
break; break;
} }
...@@ -1143,7 +1125,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim) ...@@ -1143,7 +1125,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
if (!done) if (!done)
attribute[i++] = c; attribute[i++] = c;
if (i == EXT_ATTLEN - 1) if (i == EXT_ATTLEN - 1)
elog(ABORT, "CopyReadAttribute - attribute length too long"); elog(ERROR, "CopyReadAttribute - attribute length too long");
} }
attribute[i] = '\0'; attribute[i] = '\0';
return (&attribute[0]); return (&attribute[0]);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.23 1998/01/05 03:30:44 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.24 1998/01/05 16:38:49 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -56,7 +56,7 @@ DefineRelation(CreateStmt *stmt) ...@@ -56,7 +56,7 @@ DefineRelation(CreateStmt *stmt)
List *constraints; List *constraints;
if (strlen(stmt->relname) >= NAMEDATALEN) if (strlen(stmt->relname) >= NAMEDATALEN)
elog(ABORT, "the relation name %s is >= %d characters long", stmt->relname, elog(ERROR, "the relation name %s is >= %d characters long", stmt->relname,
NAMEDATALEN); NAMEDATALEN);
StrNCpy(relname, stmt->relname, NAMEDATALEN); /* make full length for StrNCpy(relname, stmt->relname, NAMEDATALEN); /* make full length for
* copy */ * copy */
...@@ -78,7 +78,7 @@ DefineRelation(CreateStmt *stmt) ...@@ -78,7 +78,7 @@ DefineRelation(CreateStmt *stmt)
numberOfAttributes = length(schema); numberOfAttributes = length(schema);
if (numberOfAttributes <= 0) if (numberOfAttributes <= 0)
{ {
elog(ABORT, "DefineRelation: %s", elog(ERROR, "DefineRelation: %s",
"please inherit from a relation or define an attribute"); "please inherit from a relation or define an attribute");
} }
...@@ -108,7 +108,7 @@ DefineRelation(CreateStmt *stmt) ...@@ -108,7 +108,7 @@ DefineRelation(CreateStmt *stmt)
for (i = 0; i < ncheck; i++) for (i = 0; i < ncheck; i++)
{ {
if (strcmp(check[i].ccname, cdef->name) == 0) if (strcmp(check[i].ccname, cdef->name) == 0)
elog(ABORT, "DefineRelation: name (%s) of CHECK constraint duplicated", cdef->name); elog(ERROR, "DefineRelation: name (%s) of CHECK constraint duplicated", cdef->name);
} }
check[ncheck].ccname = cdef->name; check[ncheck].ccname = cdef->name;
} }
...@@ -218,7 +218,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr) ...@@ -218,7 +218,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
if (!strcmp(coldef->colname, restdef->colname)) if (!strcmp(coldef->colname, restdef->colname))
{ {
elog(ABORT, "attribute '%s' duplicated", elog(ERROR, "attribute '%s' duplicated",
coldef->colname); coldef->colname);
} }
} }
...@@ -231,7 +231,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr) ...@@ -231,7 +231,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
{ {
if (!strcmp(strVal(lfirst(entry)), strVal(lfirst(rest)))) if (!strcmp(strVal(lfirst(entry)), strVal(lfirst(rest))))
{ {
elog(ABORT, "relation '%s' duplicated", elog(ERROR, "relation '%s' duplicated",
strVal(lfirst(entry))); strVal(lfirst(entry)));
} }
} }
...@@ -252,12 +252,12 @@ MergeAttributes(List *schema, List *supers, List **supconstr) ...@@ -252,12 +252,12 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
relation = heap_openr(name); relation = heap_openr(name);
if (relation == NULL) if (relation == NULL)
{ {
elog(ABORT, elog(ERROR,
"MergeAttr: Can't inherit from non-existent superclass '%s'", name); "MergeAttr: Can't inherit from non-existent superclass '%s'", name);
} }
if (relation->rd_rel->relkind == 'S') if (relation->rd_rel->relkind == 'S')
{ {
elog(ABORT, "MergeAttr: Can't inherit from sequence superclass '%s'", name); elog(ERROR, "MergeAttr: Can't inherit from sequence superclass '%s'", name);
} }
tupleDesc = RelationGetTupleDescriptor(relation); tupleDesc = RelationGetTupleDescriptor(relation);
constr = tupleDesc->constr; constr = tupleDesc->constr;
...@@ -567,7 +567,7 @@ checkAttrExists(char *attributeName, char *attributeType, List *schema) ...@@ -567,7 +567,7 @@ checkAttrExists(char *attributeName, char *attributeType, List *schema)
*/ */
if (strcmp(attributeType, def->typename->name) != 0) if (strcmp(attributeType, def->typename->name) != 0)
{ {
elog(ABORT, "%s and %s conflict for %s", elog(ERROR, "%s and %s conflict for %s",
attributeType, def->typename->name, attributeName); attributeType, def->typename->name, attributeName);
} }
return 1; return 1;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.4 1998/01/05 03:30:44 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.5 1998/01/05 16:38:51 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -75,12 +75,12 @@ createdb(char *dbname, char *dbpath) ...@@ -75,12 +75,12 @@ createdb(char *dbname, char *dbpath)
lp = ExpandDatabasePath(loc); lp = ExpandDatabasePath(loc);
if (lp == NULL) if (lp == NULL)
elog(ABORT,"Unable to locate path '%s'" elog(ERROR,"Unable to locate path '%s'"
"\n\tThis may be due to a missing environment variable" "\n\tThis may be due to a missing environment variable"
" in the server",loc); " in the server",loc);
if (mkdir(lp,S_IRWXU) != 0) if (mkdir(lp,S_IRWXU) != 0)
elog(ABORT,"Unable to create database directory %s",lp); elog(ERROR,"Unable to create database directory %s",lp);
sprintf(buf, "%s %s%cbase%ctemplate1%c* %s", sprintf(buf, "%s %s%cbase%ctemplate1%c* %s",
COPY_CMD, DataDir, SEP_CHAR, SEP_CHAR, SEP_CHAR, lp); COPY_CMD, DataDir, SEP_CHAR, SEP_CHAR, SEP_CHAR, lp);
...@@ -123,7 +123,7 @@ destroydb(char *dbname) ...@@ -123,7 +123,7 @@ destroydb(char *dbname)
path = ExpandDatabasePath(dbpath); path = ExpandDatabasePath(dbpath);
if (path == NULL) if (path == NULL)
elog(ABORT,"Unable to locate path '%s'" elog(ERROR,"Unable to locate path '%s'"
"\n\tThis may be due to a missing environment variable" "\n\tThis may be due to a missing environment variable"
" in the server",dbpath); " in the server",dbpath);
...@@ -161,7 +161,7 @@ get_pg_dbtup(char *command, char *dbname, Relation dbrel) ...@@ -161,7 +161,7 @@ get_pg_dbtup(char *command, char *dbname, Relation dbrel)
scan = heap_beginscan(dbrel, 0, false, 1, &scanKey); scan = heap_beginscan(dbrel, 0, false, 1, &scanKey);
if (!HeapScanIsValid(scan)) if (!HeapScanIsValid(scan))
elog(ABORT, "%s: cannot begin scan of pg_database.", command); elog(ERROR, "%s: cannot begin scan of pg_database.", command);
/* /*
* since we want to return the tuple out of this proc, and we're going * since we want to return the tuple out of this proc, and we're going
...@@ -185,7 +185,7 @@ get_pg_dbtup(char *command, char *dbname, Relation dbrel) ...@@ -185,7 +185,7 @@ get_pg_dbtup(char *command, char *dbname, Relation dbrel)
* check_permissions() -- verify that the user is permitted to do this. * check_permissions() -- verify that the user is permitted to do this.
* *
* If the user is not allowed to carry out this operation, this routine * If the user is not allowed to carry out this operation, this routine
* elog(ABORT, ...)s, which will abort the xact. As a side effect, the * elog(ERROR, ...)s, which will abort the xact. As a side effect, the
* user's pg_user tuple OID is returned in userIdP and the target database's * user's pg_user tuple OID is returned in userIdP and the target database's
* OID is returned in dbIdP. * OID is returned in dbIdP.
*/ */
...@@ -218,20 +218,20 @@ check_permissions(char *command, ...@@ -218,20 +218,20 @@ check_permissions(char *command,
/* Check to make sure user has permission to use createdb */ /* Check to make sure user has permission to use createdb */
if (!use_createdb) if (!use_createdb)
{ {
elog(ABORT, "user \"%s\" is not allowed to create/destroy databases", elog(ERROR, "user \"%s\" is not allowed to create/destroy databases",
userName); userName);
} }
/* Make sure we are not mucking with the template database */ /* Make sure we are not mucking with the template database */
if (!strcmp(dbname, "template1")) if (!strcmp(dbname, "template1"))
{ {
elog(ABORT, "%s cannot be executed on the template database.", command); elog(ERROR, "%s cannot be executed on the template database.", command);
} }
/* Check to make sure database is not the currently open database */ /* Check to make sure database is not the currently open database */
if (!strcmp(dbname, GetDatabaseName())) if (!strcmp(dbname, GetDatabaseName()))
{ {
elog(ABORT, "%s cannot be executed on an open database", command); elog(ERROR, "%s cannot be executed on an open database", command);
} }
/* Check to make sure database is owned by this user */ /* Check to make sure database is owned by this user */
...@@ -285,20 +285,20 @@ check_permissions(char *command, ...@@ -285,20 +285,20 @@ check_permissions(char *command,
if (dbfound && !strcmp(command, "createdb")) if (dbfound && !strcmp(command, "createdb"))
{ {
elog(ABORT, "createdb: database %s already exists.", dbname); elog(ERROR, "createdb: database %s already exists.", dbname);
} }
else if (!dbfound && !strcmp(command, "destroydb")) else if (!dbfound && !strcmp(command, "destroydb"))
{ {
elog(ABORT, "destroydb: database %s does not exist.", dbname); elog(ERROR, "destroydb: database %s does not exist.", dbname);
} }
else if (dbfound && !strcmp(command, "destroydb") else if (dbfound && !strcmp(command, "destroydb")
&& dbowner != *userIdP && use_super == false) && dbowner != *userIdP && use_super == false)
{ {
elog(ABORT, "%s: database %s is not owned by you.", command, dbname); elog(ERROR, "%s: database %s is not owned by you.", command, dbname);
} }
...@@ -332,7 +332,7 @@ stop_vacuum(char *dbpath, char *dbname) ...@@ -332,7 +332,7 @@ stop_vacuum(char *dbpath, char *dbname)
FreeFile(fp); FreeFile(fp);
if (kill(pid, SIGKILLDAEMON1) < 0) if (kill(pid, SIGKILLDAEMON1) < 0)
{ {
elog(ABORT, "can't kill vacuum daemon (pid %d) on %s", elog(ERROR, "can't kill vacuum daemon (pid %d) on %s",
pid, dbname); pid, dbname);
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.19 1998/01/05 03:30:46 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.20 1998/01/05 16:38:52 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -95,7 +95,7 @@ DefineIndex(char *heapRelationName, ...@@ -95,7 +95,7 @@ DefineIndex(char *heapRelationName,
numberOfAttributes = length(attributeList); numberOfAttributes = length(attributeList);
if (numberOfAttributes <= 0) if (numberOfAttributes <= 0)
{ {
elog(ABORT, "DefineIndex: must specify at least one attribute"); elog(ERROR, "DefineIndex: must specify at least one attribute");
} }
/* /*
...@@ -106,16 +106,16 @@ DefineIndex(char *heapRelationName, ...@@ -106,16 +106,16 @@ DefineIndex(char *heapRelationName,
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
{ {
elog(ABORT, "DefineIndex: %s relation not found", elog(ERROR, "DefineIndex: %s relation not found",
heapRelationName); heapRelationName);
} }
relationId = tuple->t_oid; relationId = tuple->t_oid;
if (unique && strcmp(accessMethodName, "btree") != 0) if (unique && strcmp(accessMethodName, "btree") != 0)
elog(ABORT, "DefineIndex: unique indices are only available with the btree access method"); elog(ERROR, "DefineIndex: unique indices are only available with the btree access method");
if (numberOfAttributes > 1 && strcmp(accessMethodName, "btree") != 0) if (numberOfAttributes > 1 && strcmp(accessMethodName, "btree") != 0)
elog(ABORT, "DefineIndex: multi-column indices are only available with the btree access method"); elog(ERROR, "DefineIndex: multi-column indices are only available with the btree access method");
/* /*
* compute access method id * compute access method id
...@@ -124,7 +124,7 @@ DefineIndex(char *heapRelationName, ...@@ -124,7 +124,7 @@ DefineIndex(char *heapRelationName,
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
{ {
elog(ABORT, "DefineIndex: %s access method not found", elog(ERROR, "DefineIndex: %s access method not found",
accessMethodName); accessMethodName);
} }
accessMethodId = tuple->t_oid; accessMethodId = tuple->t_oid;
...@@ -168,7 +168,7 @@ DefineIndex(char *heapRelationName, ...@@ -168,7 +168,7 @@ DefineIndex(char *heapRelationName,
nargs = length(funcIndex->args); nargs = length(funcIndex->args);
if (nargs > INDEX_MAX_KEYS) if (nargs > INDEX_MAX_KEYS)
{ {
elog(ABORT, elog(ERROR,
"Too many args to function, limit of %d", "Too many args to function, limit of %d",
INDEX_MAX_KEYS); INDEX_MAX_KEYS);
} }
...@@ -250,7 +250,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable) ...@@ -250,7 +250,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
{ {
elog(ABORT, "ExtendIndex: %s index not found", elog(ERROR, "ExtendIndex: %s index not found",
indexRelationName); indexRelationName);
} }
indexId = tuple->t_oid; indexId = tuple->t_oid;
...@@ -264,7 +264,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable) ...@@ -264,7 +264,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
{ {
elog(ABORT, "ExtendIndex: %s is not an index", elog(ERROR, "ExtendIndex: %s is not an index",
indexRelationName); indexRelationName);
} }
...@@ -290,7 +290,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable) ...@@ -290,7 +290,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
pfree(predString); pfree(predString);
} }
if (oldPred == NULL) if (oldPred == NULL)
elog(ABORT, "ExtendIndex: %s is not a partial index", elog(ERROR, "ExtendIndex: %s is not a partial index",
indexRelationName); indexRelationName);
/* /*
...@@ -334,7 +334,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable) ...@@ -334,7 +334,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
ObjectIdGetDatum(indproc), ObjectIdGetDatum(indproc),
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
elog(ABORT, "ExtendIndex: index procedure not found"); elog(ERROR, "ExtendIndex: index procedure not found");
namecpy(&(funcInfo->funcName), namecpy(&(funcInfo->funcName),
&(((Form_pg_proc) GETSTRUCT(tuple))->proname)); &(((Form_pg_proc) GETSTRUCT(tuple))->proname));
...@@ -388,7 +388,7 @@ CheckPredExpr(Node *predicate, List *rangeTable, Oid baseRelOid) ...@@ -388,7 +388,7 @@ CheckPredExpr(Node *predicate, List *rangeTable, Oid baseRelOid)
else if (or_clause(predicate) || and_clause(predicate)) else if (or_clause(predicate) || and_clause(predicate))
clauses = ((Expr *) predicate)->args; clauses = ((Expr *) predicate)->args;
else else
elog(ABORT, "Unsupported partial-index predicate expression type"); elog(ERROR, "Unsupported partial-index predicate expression type");
foreach(clause, clauses) foreach(clause, clauses)
{ {
...@@ -409,11 +409,11 @@ CheckPredClause(Expr *predicate, List *rangeTable, Oid baseRelOid) ...@@ -409,11 +409,11 @@ CheckPredClause(Expr *predicate, List *rangeTable, Oid baseRelOid)
!IsA(pred_var, Var) || !IsA(pred_var, Var) ||
!IsA(pred_const, Const)) !IsA(pred_const, Const))
{ {
elog(ABORT, "Unsupported partial-index predicate clause type"); elog(ERROR, "Unsupported partial-index predicate clause type");
} }
if (getrelid(pred_var->varno, rangeTable) != baseRelOid) if (getrelid(pred_var->varno, rangeTable) != baseRelOid)
elog(ABORT, elog(ERROR,
"Partial-index predicates may refer only to the base relation"); "Partial-index predicates may refer only to the base relation");
} }
...@@ -435,7 +435,7 @@ FuncIndexArgs(IndexElem *funcIndex, ...@@ -435,7 +435,7 @@ FuncIndexArgs(IndexElem *funcIndex,
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
{ {
elog(ABORT, "DefineIndex: %s class not found", elog(ERROR, "DefineIndex: %s class not found",
funcIndex->class); funcIndex->class);
} }
*opOidP = tuple->t_oid; *opOidP = tuple->t_oid;
...@@ -457,7 +457,7 @@ FuncIndexArgs(IndexElem *funcIndex, ...@@ -457,7 +457,7 @@ FuncIndexArgs(IndexElem *funcIndex,
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
{ {
elog(ABORT, elog(ERROR,
"DefineIndex: attribute \"%s\" not found", "DefineIndex: attribute \"%s\" not found",
arg); arg);
} }
...@@ -488,7 +488,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */ ...@@ -488,7 +488,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
attribute = lfirst(rest); attribute = lfirst(rest);
if (attribute->name == NULL) if (attribute->name == NULL)
elog(ABORT, "missing attribute for define index"); elog(ERROR, "missing attribute for define index");
tuple = SearchSysCacheTuple(ATTNAME, tuple = SearchSysCacheTuple(ATTNAME,
ObjectIdGetDatum(relId), ObjectIdGetDatum(relId),
...@@ -496,7 +496,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */ ...@@ -496,7 +496,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
0, 0); 0, 0);
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
{ {
elog(ABORT, elog(ERROR,
"DefineIndex: attribute \"%s\" not found", "DefineIndex: attribute \"%s\" not found",
attribute->name); attribute->name);
} }
...@@ -510,7 +510,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */ ...@@ -510,7 +510,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
attribute->class = GetDefaultOpClass(attform->atttypid); attribute->class = GetDefaultOpClass(attform->atttypid);
if (attribute->class == NULL) if (attribute->class == NULL)
{ {
elog(ABORT, elog(ERROR,
"Can't find a default operator class for type %d.", "Can't find a default operator class for type %d.",
attform->atttypid); attform->atttypid);
} }
...@@ -522,7 +522,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */ ...@@ -522,7 +522,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
{ {
elog(ABORT, "DefineIndex: %s class not found", elog(ERROR, "DefineIndex: %s class not found",
attribute->class); attribute->class);
} }
*opOidP++ = tuple->t_oid; *opOidP++ = tuple->t_oid;
...@@ -565,12 +565,12 @@ RemoveIndex(char *name) ...@@ -565,12 +565,12 @@ RemoveIndex(char *name)
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
{ {
elog(ABORT, "index \"%s\" nonexistent", name); elog(ERROR, "index \"%s\" nonexistent", name);
} }
if (((Form_pg_class) GETSTRUCT(tuple))->relkind != RELKIND_INDEX) if (((Form_pg_class) GETSTRUCT(tuple))->relkind != RELKIND_INDEX)
{ {
elog(ABORT, "relation \"%s\" is of type \"%c\"", elog(ERROR, "relation \"%s\" is of type \"%c\"",
name, name,
((Form_pg_class) GETSTRUCT(tuple))->relkind); ((Form_pg_class) GETSTRUCT(tuple))->relkind);
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.20 1998/01/05 03:30:48 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.21 1998/01/05 16:38:54 momjian Exp $
* *
* DESCRIPTION * DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the * The "DefineFoo" routines take the parse tree and pick out the
...@@ -140,7 +140,7 @@ compute_full_attributes(const List *parameters, int32 *byte_pct_p, ...@@ -140,7 +140,7 @@ compute_full_attributes(const List *parameters, int32 *byte_pct_p,
* we don't have untrusted functions any more. The 4.2 * we don't have untrusted functions any more. The 4.2
* implementation is lousy anyway so I took it out. -ay 10/94 * implementation is lousy anyway so I took it out. -ay 10/94
*/ */
elog(ABORT, "untrusted function has been decommissioned."); elog(ERROR, "untrusted function has been decommissioned.");
} }
else if (strcasecmp(param->name, "byte_pct") == 0) else if (strcasecmp(param->name, "byte_pct") == 0)
{ {
...@@ -275,7 +275,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest) ...@@ -275,7 +275,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest)
if (!HeapTupleIsValid(languageTuple)) { if (!HeapTupleIsValid(languageTuple)) {
elog(ABORT, elog(ERROR,
"Unrecognized language specified in a CREATE FUNCTION: " "Unrecognized language specified in a CREATE FUNCTION: "
"'%s'. Recognized languages are sql, C, internal " "'%s'. Recognized languages are sql, C, internal "
"and the created procedural languages.", "and the created procedural languages.",
...@@ -285,7 +285,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest) ...@@ -285,7 +285,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest)
/* Check that this language is a PL */ /* Check that this language is a PL */
languageStruct = (Form_pg_language) GETSTRUCT(languageTuple); languageStruct = (Form_pg_language) GETSTRUCT(languageTuple);
if (!(languageStruct->lanispl)) { if (!(languageStruct->lanispl)) {
elog(ABORT, elog(ERROR,
"Language '%s' isn't defined as PL", languageName); "Language '%s' isn't defined as PL", languageName);
} }
...@@ -294,7 +294,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest) ...@@ -294,7 +294,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest)
* restricted to be defined by postgres superusers only * restricted to be defined by postgres superusers only
*/ */
if (languageStruct->lanpltrusted == false && !superuser()) { if (languageStruct->lanpltrusted == false && !superuser()) {
elog(ABORT, "Only users with Postgres superuser privilege " elog(ERROR, "Only users with Postgres superuser privilege "
"are permitted to create a function in the '%s' " "are permitted to create a function in the '%s' "
"language.", "language.",
languageName); languageName);
...@@ -313,7 +313,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest) ...@@ -313,7 +313,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest)
interpret_AS_clause(languageName, stmt->as, &prosrc_str, &probin_str); interpret_AS_clause(languageName, stmt->as, &prosrc_str, &probin_str);
if (strcmp(languageName, "sql") != 0 && lanisPL == false && !superuser()) if (strcmp(languageName, "sql") != 0 && lanisPL == false && !superuser())
elog(ABORT, elog(ERROR,
"Only users with Postgres superuser privilege are permitted " "Only users with Postgres superuser privilege are permitted "
"to create a function " "to create a function "
"in the '%s' language. Others may use the 'sql' language " "in the '%s' language. Others may use the 'sql' language "
...@@ -388,7 +388,7 @@ DefineOperator(char *oprName, ...@@ -388,7 +388,7 @@ DefineOperator(char *oprName,
{ {
/* see gram.y, must be setof */ /* see gram.y, must be setof */
if (nodeTag(defel->arg) == T_TypeName) if (nodeTag(defel->arg) == T_TypeName)
elog(ABORT, "setof type not implemented for leftarg"); elog(ERROR, "setof type not implemented for leftarg");
if (nodeTag(defel->arg) == T_String) if (nodeTag(defel->arg) == T_String)
{ {
...@@ -396,14 +396,14 @@ DefineOperator(char *oprName, ...@@ -396,14 +396,14 @@ DefineOperator(char *oprName,
} }
else else
{ {
elog(ABORT, "type for leftarg is malformed."); elog(ERROR, "type for leftarg is malformed.");
} }
} }
else if (!strcasecmp(defel->defname, "rightarg")) else if (!strcasecmp(defel->defname, "rightarg"))
{ {
/* see gram.y, must be setof */ /* see gram.y, must be setof */
if (nodeTag(defel->arg) == T_TypeName) if (nodeTag(defel->arg) == T_TypeName)
elog(ABORT, "setof type not implemented for rightarg"); elog(ERROR, "setof type not implemented for rightarg");
if (nodeTag(defel->arg) == T_String) if (nodeTag(defel->arg) == T_String)
{ {
...@@ -411,7 +411,7 @@ DefineOperator(char *oprName, ...@@ -411,7 +411,7 @@ DefineOperator(char *oprName,
} }
else else
{ {
elog(ABORT, "type for rightarg is malformed."); elog(ERROR, "type for rightarg is malformed.");
} }
} }
else if (!strcasecmp(defel->defname, "procedure")) else if (!strcasecmp(defel->defname, "procedure"))
...@@ -474,7 +474,7 @@ DefineOperator(char *oprName, ...@@ -474,7 +474,7 @@ DefineOperator(char *oprName,
*/ */
if (functionName == NULL) if (functionName == NULL)
{ {
elog(ABORT, "Define: \"procedure\" unspecified"); elog(ERROR, "Define: \"procedure\" unspecified");
} }
/* ---------------- /* ----------------
...@@ -579,16 +579,16 @@ DefineAggregate(char *aggName, List *parameters) ...@@ -579,16 +579,16 @@ DefineAggregate(char *aggName, List *parameters)
* make sure we have our required definitions * make sure we have our required definitions
*/ */
if (baseType == NULL) if (baseType == NULL)
elog(ABORT, "Define: \"basetype\" unspecified"); elog(ERROR, "Define: \"basetype\" unspecified");
if (stepfunc1Name != NULL) if (stepfunc1Name != NULL)
{ {
if (stepfunc1Type == NULL) if (stepfunc1Type == NULL)
elog(ABORT, "Define: \"stype1\" unspecified"); elog(ERROR, "Define: \"stype1\" unspecified");
} }
if (stepfunc2Name != NULL) if (stepfunc2Name != NULL)
{ {
if (stepfunc2Type == NULL) if (stepfunc2Type == NULL)
elog(ABORT, "Define: \"stype2\" unspecified"); elog(ERROR, "Define: \"stype2\" unspecified");
} }
/* /*
...@@ -635,7 +635,7 @@ DefineType(char *typeName, List *parameters) ...@@ -635,7 +635,7 @@ DefineType(char *typeName, List *parameters)
*/ */
if (strlen(typeName) >= (NAMEDATALEN - 1)) if (strlen(typeName) >= (NAMEDATALEN - 1))
{ {
elog(ABORT, "DefineType: type names must be %d characters or less", elog(ERROR, "DefineType: type names must be %d characters or less",
NAMEDATALEN - 1); NAMEDATALEN - 1);
} }
...@@ -699,7 +699,7 @@ DefineType(char *typeName, List *parameters) ...@@ -699,7 +699,7 @@ DefineType(char *typeName, List *parameters)
} }
else else
{ {
elog(ABORT, "DefineType: \"%s\" alignment not recognized", elog(ERROR, "DefineType: \"%s\" alignment not recognized",
a); a);
} }
} }
...@@ -714,9 +714,9 @@ DefineType(char *typeName, List *parameters) ...@@ -714,9 +714,9 @@ DefineType(char *typeName, List *parameters)
* make sure we have our required definitions * make sure we have our required definitions
*/ */
if (inputName == NULL) if (inputName == NULL)
elog(ABORT, "Define: \"input\" unspecified"); elog(ERROR, "Define: \"input\" unspecified");
if (outputName == NULL) if (outputName == NULL)
elog(ABORT, "Define: \"output\" unspecified"); elog(ERROR, "Define: \"output\" unspecified");
/* ---------------- /* ----------------
* now have TypeCreate do all the real work. * now have TypeCreate do all the real work.
...@@ -766,7 +766,7 @@ static char * ...@@ -766,7 +766,7 @@ static char *
defGetString(DefElem *def) defGetString(DefElem *def)
{ {
if (nodeTag(def->arg) != T_String) if (nodeTag(def->arg) != T_String)
elog(ABORT, "Define: \"%s\" = what?", def->defname); elog(ERROR, "Define: \"%s\" = what?", def->defname);
return (strVal(def->arg)); return (strVal(def->arg));
} }
...@@ -779,6 +779,6 @@ defGetTypeLength(DefElem *def) ...@@ -779,6 +779,6 @@ defGetTypeLength(DefElem *def)
!strcasecmp(strVal(def->arg), "variable")) !strcasecmp(strVal(def->arg), "variable"))
return -1; /* variable length */ return -1; /* variable length */
elog(ABORT, "Define: \"%s\" = what?", def->defname); elog(ERROR, "Define: \"%s\" = what?", def->defname);
return -1; return -1;
} }
...@@ -64,7 +64,7 @@ CreateProceduralLanguage(CreatePLangStmt * stmt) ...@@ -64,7 +64,7 @@ CreateProceduralLanguage(CreatePLangStmt * stmt)
*/ */
if (!superuser()) if (!superuser())
{ {
elog(ABORT, "Only users with Postgres superuser privilege are " elog(ERROR, "Only users with Postgres superuser privilege are "
"permitted to create procedural languages"); "permitted to create procedural languages");
} }
...@@ -80,7 +80,7 @@ CreateProceduralLanguage(CreatePLangStmt * stmt) ...@@ -80,7 +80,7 @@ CreateProceduralLanguage(CreatePLangStmt * stmt)
0, 0, 0); 0, 0, 0);
if (HeapTupleIsValid(langTup)) if (HeapTupleIsValid(langTup))
{ {
elog(ABORT, "Language %s already exists", languageName); elog(ERROR, "Language %s already exists", languageName);
} }
/* ---------------- /* ----------------
...@@ -96,12 +96,12 @@ CreateProceduralLanguage(CreatePLangStmt * stmt) ...@@ -96,12 +96,12 @@ CreateProceduralLanguage(CreatePLangStmt * stmt)
0); 0);
if (!HeapTupleIsValid(procTup)) if (!HeapTupleIsValid(procTup))
{ {
elog(ABORT, "PL handler function %s() doesn't exist", elog(ERROR, "PL handler function %s() doesn't exist",
stmt->plhandler); stmt->plhandler);
} }
if (((Form_pg_proc) GETSTRUCT(procTup))->prorettype != InvalidOid) if (((Form_pg_proc) GETSTRUCT(procTup))->prorettype != InvalidOid)
{ {
elog(ABORT, "PL handler function %s() isn't of return type Opaque", elog(ERROR, "PL handler function %s() isn't of return type Opaque",
stmt->plhandler); stmt->plhandler);
} }
...@@ -155,7 +155,7 @@ DropProceduralLanguage(DropPLangStmt * stmt) ...@@ -155,7 +155,7 @@ DropProceduralLanguage(DropPLangStmt * stmt)
*/ */
if (!superuser()) if (!superuser())
{ {
elog(ABORT, "Only users with Postgres superuser privilege are " elog(ERROR, "Only users with Postgres superuser privilege are "
"permitted to drop procedural languages"); "permitted to drop procedural languages");
} }
...@@ -171,12 +171,12 @@ DropProceduralLanguage(DropPLangStmt * stmt) ...@@ -171,12 +171,12 @@ DropProceduralLanguage(DropPLangStmt * stmt)
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(langTup)) if (!HeapTupleIsValid(langTup))
{ {
elog(ABORT, "Language %s doesn't exist", languageName); elog(ERROR, "Language %s doesn't exist", languageName);
} }
if (!((Form_pg_language) GETSTRUCT(langTup))->lanispl) if (!((Form_pg_language) GETSTRUCT(langTup))->lanispl)
{ {
elog(ABORT, "Language %s isn't a created procedural language", elog(ERROR, "Language %s isn't a created procedural language",
languageName); languageName);
} }
...@@ -195,7 +195,7 @@ DropProceduralLanguage(DropPLangStmt * stmt) ...@@ -195,7 +195,7 @@ DropProceduralLanguage(DropPLangStmt * stmt)
if (!HeapTupleIsValid(tup)) if (!HeapTupleIsValid(tup))
{ {
elog(ABORT, "Language with name '%s' not found", languageName); elog(ERROR, "Language with name '%s' not found", languageName);
} }
heap_delete(rdesc, &(tup->t_ctid)); heap_delete(rdesc, &(tup->t_ctid));
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.16 1998/01/05 03:30:50 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.17 1998/01/05 16:38:57 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -402,7 +402,7 @@ tg_rewriteQuery(TgRecipe * r, ...@@ -402,7 +402,7 @@ tg_rewriteQuery(TgRecipe * r,
{ {
if (nodeTag(orig->qual) == T_List) if (nodeTag(orig->qual) == T_List)
{ {
elog(ABORT, "tg_rewriteQuery: Whoa! why is my qual a List???"); elog(ERROR, "tg_rewriteQuery: Whoa! why is my qual a List???");
} }
orig->qual = tg_rewriteParamsInExpr(orig->qual, inputQlist); orig->qual = tg_rewriteParamsInExpr(orig->qual, inputQlist);
} }
...@@ -629,7 +629,7 @@ tg_rewriteParamsInExpr(Node *expression, QueryTreeList *inputQlist) ...@@ -629,7 +629,7 @@ tg_rewriteParamsInExpr(Node *expression, QueryTreeList *inputQlist)
} }
else else
{ {
elog(ABORT, "tg_rewriteParamsInExpr:can't substitute for parameter %d when that input is unconnected", p->paramid); elog(ERROR, "tg_rewriteParamsInExpr:can't substitute for parameter %d when that input is unconnected", p->paramid);
} }
} }
...@@ -719,13 +719,13 @@ getParamTypes(TgElement * elem, Oid typev[]) ...@@ -719,13 +719,13 @@ getParamTypes(TgElement * elem, Oid typev[])
{ {
if (parameterCount == 8) if (parameterCount == 8)
{ {
elog(ABORT, elog(ERROR,
"getParamTypes: Ingredients cannot take > 8 arguments"); "getParamTypes: Ingredients cannot take > 8 arguments");
} }
t = elem->inTypes->val[j]; t = elem->inTypes->val[j];
if (strcmp(t, "opaque") == 0) if (strcmp(t, "opaque") == 0)
{ {
elog(ABORT, elog(ERROR,
"getParamTypes: Ingredient functions cannot take type 'opaque'"); "getParamTypes: Ingredient functions cannot take type 'opaque'");
} }
else else
...@@ -733,7 +733,7 @@ getParamTypes(TgElement * elem, Oid typev[]) ...@@ -733,7 +733,7 @@ getParamTypes(TgElement * elem, Oid typev[])
toid = TypeGet(elem->inTypes->val[j], &defined); toid = TypeGet(elem->inTypes->val[j], &defined);
if (!OidIsValid(toid)) if (!OidIsValid(toid))
{ {
elog(ABORT, "getParamTypes: arg type '%s' is not defined", t); elog(ERROR, "getParamTypes: arg type '%s' is not defined", t);
} }
if (!defined) if (!defined)
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.19 1998/01/05 03:30:51 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.20 1998/01/05 16:38:58 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -65,7 +65,7 @@ RemoveOperator(char *operatorName, /* operator name */ ...@@ -65,7 +65,7 @@ RemoveOperator(char *operatorName, /* operator name */
typeId1 = TypeGet(typeName1, &defined); typeId1 = TypeGet(typeName1, &defined);
if (!OidIsValid(typeId1)) if (!OidIsValid(typeId1))
{ {
elog(ABORT, "RemoveOperator: type '%s' does not exist", typeName1); elog(ERROR, "RemoveOperator: type '%s' does not exist", typeName1);
return; return;
} }
} }
...@@ -75,7 +75,7 @@ RemoveOperator(char *operatorName, /* operator name */ ...@@ -75,7 +75,7 @@ RemoveOperator(char *operatorName, /* operator name */
typeId2 = TypeGet(typeName2, &defined); typeId2 = TypeGet(typeName2, &defined);
if (!OidIsValid(typeId2)) if (!OidIsValid(typeId2))
{ {
elog(ABORT, "RemoveOperator: type '%s' does not exist", typeName2); elog(ERROR, "RemoveOperator: type '%s' does not exist", typeName2);
return; return;
} }
} }
...@@ -105,7 +105,7 @@ RemoveOperator(char *operatorName, /* operator name */ ...@@ -105,7 +105,7 @@ RemoveOperator(char *operatorName, /* operator name */
if (!pg_ownercheck(userName, if (!pg_ownercheck(userName,
(char *) ObjectIdGetDatum(tup->t_oid), (char *) ObjectIdGetDatum(tup->t_oid),
OPROID)) OPROID))
elog(ABORT, "RemoveOperator: operator '%s': permission denied", elog(ERROR, "RemoveOperator: operator '%s': permission denied",
operatorName); operatorName);
#endif #endif
ItemPointerCopy(&tup->t_ctid, &itemPointerData); ItemPointerCopy(&tup->t_ctid, &itemPointerData);
...@@ -115,20 +115,20 @@ RemoveOperator(char *operatorName, /* operator name */ ...@@ -115,20 +115,20 @@ RemoveOperator(char *operatorName, /* operator name */
{ {
if (OidIsValid(typeId1) && OidIsValid(typeId2)) if (OidIsValid(typeId1) && OidIsValid(typeId2))
{ {
elog(ABORT, "RemoveOperator: binary operator '%s' taking '%s' and '%s' does not exist", elog(ERROR, "RemoveOperator: binary operator '%s' taking '%s' and '%s' does not exist",
operatorName, operatorName,
typeName1, typeName1,
typeName2); typeName2);
} }
else if (OidIsValid(typeId1)) else if (OidIsValid(typeId1))
{ {
elog(ABORT, "RemoveOperator: right unary operator '%s' taking '%s' does not exist", elog(ERROR, "RemoveOperator: right unary operator '%s' taking '%s' does not exist",
operatorName, operatorName,
typeName1); typeName1);
} }
else else
{ {
elog(ABORT, "RemoveOperator: left unary operator '%s' taking '%s' does not exist", elog(ERROR, "RemoveOperator: left unary operator '%s' taking '%s' does not exist",
operatorName, operatorName,
typeName2); typeName2);
} }
...@@ -272,7 +272,7 @@ RemoveType(char *typeName) /* type name to be removed */ ...@@ -272,7 +272,7 @@ RemoveType(char *typeName) /* type name to be removed */
#ifndef NO_SECURITY #ifndef NO_SECURITY
userName = GetPgUserName(); userName = GetPgUserName();
if (!pg_ownercheck(userName, typeName, TYPNAME)) if (!pg_ownercheck(userName, typeName, TYPNAME))
elog(ABORT, "RemoveType: type '%s': permission denied", elog(ERROR, "RemoveType: type '%s': permission denied",
typeName); typeName);
#endif #endif
...@@ -290,7 +290,7 @@ RemoveType(char *typeName) /* type name to be removed */ ...@@ -290,7 +290,7 @@ RemoveType(char *typeName) /* type name to be removed */
{ {
heap_endscan(scan); heap_endscan(scan);
heap_close(relation); heap_close(relation);
elog(ABORT, "RemoveType: type '%s' does not exist", elog(ERROR, "RemoveType: type '%s' does not exist",
typeName); typeName);
} }
typeOid = tup->t_oid; typeOid = tup->t_oid;
...@@ -308,7 +308,7 @@ RemoveType(char *typeName) /* type name to be removed */ ...@@ -308,7 +308,7 @@ RemoveType(char *typeName) /* type name to be removed */
if (!HeapTupleIsValid(tup)) if (!HeapTupleIsValid(tup))
{ {
elog(ABORT, "RemoveType: type '%s': array stub not found", elog(ERROR, "RemoveType: type '%s': array stub not found",
typeName); typeName);
} }
typeOid = tup->t_oid; typeOid = tup->t_oid;
...@@ -364,7 +364,7 @@ RemoveFunction(char *functionName, /* function name to be removed */ ...@@ -364,7 +364,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
if (!HeapTupleIsValid(tup)) if (!HeapTupleIsValid(tup))
{ {
elog(ABORT, "RemoveFunction: type '%s' not found", typename); elog(ERROR, "RemoveFunction: type '%s' not found", typename);
} }
argList[i] = tup->t_oid; argList[i] = tup->t_oid;
} }
...@@ -380,7 +380,7 @@ RemoveFunction(char *functionName, /* function name to be removed */ ...@@ -380,7 +380,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
userName = GetPgUserName(); userName = GetPgUserName();
if (!pg_func_ownercheck(userName, functionName, nargs, argList)) if (!pg_func_ownercheck(userName, functionName, nargs, argList))
{ {
elog(ABORT, "RemoveFunction: function '%s': permission denied", elog(ERROR, "RemoveFunction: function '%s': permission denied",
functionName); functionName);
} }
#endif #endif
...@@ -420,7 +420,7 @@ RemoveFunction(char *functionName, /* function name to be removed */ ...@@ -420,7 +420,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
/* ok, function has been found */ /* ok, function has been found */
if (the_proc->prolang == INTERNALlanguageId) if (the_proc->prolang == INTERNALlanguageId)
elog(ABORT, "RemoveFunction: function \"%s\" is built-in", elog(ERROR, "RemoveFunction: function \"%s\" is built-in",
functionName); functionName);
ItemPointerCopy(&tup->t_ctid, &itemPointerData); ItemPointerCopy(&tup->t_ctid, &itemPointerData);
...@@ -457,7 +457,7 @@ RemoveAggregate(char *aggName, char *aggType) ...@@ -457,7 +457,7 @@ RemoveAggregate(char *aggName, char *aggType)
basetypeID = TypeGet(aggType, &defined); basetypeID = TypeGet(aggType, &defined);
if (!OidIsValid(basetypeID)) if (!OidIsValid(basetypeID))
{ {
elog(ABORT, "RemoveAggregate: type '%s' does not exist", aggType); elog(ERROR, "RemoveAggregate: type '%s' does not exist", aggType);
} }
} }
else else
...@@ -473,12 +473,12 @@ RemoveAggregate(char *aggName, char *aggType) ...@@ -473,12 +473,12 @@ RemoveAggregate(char *aggName, char *aggType)
{ {
if (aggType) if (aggType)
{ {
elog(ABORT, "RemoveAggregate: aggregate '%s' on type '%s': permission denied", elog(ERROR, "RemoveAggregate: aggregate '%s' on type '%s': permission denied",
aggName, aggType); aggName, aggType);
} }
else else
{ {
elog(ABORT, "RemoveAggregate: aggregate '%s': permission denied", elog(ERROR, "RemoveAggregate: aggregate '%s': permission denied",
aggName); aggName);
} }
} }
...@@ -505,12 +505,12 @@ RemoveAggregate(char *aggName, char *aggType) ...@@ -505,12 +505,12 @@ RemoveAggregate(char *aggName, char *aggType)
heap_close(relation); heap_close(relation);
if (aggType) if (aggType)
{ {
elog(ABORT, "RemoveAggregate: aggregate '%s' for '%s' does not exist", elog(ERROR, "RemoveAggregate: aggregate '%s' for '%s' does not exist",
aggName, aggType); aggName, aggType);
} }
else else
{ {
elog(ABORT, "RemoveAggregate: aggregate '%s' for all types does not exist", elog(ERROR, "RemoveAggregate: aggregate '%s' for all types does not exist",
aggName); aggName);
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.10 1998/01/05 03:30:52 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.11 1998/01/05 16:38:59 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -81,12 +81,12 @@ renameatt(char *relname, ...@@ -81,12 +81,12 @@ renameatt(char *relname,
* normally, only the owner of a class can change its schema. * normally, only the owner of a class can change its schema.
*/ */
if (IsSystemRelationName(relname)) if (IsSystemRelationName(relname))
elog(ABORT, "renameatt: class \"%s\" is a system catalog", elog(ERROR, "renameatt: class \"%s\" is a system catalog",
relname); relname);
#ifndef NO_SECURITY #ifndef NO_SECURITY
if (!IsBootstrapProcessingMode() && if (!IsBootstrapProcessingMode() &&
!pg_ownercheck(userName, relname, RELNAME)) !pg_ownercheck(userName, relname, RELNAME))
elog(ABORT, "renameatt: you do not own class \"%s\"", elog(ERROR, "renameatt: you do not own class \"%s\"",
relname); relname);
#endif #endif
...@@ -109,7 +109,7 @@ renameatt(char *relname, ...@@ -109,7 +109,7 @@ renameatt(char *relname,
relrdesc = heap_openr(relname); relrdesc = heap_openr(relname);
if (!RelationIsValid(relrdesc)) if (!RelationIsValid(relrdesc))
{ {
elog(ABORT, "renameatt: unknown relation: \"%s\"", elog(ERROR, "renameatt: unknown relation: \"%s\"",
relname); relname);
} }
myrelid = relrdesc->rd_id; myrelid = relrdesc->rd_id;
...@@ -134,7 +134,7 @@ renameatt(char *relname, ...@@ -134,7 +134,7 @@ renameatt(char *relname,
relrdesc = heap_open(childrelid); relrdesc = heap_open(childrelid);
if (!RelationIsValid(relrdesc)) if (!RelationIsValid(relrdesc))
{ {
elog(ABORT, "renameatt: can't find catalog entry for inheriting class with oid %d", elog(ERROR, "renameatt: can't find catalog entry for inheriting class with oid %d",
childrelid); childrelid);
} }
childname = (relrdesc->rd_rel->relname).data; childname = (relrdesc->rd_rel->relname).data;
...@@ -149,7 +149,7 @@ renameatt(char *relname, ...@@ -149,7 +149,7 @@ renameatt(char *relname,
if (!PointerIsValid(reltup)) if (!PointerIsValid(reltup))
{ {
heap_close(relrdesc); heap_close(relrdesc);
elog(ABORT, "renameatt: relation \"%s\" nonexistent", elog(ERROR, "renameatt: relation \"%s\" nonexistent",
relname); relname);
return; return;
} }
...@@ -160,12 +160,12 @@ renameatt(char *relname, ...@@ -160,12 +160,12 @@ renameatt(char *relname,
if (!PointerIsValid(oldatttup)) if (!PointerIsValid(oldatttup))
{ {
heap_close(attrdesc); heap_close(attrdesc);
elog(ABORT, "renameatt: attribute \"%s\" nonexistent", elog(ERROR, "renameatt: attribute \"%s\" nonexistent",
oldattname); oldattname);
} }
if (((AttributeTupleForm) GETSTRUCT(oldatttup))->attnum < 0) if (((AttributeTupleForm) GETSTRUCT(oldatttup))->attnum < 0)
{ {
elog(ABORT, "renameatt: system attribute \"%s\" not renamed", elog(ERROR, "renameatt: system attribute \"%s\" not renamed",
oldattname); oldattname);
} }
...@@ -174,7 +174,7 @@ renameatt(char *relname, ...@@ -174,7 +174,7 @@ renameatt(char *relname,
{ {
pfree(oldatttup); pfree(oldatttup);
heap_close(attrdesc); heap_close(attrdesc);
elog(ABORT, "renameatt: attribute \"%s\" exists", elog(ERROR, "renameatt: attribute \"%s\" exists",
newattname); newattname);
} }
...@@ -223,13 +223,13 @@ renamerel(char oldrelname[], char newrelname[]) ...@@ -223,13 +223,13 @@ renamerel(char oldrelname[], char newrelname[])
if (IsSystemRelationName(oldrelname)) if (IsSystemRelationName(oldrelname))
{ {
elog(ABORT, "renamerel: system relation \"%s\" not renamed", elog(ERROR, "renamerel: system relation \"%s\" not renamed",
oldrelname); oldrelname);
return; return;
} }
if (IsSystemRelationName(newrelname)) if (IsSystemRelationName(newrelname))
{ {
elog(ABORT, "renamerel: Illegal class name: \"%s\" -- pg_ is reserved for system catalogs", elog(ERROR, "renamerel: Illegal class name: \"%s\" -- pg_ is reserved for system catalogs",
newrelname); newrelname);
return; return;
} }
...@@ -240,7 +240,7 @@ renamerel(char oldrelname[], char newrelname[]) ...@@ -240,7 +240,7 @@ renamerel(char oldrelname[], char newrelname[])
if (!PointerIsValid(oldreltup)) if (!PointerIsValid(oldreltup))
{ {
heap_close(relrdesc); heap_close(relrdesc);
elog(ABORT, "renamerel: relation \"%s\" does not exist", elog(ERROR, "renamerel: relation \"%s\" does not exist",
oldrelname); oldrelname);
} }
...@@ -249,7 +249,7 @@ renamerel(char oldrelname[], char newrelname[]) ...@@ -249,7 +249,7 @@ renamerel(char oldrelname[], char newrelname[])
{ {
pfree(oldreltup); pfree(oldreltup);
heap_close(relrdesc); heap_close(relrdesc);
elog(ABORT, "renamerel: relation \"%s\" exists", elog(ERROR, "renamerel: relation \"%s\" exists",
newrelname); newrelname);
} }
...@@ -257,7 +257,7 @@ renamerel(char oldrelname[], char newrelname[]) ...@@ -257,7 +257,7 @@ renamerel(char oldrelname[], char newrelname[])
strcpy(oldpath, relpath(oldrelname)); strcpy(oldpath, relpath(oldrelname));
strcpy(newpath, relpath(newrelname)); strcpy(newpath, relpath(newrelname));
if (rename(oldpath, newpath) < 0) if (rename(oldpath, newpath) < 0)
elog(ABORT, "renamerel: unable to rename file: %m"); elog(ERROR, "renamerel: unable to rename file: %m");
memmove((char *) (((Form_pg_class) GETSTRUCT(oldreltup))->relname.data), memmove((char *) (((Form_pg_class) GETSTRUCT(oldreltup))->relname.data),
newrelname, newrelname,
......
...@@ -175,7 +175,7 @@ DefineSequence(CreateSeqStmt *seq) ...@@ -175,7 +175,7 @@ DefineSequence(CreateSeqStmt *seq)
buf = ReadBuffer(rel, P_NEW); buf = ReadBuffer(rel, P_NEW);
if (!BufferIsValid(buf)) if (!BufferIsValid(buf))
elog(ABORT, "DefineSequence: ReadBuffer failed"); elog(ERROR, "DefineSequence: ReadBuffer failed");
page = (PageHeader) BufferGetPage(buf); page = (PageHeader) BufferGetPage(buf);
...@@ -188,7 +188,7 @@ DefineSequence(CreateSeqStmt *seq) ...@@ -188,7 +188,7 @@ DefineSequence(CreateSeqStmt *seq)
heap_insert(rel, tuple); heap_insert(rel, tuple);
if (WriteBuffer(buf) == STATUS_ERROR) if (WriteBuffer(buf) == STATUS_ERROR)
elog(ABORT, "DefineSequence: WriteBuffer failed"); elog(ERROR, "DefineSequence: WriteBuffer failed");
RelationUnsetLockForWrite(rel); RelationUnsetLockForWrite(rel);
heap_close(rel); heap_close(rel);
...@@ -251,7 +251,7 @@ nextval(struct varlena * seqin) ...@@ -251,7 +251,7 @@ nextval(struct varlena * seqin)
if (rescnt > 0) if (rescnt > 0)
break; /* stop caching */ break; /* stop caching */
if (seq->is_cycled != 't') if (seq->is_cycled != 't')
elog(ABORT, "%s.nextval: got MAXVALUE (%d)", elog(ERROR, "%s.nextval: got MAXVALUE (%d)",
elm->name, maxv); elm->name, maxv);
next = minv; next = minv;
} }
...@@ -267,7 +267,7 @@ nextval(struct varlena * seqin) ...@@ -267,7 +267,7 @@ nextval(struct varlena * seqin)
if (rescnt > 0) if (rescnt > 0)
break; /* stop caching */ break; /* stop caching */
if (seq->is_cycled != 't') if (seq->is_cycled != 't')
elog(ABORT, "%s.nextval: got MINVALUE (%d)", elog(ERROR, "%s.nextval: got MINVALUE (%d)",
elm->name, minv); elm->name, minv);
next = maxv; next = maxv;
} }
...@@ -288,7 +288,7 @@ nextval(struct varlena * seqin) ...@@ -288,7 +288,7 @@ nextval(struct varlena * seqin)
seq->is_called = 't'; seq->is_called = 't';
if (WriteBuffer(buf) == STATUS_ERROR) if (WriteBuffer(buf) == STATUS_ERROR)
elog(ABORT, "%s.nextval: WriteBuffer failed", elm->name); elog(ERROR, "%s.nextval: WriteBuffer failed", elm->name);
ItemPointerSet(&iptr, 0, FirstOffsetNumber); ItemPointerSet(&iptr, 0, FirstOffsetNumber);
RelationUnsetSingleWLockPage(elm->rel, &iptr); RelationUnsetSingleWLockPage(elm->rel, &iptr);
...@@ -311,7 +311,7 @@ currval(struct varlena * seqin) ...@@ -311,7 +311,7 @@ currval(struct varlena * seqin)
if (elm->increment == 0) /* nextval/read_info were not called */ if (elm->increment == 0) /* nextval/read_info were not called */
{ {
elog(ABORT, "%s.currval is not yet defined in this session", elm->name); elog(ERROR, "%s.currval is not yet defined in this session", elm->name);
} }
result = elm->last; result = elm->last;
...@@ -334,18 +334,18 @@ read_info(char *caller, SeqTable elm, Buffer *buf) ...@@ -334,18 +334,18 @@ read_info(char *caller, SeqTable elm, Buffer *buf)
RelationSetSingleWLockPage(elm->rel, &iptr); RelationSetSingleWLockPage(elm->rel, &iptr);
if (RelationGetNumberOfBlocks(elm->rel) != 1) if (RelationGetNumberOfBlocks(elm->rel) != 1)
elog(ABORT, "%s.%s: invalid number of blocks in sequence", elog(ERROR, "%s.%s: invalid number of blocks in sequence",
elm->name, caller); elm->name, caller);
*buf = ReadBuffer(elm->rel, 0); *buf = ReadBuffer(elm->rel, 0);
if (!BufferIsValid(*buf)) if (!BufferIsValid(*buf))
elog(ABORT, "%s.%s: ReadBuffer failed", elm->name, caller); elog(ERROR, "%s.%s: ReadBuffer failed", elm->name, caller);
page = (PageHeader) BufferGetPage(*buf); page = (PageHeader) BufferGetPage(*buf);
sm = (sequence_magic *) PageGetSpecialPointer(page); sm = (sequence_magic *) PageGetSpecialPointer(page);
if (sm->magic != SEQ_MAGIC) if (sm->magic != SEQ_MAGIC)
elog(ABORT, "%s.%s: bad magic (%08X)", elm->name, caller, sm->magic); elog(ERROR, "%s.%s: bad magic (%08X)", elm->name, caller, sm->magic);
lp = PageGetItemId(page, FirstOffsetNumber); lp = PageGetItemId(page, FirstOffsetNumber);
Assert(ItemIdIsUsed(lp)); Assert(ItemIdIsUsed(lp));
...@@ -395,12 +395,12 @@ init_sequence(char *caller, char *name) ...@@ -395,12 +395,12 @@ init_sequence(char *caller, char *name)
temp->rel = heap_openr(name); temp->rel = heap_openr(name);
if (!RelationIsValid(temp->rel)) if (!RelationIsValid(temp->rel))
elog(ABORT, "%s.%s: sequence does not exist", name, caller); elog(ERROR, "%s.%s: sequence does not exist", name, caller);
RelationSetWIntentLock(temp->rel); RelationSetWIntentLock(temp->rel);
if (temp->rel->rd_rel->relkind != RELKIND_SEQUENCE) if (temp->rel->rd_rel->relkind != RELKIND_SEQUENCE)
elog(ABORT, "%s.%s: %s is not sequence !", name, caller, name); elog(ERROR, "%s.%s: %s is not sequence !", name, caller, name);
if (elm != (SeqTable) NULL) /* we opened sequence from our */ if (elm != (SeqTable) NULL) /* we opened sequence from our */
{ /* SeqTable - check relid ! */ { /* SeqTable - check relid ! */
...@@ -484,18 +484,18 @@ init_params(CreateSeqStmt *seq, SequenceTupleForm new) ...@@ -484,18 +484,18 @@ init_params(CreateSeqStmt *seq, SequenceTupleForm new)
else if (!strcasecmp(defel->defname, "cycle")) else if (!strcasecmp(defel->defname, "cycle"))
{ {
if (defel->arg != (Node *) NULL) if (defel->arg != (Node *) NULL)
elog(ABORT, "DefineSequence: CYCLE ??"); elog(ERROR, "DefineSequence: CYCLE ??");
new->is_cycled = 't'; new->is_cycled = 't';
} }
else else
elog(ABORT, "DefineSequence: option \"%s\" not recognized", elog(ERROR, "DefineSequence: option \"%s\" not recognized",
defel->defname); defel->defname);
} }
if (increment_by == (DefElem *) NULL) /* INCREMENT BY */ if (increment_by == (DefElem *) NULL) /* INCREMENT BY */
new->increment_by = 1; new->increment_by = 1;
else if ((new->increment_by = get_param(increment_by)) == 0) else if ((new->increment_by = get_param(increment_by)) == 0)
elog(ABORT, "DefineSequence: can't INCREMENT by 0"); elog(ERROR, "DefineSequence: can't INCREMENT by 0");
if (max_value == (DefElem *) NULL) /* MAXVALUE */ if (max_value == (DefElem *) NULL) /* MAXVALUE */
if (new->increment_by > 0) if (new->increment_by > 0)
...@@ -514,7 +514,7 @@ init_params(CreateSeqStmt *seq, SequenceTupleForm new) ...@@ -514,7 +514,7 @@ init_params(CreateSeqStmt *seq, SequenceTupleForm new)
new->min_value = get_param(min_value); new->min_value = get_param(min_value);
if (new->min_value >= new->max_value) if (new->min_value >= new->max_value)
elog(ABORT, "DefineSequence: MINVALUE (%d) can't be >= MAXVALUE (%d)", elog(ERROR, "DefineSequence: MINVALUE (%d) can't be >= MAXVALUE (%d)",
new->min_value, new->max_value); new->min_value, new->max_value);
if (last_value == (DefElem *) NULL) /* START WITH */ if (last_value == (DefElem *) NULL) /* START WITH */
...@@ -526,16 +526,16 @@ init_params(CreateSeqStmt *seq, SequenceTupleForm new) ...@@ -526,16 +526,16 @@ init_params(CreateSeqStmt *seq, SequenceTupleForm new)
new->last_value = get_param(last_value); new->last_value = get_param(last_value);
if (new->last_value < new->min_value) if (new->last_value < new->min_value)
elog(ABORT, "DefineSequence: START value (%d) can't be < MINVALUE (%d)", elog(ERROR, "DefineSequence: START value (%d) can't be < MINVALUE (%d)",
new->last_value, new->min_value); new->last_value, new->min_value);
if (new->last_value > new->max_value) if (new->last_value > new->max_value)
elog(ABORT, "DefineSequence: START value (%d) can't be > MAXVALUE (%d)", elog(ERROR, "DefineSequence: START value (%d) can't be > MAXVALUE (%d)",
new->last_value, new->max_value); new->last_value, new->max_value);
if (cache_value == (DefElem *) NULL) /* CACHE */ if (cache_value == (DefElem *) NULL) /* CACHE */
new->cache_value = 1; new->cache_value = 1;
else if ((new->cache_value = get_param(cache_value)) <= 0) else if ((new->cache_value = get_param(cache_value)) <= 0)
elog(ABORT, "DefineSequence: CACHE (%d) can't be <= 0", elog(ERROR, "DefineSequence: CACHE (%d) can't be <= 0",
new->cache_value); new->cache_value);
} }
...@@ -545,11 +545,11 @@ static int ...@@ -545,11 +545,11 @@ static int
get_param(DefElem *def) get_param(DefElem *def)
{ {
if (def->arg == (Node *) NULL) if (def->arg == (Node *) NULL)
elog(ABORT, "DefineSequence: \"%s\" value unspecified", def->defname); elog(ERROR, "DefineSequence: \"%s\" value unspecified", def->defname);
if (nodeTag(def->arg) == T_Integer) if (nodeTag(def->arg) == T_Integer)
return (intVal(def->arg)); return (intVal(def->arg));
elog(ABORT, "DefineSequence: \"%s\" is to be integer", def->defname); elog(ERROR, "DefineSequence: \"%s\" is to be integer", def->defname);
return (-1); return (-1);
} }
...@@ -68,16 +68,16 @@ CreateTrigger(CreateTrigStmt * stmt) ...@@ -68,16 +68,16 @@ CreateTrigger(CreateTrigStmt * stmt)
int i; int i;
if (IsSystemRelationName(stmt->relname)) if (IsSystemRelationName(stmt->relname))
elog(ABORT, "CreateTrigger: can't create trigger for system relation %s", stmt->relname); elog(ERROR, "CreateTrigger: can't create trigger for system relation %s", stmt->relname);
#ifndef NO_SECURITY #ifndef NO_SECURITY
if (!pg_ownercheck(GetPgUserName(), stmt->relname, RELNAME)) if (!pg_ownercheck(GetPgUserName(), stmt->relname, RELNAME))
elog(ABORT, "%s: %s", stmt->relname, aclcheck_error_strings[ACLCHECK_NOT_OWNER]); elog(ERROR, "%s: %s", stmt->relname, aclcheck_error_strings[ACLCHECK_NOT_OWNER]);
#endif #endif
rel = heap_openr(stmt->relname); rel = heap_openr(stmt->relname);
if (!RelationIsValid(rel)) if (!RelationIsValid(rel))
elog(ABORT, "CreateTrigger: there is no relation %s", stmt->relname); elog(ERROR, "CreateTrigger: there is no relation %s", stmt->relname);
RelationSetLockForWrite(rel); RelationSetLockForWrite(rel);
...@@ -87,7 +87,7 @@ CreateTrigger(CreateTrigStmt * stmt) ...@@ -87,7 +87,7 @@ CreateTrigger(CreateTrigStmt * stmt)
if (stmt->row) if (stmt->row)
TRIGGER_SETT_ROW(tgtype); TRIGGER_SETT_ROW(tgtype);
else else
elog(ABORT, "CreateTrigger: STATEMENT triggers are unimplemented, yet"); elog(ERROR, "CreateTrigger: STATEMENT triggers are unimplemented, yet");
for (i = 0; i < 3 && stmt->actions[i]; i++) for (i = 0; i < 3 && stmt->actions[i]; i++)
{ {
...@@ -95,21 +95,21 @@ CreateTrigger(CreateTrigStmt * stmt) ...@@ -95,21 +95,21 @@ CreateTrigger(CreateTrigStmt * stmt)
{ {
case 'i': case 'i':
if (TRIGGER_FOR_INSERT(tgtype)) if (TRIGGER_FOR_INSERT(tgtype))
elog(ABORT, "CreateTrigger: double INSERT event specified"); elog(ERROR, "CreateTrigger: double INSERT event specified");
TRIGGER_SETT_INSERT(tgtype); TRIGGER_SETT_INSERT(tgtype);
break; break;
case 'd': case 'd':
if (TRIGGER_FOR_DELETE(tgtype)) if (TRIGGER_FOR_DELETE(tgtype))
elog(ABORT, "CreateTrigger: double DELETE event specified"); elog(ERROR, "CreateTrigger: double DELETE event specified");
TRIGGER_SETT_DELETE(tgtype); TRIGGER_SETT_DELETE(tgtype);
break; break;
case 'u': case 'u':
if (TRIGGER_FOR_UPDATE(tgtype)) if (TRIGGER_FOR_UPDATE(tgtype))
elog(ABORT, "CreateTrigger: double UPDATE event specified"); elog(ERROR, "CreateTrigger: double UPDATE event specified");
TRIGGER_SETT_UPDATE(tgtype); TRIGGER_SETT_UPDATE(tgtype);
break; break;
default: default:
elog(ABORT, "CreateTrigger: unknown event specified"); elog(ERROR, "CreateTrigger: unknown event specified");
break; break;
} }
} }
...@@ -125,7 +125,7 @@ CreateTrigger(CreateTrigStmt * stmt) ...@@ -125,7 +125,7 @@ CreateTrigger(CreateTrigStmt * stmt)
Form_pg_trigger pg_trigger = (Form_pg_trigger) GETSTRUCT(tuple); Form_pg_trigger pg_trigger = (Form_pg_trigger) GETSTRUCT(tuple);
if (namestrcmp(&(pg_trigger->tgname), stmt->trigname) == 0) if (namestrcmp(&(pg_trigger->tgname), stmt->trigname) == 0)
elog(ABORT, "CreateTrigger: trigger %s already defined on relation %s", elog(ERROR, "CreateTrigger: trigger %s already defined on relation %s",
stmt->trigname, stmt->relname); stmt->trigname, stmt->relname);
else else
found++; found++;
...@@ -139,7 +139,7 @@ CreateTrigger(CreateTrigStmt * stmt) ...@@ -139,7 +139,7 @@ CreateTrigger(CreateTrigStmt * stmt)
if (!HeapTupleIsValid(tuple) || if (!HeapTupleIsValid(tuple) ||
((Form_pg_proc) GETSTRUCT(tuple))->prorettype != 0 || ((Form_pg_proc) GETSTRUCT(tuple))->prorettype != 0 ||
((Form_pg_proc) GETSTRUCT(tuple))->pronargs != 0) ((Form_pg_proc) GETSTRUCT(tuple))->pronargs != 0)
elog(ABORT, "CreateTrigger: function %s () does not exist", stmt->funcname); elog(ERROR, "CreateTrigger: function %s () does not exist", stmt->funcname);
if (((Form_pg_proc) GETSTRUCT(tuple))->prolang != ClanguageId) if (((Form_pg_proc) GETSTRUCT(tuple))->prolang != ClanguageId)
{ {
...@@ -150,12 +150,12 @@ CreateTrigger(CreateTrigStmt * stmt) ...@@ -150,12 +150,12 @@ CreateTrigger(CreateTrigStmt * stmt)
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(langTup)) if (!HeapTupleIsValid(langTup))
{ {
elog(ABORT, "CreateTrigger: cache lookup for PL failed"); elog(ERROR, "CreateTrigger: cache lookup for PL failed");
} }
if (((Form_pg_language) GETSTRUCT(langTup))->lanispl == false) if (((Form_pg_language) GETSTRUCT(langTup))->lanispl == false)
{ {
elog(ABORT, "CreateTrigger: only C and PL functions are supported"); elog(ERROR, "CreateTrigger: only C and PL functions are supported");
} }
} }
...@@ -227,7 +227,7 @@ CreateTrigger(CreateTrigStmt * stmt) ...@@ -227,7 +227,7 @@ CreateTrigger(CreateTrigStmt * stmt)
if (!PointerIsValid(tuple)) if (!PointerIsValid(tuple))
{ {
heap_close(relrdesc); heap_close(relrdesc);
elog(ABORT, "CreateTrigger: relation %s not found in pg_class", stmt->relname); elog(ERROR, "CreateTrigger: relation %s not found in pg_class", stmt->relname);
} }
((Form_pg_class) GETSTRUCT(tuple))->reltriggers = found + 1; ((Form_pg_class) GETSTRUCT(tuple))->reltriggers = found + 1;
RelationInvalidateHeapTuple(relrdesc, tuple); RelationInvalidateHeapTuple(relrdesc, tuple);
...@@ -266,12 +266,12 @@ DropTrigger(DropTrigStmt * stmt) ...@@ -266,12 +266,12 @@ DropTrigger(DropTrigStmt * stmt)
#ifndef NO_SECURITY #ifndef NO_SECURITY
if (!pg_ownercheck(GetPgUserName(), stmt->relname, RELNAME)) if (!pg_ownercheck(GetPgUserName(), stmt->relname, RELNAME))
elog(ABORT, "%s: %s", stmt->relname, aclcheck_error_strings[ACLCHECK_NOT_OWNER]); elog(ERROR, "%s: %s", stmt->relname, aclcheck_error_strings[ACLCHECK_NOT_OWNER]);
#endif #endif
rel = heap_openr(stmt->relname); rel = heap_openr(stmt->relname);
if (!RelationIsValid(rel)) if (!RelationIsValid(rel))
elog(ABORT, "DropTrigger: there is no relation %s", stmt->relname); elog(ERROR, "DropTrigger: there is no relation %s", stmt->relname);
RelationSetLockForWrite(rel); RelationSetLockForWrite(rel);
...@@ -293,7 +293,7 @@ DropTrigger(DropTrigStmt * stmt) ...@@ -293,7 +293,7 @@ DropTrigger(DropTrigStmt * stmt)
found++; found++;
} }
if (tgfound == 0) if (tgfound == 0)
elog(ABORT, "DropTrigger: there is no trigger %s on relation %s", elog(ERROR, "DropTrigger: there is no trigger %s on relation %s",
stmt->trigname, stmt->relname); stmt->trigname, stmt->relname);
if (tgfound > 1) if (tgfound > 1)
elog(NOTICE, "DropTrigger: found (and deleted) %d trigger %s on relation %s", elog(NOTICE, "DropTrigger: found (and deleted) %d trigger %s on relation %s",
...@@ -308,7 +308,7 @@ DropTrigger(DropTrigStmt * stmt) ...@@ -308,7 +308,7 @@ DropTrigger(DropTrigStmt * stmt)
if (!PointerIsValid(tuple)) if (!PointerIsValid(tuple))
{ {
heap_close(relrdesc); heap_close(relrdesc);
elog(ABORT, "DropTrigger: relation %s not found in pg_class", stmt->relname); elog(ERROR, "DropTrigger: relation %s not found in pg_class", stmt->relname);
} }
((Form_pg_class) GETSTRUCT(tuple))->reltriggers = found; ((Form_pg_class) GETSTRUCT(tuple))->reltriggers = found;
RelationInvalidateHeapTuple(relrdesc, tuple); RelationInvalidateHeapTuple(relrdesc, tuple);
...@@ -400,7 +400,7 @@ RelationBuildTriggers(Relation relation) ...@@ -400,7 +400,7 @@ RelationBuildTriggers(Relation relation)
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
continue; continue;
if (found == ntrigs) if (found == ntrigs)
elog(ABORT, "RelationBuildTriggers: unexpected record found for rel %.*s", elog(ERROR, "RelationBuildTriggers: unexpected record found for rel %.*s",
NAMEDATALEN, relation->rd_rel->relname.data); NAMEDATALEN, relation->rd_rel->relname.data);
pg_trigger = (Form_pg_trigger) GETSTRUCT(tuple); pg_trigger = (Form_pg_trigger) GETSTRUCT(tuple);
...@@ -422,7 +422,7 @@ RelationBuildTriggers(Relation relation) ...@@ -422,7 +422,7 @@ RelationBuildTriggers(Relation relation)
Anum_pg_trigger_tgargs, Anum_pg_trigger_tgargs,
tgrel->rd_att, &isnull); tgrel->rd_att, &isnull);
if (isnull) if (isnull)
elog(ABORT, "RelationBuildTriggers: tgargs IS NULL for rel %.*s", elog(ERROR, "RelationBuildTriggers: tgargs IS NULL for rel %.*s",
NAMEDATALEN, relation->rd_rel->relname.data); NAMEDATALEN, relation->rd_rel->relname.data);
if (build->tgnargs > 0) if (build->tgnargs > 0)
{ {
...@@ -433,7 +433,7 @@ RelationBuildTriggers(Relation relation) ...@@ -433,7 +433,7 @@ RelationBuildTriggers(Relation relation)
Anum_pg_trigger_tgargs, Anum_pg_trigger_tgargs,
tgrel->rd_att, &isnull); tgrel->rd_att, &isnull);
if (isnull) if (isnull)
elog(ABORT, "RelationBuildTriggers: tgargs IS NULL for rel %.*s", elog(ERROR, "RelationBuildTriggers: tgargs IS NULL for rel %.*s",
NAMEDATALEN, relation->rd_rel->relname.data); NAMEDATALEN, relation->rd_rel->relname.data);
p = (char *) VARDATA(val); p = (char *) VARDATA(val);
build->tgargs = (char **) palloc(build->tgnargs * sizeof(char *)); build->tgargs = (char **) palloc(build->tgnargs * sizeof(char *));
...@@ -452,7 +452,7 @@ RelationBuildTriggers(Relation relation) ...@@ -452,7 +452,7 @@ RelationBuildTriggers(Relation relation)
} }
if (found < ntrigs) if (found < ntrigs)
elog(ABORT, "RelationBuildTriggers: %d record not found for rel %.*s", elog(ERROR, "RelationBuildTriggers: %d record not found for rel %.*s",
ntrigs - found, ntrigs - found,
NAMEDATALEN, relation->rd_rel->relname.data); NAMEDATALEN, relation->rd_rel->relname.data);
...@@ -616,7 +616,7 @@ ExecCallTriggerFunc(Trigger * trigger) ...@@ -616,7 +616,7 @@ ExecCallTriggerFunc(Trigger * trigger)
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(procTuple)) if (!HeapTupleIsValid(procTuple))
{ {
elog(ABORT, "ExecCallTriggerFunc(): Cache lookup for proc %ld failed", elog(ERROR, "ExecCallTriggerFunc(): Cache lookup for proc %ld failed",
ObjectIdGetDatum(trigger->tgfoid)); ObjectIdGetDatum(trigger->tgfoid));
} }
procStruct = (Form_pg_proc) GETSTRUCT(procTuple); procStruct = (Form_pg_proc) GETSTRUCT(procTuple);
...@@ -626,7 +626,7 @@ ExecCallTriggerFunc(Trigger * trigger) ...@@ -626,7 +626,7 @@ ExecCallTriggerFunc(Trigger * trigger)
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(langTuple)) if (!HeapTupleIsValid(langTuple))
{ {
elog(ABORT, "ExecCallTriggerFunc(): Cache lookup for language %ld failed", elog(ERROR, "ExecCallTriggerFunc(): Cache lookup for language %ld failed",
ObjectIdGetDatum(procStruct->prolang)); ObjectIdGetDatum(procStruct->prolang));
} }
langStruct = (Form_pg_language) GETSTRUCT(langTuple); langStruct = (Form_pg_language) GETSTRUCT(langTuple);
...@@ -840,7 +840,7 @@ GetTupleForTrigger(Relation relation, ItemPointer tid, bool before) ...@@ -840,7 +840,7 @@ GetTupleForTrigger(Relation relation, ItemPointer tid, bool before)
b = ReadBuffer(relation, ItemPointerGetBlockNumber(tid)); b = ReadBuffer(relation, ItemPointerGetBlockNumber(tid));
if (!BufferIsValid(b)) if (!BufferIsValid(b))
elog(ABORT, "GetTupleForTrigger: failed ReadBuffer"); elog(ERROR, "GetTupleForTrigger: failed ReadBuffer");
dp = (PageHeader) BufferGetPage(b); dp = (PageHeader) BufferGetPage(b);
lp = PageGetItemId(dp, ItemPointerGetOffsetNumber(tid)); lp = PageGetItemId(dp, ItemPointerGetOffsetNumber(tid));
...@@ -863,7 +863,7 @@ GetTupleForTrigger(Relation relation, ItemPointer tid, bool before) ...@@ -863,7 +863,7 @@ GetTupleForTrigger(Relation relation, ItemPointer tid, bool before)
if (!tuple) if (!tuple)
{ {
ReleaseBuffer(b); ReleaseBuffer(b);
elog(ABORT, "GetTupleForTrigger: (am)invalid tid"); elog(ERROR, "GetTupleForTrigger: (am)invalid tid");
} }
} }
......
...@@ -102,7 +102,7 @@ void DefineUser(CreateUserStmt *stmt) { ...@@ -102,7 +102,7 @@ void DefineUser(CreateUserStmt *stmt) {
pg_user = GetPgUserName(); pg_user = GetPgUserName();
if (pg_aclcheck(UserRelationName, pg_user, ACL_RD | ACL_WR | ACL_AP) != ACLCHECK_OK) { if (pg_aclcheck(UserRelationName, pg_user, ACL_RD | ACL_WR | ACL_AP) != ACLCHECK_OK) {
UserAbortTransactionBlock(); UserAbortTransactionBlock();
elog(ABORT, "defineUser: user \"%s\" does not have SELECT and INSERT privilege for \"%s\"", elog(ERROR, "defineUser: user \"%s\" does not have SELECT and INSERT privilege for \"%s\"",
pg_user, UserRelationName); pg_user, UserRelationName);
return; return;
} }
...@@ -135,7 +135,7 @@ void DefineUser(CreateUserStmt *stmt) { ...@@ -135,7 +135,7 @@ void DefineUser(CreateUserStmt *stmt) {
RelationUnsetLockForWrite(pg_user_rel); RelationUnsetLockForWrite(pg_user_rel);
heap_close(pg_user_rel); heap_close(pg_user_rel);
UserAbortTransactionBlock(); UserAbortTransactionBlock();
elog(ABORT, "defineUser: user \"%s\" has already been created", stmt->user); elog(ERROR, "defineUser: user \"%s\" has already been created", stmt->user);
return; return;
} }
...@@ -213,7 +213,7 @@ extern void AlterUser(AlterUserStmt *stmt) { ...@@ -213,7 +213,7 @@ extern void AlterUser(AlterUserStmt *stmt) {
pg_user = GetPgUserName(); pg_user = GetPgUserName();
if (pg_aclcheck(UserRelationName, pg_user, ACL_RD | ACL_WR) != ACLCHECK_OK) { if (pg_aclcheck(UserRelationName, pg_user, ACL_RD | ACL_WR) != ACLCHECK_OK) {
UserAbortTransactionBlock(); UserAbortTransactionBlock();
elog(ABORT, "alterUser: user \"%s\" does not have SELECT and UPDATE privilege for \"%s\"", elog(ERROR, "alterUser: user \"%s\" does not have SELECT and UPDATE privilege for \"%s\"",
pg_user, UserRelationName); pg_user, UserRelationName);
return; return;
} }
...@@ -243,7 +243,7 @@ extern void AlterUser(AlterUserStmt *stmt) { ...@@ -243,7 +243,7 @@ extern void AlterUser(AlterUserStmt *stmt) {
RelationUnsetLockForWrite(pg_user_rel); RelationUnsetLockForWrite(pg_user_rel);
heap_close(pg_user_rel); heap_close(pg_user_rel);
UserAbortTransactionBlock(); UserAbortTransactionBlock();
elog(ABORT, "alterUser: user \"%s\" does not exist", stmt->user); elog(ERROR, "alterUser: user \"%s\" does not exist", stmt->user);
return; return;
} }
...@@ -323,7 +323,7 @@ extern void RemoveUser(char* user) { ...@@ -323,7 +323,7 @@ extern void RemoveUser(char* user) {
pg_user = GetPgUserName(); pg_user = GetPgUserName();
if (pg_aclcheck(UserRelationName, pg_user, ACL_RD | ACL_WR) != ACLCHECK_OK) { if (pg_aclcheck(UserRelationName, pg_user, ACL_RD | ACL_WR) != ACLCHECK_OK) {
UserAbortTransactionBlock(); UserAbortTransactionBlock();
elog(ABORT, "removeUser: user \"%s\" does not have SELECT and DELETE privilege for \"%s\"", elog(ERROR, "removeUser: user \"%s\" does not have SELECT and DELETE privilege for \"%s\"",
pg_user, UserRelationName); pg_user, UserRelationName);
return; return;
} }
...@@ -355,7 +355,7 @@ extern void RemoveUser(char* user) { ...@@ -355,7 +355,7 @@ extern void RemoveUser(char* user) {
RelationUnsetLockForWrite(pg_user_rel); RelationUnsetLockForWrite(pg_user_rel);
heap_close(pg_user_rel); heap_close(pg_user_rel);
UserAbortTransactionBlock(); UserAbortTransactionBlock();
elog(ABORT, "removeUser: user \"%s\" does not exist", user); elog(ERROR, "removeUser: user \"%s\" does not exist", user);
return; return;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.56 1998/01/05 03:30:57 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.57 1998/01/05 16:39:05 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -185,7 +185,7 @@ vc_init() ...@@ -185,7 +185,7 @@ vc_init()
int fd; int fd;
if ((fd = open("pg_vlock", O_CREAT | O_EXCL, 0600)) < 0) if ((fd = open("pg_vlock", O_CREAT | O_EXCL, 0600)) < 0)
elog(ABORT, "can't create lock file -- another vacuum cleaner running?"); elog(ERROR, "can't create lock file -- another vacuum cleaner running?");
close(fd); close(fd);
...@@ -207,7 +207,7 @@ vc_shutdown() ...@@ -207,7 +207,7 @@ vc_shutdown()
{ {
/* on entry, not in a transaction */ /* on entry, not in a transaction */
if (unlink("pg_vlock") < 0) if (unlink("pg_vlock") < 0)
elog(ABORT, "vacuum: can't destroy lock file!"); elog(ERROR, "vacuum: can't destroy lock file!");
/* okay, we're done */ /* okay, we're done */
VacuumRunning = false; VacuumRunning = false;
...@@ -438,7 +438,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols) ...@@ -438,7 +438,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
List *le; List *le;
if (length(va_cols) > attr_cnt) if (length(va_cols) > attr_cnt)
elog(ABORT, "vacuum: too many attributes specified for relation %s", elog(ERROR, "vacuum: too many attributes specified for relation %s",
(RelationGetRelationName(onerel))->data); (RelationGetRelationName(onerel))->data);
attnums = (int *) palloc(attr_cnt * sizeof(int)); attnums = (int *) palloc(attr_cnt * sizeof(int));
foreach(le, va_cols) foreach(le, va_cols)
...@@ -454,7 +454,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols) ...@@ -454,7 +454,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
attnums[tcnt++] = i; attnums[tcnt++] = i;
else else
{ {
elog(ABORT, "vacuum: there is no attribute %s in %s", elog(ERROR, "vacuum: there is no attribute %s in %s",
col, (RelationGetRelationName(onerel))->data); col, (RelationGetRelationName(onerel))->data);
} }
} }
...@@ -1139,7 +1139,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel, ...@@ -1139,7 +1139,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
InvalidOffsetNumber, LP_USED); InvalidOffsetNumber, LP_USED);
if (newoff == InvalidOffsetNumber) if (newoff == InvalidOffsetNumber)
{ {
elog(ABORT, "\ elog(ERROR, "\
failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)", failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
tlen, ToVpd->vpd_blkno, ToVpd->vpd_free, tlen, ToVpd->vpd_blkno, ToVpd->vpd_free,
ToVpd->vpd_nusd, ToVpd->vpd_noff); ToVpd->vpd_nusd, ToVpd->vpd_noff);
...@@ -1789,7 +1789,7 @@ vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelst ...@@ -1789,7 +1789,7 @@ vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelst
rsdesc = heap_beginscan(rd, false, false, 1, &rskey); rsdesc = heap_beginscan(rd, false, false, 1, &rskey);
if (!HeapTupleIsValid(rtup = heap_getnext(rsdesc, 0, &rbuf))) if (!HeapTupleIsValid(rtup = heap_getnext(rsdesc, 0, &rbuf)))
elog(ABORT, "pg_class entry for relid %d vanished during vacuuming", elog(ERROR, "pg_class entry for relid %d vanished during vacuuming",
relid); relid);
/* overwrite the existing statistics in the tuple */ /* overwrite the existing statistics in the tuple */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.18 1998/01/05 03:30:59 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.19 1998/01/05 16:39:08 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -89,7 +89,7 @@ DefineVirtualRelation(char *relname, List *tlist) ...@@ -89,7 +89,7 @@ DefineVirtualRelation(char *relname, List *tlist)
} }
else else
{ {
elog(ABORT, "attempted to define virtual relation with no attrs"); elog(ERROR, "attempted to define virtual relation with no attrs");
} }
/* /*
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.33 1998/01/05 03:32:35 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.34 1998/01/05 16:39:19 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -199,13 +199,13 @@ other . ...@@ -199,13 +199,13 @@ other .
errno = 0; errno = 0;
yylval.ival = strtol((char *)literal,&endptr,2); yylval.ival = strtol((char *)literal,&endptr,2);
if (*endptr != '\0' || errno == ERANGE) if (*endptr != '\0' || errno == ERANGE)
elog(ABORT,"Bad binary integer input '%s'",literal); elog(ERROR,"Bad binary integer input '%s'",literal);
return (ICONST); return (ICONST);
} }
<xh>{xhinside} | <xh>{xhinside} |
<xb>{xbinside} { <xb>{xbinside} {
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1)) if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER); elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1); memcpy(literal+llen, yytext, yyleng+1);
llen += yyleng; llen += yyleng;
} }
...@@ -225,7 +225,7 @@ other . ...@@ -225,7 +225,7 @@ other .
errno = 0; errno = 0;
yylval.ival = strtol((char *)literal,&endptr,16); yylval.ival = strtol((char *)literal,&endptr,16);
if (*endptr != '\0' || errno == ERANGE) if (*endptr != '\0' || errno == ERANGE)
elog(ABORT,"Bad hexadecimal integer input '%s'",literal); elog(ERROR,"Bad hexadecimal integer input '%s'",literal);
return (ICONST); return (ICONST);
} }
...@@ -242,13 +242,13 @@ other . ...@@ -242,13 +242,13 @@ other .
<xq>{xqdouble} | <xq>{xqdouble} |
<xq>{xqinside} { <xq>{xqinside} {
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1)) if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER); elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1); memcpy(literal+llen, yytext, yyleng+1);
llen += yyleng; llen += yyleng;
} }
<xq>{xqembedded} { <xq>{xqembedded} {
if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1)) if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1))
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER); elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1); memcpy(literal+llen, yytext, yyleng+1);
*(literal+llen) = '\''; *(literal+llen) = '\'';
llen += yyleng; llen += yyleng;
...@@ -256,7 +256,7 @@ other . ...@@ -256,7 +256,7 @@ other .
<xq>{xqliteral} { <xq>{xqliteral} {
if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1)) if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1))
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER); elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1); memcpy(literal+llen, yytext, yyleng+1);
llen += yyleng; llen += yyleng;
} }
...@@ -276,7 +276,7 @@ other . ...@@ -276,7 +276,7 @@ other .
} }
<xd>{xdinside} { <xd>{xdinside} {
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1)) if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER); elog(ERROR,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1); memcpy(literal+llen, yytext, yyleng+1);
llen += yyleng; llen += yyleng;
} }
...@@ -318,7 +318,7 @@ other . ...@@ -318,7 +318,7 @@ other .
errno = 0; errno = 0;
yylval.ival = strtol((char *)yytext,&endptr,10); yylval.ival = strtol((char *)yytext,&endptr,10);
if (*endptr != '\0' || errno == ERANGE) if (*endptr != '\0' || errno == ERANGE)
elog(ABORT,"Bad integer input '%s'",yytext); elog(ERROR,"Bad integer input '%s'",yytext);
return (ICONST); return (ICONST);
} }
{real}/{space}*-{number} { {real}/{space}*-{number} {
...@@ -328,7 +328,7 @@ other . ...@@ -328,7 +328,7 @@ other .
errno = 0; errno = 0;
yylval.dval = strtod(((char *)yytext),&endptr); yylval.dval = strtod(((char *)yytext),&endptr);
if (*endptr != '\0' || errno == ERANGE) if (*endptr != '\0' || errno == ERANGE)
elog(ABORT,"Bad float8 input '%s'",yytext); elog(ERROR,"Bad float8 input '%s'",yytext);
CheckFloat8Val(yylval.dval); CheckFloat8Val(yylval.dval);
return (FCONST); return (FCONST);
} }
...@@ -338,7 +338,7 @@ other . ...@@ -338,7 +338,7 @@ other .
errno = 0; errno = 0;
yylval.ival = strtol((char *)yytext,&endptr,10); yylval.ival = strtol((char *)yytext,&endptr,10);
if (*endptr != '\0' || errno == ERANGE) if (*endptr != '\0' || errno == ERANGE)
elog(ABORT,"Bad integer input '%s'",yytext); elog(ERROR,"Bad integer input '%s'",yytext);
return (ICONST); return (ICONST);
} }
{real} { {real} {
...@@ -347,7 +347,7 @@ other . ...@@ -347,7 +347,7 @@ other .
errno = 0; errno = 0;
yylval.dval = strtod((char *)yytext,&endptr); yylval.dval = strtod((char *)yytext,&endptr);
if (*endptr != '\0' || errno == ERANGE) if (*endptr != '\0' || errno == ERANGE)
elog(ABORT,"Bad float input '%s'",yytext); elog(ERROR,"Bad float input '%s'",yytext);
CheckFloat8Val(yylval.dval); CheckFloat8Val(yylval.dval);
return (FCONST); return (FCONST);
} }
...@@ -377,7 +377,7 @@ other . ...@@ -377,7 +377,7 @@ other .
void yyerror(char message[]) void yyerror(char message[])
{ {
elog(ABORT, "parser: %s at or near \"%s\"", message, yytext); elog(ERROR, "parser: %s at or near \"%s\"", message, yytext);
} }
int yywrap() int yywrap()
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/Attic/aclchk.c,v 1.21 1998/01/05 03:33:40 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/tcop/Attic/aclchk.c,v 1.22 1998/01/05 16:39:30 momjian Exp $
* *
* NOTES * NOTES
* See acl.h. * See acl.h.
...@@ -120,7 +120,7 @@ ChangeAcl(char *relname, ...@@ -120,7 +120,7 @@ ChangeAcl(char *relname,
*/ */
relation = heap_openr(RelationRelationName); relation = heap_openr(RelationRelationName);
if (!RelationIsValid(relation)) if (!RelationIsValid(relation))
elog(ABORT, "ChangeAcl: could not open '%s'??", elog(ERROR, "ChangeAcl: could not open '%s'??",
RelationRelationName); RelationRelationName);
fmgr_info(NameEqualRegProcedure, &relkey[0].sk_func, &relkey[0].sk_nargs); fmgr_info(NameEqualRegProcedure, &relkey[0].sk_func, &relkey[0].sk_nargs);
relkey[0].sk_argument = NameGetDatum(relname); relkey[0].sk_argument = NameGetDatum(relname);
...@@ -134,7 +134,7 @@ ChangeAcl(char *relname, ...@@ -134,7 +134,7 @@ ChangeAcl(char *relname,
{ {
heap_endscan(hsdp); heap_endscan(hsdp);
heap_close(relation); heap_close(relation);
elog(ABORT, "ChangeAcl: class \"%s\" not found", elog(ERROR, "ChangeAcl: class \"%s\" not found",
relname); relname);
return; return;
} }
...@@ -205,7 +205,7 @@ get_grosysid(char *groname) ...@@ -205,7 +205,7 @@ get_grosysid(char *groname)
} }
else else
{ {
elog(ABORT, "non-existent group \"%s\"", groname); elog(ERROR, "non-existent group \"%s\"", groname);
} }
return (id); return (id);
} }
...@@ -370,7 +370,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode) ...@@ -370,7 +370,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode)
case ACL_IDTYPE_WORLD: case ACL_IDTYPE_WORLD:
break; break;
default: default:
elog(ABORT, "aclcheck: bogus ACL id type: %d", idtype); elog(ERROR, "aclcheck: bogus ACL id type: %d", idtype);
break; break;
} }
...@@ -393,7 +393,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode) ...@@ -393,7 +393,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename), htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(ABORT, "pg_aclcheck: user \"%s\" not found", elog(ERROR, "pg_aclcheck: user \"%s\" not found",
usename); usename);
id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid; id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid;
...@@ -445,9 +445,9 @@ pg_aclcheck(char *relname, char *usename, AclMode mode) ...@@ -445,9 +445,9 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
{ {
elog(ABORT, "pg_aclcheck: class \"%s\" not found", elog(ERROR, "pg_aclcheck: class \"%s\" not found",
relname); relname);
/* an elog(ABORT) kills us, so no need to return anything. */ /* an elog(ERROR) kills us, so no need to return anything. */
} }
if (!heap_attisnull(htp, Anum_pg_class_relacl)) if (!heap_attisnull(htp, Anum_pg_class_relacl))
{ {
...@@ -528,7 +528,7 @@ pg_ownercheck(char *usename, ...@@ -528,7 +528,7 @@ pg_ownercheck(char *usename,
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename), htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(ABORT, "pg_ownercheck: user \"%s\" not found", elog(ERROR, "pg_ownercheck: user \"%s\" not found",
usename); usename);
user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid; user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid;
...@@ -550,30 +550,30 @@ pg_ownercheck(char *usename, ...@@ -550,30 +550,30 @@ pg_ownercheck(char *usename,
{ {
case OPROID: case OPROID:
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(ABORT, "pg_ownercheck: operator %ld not found", elog(ERROR, "pg_ownercheck: operator %ld not found",
PointerGetDatum(value)); PointerGetDatum(value));
owner_id = ((OperatorTupleForm) GETSTRUCT(htp))->oprowner; owner_id = ((OperatorTupleForm) GETSTRUCT(htp))->oprowner;
break; break;
case PRONAME: case PRONAME:
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(ABORT, "pg_ownercheck: function \"%s\" not found", elog(ERROR, "pg_ownercheck: function \"%s\" not found",
value); value);
owner_id = ((Form_pg_proc) GETSTRUCT(htp))->proowner; owner_id = ((Form_pg_proc) GETSTRUCT(htp))->proowner;
break; break;
case RELNAME: case RELNAME:
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(ABORT, "pg_ownercheck: class \"%s\" not found", elog(ERROR, "pg_ownercheck: class \"%s\" not found",
value); value);
owner_id = ((Form_pg_class) GETSTRUCT(htp))->relowner; owner_id = ((Form_pg_class) GETSTRUCT(htp))->relowner;
break; break;
case TYPNAME: case TYPNAME:
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(ABORT, "pg_ownercheck: type \"%s\" not found", elog(ERROR, "pg_ownercheck: type \"%s\" not found",
value); value);
owner_id = ((TypeTupleForm) GETSTRUCT(htp))->typowner; owner_id = ((TypeTupleForm) GETSTRUCT(htp))->typowner;
break; break;
default: default:
elog(ABORT, "pg_ownercheck: invalid cache id: %d", elog(ERROR, "pg_ownercheck: invalid cache id: %d",
cacheid); cacheid);
break; break;
} }
...@@ -594,7 +594,7 @@ pg_func_ownercheck(char *usename, ...@@ -594,7 +594,7 @@ pg_func_ownercheck(char *usename,
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename), htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(ABORT, "pg_func_ownercheck: user \"%s\" not found", elog(ERROR, "pg_func_ownercheck: user \"%s\" not found",
usename); usename);
user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid; user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid;
...@@ -635,7 +635,7 @@ pg_aggr_ownercheck(char *usename, ...@@ -635,7 +635,7 @@ pg_aggr_ownercheck(char *usename,
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename), htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(ABORT, "pg_aggr_ownercheck: user \"%s\" not found", elog(ERROR, "pg_aggr_ownercheck: user \"%s\" not found",
usename); usename);
user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid; user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.34 1998/01/05 03:33:49 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.35 1998/01/05 16:39:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -183,24 +183,24 @@ ProcessUtility(Node * parsetree, ...@@ -183,24 +183,24 @@ ProcessUtility(Node * parsetree,
{ {
relname = strVal(lfirst(arg)); relname = strVal(lfirst(arg));
if (IsSystemRelationName(relname)) if (IsSystemRelationName(relname))
elog(ABORT, "class \"%s\" is a system catalog", elog(ERROR, "class \"%s\" is a system catalog",
relname); relname);
rel = heap_openr(relname); rel = heap_openr(relname);
if (RelationIsValid(rel)) if (RelationIsValid(rel))
{ {
if (stmt->sequence && if (stmt->sequence &&
rel->rd_rel->relkind != RELKIND_SEQUENCE) rel->rd_rel->relkind != RELKIND_SEQUENCE)
elog(ABORT, "Use DROP TABLE to drop table '%s'", elog(ERROR, "Use DROP TABLE to drop table '%s'",
relname); relname);
if (!(stmt->sequence) && if (!(stmt->sequence) &&
rel->rd_rel->relkind == RELKIND_SEQUENCE) rel->rd_rel->relkind == RELKIND_SEQUENCE)
elog(ABORT, "Use DROP SEQUENCE to drop sequence '%s'", elog(ERROR, "Use DROP SEQUENCE to drop sequence '%s'",
relname); relname);
heap_close(rel); heap_close(rel);
} }
#ifndef NO_SECURITY #ifndef NO_SECURITY
if (!pg_ownercheck(userName, relname, RELNAME)) if (!pg_ownercheck(userName, relname, RELNAME))
elog(ABORT, "you do not own class \"%s\"", elog(ERROR, "you do not own class \"%s\"",
relname); relname);
#endif #endif
} }
...@@ -263,11 +263,11 @@ ProcessUtility(Node * parsetree, ...@@ -263,11 +263,11 @@ ProcessUtility(Node * parsetree,
relname = stmt->relname; relname = stmt->relname;
if (IsSystemRelationName(relname)) if (IsSystemRelationName(relname))
elog(ABORT, "class \"%s\" is a system catalog", elog(ERROR, "class \"%s\" is a system catalog",
relname); relname);
#ifndef NO_SECURITY #ifndef NO_SECURITY
if (!pg_ownercheck(userName, relname, RELNAME)) if (!pg_ownercheck(userName, relname, RELNAME))
elog(ABORT, "you do not own class \"%s\"", elog(ERROR, "you do not own class \"%s\"",
relname); relname);
#endif #endif
...@@ -327,7 +327,7 @@ ProcessUtility(Node * parsetree, ...@@ -327,7 +327,7 @@ ProcessUtility(Node * parsetree,
{ {
relname = strVal(lfirst(i)); relname = strVal(lfirst(i));
if (!pg_ownercheck(userName, relname, RELNAME)) if (!pg_ownercheck(userName, relname, RELNAME))
elog(ABORT, "you do not own class \"%s\"", elog(ERROR, "you do not own class \"%s\"",
relname); relname);
} }
#endif #endif
...@@ -413,7 +413,7 @@ ProcessUtility(Node * parsetree, ...@@ -413,7 +413,7 @@ ProcessUtility(Node * parsetree,
relname = stmt->object->relname; relname = stmt->object->relname;
aclcheck_result = pg_aclcheck(relname, userName, ACL_RU); aclcheck_result = pg_aclcheck(relname, userName, ACL_RU);
if (aclcheck_result != ACLCHECK_OK) if (aclcheck_result != ACLCHECK_OK)
elog(ABORT, "%s: %s", relname, aclcheck_error_strings[aclcheck_result]); elog(ERROR, "%s: %s", relname, aclcheck_error_strings[aclcheck_result]);
#endif #endif
commandTag = "CREATE"; commandTag = "CREATE";
CHECK_IF_ABORTED(); CHECK_IF_ABORTED();
...@@ -453,11 +453,11 @@ ProcessUtility(Node * parsetree, ...@@ -453,11 +453,11 @@ ProcessUtility(Node * parsetree,
case INDEX: case INDEX:
relname = stmt->name; relname = stmt->name;
if (IsSystemRelationName(relname)) if (IsSystemRelationName(relname))
elog(ABORT, "class \"%s\" is a system catalog index", elog(ERROR, "class \"%s\" is a system catalog index",
relname); relname);
#ifndef NO_SECURITY #ifndef NO_SECURITY
if (!pg_ownercheck(userName, relname, RELNAME)) if (!pg_ownercheck(userName, relname, RELNAME))
elog(ABORT, "%s: %s", relname, aclcheck_error_strings[ACLCHECK_NOT_OWNER]); elog(ERROR, "%s: %s", relname, aclcheck_error_strings[ACLCHECK_NOT_OWNER]);
#endif #endif
RemoveIndex(relname); RemoveIndex(relname);
break; break;
...@@ -472,7 +472,7 @@ ProcessUtility(Node * parsetree, ...@@ -472,7 +472,7 @@ ProcessUtility(Node * parsetree,
aclcheck_result = pg_aclcheck(relationName, userName, ACL_RU); aclcheck_result = pg_aclcheck(relationName, userName, ACL_RU);
if (aclcheck_result != ACLCHECK_OK) if (aclcheck_result != ACLCHECK_OK)
{ {
elog(ABORT, "%s: %s", relationName, aclcheck_error_strings[aclcheck_result]); elog(ERROR, "%s: %s", relationName, aclcheck_error_strings[aclcheck_result]);
} }
#endif #endif
RemoveRewriteRule(rulename); RemoveRewriteRule(rulename);
...@@ -494,7 +494,7 @@ ProcessUtility(Node * parsetree, ...@@ -494,7 +494,7 @@ ProcessUtility(Node * parsetree,
ruleName = MakeRetrieveViewRuleName(viewName); ruleName = MakeRetrieveViewRuleName(viewName);
relationName = RewriteGetRuleEventRel(ruleName); relationName = RewriteGetRuleEventRel(ruleName);
if (!pg_ownercheck(userName, relationName, RELNAME)) if (!pg_ownercheck(userName, relationName, RELNAME))
elog(ABORT, "%s: %s", relationName, aclcheck_error_strings[ACLCHECK_NOT_OWNER]); elog(ERROR, "%s: %s", relationName, aclcheck_error_strings[ACLCHECK_NOT_OWNER]);
pfree(ruleName); pfree(ruleName);
#endif #endif
RemoveView(viewName); RemoveView(viewName);
...@@ -546,7 +546,7 @@ ProcessUtility(Node * parsetree, ...@@ -546,7 +546,7 @@ ProcessUtility(Node * parsetree,
case T_VersionStmt: case T_VersionStmt:
{ {
elog(ABORT, "CREATE VERSION is not currently implemented"); elog(ERROR, "CREATE VERSION is not currently implemented");
} }
break; break;
...@@ -609,7 +609,7 @@ ProcessUtility(Node * parsetree, ...@@ -609,7 +609,7 @@ ProcessUtility(Node * parsetree,
filename = stmt->filename; filename = stmt->filename;
closeAllVfds(); closeAllVfds();
if ((fp = AllocateFile(filename, "r")) == NULL) if ((fp = AllocateFile(filename, "r")) == NULL)
elog(ABORT, "LOAD: could not open file %s", filename); elog(ERROR, "LOAD: could not open file %s", filename);
FreeFile(fp); FreeFile(fp);
load_file(filename); load_file(filename);
} }
...@@ -754,7 +754,7 @@ ProcessUtility(Node * parsetree, ...@@ -754,7 +754,7 @@ ProcessUtility(Node * parsetree,
* *
*/ */
default: default:
elog(ABORT, "ProcessUtility: command #%d unsupported", elog(ERROR, "ProcessUtility: command #%d unsupported",
nodeTag(parsetree)); nodeTag(parsetree));
break; break;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Routines for handling of 'SET var TO', * Routines for handling of 'SET var TO',
* 'SHOW var' and 'RESET var' statements. * 'SHOW var' and 'RESET var' statements.
* *
* $Id: variable.c,v 1.25 1998/01/05 03:33:50 momjian Exp $ * $Id: variable.c,v 1.26 1998/01/05 16:39:35 momjian Exp $
* *
*/ */
...@@ -53,7 +53,7 @@ get_token(char **tok, char **val, const char *str) ...@@ -53,7 +53,7 @@ get_token(char **tok, char **val, const char *str)
while (isspace(*str)) while (isspace(*str))
str++; str++;
if (*str == ',' || *str == '=') if (*str == ',' || *str == '=')
elog(ABORT, "Syntax error near (%s): empty setting", str); elog(ERROR, "Syntax error near (%s): empty setting", str);
/* end of string? then return NULL */ /* end of string? then return NULL */
if (!(*str)) if (!(*str))
...@@ -94,7 +94,7 @@ get_token(char **tok, char **val, const char *str) ...@@ -94,7 +94,7 @@ get_token(char **tok, char **val, const char *str)
} }
else if ((val == NULL) || (*str != '=')) else if ((val == NULL) || (*str != '='))
{ {
elog(ABORT, "Syntax error near (%s)", str); elog(ERROR, "Syntax error near (%s)", str);
}; };
str++; /* '=': get value */ str++; /* '=': get value */
...@@ -105,7 +105,7 @@ get_token(char **tok, char **val, const char *str) ...@@ -105,7 +105,7 @@ get_token(char **tok, char **val, const char *str)
str++; str++;
if (*str == ',' || !(*str)) if (*str == ',' || !(*str))
elog(ABORT, "Syntax error near (=%s)", str); elog(ERROR, "Syntax error near (=%s)", str);
start = str; start = str;
...@@ -131,7 +131,7 @@ get_token(char **tok, char **val, const char *str) ...@@ -131,7 +131,7 @@ get_token(char **tok, char **val, const char *str)
if (*str == ',') if (*str == ',')
return (++str); return (++str);
elog(ABORT, "Syntax error near (%s)", str); elog(ERROR, "Syntax error near (%s)", str);
return str; return str;
} }
...@@ -172,10 +172,10 @@ parse_geqo(const char *value) ...@@ -172,10 +172,10 @@ parse_geqo(const char *value)
rest = get_token(&tok, &val, value); rest = get_token(&tok, &val, value);
if (tok == NULL) if (tok == NULL)
elog(ABORT, "Value undefined"); elog(ERROR, "Value undefined");
if ((rest) && (*rest != '\0')) if ((rest) && (*rest != '\0'))
elog(ABORT, "Unable to parse '%s'", value); elog(ERROR, "Unable to parse '%s'", value);
if (strcasecmp(tok, "on") == 0) if (strcasecmp(tok, "on") == 0)
{ {
...@@ -185,7 +185,7 @@ parse_geqo(const char *value) ...@@ -185,7 +185,7 @@ parse_geqo(const char *value)
{ {
geqo_rels = pg_atoi(val, sizeof(int32), '\0'); geqo_rels = pg_atoi(val, sizeof(int32), '\0');
if (geqo_rels <= 1) if (geqo_rels <= 1)
elog(ABORT, "Bad value for # of relations (%s)", val); elog(ERROR, "Bad value for # of relations (%s)", val);
PFREE(val); PFREE(val);
} }
_use_geqo_ = true; _use_geqo_ = true;
...@@ -194,11 +194,11 @@ parse_geqo(const char *value) ...@@ -194,11 +194,11 @@ parse_geqo(const char *value)
else if (strcasecmp(tok, "off") == 0) else if (strcasecmp(tok, "off") == 0)
{ {
if ((val != NULL) && (*val != '\0')) if ((val != NULL) && (*val != '\0'))
elog(ABORT, "%s does not allow a parameter", tok); elog(ERROR, "%s does not allow a parameter", tok);
_use_geqo_ = false; _use_geqo_ = false;
} }
else else
elog(ABORT, "Bad value for GEQO (%s)", value); elog(ERROR, "Bad value for GEQO (%s)", value);
PFREE(tok); PFREE(tok);
return TRUE; return TRUE;
...@@ -242,7 +242,7 @@ parse_r_plans(const char *value) ...@@ -242,7 +242,7 @@ parse_r_plans(const char *value)
else if (strcasecmp(value, "off") == 0) else if (strcasecmp(value, "off") == 0)
_use_right_sided_plans_ = false; _use_right_sided_plans_ = false;
else else
elog(ABORT, "Bad value for Right-sided Plans (%s)", value); elog(ERROR, "Bad value for Right-sided Plans (%s)", value);
return TRUE; return TRUE;
} }
...@@ -392,7 +392,7 @@ parse_date(const char *value) ...@@ -392,7 +392,7 @@ parse_date(const char *value)
} }
else else
{ {
elog(ABORT, "Bad value for date style (%s)", tok); elog(ERROR, "Bad value for date style (%s)", tok);
} }
PFREE(tok); PFREE(tok);
} }
...@@ -490,7 +490,7 @@ parse_timezone(const char *value) ...@@ -490,7 +490,7 @@ parse_timezone(const char *value)
strcpy(tzbuf, "TZ="); strcpy(tzbuf, "TZ=");
strcat(tzbuf, tok); strcat(tzbuf, tok);
if (putenv(tzbuf) != 0) if (putenv(tzbuf) != 0)
elog(ABORT, "Unable to set TZ environment variable to %s", tok); elog(ERROR, "Unable to set TZ environment variable to %s", tok);
tzset(); tzset();
PFREE(tok); PFREE(tok);
...@@ -528,13 +528,13 @@ reset_timezone() ...@@ -528,13 +528,13 @@ reset_timezone()
strcpy(tzbuf, "TZ="); strcpy(tzbuf, "TZ=");
strcat(tzbuf, TZvalue); strcat(tzbuf, TZvalue);
if (putenv(tzbuf) != 0) if (putenv(tzbuf) != 0)
elog(ABORT, "Unable to set TZ environment variable to %s", TZvalue); elog(ERROR, "Unable to set TZ environment variable to %s", TZvalue);
} }
else else
{ {
strcpy(tzbuf, "="); strcpy(tzbuf, "=");
if (putenv(tzbuf) != 0) if (putenv(tzbuf) != 0)
elog(ABORT, "Unable to clear TZ environment variable", NULL); elog(ERROR, "Unable to clear TZ environment variable", NULL);
} }
tzset(); tzset();
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.22 1998/01/05 03:33:53 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.23 1998/01/05 16:39:39 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -54,7 +54,7 @@ getid(char *s, char *n) ...@@ -54,7 +54,7 @@ getid(char *s, char *n)
for (id = s, len = 0; isalnum(*s) || *s == '_'; ++len, ++s) for (id = s, len = 0; isalnum(*s) || *s == '_'; ++len, ++s)
; ;
if (len > sizeof(NameData)) if (len > sizeof(NameData))
elog(ABORT, "getid: identifier cannot be >%d characters", elog(ERROR, "getid: identifier cannot be >%d characters",
sizeof(NameData)); sizeof(NameData));
if (len > 0) if (len > 0)
memmove(n, id, len); memmove(n, id, len);
...@@ -102,11 +102,11 @@ aclparse(char *s, AclItem *aip, unsigned *modechg) ...@@ -102,11 +102,11 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
} }
else if (strcmp(name, ACL_IDTYPE_UID_KEYWORD)) else if (strcmp(name, ACL_IDTYPE_UID_KEYWORD))
{ {
elog(ABORT, "aclparse: bad keyword, must be [group|user]"); elog(ERROR, "aclparse: bad keyword, must be [group|user]");
} }
s = getid(s, name); /* move s to the name beyond the keyword */ s = getid(s, name); /* move s to the name beyond the keyword */
if (name[0] == '\0') if (name[0] == '\0')
elog(ABORT, "aclparse: a name must follow the [group|user] keyword"); elog(ERROR, "aclparse: a name must follow the [group|user] keyword");
} }
if (name[0] == '\0') if (name[0] == '\0')
aip->ai_idtype = ACL_IDTYPE_WORLD; aip->ai_idtype = ACL_IDTYPE_WORLD;
...@@ -123,7 +123,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg) ...@@ -123,7 +123,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
*modechg = ACL_MODECHG_EQL; *modechg = ACL_MODECHG_EQL;
break; break;
default: default:
elog(ABORT, "aclparse: mode change flag must use \"%s\"", elog(ERROR, "aclparse: mode change flag must use \"%s\"",
ACL_MODECHG_STR); ACL_MODECHG_STR);
} }
...@@ -145,7 +145,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg) ...@@ -145,7 +145,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
aip->ai_mode |= ACL_RU; aip->ai_mode |= ACL_RU;
break; break;
default: default:
elog(ABORT, "aclparse: mode flags must use \"%s\"", elog(ERROR, "aclparse: mode flags must use \"%s\"",
ACL_MODE_STR); ACL_MODE_STR);
} }
} }
...@@ -156,7 +156,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg) ...@@ -156,7 +156,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(name), htp = SearchSysCacheTuple(USENAME, PointerGetDatum(name),
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(ABORT, "aclparse: non-existent user \"%s\"", name); elog(ERROR, "aclparse: non-existent user \"%s\"", name);
aip->ai_id = ((Form_pg_user) GETSTRUCT(htp))->usesysid; aip->ai_id = ((Form_pg_user) GETSTRUCT(htp))->usesysid;
break; break;
case ACL_IDTYPE_GID: case ACL_IDTYPE_GID:
...@@ -188,10 +188,10 @@ makeacl(int n) ...@@ -188,10 +188,10 @@ makeacl(int n)
Size size; Size size;
if (n < 0) if (n < 0)
elog(ABORT, "makeacl: invalid size: %d\n", n); elog(ERROR, "makeacl: invalid size: %d\n", n);
size = ACL_N_SIZE(n); size = ACL_N_SIZE(n);
if (!(new_acl = (Acl *) palloc(size))) if (!(new_acl = (Acl *) palloc(size)))
elog(ABORT, "makeacl: palloc failed on %d\n", size); elog(ERROR, "makeacl: palloc failed on %d\n", size);
MemSet((char *) new_acl, 0, size); MemSet((char *) new_acl, 0, size);
new_acl->size = size; new_acl->size = size;
new_acl->ndim = 1; new_acl->ndim = 1;
...@@ -216,18 +216,18 @@ aclitemin(char *s) ...@@ -216,18 +216,18 @@ aclitemin(char *s)
AclItem *aip; AclItem *aip;
if (!s) if (!s)
elog(ABORT, "aclitemin: null string"); elog(ERROR, "aclitemin: null string");
aip = (AclItem *) palloc(sizeof(AclItem)); aip = (AclItem *) palloc(sizeof(AclItem));
if (!aip) if (!aip)
elog(ABORT, "aclitemin: palloc failed"); elog(ERROR, "aclitemin: palloc failed");
s = aclparse(s, aip, &modechg); s = aclparse(s, aip, &modechg);
if (modechg != ACL_MODECHG_EQL) if (modechg != ACL_MODECHG_EQL)
elog(ABORT, "aclitemin: cannot accept anything but = ACLs"); elog(ERROR, "aclitemin: cannot accept anything but = ACLs");
while (isspace(*s)) while (isspace(*s))
++s; ++s;
if (*s) if (*s)
elog(ABORT, "aclitemin: extra garbage at end of specification"); elog(ERROR, "aclitemin: extra garbage at end of specification");
return (aip); return (aip);
} }
...@@ -257,7 +257,7 @@ aclitemout(AclItem *aip) ...@@ -257,7 +257,7 @@ aclitemout(AclItem *aip)
p = out = palloc(strlen("group =arwR ") + 1 + NAMEDATALEN); p = out = palloc(strlen("group =arwR ") + 1 + NAMEDATALEN);
if (!out) if (!out)
elog(ABORT, "aclitemout: palloc failed"); elog(ERROR, "aclitemout: palloc failed");
*p = '\0'; *p = '\0';
switch (aip->ai_idtype) switch (aip->ai_idtype)
...@@ -296,7 +296,7 @@ aclitemout(AclItem *aip) ...@@ -296,7 +296,7 @@ aclitemout(AclItem *aip)
case ACL_IDTYPE_WORLD: case ACL_IDTYPE_WORLD:
break; break;
default: default:
elog(ABORT, "aclitemout: bad ai_idtype: %d", aip->ai_idtype); elog(ERROR, "aclitemout: bad ai_idtype: %d", aip->ai_idtype);
break; break;
} }
while (*p) while (*p)
...@@ -420,7 +420,7 @@ aclinsert3(Acl *old_acl, AclItem *mod_aip, unsigned modechg) ...@@ -420,7 +420,7 @@ aclinsert3(Acl *old_acl, AclItem *mod_aip, unsigned modechg)
new_aip = ACL_DAT(new_acl); new_aip = ACL_DAT(new_acl);
if (dst == 0) if (dst == 0)
{ /* start */ { /* start */
elog(ABORT, "aclinsert3: insertion before world ACL??"); elog(ERROR, "aclinsert3: insertion before world ACL??");
} }
else if (dst >= num) else if (dst >= num)
{ /* end */ { /* end */
...@@ -534,7 +534,7 @@ aclremove(Acl *old_acl, AclItem *mod_aip) ...@@ -534,7 +534,7 @@ aclremove(Acl *old_acl, AclItem *mod_aip)
new_aip = ACL_DAT(new_acl); new_aip = ACL_DAT(new_acl);
if (dst == 0) if (dst == 0)
{ /* start */ { /* start */
elog(ABORT, "aclremove: removal of the world ACL??"); elog(ERROR, "aclremove: removal of the world ACL??");
} }
else if (dst == old_num - 1) else if (dst == old_num - 1)
{ /* end */ { /* end */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.22 1998/01/05 03:33:54 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.23 1998/01/05 16:39:41 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -145,14 +145,14 @@ array_in(char *string, /* input array in external form */ ...@@ -145,14 +145,14 @@ array_in(char *string, /* input array in external form */
} }
for (q = p; isdigit(*q); q++); for (q = p; isdigit(*q); q++);
if (*q != ']') if (*q != ']')
elog(ABORT, "array_in: missing ']' in array declaration"); elog(ERROR, "array_in: missing ']' in array declaration");
*q = '\0'; *q = '\0';
dim[ndim] = atoi(p); dim[ndim] = atoi(p);
if ((dim[ndim] < 0) || (lBound[ndim] < 0)) if ((dim[ndim] < 0) || (lBound[ndim] < 0))
elog(ABORT, "array_in: array dimensions need to be positive"); elog(ERROR, "array_in: array dimensions need to be positive");
dim[ndim] = dim[ndim] - lBound[ndim] + 1; dim[ndim] = dim[ndim] - lBound[ndim] + 1;
if (dim[ndim] < 0) if (dim[ndim] < 0)
elog(ABORT, "array_in: upper_bound cannot be < lower_bound"); elog(ERROR, "array_in: upper_bound cannot be < lower_bound");
p = q + 1; p = q + 1;
ndim++; ndim++;
} }
...@@ -171,7 +171,7 @@ array_in(char *string, /* input array in external form */ ...@@ -171,7 +171,7 @@ array_in(char *string, /* input array in external form */
} }
else else
{ {
elog(ABORT, "array_in: Need to specify dimension"); elog(ERROR, "array_in: Need to specify dimension");
} }
} }
else else
...@@ -179,7 +179,7 @@ array_in(char *string, /* input array in external form */ ...@@ -179,7 +179,7 @@ array_in(char *string, /* input array in external form */
while (isspace(*p)) while (isspace(*p))
p++; p++;
if (strncmp(p, ASSGN, strlen(ASSGN))) if (strncmp(p, ASSGN, strlen(ASSGN)))
elog(ABORT, "array_in: missing assignment operator"); elog(ERROR, "array_in: missing assignment operator");
p += strlen(ASSGN); p += strlen(ASSGN);
while (isspace(*p)) while (isspace(*p))
p++; p++;
...@@ -249,7 +249,7 @@ array_in(char *string, /* input array in external form */ ...@@ -249,7 +249,7 @@ array_in(char *string, /* input array in external form */
memmove((char *) ARR_LBOUND(retval), (char *) lBound, ndim * sizeof(int)); memmove((char *) ARR_LBOUND(retval), (char *) lBound, ndim * sizeof(int));
memmove(ARR_DATA_PTR(retval), dataPtr, bytes); memmove(ARR_DATA_PTR(retval), dataPtr, bytes);
#endif #endif
elog(ABORT, "large object arrays not supported"); elog(ERROR, "large object arrays not supported");
} }
pfree(string_save); pfree(string_save);
return ((char *) retval); return ((char *) retval);
...@@ -302,7 +302,7 @@ _ArrayCount(char *str, int dim[], int typdelim) ...@@ -302,7 +302,7 @@ _ArrayCount(char *str, int dim[], int typdelim)
* Signal a premature end of the string. DZ - * Signal a premature end of the string. DZ -
* 2-9-1996 * 2-9-1996
*/ */
elog(ABORT, "malformed array constant: %s", str); elog(ERROR, "malformed array constant: %s", str);
break; break;
case '\"': case '\"':
scanning_string = !scanning_string; scanning_string = !scanning_string;
...@@ -425,7 +425,7 @@ _ReadArrayStr(char *arrayStr, ...@@ -425,7 +425,7 @@ _ReadArrayStr(char *arrayStr,
p++; p++;
nest_level++; nest_level++;
if (nest_level > ndim) if (nest_level > ndim)
elog(ABORT, "array_in: illformed array constant"); elog(ERROR, "array_in: illformed array constant");
indx[nest_level - 1] = 0; indx[nest_level - 1] = 0;
indx[ndim - 1] = 0; indx[ndim - 1] = 0;
} }
...@@ -460,7 +460,7 @@ _ReadArrayStr(char *arrayStr, ...@@ -460,7 +460,7 @@ _ReadArrayStr(char *arrayStr,
} }
*q = '\0'; *q = '\0';
if (i >= nitems) if (i >= nitems)
elog(ABORT, "array_in: illformed array constant"); elog(ERROR, "array_in: illformed array constant");
values[i] = (*inputproc) (p, typelem); values[i] = (*inputproc) (p, typelem);
p = ++q; p = ++q;
if (!eoArray) if (!eoArray)
...@@ -544,27 +544,27 @@ _ReadLOArray(char *str, ...@@ -544,27 +544,27 @@ _ReadLOArray(char *str,
if (!strcmp(word, "-chunk")) if (!strcmp(word, "-chunk"))
{ {
if (str == NULL) if (str == NULL)
elog(ABORT, "array_in: access pattern file required"); elog(ERROR, "array_in: access pattern file required");
str = _AdvanceBy1word(str, &accessfile); str = _AdvanceBy1word(str, &accessfile);
} }
else if (!strcmp(word, "-noreorg")) else if (!strcmp(word, "-noreorg"))
{ {
if (str == NULL) if (str == NULL)
elog(ABORT, "array_in: chunk file required"); elog(ERROR, "array_in: chunk file required");
str = _AdvanceBy1word(str, &chunkfile); str = _AdvanceBy1word(str, &chunkfile);
} }
else else
{ {
elog(ABORT, "usage: <input file> -chunk DEFAULT/<access pattern file> -invert/-native [-noreorg <chunk file>]"); elog(ERROR, "usage: <input file> -chunk DEFAULT/<access pattern file> -invert/-native [-noreorg <chunk file>]");
} }
} }
if (inputfile == NULL) if (inputfile == NULL)
elog(ABORT, "array_in: missing file name"); elog(ERROR, "array_in: missing file name");
lobjId = lo_creat(0); lobjId = lo_creat(0);
*fd = lo_open(lobjId, INV_READ); *fd = lo_open(lobjId, INV_READ);
if (*fd < 0) if (*fd < 0)
elog(ABORT, "Large object create failed"); elog(ERROR, "Large object create failed");
retStr = inputfile; retStr = inputfile;
*nbytes = strlen(retStr) + 2; *nbytes = strlen(retStr) + 2;
...@@ -573,7 +573,7 @@ _ReadLOArray(char *str, ...@@ -573,7 +573,7 @@ _ReadLOArray(char *str,
FILE *afd; FILE *afd;
if ((afd = AllocateFile(accessfile, "r")) == NULL) if ((afd = AllocateFile(accessfile, "r")) == NULL)
elog(ABORT, "unable to open access pattern file"); elog(ERROR, "unable to open access pattern file");
*chunkFlag = true; *chunkFlag = true;
retStr = _ChunkArray(*fd, afd, ndim, dim, baseSize, nbytes, retStr = _ChunkArray(*fd, afd, ndim, dim, baseSize, nbytes,
chunkfile); chunkfile);
...@@ -836,7 +836,7 @@ array_ref(ArrayType *array, ...@@ -836,7 +836,7 @@ array_ref(ArrayType *array,
* fixed length arrays -- these are assumed to be 1-d * fixed length arrays -- these are assumed to be 1-d
*/ */
if (indx[0] * elmlen > arraylen) if (indx[0] * elmlen > arraylen)
elog(ABORT, "array_ref: array bound exceeded"); elog(ERROR, "array_ref: array bound exceeded");
retval = (char *) array + indx[0] * elmlen; retval = (char *) array + indx[0] * elmlen;
return _ArrayCast(retval, reftype, elmlen); return _ArrayCast(retval, reftype, elmlen);
} }
...@@ -964,7 +964,7 @@ array_clip(ArrayType *array, ...@@ -964,7 +964,7 @@ array_clip(ArrayType *array,
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
if (lowerIndx[i] > upperIndx[i]) if (lowerIndx[i] > upperIndx[i])
elog(ABORT, "lowerIndex cannot be larger than upperIndx"); elog(ERROR, "lowerIndex cannot be larger than upperIndx");
mda_get_range(n, span, lowerIndx, upperIndx); mda_get_range(n, span, lowerIndx, upperIndx);
if (ARR_IS_LO(array)) if (ARR_IS_LO(array))
...@@ -980,7 +980,7 @@ array_clip(ArrayType *array, ...@@ -980,7 +980,7 @@ array_clip(ArrayType *array,
rsize; rsize;
if (len < 0) if (len < 0)
elog(ABORT, "array_clip: array of variable length objects not supported"); elog(ERROR, "array_clip: array of variable length objects not supported");
#ifdef LOARRAY #ifdef LOARRAY
lo_name = (char *) ARR_DATA_PTR(array); lo_name = (char *) ARR_DATA_PTR(array);
if ((fd = LOopen(lo_name, ARR_IS_INV(array) ? INV_READ : O_RDONLY)) < 0) if ((fd = LOopen(lo_name, ARR_IS_INV(array) ? INV_READ : O_RDONLY)) < 0)
...@@ -1098,7 +1098,7 @@ array_set(ArrayType *array, ...@@ -1098,7 +1098,7 @@ array_set(ArrayType *array,
* fixed length arrays -- these are assumed to be 1-d * fixed length arrays -- these are assumed to be 1-d
*/ */
if (indx[0] * elmlen > arraylen) if (indx[0] * elmlen > arraylen)
elog(ABORT, "array_ref: array bound exceeded"); elog(ERROR, "array_ref: array bound exceeded");
pos = (char *) array + indx[0] * elmlen; pos = (char *) array + indx[0] * elmlen;
ArrayCastAndSet(dataPtr, (bool) reftype, elmlen, pos); ArrayCastAndSet(dataPtr, (bool) reftype, elmlen, pos);
return ((char *) array); return ((char *) array);
...@@ -1110,7 +1110,7 @@ array_set(ArrayType *array, ...@@ -1110,7 +1110,7 @@ array_set(ArrayType *array,
if (!SanityCheckInput(ndim, n, dim, lb, indx)) if (!SanityCheckInput(ndim, n, dim, lb, indx))
{ {
elog(ABORT, "array_set: array bound exceeded"); elog(ERROR, "array_set: array bound exceeded");
return ((char *) array); return ((char *) array);
} }
offset = GetOffset(n, dim, lb, indx); offset = GetOffset(n, dim, lb, indx);
...@@ -1225,7 +1225,7 @@ array_assgn(ArrayType *array, ...@@ -1225,7 +1225,7 @@ array_assgn(ArrayType *array,
if (array == (ArrayType *) NULL) if (array == (ArrayType *) NULL)
RETURN_NULL; RETURN_NULL;
if (len < 0) if (len < 0)
elog(ABORT, "array_assgn:updates on arrays of variable length elements not allowed"); elog(ERROR, "array_assgn:updates on arrays of variable length elements not allowed");
dim = ARR_DIMS(array); dim = ARR_DIMS(array);
lb = ARR_LBOUND(array); lb = ARR_LBOUND(array);
...@@ -1239,7 +1239,7 @@ array_assgn(ArrayType *array, ...@@ -1239,7 +1239,7 @@ array_assgn(ArrayType *array,
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
if (lowerIndx[i] > upperIndx[i]) if (lowerIndx[i] > upperIndx[i])
elog(ABORT, "lowerIndex larger than upperIndx"); elog(ERROR, "lowerIndex larger than upperIndx");
if (ARR_IS_LO(array)) if (ARR_IS_LO(array))
{ {
...@@ -1315,7 +1315,7 @@ system_cache_lookup(Oid element_type, ...@@ -1315,7 +1315,7 @@ system_cache_lookup(Oid element_type,
if (!HeapTupleIsValid(typeTuple)) if (!HeapTupleIsValid(typeTuple))
{ {
elog(ABORT, "array_out: Cache lookup failed for type %d\n", elog(ERROR, "array_out: Cache lookup failed for type %d\n",
element_type); element_type);
return; return;
} }
...@@ -1350,7 +1350,7 @@ _ArrayCast(char *value, bool byval, int len) ...@@ -1350,7 +1350,7 @@ _ArrayCast(char *value, bool byval, int len)
case 4: case 4:
return ((Datum) *(int32 *) value); return ((Datum) *(int32 *) value);
default: default:
elog(ABORT, "array_ref: byval and elt len > 4!"); elog(ERROR, "array_ref: byval and elt len > 4!");
break; break;
} }
} }
...@@ -1734,7 +1734,7 @@ _array_newLO(int *fd, int flag) ...@@ -1734,7 +1734,7 @@ _array_newLO(int *fd, int flag)
strcpy(saveName, p); strcpy(saveName, p);
#ifdef LOARRAY #ifdef LOARRAY
if ((*fd = LOcreat(saveName, 0600, flag)) < 0) if ((*fd = LOcreat(saveName, 0600, flag)) < 0)
elog(ABORT, "Large object create failed"); elog(ERROR, "Large object create failed");
#endif #endif
return (p); return (p);
} }
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.12 1998/01/05 03:33:55 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/bool.c,v 1.13 1998/01/05 16:39:42 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -72,7 +72,7 @@ boolin(char *b) ...@@ -72,7 +72,7 @@ boolin(char *b)
break; break;
} }
elog(ABORT,"Bad boolean external representation '%s'", b); elog(ERROR,"Bad boolean external representation '%s'", b);
/* not reached */ /* not reached */
return (FALSE); return (FALSE);
} /* boolin() */ } /* boolin() */
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* workings can be found in the book "Software Solutions in C" by * workings can be found in the book "Software Solutions in C" by
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7. * Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
* *
* $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.19 1998/01/05 03:33:56 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.20 1998/01/05 16:39:45 momjian Exp $
*/ */
#include <stdio.h> #include <stdio.h>
...@@ -156,10 +156,10 @@ printf( "cashin- precision %d; decimal %c; thousands %c; currency %c; positive % ...@@ -156,10 +156,10 @@ printf( "cashin- precision %d; decimal %c; thousands %c; currency %c; positive %
s++; s++;
if (*s != '\0') if (*s != '\0')
elog(ABORT, "Bad money external representation %s", str); elog(ERROR, "Bad money external representation %s", str);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't input cash '%s'", str); elog(ERROR, "Memory allocation failed, can't input cash '%s'", str);
*result = (value * sgn); *result = (value * sgn);
...@@ -257,7 +257,7 @@ cash_out(Cash *in_value) ...@@ -257,7 +257,7 @@ cash_out(Cash *in_value)
if (minus) if (minus)
{ {
if (!PointerIsValid(result = PALLOC(CASH_BUFSZ + 2 - count + strlen(nsymbol)))) if (!PointerIsValid(result = PALLOC(CASH_BUFSZ + 2 - count + strlen(nsymbol))))
elog(ABORT, "Memory allocation failed, can't output cash", NULL); elog(ERROR, "Memory allocation failed, can't output cash", NULL);
/* Position code of 0 means use parens */ /* Position code of 0 means use parens */
if (convention == 0) if (convention == 0)
...@@ -270,7 +270,7 @@ cash_out(Cash *in_value) ...@@ -270,7 +270,7 @@ cash_out(Cash *in_value)
else else
{ {
if (!PointerIsValid(result = PALLOC(CASH_BUFSZ + 2 - count))) if (!PointerIsValid(result = PALLOC(CASH_BUFSZ + 2 - count)))
elog(ABORT, "Memory allocation failed, can't output cash", NULL); elog(ERROR, "Memory allocation failed, can't output cash", NULL);
strcpy(result, buf + count); strcpy(result, buf + count);
} }
...@@ -346,7 +346,7 @@ cash_pl(Cash *c1, Cash *c2) ...@@ -346,7 +346,7 @@ cash_pl(Cash *c1, Cash *c2)
return (NULL); return (NULL);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't add cash", NULL); elog(ERROR, "Memory allocation failed, can't add cash", NULL);
*result = (*c1 + *c2); *result = (*c1 + *c2);
...@@ -366,7 +366,7 @@ cash_mi(Cash *c1, Cash *c2) ...@@ -366,7 +366,7 @@ cash_mi(Cash *c1, Cash *c2)
return (NULL); return (NULL);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't subtract cash", NULL); elog(ERROR, "Memory allocation failed, can't subtract cash", NULL);
*result = (*c1 - *c2); *result = (*c1 - *c2);
...@@ -386,7 +386,7 @@ cash_mul_flt8(Cash *c, float8 *f) ...@@ -386,7 +386,7 @@ cash_mul_flt8(Cash *c, float8 *f)
return (NULL); return (NULL);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't multiply cash", NULL); elog(ERROR, "Memory allocation failed, can't multiply cash", NULL);
*result = ((*f) * (*c)); *result = ((*f) * (*c));
...@@ -419,10 +419,10 @@ cash_div_flt8(Cash *c, float8 *f) ...@@ -419,10 +419,10 @@ cash_div_flt8(Cash *c, float8 *f)
return (NULL); return (NULL);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't divide cash", NULL); elog(ERROR, "Memory allocation failed, can't divide cash", NULL);
if (*f == 0.0) if (*f == 0.0)
elog(ABORT, "cash_div: divide by 0.0 error"); elog(ERROR, "cash_div: divide by 0.0 error");
*result = rint(*c / *f); *result = rint(*c / *f);
...@@ -441,7 +441,7 @@ cash_mul_flt4(Cash *c, float4 *f) ...@@ -441,7 +441,7 @@ cash_mul_flt4(Cash *c, float4 *f)
return (NULL); return (NULL);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't multiply cash", NULL); elog(ERROR, "Memory allocation failed, can't multiply cash", NULL);
*result = ((*f) * (*c)); *result = ((*f) * (*c));
...@@ -474,10 +474,10 @@ cash_div_flt4(Cash *c, float4 *f) ...@@ -474,10 +474,10 @@ cash_div_flt4(Cash *c, float4 *f)
return (NULL); return (NULL);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't divide cash", NULL); elog(ERROR, "Memory allocation failed, can't divide cash", NULL);
if (*f == 0.0) if (*f == 0.0)
elog(ABORT, "cash_div: divide by 0.0 error"); elog(ERROR, "cash_div: divide by 0.0 error");
*result = rint(*c / *f); *result = rint(*c / *f);
...@@ -497,7 +497,7 @@ cash_mul_int4(Cash *c, int4 i) ...@@ -497,7 +497,7 @@ cash_mul_int4(Cash *c, int4 i)
return (NULL); return (NULL);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't multiply cash", NULL); elog(ERROR, "Memory allocation failed, can't multiply cash", NULL);
*result = ((i) * (*c)); *result = ((i) * (*c));
...@@ -530,10 +530,10 @@ cash_div_int4(Cash *c, int4 i) ...@@ -530,10 +530,10 @@ cash_div_int4(Cash *c, int4 i)
return (NULL); return (NULL);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't divide cash", NULL); elog(ERROR, "Memory allocation failed, can't divide cash", NULL);
if (i == 0) if (i == 0)
elog(ABORT, "cash_idiv: divide by 0 error"); elog(ERROR, "cash_idiv: divide by 0 error");
*result = rint(*c / i); *result = rint(*c / i);
...@@ -553,7 +553,7 @@ cash_mul_int2(Cash *c, int2 s) ...@@ -553,7 +553,7 @@ cash_mul_int2(Cash *c, int2 s)
return (NULL); return (NULL);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't multiply cash", NULL); elog(ERROR, "Memory allocation failed, can't multiply cash", NULL);
*result = ((s) * (*c)); *result = ((s) * (*c));
...@@ -586,10 +586,10 @@ cash_div_int2(Cash *c, int2 s) ...@@ -586,10 +586,10 @@ cash_div_int2(Cash *c, int2 s)
return (NULL); return (NULL);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't divide cash", NULL); elog(ERROR, "Memory allocation failed, can't divide cash", NULL);
if (s == 0) if (s == 0)
elog(ABORT, "cash_div: divide by 0 error"); elog(ERROR, "cash_div: divide by 0 error");
*result = rint(*c / s); *result = rint(*c / s);
...@@ -609,7 +609,7 @@ cashlarger(Cash *c1, Cash *c2) ...@@ -609,7 +609,7 @@ cashlarger(Cash *c1, Cash *c2)
return (NULL); return (NULL);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't return larger cash", NULL); elog(ERROR, "Memory allocation failed, can't return larger cash", NULL);
*result = ((*c1 > *c2) ? *c1 : *c2); *result = ((*c1 > *c2) ? *c1 : *c2);
...@@ -629,7 +629,7 @@ cashsmaller(Cash *c1, Cash *c2) ...@@ -629,7 +629,7 @@ cashsmaller(Cash *c1, Cash *c2)
return (NULL); return (NULL);
if (!PointerIsValid(result = PALLOCTYPE(Cash))) if (!PointerIsValid(result = PALLOCTYPE(Cash)))
elog(ABORT, "Memory allocation failed, can't return smaller cash", NULL); elog(ERROR, "Memory allocation failed, can't return smaller cash", NULL);
*result = ((*c1 < *c2) ? *c1 : *c2); *result = ((*c1 < *c2) ? *c1 : *c2);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/chunk.c,v 1.12 1998/01/05 03:33:58 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/chunk.c,v 1.13 1998/01/05 16:39:46 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -104,7 +104,7 @@ _ChunkArray(int fd, ...@@ -104,7 +104,7 @@ _ChunkArray(int fd,
else else
cfd = LOopen(chunkfile, O_RDONLY); cfd = LOopen(chunkfile, O_RDONLY);
if (cfd < 0) if (cfd < 0)
elog(ABORT, "Unable to open chunk file"); elog(ERROR, "Unable to open chunk file");
#endif #endif
strcpy(cInfo.lo_name, chunkfile); strcpy(cInfo.lo_name, chunkfile);
...@@ -148,11 +148,11 @@ GetChunkSize(FILE *fd, ...@@ -148,11 +148,11 @@ GetChunkSize(FILE *fd,
*/ */
fscanf(fd, "%d", &N); fscanf(fd, "%d", &N);
if (N > MAXPAT) if (N > MAXPAT)
elog(ABORT, "array_in: too many access pattern elements"); elog(ERROR, "array_in: too many access pattern elements");
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
for (j = 0; j < ndim + 1; j++) for (j = 0; j < ndim + 1; j++)
if (fscanf(fd, "%d ", &(A[i][j])) == EOF) if (fscanf(fd, "%d ", &(A[i][j])) == EOF)
elog(ABORT, "array_in: bad access pattern input"); elog(ERROR, "array_in: bad access pattern input");
/* /*
* estimate chunk size * estimate chunk size
...@@ -413,12 +413,12 @@ seek_and_read(int pos, int size, char buff[], int fp, int from) ...@@ -413,12 +413,12 @@ seek_and_read(int pos, int size, char buff[], int fp, int from)
/* Assuming only one file */ /* Assuming only one file */
if (lo_lseek(fp, pos, from) < 0) if (lo_lseek(fp, pos, from) < 0)
elog(ABORT, "File seek error"); elog(ERROR, "File seek error");
#ifdef LOARRAY #ifdef LOARRAY
v = (struct varlena *) LOread(fp, size); v = (struct varlena *) LOread(fp, size);
#endif #endif
if (VARSIZE(v) - VARHDRSZ < size) if (VARSIZE(v) - VARHDRSZ < size)
elog(ABORT, "File read error"); elog(ERROR, "File read error");
memmove(buff, VARDATA(v), size); memmove(buff, VARDATA(v), size);
pfree(v); pfree(v);
return (1); return (1);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.20 1998/01/05 03:33:59 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.21 1998/01/05 16:39:48 momjian Exp $
* *
* NOTES * NOTES
* This code is actually (almost) unused. * This code is actually (almost) unused.
...@@ -129,14 +129,14 @@ reltimein(char *str) ...@@ -129,14 +129,14 @@ reltimein(char *str)
char lowstr[MAXDATELEN + 1]; char lowstr[MAXDATELEN + 1];
if (!PointerIsValid(str)) if (!PointerIsValid(str))
elog(ABORT, "Bad (null) date external representation", NULL); elog(ERROR, "Bad (null) date external representation", NULL);
if (strlen(str) > MAXDATELEN) if (strlen(str) > MAXDATELEN)
elog(ABORT, "Bad (length) reltime external representation '%s'", str); elog(ERROR, "Bad (length) reltime external representation '%s'", str);
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0) if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|| (DecodeDateDelta(field, ftype, nf, &dtype, tm, &fsec) != 0)) || (DecodeDateDelta(field, ftype, nf, &dtype, tm, &fsec) != 0))
elog(ABORT, "Bad reltime external representation '%s'", str); elog(ERROR, "Bad reltime external representation '%s'", str);
#ifdef DATEDEBUG #ifdef DATEDEBUG
printf("reltimein- %d fields are type %d (DTK_DATE=%d)\n", nf, dtype, DTK_DATE); printf("reltimein- %d fields are type %d (DTK_DATE=%d)\n", nf, dtype, DTK_DATE);
...@@ -153,7 +153,7 @@ reltimein(char *str) ...@@ -153,7 +153,7 @@ reltimein(char *str)
return (INVALID_RELTIME); return (INVALID_RELTIME);
} }
elog(ABORT, "Bad reltime (internal coding error) '%s'", str); elog(ERROR, "Bad reltime (internal coding error) '%s'", str);
return (INVALID_RELTIME); return (INVALID_RELTIME);
} /* reltimein() */ } /* reltimein() */
...@@ -361,7 +361,7 @@ reltime_timespan(RelativeTime reltime) ...@@ -361,7 +361,7 @@ reltime_timespan(RelativeTime reltime)
month; month;
if (!PointerIsValid(result = PALLOCTYPE(TimeSpan))) if (!PointerIsValid(result = PALLOCTYPE(TimeSpan)))
elog(ABORT, "Memory allocation failed, can't convert reltime to timespan", NULL); elog(ERROR, "Memory allocation failed, can't convert reltime to timespan", NULL);
switch (reltime) switch (reltime)
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.19 1998/01/05 03:34:00 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.20 1998/01/05 16:39:50 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -71,14 +71,14 @@ date_in(char *str) ...@@ -71,14 +71,14 @@ date_in(char *str)
char lowstr[MAXDATELEN + 1]; char lowstr[MAXDATELEN + 1];
if (!PointerIsValid(str)) if (!PointerIsValid(str))
elog(ABORT, "Bad (null) date external representation", NULL); elog(ERROR, "Bad (null) date external representation", NULL);
#ifdef DATEDEBUG #ifdef DATEDEBUG
printf("date_in- input string is %s\n", str); printf("date_in- input string is %s\n", str);
#endif #endif
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0) if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|| (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp) != 0)) || (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp) != 0))
elog(ABORT, "Bad date external representation %s", str); elog(ERROR, "Bad date external representation %s", str);
switch (dtype) switch (dtype)
{ {
...@@ -96,15 +96,15 @@ date_in(char *str) ...@@ -96,15 +96,15 @@ date_in(char *str)
break; break;
default: default:
elog(ABORT, "Unrecognized date external representation %s", str); elog(ERROR, "Unrecognized date external representation %s", str);
} }
if (tm->tm_year < 0 || tm->tm_year > 32767) if (tm->tm_year < 0 || tm->tm_year > 32767)
elog(ABORT, "date_in: year must be limited to values 0 through 32767 in '%s'", str); elog(ERROR, "date_in: year must be limited to values 0 through 32767 in '%s'", str);
if (tm->tm_mon < 1 || tm->tm_mon > 12) if (tm->tm_mon < 1 || tm->tm_mon > 12)
elog(ABORT, "date_in: month must be limited to values 1 through 12 in '%s'", str); elog(ERROR, "date_in: month must be limited to values 1 through 12 in '%s'", str);
if (tm->tm_mday < 1 || tm->tm_mday > day_tab[isleap(tm->tm_year)][tm->tm_mon - 1]) if (tm->tm_mday < 1 || tm->tm_mday > day_tab[isleap(tm->tm_year)][tm->tm_mon - 1])
elog(ABORT, "date_in: day must be limited to values 1 through %d in '%s'", elog(ERROR, "date_in: day must be limited to values 1 through %d in '%s'",
day_tab[isleap(tm->tm_year)][tm->tm_mon - 1], str); day_tab[isleap(tm->tm_year)][tm->tm_mon - 1], str);
date = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(2000, 1, 1)); date = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(2000, 1, 1));
...@@ -239,7 +239,7 @@ date_datetime(DateADT dateVal) ...@@ -239,7 +239,7 @@ date_datetime(DateADT dateVal)
result = PALLOCTYPE(DateTime); result = PALLOCTYPE(DateTime);
if (date2tm(dateVal, &tz, tm, &fsec, &tzn) != 0) if (date2tm(dateVal, &tz, tm, &fsec, &tzn) != 0)
elog(ABORT, "Unable to convert date to datetime", NULL); elog(ERROR, "Unable to convert date to datetime", NULL);
#ifdef DATEDEBUG #ifdef DATEDEBUG
printf("date_datetime- date is %d.%02d.%02d\n", tm->tm_year, tm->tm_mon, tm->tm_mday); printf("date_datetime- date is %d.%02d.%02d\n", tm->tm_year, tm->tm_mon, tm->tm_mday);
...@@ -247,7 +247,7 @@ date_datetime(DateADT dateVal) ...@@ -247,7 +247,7 @@ date_datetime(DateADT dateVal)
#endif #endif
if (tm2datetime(tm, fsec, &tz, result) != 0) if (tm2datetime(tm, fsec, &tz, result) != 0)
elog(ABORT, "Datetime out of range", NULL); elog(ERROR, "Datetime out of range", NULL);
return (result); return (result);
} /* date_datetime() */ } /* date_datetime() */
...@@ -267,10 +267,10 @@ datetime_date(DateTime *datetime) ...@@ -267,10 +267,10 @@ datetime_date(DateTime *datetime)
char *tzn; char *tzn;
if (!PointerIsValid(datetime)) if (!PointerIsValid(datetime))
elog(ABORT, "Unable to convert null datetime to date", NULL); elog(ERROR, "Unable to convert null datetime to date", NULL);
if (DATETIME_NOT_FINITE(*datetime)) if (DATETIME_NOT_FINITE(*datetime))
elog(ABORT, "Unable to convert datetime to date", NULL); elog(ERROR, "Unable to convert datetime to date", NULL);
if (DATETIME_IS_EPOCH(*datetime)) if (DATETIME_IS_EPOCH(*datetime))
{ {
...@@ -285,7 +285,7 @@ datetime_date(DateTime *datetime) ...@@ -285,7 +285,7 @@ datetime_date(DateTime *datetime)
else else
{ {
if (datetime2tm(*datetime, &tz, tm, &fsec, &tzn) != 0) if (datetime2tm(*datetime, &tz, tm, &fsec, &tzn) != 0)
elog(ABORT, "Unable to convert datetime to date", NULL); elog(ERROR, "Unable to convert datetime to date", NULL);
} }
result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(2000, 1, 1)); result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(2000, 1, 1));
...@@ -310,7 +310,7 @@ abstime_date(AbsoluteTime abstime) ...@@ -310,7 +310,7 @@ abstime_date(AbsoluteTime abstime)
case INVALID_ABSTIME: case INVALID_ABSTIME:
case NOSTART_ABSTIME: case NOSTART_ABSTIME:
case NOEND_ABSTIME: case NOEND_ABSTIME:
elog(ABORT, "Unable to convert reserved abstime value to date", NULL); elog(ERROR, "Unable to convert reserved abstime value to date", NULL);
/* /*
* pretend to drop through to make compiler think that result * pretend to drop through to make compiler think that result
...@@ -440,18 +440,18 @@ time_in(char *str) ...@@ -440,18 +440,18 @@ time_in(char *str)
int ftype[MAXDATEFIELDS]; int ftype[MAXDATEFIELDS];
if (!PointerIsValid(str)) if (!PointerIsValid(str))
elog(ABORT, "Bad (null) time external representation", NULL); elog(ERROR, "Bad (null) time external representation", NULL);
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0) if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|| (DecodeTimeOnly(field, ftype, nf, &dtype, tm, &fsec) != 0)) || (DecodeTimeOnly(field, ftype, nf, &dtype, tm, &fsec) != 0))
elog(ABORT, "Bad time external representation '%s'", str); elog(ERROR, "Bad time external representation '%s'", str);
if ((tm->tm_hour < 0) || (tm->tm_hour > 23)) if ((tm->tm_hour < 0) || (tm->tm_hour > 23))
elog(ABORT, "Hour must be limited to values 0 through 23 in '%s'", str); elog(ERROR, "Hour must be limited to values 0 through 23 in '%s'", str);
if ((tm->tm_min < 0) || (tm->tm_min > 59)) if ((tm->tm_min < 0) || (tm->tm_min > 59))
elog(ABORT, "Minute must be limited to values 0 through 59 in '%s'", str); elog(ERROR, "Minute must be limited to values 0 through 59 in '%s'", str);
if ((tm->tm_sec < 0) || ((tm->tm_sec + fsec) >= 60)) if ((tm->tm_sec < 0) || ((tm->tm_sec + fsec) >= 60))
elog(ABORT, "Second must be limited to values 0 through < 60 in '%s'", str); elog(ERROR, "Second must be limited to values 0 through < 60 in '%s'", str);
time = PALLOCTYPE(TimeADT); time = PALLOCTYPE(TimeADT);
...@@ -565,10 +565,10 @@ datetime_time(DateTime *datetime) ...@@ -565,10 +565,10 @@ datetime_time(DateTime *datetime)
char *tzn; char *tzn;
if (!PointerIsValid(datetime)) if (!PointerIsValid(datetime))
elog(ABORT, "Unable to convert null datetime to date", NULL); elog(ERROR, "Unable to convert null datetime to date", NULL);
if (DATETIME_NOT_FINITE(*datetime)) if (DATETIME_NOT_FINITE(*datetime))
elog(ABORT, "Unable to convert datetime to date", NULL); elog(ERROR, "Unable to convert datetime to date", NULL);
if (DATETIME_IS_EPOCH(*datetime)) if (DATETIME_IS_EPOCH(*datetime))
{ {
...@@ -583,7 +583,7 @@ datetime_time(DateTime *datetime) ...@@ -583,7 +583,7 @@ datetime_time(DateTime *datetime)
else else
{ {
if (datetime2tm(*datetime, &tz, tm, &fsec, &tzn) != 0) if (datetime2tm(*datetime, &tz, tm, &fsec, &tzn) != 0)
elog(ABORT, "Unable to convert datetime to date", NULL); elog(ERROR, "Unable to convert datetime to date", NULL);
} }
result = PALLOCTYPE(TimeADT); result = PALLOCTYPE(TimeADT);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.8 1998/01/05 03:34:01 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.9 1998/01/05 16:39:52 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -61,7 +61,7 @@ datumGetSize(Datum value, Oid type, bool byVal, Size len) ...@@ -61,7 +61,7 @@ datumGetSize(Datum value, Oid type, bool byVal, Size len)
} }
else else
{ {
elog(ABORT, elog(ERROR,
"datumGetSize: Error: type=%ld, byVaL with len=%d", "datumGetSize: Error: type=%ld, byVaL with len=%d",
(long) type, len); (long) type, len);
} }
...@@ -78,7 +78,7 @@ datumGetSize(Datum value, Oid type, bool byVal, Size len) ...@@ -78,7 +78,7 @@ datumGetSize(Datum value, Oid type, bool byVal, Size len)
s = (struct varlena *) DatumGetPointer(value); s = (struct varlena *) DatumGetPointer(value);
if (!PointerIsValid(s)) if (!PointerIsValid(s))
{ {
elog(ABORT, elog(ERROR,
"datumGetSize: Invalid Datum Pointer"); "datumGetSize: Invalid Datum Pointer");
} }
size = (Size) VARSIZE(s); size = (Size) VARSIZE(s);
...@@ -132,7 +132,7 @@ datumCopy(Datum value, Oid type, bool byVal, Size len) ...@@ -132,7 +132,7 @@ datumCopy(Datum value, Oid type, bool byVal, Size len)
s = (char *) palloc(realSize); s = (char *) palloc(realSize);
if (s == NULL) if (s == NULL)
{ {
elog(ABORT, "datumCopy: out of memory\n"); elog(ERROR, "datumCopy: out of memory\n");
} }
memmove(s, DatumGetPointer(value), realSize); memmove(s, DatumGetPointer(value), realSize);
res = (Datum) s; res = (Datum) s;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.48 1998/01/05 03:34:03 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.49 1998/01/05 16:39:55 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -109,11 +109,11 @@ datetime_in(char *str) ...@@ -109,11 +109,11 @@ datetime_in(char *str)
char lowstr[MAXDATELEN + 1]; char lowstr[MAXDATELEN + 1];
if (!PointerIsValid(str)) if (!PointerIsValid(str))
elog(ABORT, "Bad (null) datetime external representation", NULL); elog(ERROR, "Bad (null) datetime external representation", NULL);
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0) if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|| (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tz) != 0)) || (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tz) != 0))
elog(ABORT, "Bad datetime external representation '%s'", str); elog(ERROR, "Bad datetime external representation '%s'", str);
result = PALLOCTYPE(DateTime); result = PALLOCTYPE(DateTime);
...@@ -121,7 +121,7 @@ datetime_in(char *str) ...@@ -121,7 +121,7 @@ datetime_in(char *str)
{ {
case DTK_DATE: case DTK_DATE:
if (tm2datetime(tm, fsec, &tz, result) != 0) if (tm2datetime(tm, fsec, &tz, result) != 0)
elog(ABORT, "Datetime out of range '%s'", str); elog(ERROR, "Datetime out of range '%s'", str);
#ifdef DATEDEBUG #ifdef DATEDEBUG
printf("datetime_in- date is %f\n", *result); printf("datetime_in- date is %f\n", *result);
...@@ -150,7 +150,7 @@ datetime_in(char *str) ...@@ -150,7 +150,7 @@ datetime_in(char *str)
break; break;
default: default:
elog(ABORT, "Internal coding error, can't input datetime '%s'", str); elog(ERROR, "Internal coding error, can't input datetime '%s'", str);
} }
return (result); return (result);
...@@ -225,11 +225,11 @@ timespan_in(char *str) ...@@ -225,11 +225,11 @@ timespan_in(char *str)
fsec = 0; fsec = 0;
if (!PointerIsValid(str)) if (!PointerIsValid(str))
elog(ABORT, "Bad (null) timespan external representation", NULL); elog(ERROR, "Bad (null) timespan external representation", NULL);
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0) if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|| (DecodeDateDelta(field, ftype, nf, &dtype, tm, &fsec) != 0)) || (DecodeDateDelta(field, ftype, nf, &dtype, tm, &fsec) != 0))
elog(ABORT, "Bad timespan external representation '%s'", str); elog(ERROR, "Bad timespan external representation '%s'", str);
span = PALLOCTYPE(TimeSpan); span = PALLOCTYPE(TimeSpan);
...@@ -241,12 +241,12 @@ timespan_in(char *str) ...@@ -241,12 +241,12 @@ timespan_in(char *str)
#if FALSE #if FALSE
TIMESPAN_INVALID(span); TIMESPAN_INVALID(span);
#endif #endif
elog(ABORT, "Bad timespan external representation '%s'", str); elog(ERROR, "Bad timespan external representation '%s'", str);
} }
break; break;
default: default:
elog(ABORT, "Internal coding error, can't input timespan '%s'", str); elog(ERROR, "Internal coding error, can't input timespan '%s'", str);
} }
return (span); return (span);
...@@ -272,7 +272,7 @@ timespan_out(TimeSpan *span) ...@@ -272,7 +272,7 @@ timespan_out(TimeSpan *span)
return (NULL); return (NULL);
if (EncodeTimeSpan(tm, fsec, DateStyle, buf) != 0) if (EncodeTimeSpan(tm, fsec, DateStyle, buf) != 0)
elog(ABORT, "Unable to format timespan", NULL); elog(ERROR, "Unable to format timespan", NULL);
result = PALLOC(strlen(buf) + 1); result = PALLOC(strlen(buf) + 1);
...@@ -904,7 +904,7 @@ datetime_pl_span(DateTime *datetime, TimeSpan *span) ...@@ -904,7 +904,7 @@ datetime_pl_span(DateTime *datetime, TimeSpan *span)
tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
#endif #endif
if (tm2datetime(tm, fsec, &tz, &dt) != 0) if (tm2datetime(tm, fsec, &tz, &dt) != 0)
elog(ABORT, "Unable to add datetime and timespan", NULL); elog(ERROR, "Unable to add datetime and timespan", NULL);
} }
else else
...@@ -1106,10 +1106,10 @@ timespan_div(TimeSpan *span1, float8 *arg2) ...@@ -1106,10 +1106,10 @@ timespan_div(TimeSpan *span1, float8 *arg2)
return NULL; return NULL;
if (!PointerIsValid(result = PALLOCTYPE(TimeSpan))) if (!PointerIsValid(result = PALLOCTYPE(TimeSpan)))
elog(ABORT, "Memory allocation failed, can't subtract timespans", NULL); elog(ERROR, "Memory allocation failed, can't subtract timespans", NULL);
if (*arg2 == 0.0) if (*arg2 == 0.0)
elog(ABORT, "timespan_div: divide by 0.0 error"); elog(ERROR, "timespan_div: divide by 0.0 error");
result->month = rint(span1->month / *arg2); result->month = rint(span1->month / *arg2);
result->time = JROUND(span1->time / *arg2); result->time = JROUND(span1->time / *arg2);
...@@ -1238,7 +1238,7 @@ datetime_age(DateTime *datetime1, DateTime *datetime2) ...@@ -1238,7 +1238,7 @@ datetime_age(DateTime *datetime1, DateTime *datetime2)
if (tm2timespan(tm, fsec, result) != 0) if (tm2timespan(tm, fsec, result) != 0)
{ {
elog(ABORT, "Unable to decode datetime", NULL); elog(ERROR, "Unable to decode datetime", NULL);
} }
#if FALSE #if FALSE
...@@ -1255,7 +1255,7 @@ datetime_age(DateTime *datetime1, DateTime *datetime2) ...@@ -1255,7 +1255,7 @@ datetime_age(DateTime *datetime1, DateTime *datetime2)
} }
else else
{ {
elog(ABORT, "Unable to decode datetime", NULL); elog(ERROR, "Unable to decode datetime", NULL);
} }
return (result); return (result);
...@@ -1436,7 +1436,7 @@ datetime_trunc(text *units, DateTime *datetime) ...@@ -1436,7 +1436,7 @@ datetime_trunc(text *units, DateTime *datetime)
{ {
#if FALSE #if FALSE
/* should return null but Postgres doesn't like that currently. - tgl 97/06/12 */ /* should return null but Postgres doesn't like that currently. - tgl 97/06/12 */
elog(ABORT, "Datetime is not finite", NULL); elog(ERROR, "Datetime is not finite", NULL);
#endif #endif
*result = 0; *result = 0;
...@@ -1480,7 +1480,7 @@ datetime_trunc(text *units, DateTime *datetime) ...@@ -1480,7 +1480,7 @@ datetime_trunc(text *units, DateTime *datetime)
break; break;
default: default:
elog(ABORT, "Datetime units '%s' not supported", lowunits); elog(ERROR, "Datetime units '%s' not supported", lowunits);
result = NULL; result = NULL;
} }
...@@ -1513,7 +1513,7 @@ datetime_trunc(text *units, DateTime *datetime) ...@@ -1513,7 +1513,7 @@ datetime_trunc(text *units, DateTime *datetime)
} }
if (tm2datetime(tm, fsec, &tz, result) != 0) if (tm2datetime(tm, fsec, &tz, result) != 0)
elog(ABORT, "Unable to truncate datetime to '%s'", lowunits); elog(ERROR, "Unable to truncate datetime to '%s'", lowunits);
#if FALSE #if FALSE
} }
...@@ -1526,7 +1526,7 @@ datetime_trunc(text *units, DateTime *datetime) ...@@ -1526,7 +1526,7 @@ datetime_trunc(text *units, DateTime *datetime)
} }
else else
{ {
elog(ABORT, "Datetime units '%s' not recognized", lowunits); elog(ERROR, "Datetime units '%s' not recognized", lowunits);
result = NULL; result = NULL;
} }
} }
...@@ -1580,7 +1580,7 @@ timespan_trunc(text *units, TimeSpan *timespan) ...@@ -1580,7 +1580,7 @@ timespan_trunc(text *units, TimeSpan *timespan)
if (TIMESPAN_IS_INVALID(*timespan)) if (TIMESPAN_IS_INVALID(*timespan))
{ {
#if FALSE #if FALSE
elog(ABORT, "Timespan is not finite", NULL); elog(ERROR, "Timespan is not finite", NULL);
#endif #endif
result = NULL; result = NULL;
...@@ -1623,12 +1623,12 @@ timespan_trunc(text *units, TimeSpan *timespan) ...@@ -1623,12 +1623,12 @@ timespan_trunc(text *units, TimeSpan *timespan)
break; break;
default: default:
elog(ABORT, "Timespan units '%s' not supported", lowunits); elog(ERROR, "Timespan units '%s' not supported", lowunits);
result = NULL; result = NULL;
} }
if (tm2timespan(tm, fsec, result) != 0) if (tm2timespan(tm, fsec, result) != 0)
elog(ABORT, "Unable to truncate timespan to '%s'", lowunits); elog(ERROR, "Unable to truncate timespan to '%s'", lowunits);
} }
else else
...@@ -1652,7 +1652,7 @@ timespan_trunc(text *units, TimeSpan *timespan) ...@@ -1652,7 +1652,7 @@ timespan_trunc(text *units, TimeSpan *timespan)
} }
else else
{ {
elog(ABORT, "Timespan units '%s' not recognized", units); elog(ERROR, "Timespan units '%s' not recognized", units);
result = NULL; result = NULL;
} }
...@@ -1708,7 +1708,7 @@ datetime_part(text *units, DateTime *datetime) ...@@ -1708,7 +1708,7 @@ datetime_part(text *units, DateTime *datetime)
{ {
#if FALSE #if FALSE
/* should return null but Postgres doesn't like that currently. - tgl 97/06/12 */ /* should return null but Postgres doesn't like that currently. - tgl 97/06/12 */
elog(ABORT, "Datetime is not finite", NULL); elog(ERROR, "Datetime is not finite", NULL);
#endif #endif
*result = 0; *result = 0;
...@@ -1774,7 +1774,7 @@ datetime_part(text *units, DateTime *datetime) ...@@ -1774,7 +1774,7 @@ datetime_part(text *units, DateTime *datetime)
break; break;
default: default:
elog(ABORT, "Datetime units '%s' not supported", lowunits); elog(ERROR, "Datetime units '%s' not supported", lowunits);
*result = 0; *result = 0;
} }
...@@ -1790,28 +1790,28 @@ datetime_part(text *units, DateTime *datetime) ...@@ -1790,28 +1790,28 @@ datetime_part(text *units, DateTime *datetime)
case DTK_DOW: case DTK_DOW:
if (datetime2tm(dt, &tz, tm, &fsec, &tzn) != 0) if (datetime2tm(dt, &tz, tm, &fsec, &tzn) != 0)
elog(ABORT, "Unable to encode datetime", NULL); elog(ERROR, "Unable to encode datetime", NULL);
*result = j2day(date2j(tm->tm_year, tm->tm_mon, tm->tm_mday)); *result = j2day(date2j(tm->tm_year, tm->tm_mon, tm->tm_mday));
break; break;
case DTK_DOY: case DTK_DOY:
if (datetime2tm(dt, &tz, tm, &fsec, &tzn) != 0) if (datetime2tm(dt, &tz, tm, &fsec, &tzn) != 0)
elog(ABORT, "Unable to encode datetime", NULL); elog(ERROR, "Unable to encode datetime", NULL);
*result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) *result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday)
- date2j(tm->tm_year, 1, 1) + 1); - date2j(tm->tm_year, 1, 1) + 1);
break; break;
default: default:
elog(ABORT, "Datetime units '%s' not supported", lowunits); elog(ERROR, "Datetime units '%s' not supported", lowunits);
*result = 0; *result = 0;
} }
} }
else else
{ {
elog(ABORT, "Datetime units '%s' not recognized", lowunits); elog(ERROR, "Datetime units '%s' not recognized", lowunits);
*result = 0; *result = 0;
} }
} }
...@@ -1864,7 +1864,7 @@ timespan_part(text *units, TimeSpan *timespan) ...@@ -1864,7 +1864,7 @@ timespan_part(text *units, TimeSpan *timespan)
if (TIMESPAN_IS_INVALID(*timespan)) if (TIMESPAN_IS_INVALID(*timespan))
{ {
#if FALSE #if FALSE
elog(ABORT, "Timespan is not finite", NULL); elog(ERROR, "Timespan is not finite", NULL);
#endif #endif
*result = 0; *result = 0;
...@@ -1925,7 +1925,7 @@ timespan_part(text *units, TimeSpan *timespan) ...@@ -1925,7 +1925,7 @@ timespan_part(text *units, TimeSpan *timespan)
break; break;
default: default:
elog(ABORT, "Timespan units '%s' not yet supported", units); elog(ERROR, "Timespan units '%s' not yet supported", units);
result = NULL; result = NULL;
} }
...@@ -1949,7 +1949,7 @@ timespan_part(text *units, TimeSpan *timespan) ...@@ -1949,7 +1949,7 @@ timespan_part(text *units, TimeSpan *timespan)
} }
else else
{ {
elog(ABORT, "Timespan units '%s' not recognized", units); elog(ERROR, "Timespan units '%s' not recognized", units);
*result = 0; *result = 0;
} }
...@@ -2005,7 +2005,7 @@ datetime_zone(text *zone, DateTime *datetime) ...@@ -2005,7 +2005,7 @@ datetime_zone(text *zone, DateTime *datetime)
* could return null but Postgres doesn't like that currently. - * could return null but Postgres doesn't like that currently. -
* tgl 97/06/12 * tgl 97/06/12
*/ */
elog(ABORT, "Datetime is not finite", NULL); elog(ERROR, "Datetime is not finite", NULL);
result = NULL; result = NULL;
} }
...@@ -2018,7 +2018,7 @@ datetime_zone(text *zone, DateTime *datetime) ...@@ -2018,7 +2018,7 @@ datetime_zone(text *zone, DateTime *datetime)
dt = dt2local(dt, tz); dt = dt2local(dt, tz);
if (datetime2tm(dt, NULL, tm, &fsec, NULL) != 0) if (datetime2tm(dt, NULL, tm, &fsec, NULL) != 0)
elog(ABORT, "Datetime not legal", NULL); elog(ERROR, "Datetime not legal", NULL);
up = upzone; up = upzone;
lp = lowzone; lp = lowzone;
...@@ -2039,7 +2039,7 @@ datetime_zone(text *zone, DateTime *datetime) ...@@ -2039,7 +2039,7 @@ datetime_zone(text *zone, DateTime *datetime)
} }
else else
{ {
elog(ABORT, "Time zone '%s' not recognized", lowzone); elog(ERROR, "Time zone '%s' not recognized", lowzone);
result = NULL; result = NULL;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.12 1998/01/05 03:34:06 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.13 1998/01/05 16:39:57 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -48,7 +48,7 @@ filename_in(char *file) ...@@ -48,7 +48,7 @@ filename_in(char *file)
if ((pw = getpwnam(userName)) == NULL) if ((pw = getpwnam(userName)) == NULL)
{ {
elog(ABORT, "User %s is not a Unix user on the db server.", elog(ERROR, "User %s is not a Unix user on the db server.",
userName); userName);
} }
...@@ -77,7 +77,7 @@ filename_in(char *file) ...@@ -77,7 +77,7 @@ filename_in(char *file)
/* printf("name: %s\n"); */ /* printf("name: %s\n"); */
if ((pw = getpwnam(name)) == NULL) if ((pw = getpwnam(name)) == NULL)
{ {
elog(ABORT, "No such user: %s\n", name); elog(ERROR, "No such user: %s\n", name);
ind = 0; ind = 0;
} }
else else
...@@ -112,7 +112,7 @@ filename_in(char *file) ...@@ -112,7 +112,7 @@ filename_in(char *file)
} }
else else
{ {
elog(ABORT, "Couldn't find %s in your environment", environment); elog(ERROR, "Couldn't find %s in your environment", environment);
} }
} }
else else
...@@ -132,6 +132,6 @@ filename_out(char *s) ...@@ -132,6 +132,6 @@ filename_out(char *s)
return ((char *) NULL); return ((char *) NULL);
ret = (char *) palloc(strlen(s) + 1); ret = (char *) palloc(strlen(s) + 1);
if (!ret) if (!ret)
elog(ABORT, "filename_out: palloc failed"); elog(ERROR, "filename_out: palloc failed");
return (strcpy(ret, s)); return (strcpy(ret, s));
} }
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.25 1998/01/05 03:34:07 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.26 1998/01/05 16:39:59 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -161,9 +161,9 @@ CheckFloat4Val(double val) ...@@ -161,9 +161,9 @@ CheckFloat4Val(double val)
return; return;
#else #else
if (fabs(val) > FLOAT4_MAX) if (fabs(val) > FLOAT4_MAX)
elog(ABORT, "Bad float4 input format -- overflow"); elog(ERROR, "Bad float4 input format -- overflow");
if (val != 0.0 && fabs(val) < FLOAT4_MIN) if (val != 0.0 && fabs(val) < FLOAT4_MIN)
elog(ABORT, "Bad float4 input format -- underflow"); elog(ERROR, "Bad float4 input format -- underflow");
return; return;
#endif /* UNSAFE_FLOATS */ #endif /* UNSAFE_FLOATS */
} }
...@@ -186,9 +186,9 @@ CheckFloat8Val(double val) ...@@ -186,9 +186,9 @@ CheckFloat8Val(double val)
return; return;
#else #else
if (fabs(val) > FLOAT8_MAX) if (fabs(val) > FLOAT8_MAX)
elog(ABORT, "Bad float8 input format -- overflow"); elog(ERROR, "Bad float8 input format -- overflow");
if (val != 0.0 && fabs(val) < FLOAT8_MIN) if (val != 0.0 && fabs(val) < FLOAT8_MIN)
elog(ABORT, "Bad float8 input format -- underflow"); elog(ERROR, "Bad float8 input format -- underflow");
return; return;
#endif /* UNSAFE_FLOATS */ #endif /* UNSAFE_FLOATS */
} }
...@@ -210,7 +210,7 @@ float4in(char *num) ...@@ -210,7 +210,7 @@ float4in(char *num)
errno = 0; errno = 0;
val = strtod(num, &endptr); val = strtod(num, &endptr);
if (*endptr != '\0' || errno == ERANGE) if (*endptr != '\0' || errno == ERANGE)
elog(ABORT, "Bad float4 input format '%s'", num); elog(ERROR, "Bad float4 input format '%s'", num);
/* /*
* if we get here, we have a legal double, still need to check to see * if we get here, we have a legal double, still need to check to see
...@@ -257,7 +257,7 @@ float8in(char *num) ...@@ -257,7 +257,7 @@ float8in(char *num)
errno = 0; errno = 0;
val = strtod(num, &endptr); val = strtod(num, &endptr);
if (*endptr != '\0' || errno == ERANGE) if (*endptr != '\0' || errno == ERANGE)
elog(ABORT, "Bad float8 input format '%s'", num); elog(ERROR, "Bad float8 input format '%s'", num);
CheckFloat8Val(val); CheckFloat8Val(val);
*result = val; *result = val;
...@@ -515,7 +515,7 @@ float4div(float32 arg1, float32 arg2) ...@@ -515,7 +515,7 @@ float4div(float32 arg1, float32 arg2)
return (float32) NULL; return (float32) NULL;
if (*arg2 == 0.0) if (*arg2 == 0.0)
elog(ABORT, "float4div: divide by zero error"); elog(ERROR, "float4div: divide by zero error");
val = *arg1 / *arg2; val = *arg1 / *arg2;
...@@ -609,7 +609,7 @@ float8div(float64 arg1, float64 arg2) ...@@ -609,7 +609,7 @@ float8div(float64 arg1, float64 arg2)
result = (float64) palloc(sizeof(float64data)); result = (float64) palloc(sizeof(float64data));
if (*arg2 == 0.0) if (*arg2 == 0.0)
elog(ABORT, "float8div: divide by zero error"); elog(ERROR, "float8div: divide by zero error");
val = *arg1 / *arg2; val = *arg1 / *arg2;
CheckFloat8Val(val); CheckFloat8Val(val);
...@@ -806,10 +806,10 @@ dtoi4(float64 num) ...@@ -806,10 +806,10 @@ dtoi4(float64 num)
int32 result; int32 result;
if (!PointerIsValid(num)) if (!PointerIsValid(num))
elog(ABORT, "dtoi4: unable to convert null", NULL); elog(ERROR, "dtoi4: unable to convert null", NULL);
if ((*num < INT_MIN) || (*num > INT_MAX)) if ((*num < INT_MIN) || (*num > INT_MAX))
elog(ABORT, "dtoi4: integer out of range", NULL); elog(ERROR, "dtoi4: integer out of range", NULL);
result = rint(*num); result = rint(*num);
return (result); return (result);
...@@ -825,10 +825,10 @@ dtoi2(float64 num) ...@@ -825,10 +825,10 @@ dtoi2(float64 num)
int16 result; int16 result;
if (!PointerIsValid(num)) if (!PointerIsValid(num))
elog(ABORT, "dtoi2: unable to convert null", NULL); elog(ERROR, "dtoi2: unable to convert null", NULL);
if ((*num < SHRT_MIN) || (*num > SHRT_MAX)) if ((*num < SHRT_MIN) || (*num > SHRT_MAX))
elog(ABORT, "dtoi2: integer out of range", NULL); elog(ERROR, "dtoi2: integer out of range", NULL);
result = rint(*num); result = rint(*num);
return (result); return (result);
...@@ -874,10 +874,10 @@ ftoi4(float32 num) ...@@ -874,10 +874,10 @@ ftoi4(float32 num)
int32 result; int32 result;
if (!PointerIsValid(num)) if (!PointerIsValid(num))
elog(ABORT, "ftoi4: unable to convert null", NULL); elog(ERROR, "ftoi4: unable to convert null", NULL);
if ((*num < INT_MIN) || (*num > INT_MAX)) if ((*num < INT_MIN) || (*num > INT_MAX))
elog(ABORT, "ftoi4: integer out of range", NULL); elog(ERROR, "ftoi4: integer out of range", NULL);
result = rint(*num); result = rint(*num);
return (result); return (result);
...@@ -893,10 +893,10 @@ ftoi2(float32 num) ...@@ -893,10 +893,10 @@ ftoi2(float32 num)
int16 result; int16 result;
if (!PointerIsValid(num)) if (!PointerIsValid(num))
elog(ABORT, "ftoi2: unable to convert null", NULL); elog(ERROR, "ftoi2: unable to convert null", NULL);
if ((*num < SHRT_MIN) || (*num > SHRT_MAX)) if ((*num < SHRT_MIN) || (*num > SHRT_MAX))
elog(ABORT, "ftoi2: integer out of range", NULL); elog(ERROR, "ftoi2: integer out of range", NULL);
result = rint(*num); result = rint(*num);
return (result); return (result);
...@@ -1052,7 +1052,7 @@ dpow(float64 arg1, float64 arg2) ...@@ -1052,7 +1052,7 @@ dpow(float64 arg1, float64 arg2)
#else #else
if (!finite(*result)) if (!finite(*result))
#endif #endif
elog(ABORT, "pow() result is out of range"); elog(ERROR, "pow() result is out of range");
CheckFloat8Val(*result); CheckFloat8Val(*result);
return (result); return (result);
...@@ -1083,7 +1083,7 @@ dexp(float64 arg1) ...@@ -1083,7 +1083,7 @@ dexp(float64 arg1)
#else #else
if (!finite(*result)) if (!finite(*result))
#endif #endif
elog(ABORT, "exp() result is out of range"); elog(ERROR, "exp() result is out of range");
CheckFloat8Val(*result); CheckFloat8Val(*result);
return (result); return (result);
...@@ -1107,9 +1107,9 @@ dlog1(float64 arg1) ...@@ -1107,9 +1107,9 @@ dlog1(float64 arg1)
tmp = *arg1; tmp = *arg1;
if (tmp == 0.0) if (tmp == 0.0)
elog(ABORT, "can't take log of zero"); elog(ERROR, "can't take log of zero");
if (tmp < 0) if (tmp < 0)
elog(ABORT, "can't take log of a negative number"); elog(ERROR, "can't take log of a negative number");
*result = (float64data) log(tmp); *result = (float64data) log(tmp);
CheckFloat8Val(*result); CheckFloat8Val(*result);
...@@ -1185,7 +1185,7 @@ float48div(float32 arg1, float64 arg2) ...@@ -1185,7 +1185,7 @@ float48div(float32 arg1, float64 arg2)
result = (float64) palloc(sizeof(float64data)); result = (float64) palloc(sizeof(float64data));
if (*arg2 == 0.0) if (*arg2 == 0.0)
elog(ABORT, "float48div: divide by zero"); elog(ERROR, "float48div: divide by zero");
*result = *arg1 / *arg2; *result = *arg1 / *arg2;
CheckFloat8Val(*result); CheckFloat8Val(*result);
...@@ -1255,7 +1255,7 @@ float84div(float64 arg1, float32 arg2) ...@@ -1255,7 +1255,7 @@ float84div(float64 arg1, float32 arg2)
result = (float64) palloc(sizeof(float64data)); result = (float64) palloc(sizeof(float64data));
if (*arg2 == 0.0) if (*arg2 == 0.0)
elog(ABORT, "float48div: divide by zero"); elog(ERROR, "float48div: divide by zero");
*result = *arg1 / *arg2; *result = *arg1 / *arg2;
CheckFloat8Val(*result); CheckFloat8Val(*result);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.27 1998/01/05 03:34:08 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.28 1998/01/05 16:40:02 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -294,7 +294,7 @@ path_encode(bool closed, int npts, Point *pt) ...@@ -294,7 +294,7 @@ path_encode(bool closed, int npts, Point *pt)
{ {
*cp++ = LDELIM; *cp++ = LDELIM;
if (!pair_encode(pt->x, pt->y, cp)) if (!pair_encode(pt->x, pt->y, cp))
elog(ABORT, "Unable to format path", NULL); elog(ERROR, "Unable to format path", NULL);
cp += strlen(cp); cp += strlen(cp);
*cp++ = RDELIM; *cp++ = RDELIM;
*cp++ = DELIM; *cp++ = DELIM;
...@@ -364,11 +364,11 @@ box_in(char *str) ...@@ -364,11 +364,11 @@ box_in(char *str)
y; y;
if (!PointerIsValid(str)) if (!PointerIsValid(str))
elog(ABORT, " Bad (null) box external representation", NULL); elog(ERROR, " Bad (null) box external representation", NULL);
if ((!path_decode(FALSE, 2, str, &isopen, &s, &(box->high))) if ((!path_decode(FALSE, 2, str, &isopen, &s, &(box->high)))
|| (*s != '\0')) || (*s != '\0'))
elog(ABORT, "Bad box external representation '%s'", str); elog(ERROR, "Bad box external representation '%s'", str);
/* reorder corners if necessary... */ /* reorder corners if necessary... */
if (box->high.x < box->low.x) if (box->high.x < box->low.x)
...@@ -1058,10 +1058,10 @@ path_in(char *str) ...@@ -1058,10 +1058,10 @@ path_in(char *str)
int depth = 0; int depth = 0;
if (!PointerIsValid(str)) if (!PointerIsValid(str))
elog(ABORT, "Bad (null) path external representation"); elog(ERROR, "Bad (null) path external representation");
if ((npts = pair_count(str, ',')) <= 0) if ((npts = pair_count(str, ',')) <= 0)
elog(ABORT, "Bad path external representation '%s'", str); elog(ERROR, "Bad path external representation '%s'", str);
s = str; s = str;
while (isspace(*s)) while (isspace(*s))
...@@ -1082,7 +1082,7 @@ path_in(char *str) ...@@ -1082,7 +1082,7 @@ path_in(char *str)
if ((!path_decode(TRUE, npts, s, &isopen, &s, &(path->p[0]))) if ((!path_decode(TRUE, npts, s, &isopen, &s, &(path->p[0])))
&& (!((depth == 0) && (*s == '\0'))) && !((depth >= 1) && (*s == RDELIM))) && (!((depth == 0) && (*s == '\0'))) && !((depth >= 1) && (*s == RDELIM)))
elog(ABORT, "Bad path external representation '%s'", str); elog(ERROR, "Bad path external representation '%s'", str);
path->closed = (!isopen); path->closed = (!isopen);
...@@ -1367,10 +1367,10 @@ point_in(char *str) ...@@ -1367,10 +1367,10 @@ point_in(char *str)
char *s; char *s;
if (!PointerIsValid(str)) if (!PointerIsValid(str))
elog(ABORT, "Bad (null) point external representation"); elog(ERROR, "Bad (null) point external representation");
if (!pair_decode(str, &x, &y, &s) || (strlen(s) > 0)) if (!pair_decode(str, &x, &y, &s) || (strlen(s) > 0))
elog(ABORT, "Bad point external representation '%s'", str); elog(ERROR, "Bad point external representation '%s'", str);
point = PALLOCTYPE(Point); point = PALLOCTYPE(Point);
...@@ -1549,13 +1549,13 @@ lseg_in(char *str) ...@@ -1549,13 +1549,13 @@ lseg_in(char *str)
char *s; char *s;
if (!PointerIsValid(str)) if (!PointerIsValid(str))
elog(ABORT, " Bad (null) lseg external representation", NULL); elog(ERROR, " Bad (null) lseg external representation", NULL);
lseg = PALLOCTYPE(LSEG); lseg = PALLOCTYPE(LSEG);
if ((!path_decode(TRUE, 2, str, &isopen, &s, &(lseg->p[0]))) if ((!path_decode(TRUE, 2, str, &isopen, &s, &(lseg->p[0])))
|| (*s != '\0')) || (*s != '\0'))
elog(ABORT, "Bad lseg external representation '%s'", str); elog(ERROR, "Bad lseg external representation '%s'", str);
lseg->m = point_sl(&lseg->p[0], &lseg->p[1]); lseg->m = point_sl(&lseg->p[0], &lseg->p[1]);
...@@ -2037,7 +2037,7 @@ dist_cpoly(CIRCLE *circle, POLYGON *poly) ...@@ -2037,7 +2037,7 @@ dist_cpoly(CIRCLE *circle, POLYGON *poly)
LSEG seg; LSEG seg;
if (!PointerIsValid(circle) || !PointerIsValid(poly)) if (!PointerIsValid(circle) || !PointerIsValid(poly))
elog(ABORT, "Invalid (null) input for distance", NULL); elog(ERROR, "Invalid (null) input for distance", NULL);
if (point_inside(&(circle->center), poly->npts, poly->p)) if (point_inside(&(circle->center), poly->npts, poly->p))
{ {
...@@ -2242,7 +2242,7 @@ Point * ...@@ -2242,7 +2242,7 @@ Point *
close_pb(Point *pt, BOX *box) close_pb(Point *pt, BOX *box)
{ {
/* think about this one for a while */ /* think about this one for a while */
elog(ABORT, "close_pb not implemented", NULL); elog(ERROR, "close_pb not implemented", NULL);
return (NULL); return (NULL);
} }
...@@ -2273,7 +2273,7 @@ Point * ...@@ -2273,7 +2273,7 @@ Point *
close_sb(LSEG *lseg, BOX *box) close_sb(LSEG *lseg, BOX *box)
{ {
/* think about this one for a while */ /* think about this one for a while */
elog(ABORT, "close_sb not implemented", NULL); elog(ERROR, "close_sb not implemented", NULL);
return (NULL); return (NULL);
} }
...@@ -2282,7 +2282,7 @@ Point * ...@@ -2282,7 +2282,7 @@ Point *
close_lb(LINE *line, BOX *box) close_lb(LINE *line, BOX *box)
{ {
/* think about this one for a while */ /* think about this one for a while */
elog(ABORT, "close_lb not implemented", NULL); elog(ERROR, "close_lb not implemented", NULL);
return (NULL); return (NULL);
} }
...@@ -2531,7 +2531,7 @@ make_bound_box(POLYGON *poly) ...@@ -2531,7 +2531,7 @@ make_bound_box(POLYGON *poly)
} }
else else
{ {
elog(ABORT, "Unable to create bounding box for empty polygon", NULL); elog(ERROR, "Unable to create bounding box for empty polygon", NULL);
} }
} }
...@@ -2553,10 +2553,10 @@ poly_in(char *str) ...@@ -2553,10 +2553,10 @@ poly_in(char *str)
char *s; char *s;
if (!PointerIsValid(str)) if (!PointerIsValid(str))
elog(ABORT, " Bad (null) polygon external representation"); elog(ERROR, " Bad (null) polygon external representation");
if ((npts = pair_count(str, ',')) <= 0) if ((npts = pair_count(str, ',')) <= 0)
elog(ABORT, "Bad polygon external representation '%s'", str); elog(ERROR, "Bad polygon external representation '%s'", str);
size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts); size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts);
poly = PALLOC(size); poly = PALLOC(size);
...@@ -2567,7 +2567,7 @@ poly_in(char *str) ...@@ -2567,7 +2567,7 @@ poly_in(char *str)
if ((!path_decode(FALSE, npts, str, &isopen, &s, &(poly->p[0]))) if ((!path_decode(FALSE, npts, str, &isopen, &s, &(poly->p[0])))
|| (*s != '\0')) || (*s != '\0'))
elog(ABORT, "Bad polygon external representation '%s'", str); elog(ERROR, "Bad polygon external representation '%s'", str);
make_bound_box(poly); make_bound_box(poly);
...@@ -2870,7 +2870,7 @@ point_div(Point *p1, Point *p2) ...@@ -2870,7 +2870,7 @@ point_div(Point *p1, Point *p2)
div = (p2->x * p2->x) + (p2->y * p2->y); div = (p2->x * p2->x) + (p2->y * p2->y);
if (div == 0.0) if (div == 0.0)
elog(ABORT, "point_div: divide by 0.0 error"); elog(ERROR, "point_div: divide by 0.0 error");
result->x = ((p1->x * p2->x) + (p1->y * p2->y)) / div; result->x = ((p1->x * p2->x) + (p1->y * p2->y)) / div;
result->y = ((p2->x * p1->y) - (p2->y * p1->x)) / div; result->y = ((p2->x * p1->y) - (p2->y * p1->x)) / div;
...@@ -3139,7 +3139,7 @@ path_center(PATH *path) ...@@ -3139,7 +3139,7 @@ path_center(PATH *path)
if (!PointerIsValid(path)) if (!PointerIsValid(path))
return (NULL); return (NULL);
elog(ABORT, "path_center not implemented", NULL); elog(ERROR, "path_center not implemented", NULL);
result = PALLOCTYPE(Point); result = PALLOCTYPE(Point);
result = NULL; result = NULL;
...@@ -3158,7 +3158,7 @@ path_poly(PATH *path) ...@@ -3158,7 +3158,7 @@ path_poly(PATH *path)
return (NULL); return (NULL);
if (!path->closed) if (!path->closed)
elog(ABORT, "Open path cannot be converted to polygon", NULL); elog(ERROR, "Open path cannot be converted to polygon", NULL);
size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * path->npts); size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * path->npts);
poly = PALLOC(size); poly = PALLOC(size);
...@@ -3197,7 +3197,7 @@ upgradepath(PATH *path) ...@@ -3197,7 +3197,7 @@ upgradepath(PATH *path)
return (NULL); return (NULL);
if (!isoldpath(path)) if (!isoldpath(path))
elog(ABORT, "upgradepath: path already upgraded?", NULL); elog(ERROR, "upgradepath: path already upgraded?", NULL);
npts = (path->npts - 1); npts = (path->npts - 1);
size = offsetof(PATH, p[0]) +(sizeof(path->p[0]) * npts); size = offsetof(PATH, p[0]) +(sizeof(path->p[0]) * npts);
...@@ -3463,7 +3463,7 @@ circle_in(char *str) ...@@ -3463,7 +3463,7 @@ circle_in(char *str)
int depth = 0; int depth = 0;
if (!PointerIsValid(str)) if (!PointerIsValid(str))
elog(ABORT, " Bad (null) circle external representation", NULL); elog(ERROR, " Bad (null) circle external representation", NULL);
circle = PALLOCTYPE(CIRCLE); circle = PALLOCTYPE(CIRCLE);
...@@ -3483,7 +3483,7 @@ circle_in(char *str) ...@@ -3483,7 +3483,7 @@ circle_in(char *str)
} }
if (!pair_decode(s, &circle->center.x, &circle->center.y, &s)) if (!pair_decode(s, &circle->center.x, &circle->center.y, &s))
elog(ABORT, "Bad circle external representation '%s'", str); elog(ERROR, "Bad circle external representation '%s'", str);
if (*s == DELIM) if (*s == DELIM)
s++; s++;
...@@ -3491,7 +3491,7 @@ circle_in(char *str) ...@@ -3491,7 +3491,7 @@ circle_in(char *str)
s++; s++;
if ((!single_decode(s, &circle->radius, &s)) || (circle->radius < 0)) if ((!single_decode(s, &circle->radius, &s)) || (circle->radius < 0))
elog(ABORT, "Bad circle external representation '%s'", str); elog(ERROR, "Bad circle external representation '%s'", str);
while (depth > 0) while (depth > 0)
{ {
...@@ -3505,12 +3505,12 @@ circle_in(char *str) ...@@ -3505,12 +3505,12 @@ circle_in(char *str)
} }
else else
{ {
elog(ABORT, "Bad circle external representation '%s'", str); elog(ERROR, "Bad circle external representation '%s'", str);
} }
} }
if (*s != '\0') if (*s != '\0')
elog(ABORT, "Bad circle external representation '%s'", str); elog(ERROR, "Bad circle external representation '%s'", str);
return (circle); return (circle);
} /* circle_in() */ } /* circle_in() */
...@@ -3532,13 +3532,13 @@ circle_out(CIRCLE *circle) ...@@ -3532,13 +3532,13 @@ circle_out(CIRCLE *circle)
*cp++ = LDELIM_C; *cp++ = LDELIM_C;
*cp++ = LDELIM; *cp++ = LDELIM;
if (!pair_encode(circle->center.x, circle->center.y, cp)) if (!pair_encode(circle->center.x, circle->center.y, cp))
elog(ABORT, "Unable to format circle", NULL); elog(ERROR, "Unable to format circle", NULL);
cp += strlen(cp); cp += strlen(cp);
*cp++ = RDELIM; *cp++ = RDELIM;
*cp++ = DELIM; *cp++ = DELIM;
if (!single_encode(circle->radius, cp)) if (!single_encode(circle->radius, cp))
elog(ABORT, "Unable to format circle", NULL); elog(ERROR, "Unable to format circle", NULL);
cp += strlen(cp); cp += strlen(cp);
*cp++ = RDELIM_C; *cp++ = RDELIM_C;
...@@ -4000,7 +4000,7 @@ circle_poly(int npts, CIRCLE *circle) ...@@ -4000,7 +4000,7 @@ circle_poly(int npts, CIRCLE *circle)
return (NULL); return (NULL);
if (FPzero(circle->radius) || (npts < 2)) if (FPzero(circle->radius) || (npts < 2))
elog(ABORT, "Unable to convert circle to polygon", NULL); elog(ERROR, "Unable to convert circle to polygon", NULL);
size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts); size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts);
poly = PALLOC(size); poly = PALLOC(size);
...@@ -4036,7 +4036,7 @@ poly_circle(POLYGON *poly) ...@@ -4036,7 +4036,7 @@ poly_circle(POLYGON *poly)
return (NULL); return (NULL);
if (poly->npts < 2) if (poly->npts < 2)
elog(ABORT, "Unable to convert polygon to circle", NULL); elog(ERROR, "Unable to convert polygon to circle", NULL);
circle = PALLOCTYPE(CIRCLE); circle = PALLOCTYPE(CIRCLE);
...@@ -4059,7 +4059,7 @@ poly_circle(POLYGON *poly) ...@@ -4059,7 +4059,7 @@ poly_circle(POLYGON *poly)
circle->radius /= poly->npts; circle->radius /= poly->npts;
if (FPzero(circle->radius)) if (FPzero(circle->radius))
elog(ABORT, "Unable to convert polygon to circle", NULL); elog(ERROR, "Unable to convert polygon to circle", NULL);
return (circle); return (circle);
} /* poly_circle() */ } /* poly_circle() */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.11 1998/01/05 03:34:09 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.12 1998/01/05 16:40:06 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -232,9 +232,9 @@ int16 ...@@ -232,9 +232,9 @@ int16
i4toi2(int32 arg1) i4toi2(int32 arg1)
{ {
if (arg1 < SHRT_MIN) if (arg1 < SHRT_MIN)
elog(ABORT, "i4toi2: '%d' causes int2 underflow", arg1); elog(ERROR, "i4toi2: '%d' causes int2 underflow", arg1);
if (arg1 > SHRT_MAX) if (arg1 > SHRT_MAX)
elog(ABORT, "i4toi2: '%d' causes int2 overflow", arg1); elog(ERROR, "i4toi2: '%d' causes int2 overflow", arg1);
return ((int16) arg1); return ((int16) arg1);
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.37 1998/01/05 03:34:11 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.38 1998/01/05 16:40:07 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -256,14 +256,14 @@ nabstimein(char *str) ...@@ -256,14 +256,14 @@ nabstimein(char *str)
ftype[MAXDATEFIELDS]; ftype[MAXDATEFIELDS];
if (!PointerIsValid(str)) if (!PointerIsValid(str))
elog(ABORT, "Bad (null) abstime external representation", NULL); elog(ERROR, "Bad (null) abstime external representation", NULL);
if (strlen(str) > MAXDATELEN) if (strlen(str) > MAXDATELEN)
elog(ABORT, "Bad (length) abstime external representation '%s'", str); elog(ERROR, "Bad (length) abstime external representation '%s'", str);
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0) if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
|| (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tz) != 0)) || (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tz) != 0))
elog(ABORT, "Bad abstime external representation '%s'", str); elog(ERROR, "Bad abstime external representation '%s'", str);
#ifdef DATEDEBUG #ifdef DATEDEBUG
printf("nabstimein- %d fields are type %d (DTK_DATE=%d)\n", nf, dtype, DTK_DATE); printf("nabstimein- %d fields are type %d (DTK_DATE=%d)\n", nf, dtype, DTK_DATE);
...@@ -296,7 +296,7 @@ nabstimein(char *str) ...@@ -296,7 +296,7 @@ nabstimein(char *str)
break; break;
default: default:
elog(ABORT, "Bad abstime (internal coding error) '%s'", str); elog(ERROR, "Bad abstime (internal coding error) '%s'", str);
result = INVALID_ABSTIME; result = INVALID_ABSTIME;
break; break;
}; };
...@@ -547,7 +547,7 @@ abstime_datetime(AbsoluteTime abstime) ...@@ -547,7 +547,7 @@ abstime_datetime(AbsoluteTime abstime)
DateTime *result; DateTime *result;
if (!PointerIsValid(result = PALLOCTYPE(DateTime))) if (!PointerIsValid(result = PALLOCTYPE(DateTime)))
elog(ABORT, "Unable to allocate space to convert abstime to datetime", NULL); elog(ERROR, "Unable to allocate space to convert abstime to datetime", NULL);
switch (abstime) switch (abstime)
{ {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.20 1998/01/05 03:34:12 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.21 1998/01/05 16:40:09 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -58,9 +58,9 @@ pg_atoi(char *s, int size, int c) ...@@ -58,9 +58,9 @@ pg_atoi(char *s, int size, int c)
errno = 0; errno = 0;
l = strtol(s, &badp, 10); l = strtol(s, &badp, 10);
if (errno) /* strtol must set ERANGE */ if (errno) /* strtol must set ERANGE */
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s); elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
if (badp && *badp && (*badp != c)) if (badp && *badp && (*badp != c))
elog(ABORT, "pg_atoi: error in \"%s\": can\'t parse \"%s\"", s, badp); elog(ERROR, "pg_atoi: error in \"%s\": can\'t parse \"%s\"", s, badp);
switch (size) switch (size)
{ {
...@@ -70,12 +70,12 @@ pg_atoi(char *s, int size, int c) ...@@ -70,12 +70,12 @@ pg_atoi(char *s, int size, int c)
if (l < INT_MIN) if (l < INT_MIN)
{ {
errno = ERANGE; errno = ERANGE;
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s); elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
} }
if (l > INT_MAX) if (l > INT_MAX)
{ {
errno = ERANGE; errno = ERANGE;
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s); elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
} }
#endif /* HAS_LONG_LONG */ #endif /* HAS_LONG_LONG */
break; break;
...@@ -83,28 +83,28 @@ pg_atoi(char *s, int size, int c) ...@@ -83,28 +83,28 @@ pg_atoi(char *s, int size, int c)
if (l < SHRT_MIN) if (l < SHRT_MIN)
{ {
errno = ERANGE; errno = ERANGE;
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s); elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
} }
if (l > SHRT_MAX) if (l > SHRT_MAX)
{ {
errno = ERANGE; errno = ERANGE;
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s); elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
} }
break; break;
case sizeof(int8): case sizeof(int8):
if (l < SCHAR_MIN) if (l < SCHAR_MIN)
{ {
errno = ERANGE; errno = ERANGE;
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s); elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
} }
if (l > SCHAR_MAX) if (l > SCHAR_MAX)
{ {
errno = ERANGE; errno = ERANGE;
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s); elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
} }
break; break;
default: default:
elog(ABORT, "pg_atoi: invalid result size: %d", size); elog(ERROR, "pg_atoi: invalid result size: %d", size);
} }
return ((int32) l); return ((int32) l);
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidname.c,v 1.10 1998/01/05 03:34:13 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidname.c,v 1.11 1998/01/05 16:40:10 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -40,7 +40,7 @@ oidnamein(char *inStr) ...@@ -40,7 +40,7 @@ oidnamein(char *inStr)
StrNCpy(oc->name.data, inptr, NAMEDATALEN); StrNCpy(oc->name.data, inptr, NAMEDATALEN);
} }
else else
elog(ABORT, "Bad input data for type oidname"); elog(ERROR, "Bad input data for type oidname");
return oc; return oc;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.12 1998/01/05 03:34:14 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.13 1998/01/05 16:40:11 momjian Exp $
* *
* Alistair Crooks added the code for the regex caching * Alistair Crooks added the code for the regex caching
* agc - cached the regular expressions used - there's a good chance * agc - cached the regular expressions used - there's a good chance
...@@ -157,7 +157,7 @@ RE_compile_and_execute(struct varlena * text_re, char *text, int cflags) ...@@ -157,7 +157,7 @@ RE_compile_and_execute(struct varlena * text_re, char *text, int cflags)
rev[oldest].cre_s = (char *) NULL; rev[oldest].cre_s = (char *) NULL;
pg95_regerror(regcomp_result, &rev[oldest].cre_re, errMsg, pg95_regerror(regcomp_result, &rev[oldest].cre_re, errMsg,
sizeof(errMsg)); sizeof(errMsg));
elog(ABORT, "regcomp failed with error %s", errMsg); elog(ERROR, "regcomp failed with error %s", errMsg);
} }
/* not reached */ /* not reached */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.11 1998/01/05 03:34:14 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.12 1998/01/05 16:40:12 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -45,7 +45,7 @@ regprocin(char *proname) ...@@ -45,7 +45,7 @@ regprocin(char *proname)
proc = heap_openr(ProcedureRelationName); proc = heap_openr(ProcedureRelationName);
if (!RelationIsValid(proc)) if (!RelationIsValid(proc))
{ {
elog(ABORT, "regprocin: could not open %s", elog(ERROR, "regprocin: could not open %s",
ProcedureRelationName); ProcedureRelationName);
return (0); return (0);
} }
...@@ -59,7 +59,7 @@ regprocin(char *proname) ...@@ -59,7 +59,7 @@ regprocin(char *proname)
if (!HeapScanIsValid(procscan)) if (!HeapScanIsValid(procscan))
{ {
heap_close(proc); heap_close(proc);
elog(ABORT, "regprocin: could not being scan of %s", elog(ERROR, "regprocin: could not being scan of %s",
ProcedureRelationName); ProcedureRelationName);
return (0); return (0);
} }
...@@ -104,7 +104,7 @@ regprocout(RegProcedure proid) ...@@ -104,7 +104,7 @@ regprocout(RegProcedure proid)
proc = heap_openr(ProcedureRelationName); proc = heap_openr(ProcedureRelationName);
if (!RelationIsValid(proc)) if (!RelationIsValid(proc))
{ {
elog(ABORT, "regprocout: could not open %s", elog(ERROR, "regprocout: could not open %s",
ProcedureRelationName); ProcedureRelationName);
return (0); return (0);
} }
...@@ -118,7 +118,7 @@ regprocout(RegProcedure proid) ...@@ -118,7 +118,7 @@ regprocout(RegProcedure proid)
if (!HeapScanIsValid(procscan)) if (!HeapScanIsValid(procscan))
{ {
heap_close(proc); heap_close(proc);
elog(ABORT, "regprocout: could not being scan of %s", elog(ERROR, "regprocout: could not being scan of %s",
ProcedureRelationName); ProcedureRelationName);
return (0); return (0);
} }
...@@ -176,7 +176,7 @@ oid8types(Oid (*oidArray)[]) ...@@ -176,7 +176,7 @@ oid8types(Oid (*oidArray)[])
type = heap_openr(TypeRelationName); type = heap_openr(TypeRelationName);
if (!RelationIsValid(type)) if (!RelationIsValid(type))
{ {
elog(ABORT, "int8typeout: could not open %s", elog(ERROR, "int8typeout: could not open %s",
TypeRelationName); TypeRelationName);
return (0); return (0);
} }
...@@ -196,7 +196,7 @@ oid8types(Oid (*oidArray)[]) ...@@ -196,7 +196,7 @@ oid8types(Oid (*oidArray)[])
if (!HeapScanIsValid(typescan)) if (!HeapScanIsValid(typescan))
{ {
heap_close(type); heap_close(type);
elog(ABORT, "int8typeout: could not being scan of %s", elog(ERROR, "int8typeout: could not being scan of %s",
TypeRelationName); TypeRelationName);
return (0); return (0);
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.13 1998/01/05 03:34:16 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.14 1998/01/05 16:40:15 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -287,7 +287,7 @@ getattdisbursion(Oid relid, AttrNumber attnum) ...@@ -287,7 +287,7 @@ getattdisbursion(Oid relid, AttrNumber attnum)
0, 0); 0, 0);
if (!HeapTupleIsValid(atp)) if (!HeapTupleIsValid(atp))
{ {
elog(ABORT, "getattdisbursion: no attribute tuple %d %d", elog(ERROR, "getattdisbursion: no attribute tuple %d %d",
relid, attnum); relid, attnum);
return (0); return (0);
} }
...@@ -304,7 +304,7 @@ getattdisbursion(Oid relid, AttrNumber attnum) ...@@ -304,7 +304,7 @@ getattdisbursion(Oid relid, AttrNumber attnum)
*/ */
if (!HeapTupleIsValid(atp)) if (!HeapTupleIsValid(atp))
{ {
elog(ABORT, "getattdisbursion: no relation tuple %d", relid); elog(ERROR, "getattdisbursion: no relation tuple %d", relid);
return (0); return (0);
} }
ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples; ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples;
...@@ -357,7 +357,7 @@ gethilokey(Oid relid, ...@@ -357,7 +357,7 @@ gethilokey(Oid relid,
*low = "n"; *low = "n";
/* /*
* XXX elog(ABORT, "gethilokey: statistic tuple not * XXX elog(ERROR, "gethilokey: statistic tuple not
* found"); * found");
*/ */
return; return;
...@@ -417,9 +417,9 @@ btreesel(Oid operatorObjectId, ...@@ -417,9 +417,9 @@ btreesel(Oid operatorObjectId,
} }
if (!PointerIsValid(result)) if (!PointerIsValid(result))
elog(ABORT, "Btree Selectivity: bad pointer"); elog(ERROR, "Btree Selectivity: bad pointer");
if (*result < 0.0 || *result > 1.0) if (*result < 0.0 || *result > 1.0)
elog(ABORT, "Btree Selectivity: bad value %lf", *result); elog(ERROR, "Btree Selectivity: bad value %lf", *result);
return (result); return (result);
} }
...@@ -465,7 +465,7 @@ btreenpage(Oid operatorObjectId, ...@@ -465,7 +465,7 @@ btreenpage(Oid operatorObjectId,
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(atp)) if (!HeapTupleIsValid(atp))
{ {
elog(ABORT, "btreenpage: no index tuple %d", indexrelid); elog(ERROR, "btreenpage: no index tuple %d", indexrelid);
return (0); return (0);
} }
...@@ -503,7 +503,7 @@ hashsel(Oid operatorObjectId, ...@@ -503,7 +503,7 @@ hashsel(Oid operatorObjectId,
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(atp)) if (!HeapTupleIsValid(atp))
{ {
elog(ABORT, "hashsel: no index tuple %d", indexrelid); elog(ERROR, "hashsel: no index tuple %d", indexrelid);
return (0); return (0);
} }
ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples; ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples;
...@@ -530,9 +530,9 @@ hashsel(Oid operatorObjectId, ...@@ -530,9 +530,9 @@ hashsel(Oid operatorObjectId,
} }
if (!PointerIsValid(result)) if (!PointerIsValid(result))
elog(ABORT, "Hash Table Selectivity: bad pointer"); elog(ERROR, "Hash Table Selectivity: bad pointer");
if (*result < 0.0 || *result > 1.0) if (*result < 0.0 || *result > 1.0)
elog(ABORT, "Hash Table Selectivity: bad value %lf", *result); elog(ERROR, "Hash Table Selectivity: bad value %lf", *result);
return (result); return (result);
...@@ -559,7 +559,7 @@ hashnpage(Oid operatorObjectId, ...@@ -559,7 +559,7 @@ hashnpage(Oid operatorObjectId,
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(atp)) if (!HeapTupleIsValid(atp))
{ {
elog(ABORT, "hashsel: no index tuple %d", indexrelid); elog(ERROR, "hashsel: no index tuple %d", indexrelid);
return (0); return (0);
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.10 1998/01/05 03:34:16 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.11 1998/01/05 16:40:17 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -90,7 +90,7 @@ SetDefine(char *querystr, char *typename) ...@@ -90,7 +90,7 @@ SetDefine(char *querystr, char *typename)
ObjectIdGetDatum(setoid), ObjectIdGetDatum(setoid),
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(tup)) if (!HeapTupleIsValid(tup))
elog(ABORT, "setin: unable to define set %s", querystr); elog(ERROR, "setin: unable to define set %s", querystr);
/* /*
* We can tell whether the set was already defined by checking the * We can tell whether the set was already defined by checking the
...@@ -145,7 +145,7 @@ SetDefine(char *querystr, char *typename) ...@@ -145,7 +145,7 @@ SetDefine(char *querystr, char *typename)
setoid = newtup->t_oid; setoid = newtup->t_oid;
} }
else else
elog(ABORT, "setin: could not find new set oid tuple"); elog(ERROR, "setin: could not find new set oid tuple");
heap_endscan(pg_proc_scan); heap_endscan(pg_proc_scan);
if (RelationGetRelationTupleForm(procrel)->relhasindex) if (RelationGetRelationTupleForm(procrel)->relhasindex)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.15 1998/01/05 03:34:19 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.16 1998/01/05 16:40:18 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -75,7 +75,7 @@ bpcharin(char *s, int dummy, int typlen) ...@@ -75,7 +75,7 @@ bpcharin(char *s, int dummy, int typlen)
} }
if (len > 4096) if (len > 4096)
elog(ABORT, "bpcharin: length of char() must be less than 4096"); elog(ERROR, "bpcharin: length of char() must be less than 4096");
result = (char *) palloc(typlen); result = (char *) palloc(typlen);
*(int32 *) result = typlen; *(int32 *) result = typlen;
...@@ -145,7 +145,7 @@ varcharin(char *s, int dummy, int typlen) ...@@ -145,7 +145,7 @@ varcharin(char *s, int dummy, int typlen)
} }
if (len > 4096) if (len > 4096)
elog(ABORT, "varcharin: length of char() must be less than 4096"); elog(ERROR, "varcharin: length of char() must be less than 4096");
result = (char *) palloc(typlen); result = (char *) palloc(typlen);
*(int32 *) result = typlen; *(int32 *) result = typlen;
...@@ -199,7 +199,7 @@ int32 ...@@ -199,7 +199,7 @@ int32
bpcharlen(char *arg) bpcharlen(char *arg)
{ {
if (!PointerIsValid(arg)) if (!PointerIsValid(arg))
elog(ABORT, "Bad (null) char() external representation", NULL); elog(ERROR, "Bad (null) char() external representation", NULL);
return(bcTruelen(arg)); return(bcTruelen(arg));
} /* bpcharlen() */ } /* bpcharlen() */
...@@ -355,7 +355,7 @@ int32 ...@@ -355,7 +355,7 @@ int32
varcharlen(char *arg) varcharlen(char *arg)
{ {
if (!PointerIsValid(arg)) if (!PointerIsValid(arg))
elog(ABORT, "Bad (null) varchar() external representation", NULL); elog(ERROR, "Bad (null) varchar() external representation", NULL);
return(vcTruelen(arg)); return(vcTruelen(arg));
} /* vclen() */ } /* vclen() */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.27 1998/01/05 03:34:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.28 1998/01/05 16:40:20 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* *
* Non-printable characters must be passed as '\nnn' (octal) and are * Non-printable characters must be passed as '\nnn' (octal) and are
* converted to internal form. '\' must be passed as '\\'. * converted to internal form. '\' must be passed as '\\'.
* elog(ABORT, ...) if bad form. * elog(ERROR, ...) if bad form.
* *
* BUGS: * BUGS:
* The input is scaned twice. * The input is scaned twice.
...@@ -46,7 +46,7 @@ byteain(char *inputText) ...@@ -46,7 +46,7 @@ byteain(char *inputText)
text *result; text *result;
if (inputText == NULL) if (inputText == NULL)
elog(ABORT, "Bad input string for type bytea"); elog(ERROR, "Bad input string for type bytea");
for (byte = 0, tp = inputText; *tp != '\0'; byte++) for (byte = 0, tp = inputText; *tp != '\0'; byte++)
if (*tp++ == '\\') if (*tp++ == '\\')
...@@ -56,7 +56,7 @@ byteain(char *inputText) ...@@ -56,7 +56,7 @@ byteain(char *inputText)
else if (!isdigit(*tp++) || else if (!isdigit(*tp++) ||
!isdigit(*tp++) || !isdigit(*tp++) ||
!isdigit(*tp++)) !isdigit(*tp++))
elog(ABORT, "Bad input string for type bytea"); elog(ERROR, "Bad input string for type bytea");
} }
tp = inputText; tp = inputText;
byte += VARHDRSZ; byte += VARHDRSZ;
...@@ -195,7 +195,7 @@ int32 ...@@ -195,7 +195,7 @@ int32
textlen(text *t) textlen(text *t)
{ {
if (!PointerIsValid(t)) if (!PointerIsValid(t))
elog(ABORT,"Null input to textlen"); elog(ERROR,"Null input to textlen");
return (VARSIZE(t) - VARHDRSZ); return (VARSIZE(t) - VARHDRSZ);
} /* textlen() */ } /* textlen() */
...@@ -537,7 +537,7 @@ byteaGetByte(text *v, int32 n) ...@@ -537,7 +537,7 @@ byteaGetByte(text *v, int32 n)
if (n >= len) if (n >= len)
{ {
elog(ABORT, "byteaGetByte: index (=%d) out of range [0..%d]", elog(ERROR, "byteaGetByte: index (=%d) out of range [0..%d]",
n, len - 1); n, len - 1);
} }
...@@ -595,7 +595,7 @@ byteaSetByte(text *v, int32 n, int32 newByte) ...@@ -595,7 +595,7 @@ byteaSetByte(text *v, int32 n, int32 newByte)
if (n >= len) if (n >= len)
{ {
elog(ABORT, elog(ERROR,
"byteaSetByte: index (=%d) out of range [0..%d]", "byteaSetByte: index (=%d) out of range [0..%d]",
n, len - 1); n, len - 1);
} }
...@@ -606,7 +606,7 @@ byteaSetByte(text *v, int32 n, int32 newByte) ...@@ -606,7 +606,7 @@ byteaSetByte(text *v, int32 n, int32 newByte)
res = (text *) palloc(VARSIZE(v)); res = (text *) palloc(VARSIZE(v));
if (res == NULL) if (res == NULL)
{ {
elog(ABORT, "byteaSetByte: Out of memory (%d bytes requested)", elog(ERROR, "byteaSetByte: Out of memory (%d bytes requested)",
VARSIZE(v)); VARSIZE(v));
} }
memmove((char *) res, (char *) v, VARSIZE(v)); memmove((char *) res, (char *) v, VARSIZE(v));
...@@ -641,7 +641,7 @@ byteaSetBit(text *v, int32 n, int32 newBit) ...@@ -641,7 +641,7 @@ byteaSetBit(text *v, int32 n, int32 newBit)
*/ */
if (newBit != 0 && newBit != 1) if (newBit != 0 && newBit != 1)
{ {
elog(ABORT, "byteaSetByte: new bit must be 0 or 1"); elog(ERROR, "byteaSetByte: new bit must be 0 or 1");
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment