mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Change some ABORTS to ERROR. Add line number when COPY Failure.
This commit is contained in:
parent
3d8820a364
commit
deea69b90e
@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* At the point the version is defined, 2 physical relations are created
|
||||
@ -195,7 +195,7 @@ setAttrList(char *bname)
|
||||
rdesc = heap_openr(bname);
|
||||
if (rdesc == NULL)
|
||||
{
|
||||
elog(ABORT, "Unable to expand all -- amopenr failed ");
|
||||
elog(ERROR, "Unable to expand all -- amopenr failed ");
|
||||
return;
|
||||
}
|
||||
maxattrs = RelationGetNumberOfAttributes(rdesc);
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
*
|
||||
* 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[])
|
||||
OldHeap = heap_openr(oldrelname);
|
||||
if (!RelationIsValid(OldHeap))
|
||||
{
|
||||
elog(ABORT, "cluster: unknown relation: \"%s\"",
|
||||
elog(ERROR, "cluster: unknown relation: \"%s\"",
|
||||
oldrelname);
|
||||
}
|
||||
OIDOldHeap = OldHeap->rd_id;/* Get OID for the index scan */
|
||||
@ -133,7 +133,7 @@ cluster(char oldrelname[], char oldindexname[])
|
||||
OldIndex = index_openr(oldindexname); /* Open old index relation */
|
||||
if (!RelationIsValid(OldIndex))
|
||||
{
|
||||
elog(ABORT, "cluster: unknown index: \"%s\"",
|
||||
elog(ERROR, "cluster: unknown index: \"%s\"",
|
||||
oldindexname);
|
||||
}
|
||||
OIDOldIndex = OldIndex->rd_id; /* OID for the index scan */
|
||||
@ -218,7 +218,7 @@ copy_heap(Oid OIDOldHeap)
|
||||
OIDNewHeap = heap_create_with_catalog(NewName, tupdesc);
|
||||
|
||||
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);
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* The PortalExecutorHeapMemory crap needs to be eliminated
|
||||
@ -294,11 +294,11 @@ PerformAddAttribute(char *relationName,
|
||||
* normally, only the owner of a class can change its schema.
|
||||
*/
|
||||
if (IsSystemRelationName(relationName))
|
||||
elog(ABORT, "PerformAddAttribute: class \"%s\" is a system catalog",
|
||||
elog(ERROR, "PerformAddAttribute: class \"%s\" is a system catalog",
|
||||
relationName);
|
||||
#ifndef NO_SECURITY
|
||||
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);
|
||||
#endif
|
||||
|
||||
@ -306,9 +306,9 @@ PerformAddAttribute(char *relationName,
|
||||
* we can't add a not null attribute
|
||||
*/
|
||||
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)
|
||||
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
|
||||
@ -331,7 +331,7 @@ PerformAddAttribute(char *relationName,
|
||||
relrdesc = heap_openr(relationName);
|
||||
if (!RelationIsValid(relrdesc))
|
||||
{
|
||||
elog(ABORT, "PerformAddAttribute: unknown relation: \"%s\"",
|
||||
elog(ERROR, "PerformAddAttribute: unknown relation: \"%s\"",
|
||||
relationName);
|
||||
}
|
||||
myrelid = relrdesc->rd_id;
|
||||
@ -353,7 +353,7 @@ PerformAddAttribute(char *relationName,
|
||||
relrdesc = heap_open(childrelid);
|
||||
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);
|
||||
}
|
||||
PerformAddAttribute((relrdesc->rd_rel->relname).data,
|
||||
@ -369,7 +369,7 @@ PerformAddAttribute(char *relationName,
|
||||
if (!PointerIsValid(reltup))
|
||||
{
|
||||
heap_close(relrdesc);
|
||||
elog(ABORT, "PerformAddAttribute: relation \"%s\" not found",
|
||||
elog(ERROR, "PerformAddAttribute: relation \"%s\" not found",
|
||||
relationName);
|
||||
}
|
||||
|
||||
@ -378,7 +378,7 @@ PerformAddAttribute(char *relationName,
|
||||
*/
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@ -389,7 +389,7 @@ PerformAddAttribute(char *relationName,
|
||||
{
|
||||
pfree(reltup); /* XXX temp */
|
||||
heap_close(relrdesc); /* XXX temp */
|
||||
elog(ABORT, "PerformAddAttribute: relations limited to %d attributes",
|
||||
elog(ERROR, "PerformAddAttribute: relations limited to %d attributes",
|
||||
MaxHeapAttributeNumber);
|
||||
return;
|
||||
}
|
||||
@ -450,7 +450,7 @@ PerformAddAttribute(char *relationName,
|
||||
heap_endscan(attsdesc); /* XXX temp */
|
||||
heap_close(attrdesc); /* 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,
|
||||
relationName);
|
||||
return;
|
||||
@ -478,7 +478,7 @@ PerformAddAttribute(char *relationName,
|
||||
|
||||
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);
|
||||
attribute->atttypid = typeTuple->t_oid;
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* 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);
|
||||
extern FILE *Pfout,
|
||||
*Pfin;
|
||||
|
||||
#ifdef COPY_DEBUG
|
||||
static int lineno;
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DoCopy executes a the SQL COPY statement.
|
||||
*/
|
||||
@ -115,15 +112,15 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
|
||||
|
||||
rel = heap_openr(relname);
|
||||
if (rel == NULL)
|
||||
elog(ABORT, "COPY command failed. Class %s "
|
||||
elog(ERROR, "COPY command failed. Class %s "
|
||||
"does not exist.", relname);
|
||||
|
||||
result = pg_aclcheck(relname, UserName, required_access);
|
||||
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 */
|
||||
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 "
|
||||
"from stdin. Psql's \\copy command also works for anyone.");
|
||||
/* Above should not return. */
|
||||
@ -132,7 +129,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
|
||||
if (from)
|
||||
{ /* copy from file to database */
|
||||
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 (IsUnderPostmaster)
|
||||
@ -147,7 +144,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
|
||||
{
|
||||
fp = AllocateFile(filename, "r");
|
||||
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 "
|
||||
"reading. Errno = %s (%d).",
|
||||
geteuid(), filename, strerror(errno), errno);
|
||||
@ -175,7 +172,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
|
||||
fp = AllocateFile(filename, "w");
|
||||
umask(oumask);
|
||||
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 "
|
||||
"writing. Errno = %s (%d).",
|
||||
geteuid(), filename, strerror(errno), errno);
|
||||
@ -532,9 +529,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
byval[i] = (bool) IsTypeByVal(attr[i]->atttypid);
|
||||
}
|
||||
|
||||
#ifdef COPY_DEBUG
|
||||
lineno = 0;
|
||||
#endif
|
||||
while (!done)
|
||||
{
|
||||
if (!binary)
|
||||
@ -543,10 +538,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
int newline = 0;
|
||||
|
||||
#endif
|
||||
#ifdef COPY_DEBUG
|
||||
lineno++;
|
||||
elog(DEBUG, "line %d", lineno);
|
||||
#endif
|
||||
if (oids)
|
||||
{
|
||||
#ifdef COPY_PATCH
|
||||
@ -560,7 +552,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
{
|
||||
loaded_oid = oidin(string);
|
||||
if (loaded_oid < BootstrapObjectIdData)
|
||||
elog(ABORT, "COPY TEXT: Invalid Oid");
|
||||
elog(ERROR, "COPY TEXT: Invalid Oid");
|
||||
}
|
||||
}
|
||||
for (i = 0; i < attr_count && !done; i++)
|
||||
@ -593,12 +585,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
if (!PointerIsValid(values[i]) &&
|
||||
!(rel->rd_att->attrs[i]->attbyval))
|
||||
{
|
||||
#ifdef COPY_DEBUG
|
||||
elog(ABORT,
|
||||
"copy from: line %d - Bad file format", lineno);
|
||||
#else
|
||||
elog(ABORT, "copy from: Bad file format");
|
||||
#endif
|
||||
elog(ERROR, "copy from line %d: Bad file format",lineno);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -622,7 +609,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
{
|
||||
fread(&loaded_oid, sizeof(int32), 1, fp);
|
||||
if (loaded_oid < BootstrapObjectIdData)
|
||||
elog(ABORT, "COPY BINARY: Invalid Oid");
|
||||
elog(ERROR, "COPY BINARY: Invalid Oid");
|
||||
}
|
||||
fread(&null_ct, sizeof(int32), 1, fp);
|
||||
if (null_ct > 0)
|
||||
@ -661,7 +648,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
ptr += sizeof(int32);
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "COPY BINARY: impossible size!");
|
||||
elog(ERROR, "COPY BINARY: impossible size!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -837,7 +824,7 @@ GetOutputFunction(Oid type)
|
||||
if (HeapTupleIsValid(typeTuple))
|
||||
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);
|
||||
}
|
||||
|
||||
@ -854,7 +841,7 @@ GetTypeElement(Oid type)
|
||||
if (HeapTupleIsValid(typeTuple))
|
||||
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);
|
||||
}
|
||||
|
||||
@ -870,7 +857,7 @@ GetInputFunction(Oid type)
|
||||
if (HeapTupleIsValid(typeTuple))
|
||||
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);
|
||||
}
|
||||
|
||||
@ -886,7 +873,7 @@ IsTypeByVal(Oid type)
|
||||
if (HeapTupleIsValid(typeTuple))
|
||||
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);
|
||||
}
|
||||
@ -1005,12 +992,7 @@ CopyReadNewline(FILE *fp, int *newline)
|
||||
{
|
||||
if (!*newline)
|
||||
{
|
||||
#ifdef COPY_DEBUG
|
||||
elog(NOTICE, "CopyReadNewline: line %d - extra fields ignored",
|
||||
lineno);
|
||||
#else
|
||||
elog(NOTICE, "CopyReadNewline: line - extra fields ignored");
|
||||
#endif
|
||||
elog(NOTICE, "CopyReadNewline: line %d - extra fields ignored", lineno);
|
||||
while (!feof(fp) && (getc(fp) != '\n'));
|
||||
}
|
||||
*newline = 0;
|
||||
@ -1125,7 +1107,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
|
||||
case '.':
|
||||
c = getc(fp);
|
||||
if (c != '\n')
|
||||
elog(ABORT, "CopyReadAttribute - end of record marker corrupted");
|
||||
elog(ERROR, "CopyReadAttribute - end of record marker corrupted");
|
||||
return (NULL);
|
||||
break;
|
||||
}
|
||||
@ -1143,7 +1125,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
|
||||
if (!done)
|
||||
attribute[i++] = c;
|
||||
if (i == EXT_ATTLEN - 1)
|
||||
elog(ABORT, "CopyReadAttribute - attribute length too long");
|
||||
elog(ERROR, "CopyReadAttribute - attribute length too long");
|
||||
}
|
||||
attribute[i] = '\0';
|
||||
return (&attribute[0]);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
List *constraints;
|
||||
|
||||
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);
|
||||
StrNCpy(relname, stmt->relname, NAMEDATALEN); /* make full length for
|
||||
* copy */
|
||||
@ -78,7 +78,7 @@ DefineRelation(CreateStmt *stmt)
|
||||
numberOfAttributes = length(schema);
|
||||
if (numberOfAttributes <= 0)
|
||||
{
|
||||
elog(ABORT, "DefineRelation: %s",
|
||||
elog(ERROR, "DefineRelation: %s",
|
||||
"please inherit from a relation or define an attribute");
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ DefineRelation(CreateStmt *stmt)
|
||||
for (i = 0; i < ncheck; i++)
|
||||
{
|
||||
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;
|
||||
}
|
||||
@ -218,7 +218,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
|
||||
|
||||
if (!strcmp(coldef->colname, restdef->colname))
|
||||
{
|
||||
elog(ABORT, "attribute '%s' duplicated",
|
||||
elog(ERROR, "attribute '%s' duplicated",
|
||||
coldef->colname);
|
||||
}
|
||||
}
|
||||
@ -231,7 +231,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
|
||||
{
|
||||
if (!strcmp(strVal(lfirst(entry)), strVal(lfirst(rest))))
|
||||
{
|
||||
elog(ABORT, "relation '%s' duplicated",
|
||||
elog(ERROR, "relation '%s' duplicated",
|
||||
strVal(lfirst(entry)));
|
||||
}
|
||||
}
|
||||
@ -252,12 +252,12 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
|
||||
relation = heap_openr(name);
|
||||
if (relation == NULL)
|
||||
{
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"MergeAttr: Can't inherit from non-existent superclass '%s'", name);
|
||||
}
|
||||
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);
|
||||
constr = tupleDesc->constr;
|
||||
@ -567,7 +567,7 @@ checkAttrExists(char *attributeName, char *attributeType, List *schema)
|
||||
*/
|
||||
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);
|
||||
}
|
||||
return 1;
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
lp = ExpandDatabasePath(loc);
|
||||
|
||||
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"
|
||||
" in the server",loc);
|
||||
|
||||
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",
|
||||
COPY_CMD, DataDir, SEP_CHAR, SEP_CHAR, SEP_CHAR, lp);
|
||||
@ -123,7 +123,7 @@ destroydb(char *dbname)
|
||||
|
||||
path = ExpandDatabasePath(dbpath);
|
||||
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"
|
||||
" in the server",dbpath);
|
||||
|
||||
@ -161,7 +161,7 @@ get_pg_dbtup(char *command, char *dbname, Relation dbrel)
|
||||
|
||||
scan = heap_beginscan(dbrel, 0, false, 1, &scanKey);
|
||||
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
|
||||
@ -185,7 +185,7 @@ get_pg_dbtup(char *command, char *dbname, Relation dbrel)
|
||||
* check_permissions() -- verify that the user is permitted to do this.
|
||||
*
|
||||
* 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
|
||||
* OID is returned in dbIdP.
|
||||
*/
|
||||
@ -218,20 +218,20 @@ check_permissions(char *command,
|
||||
/* Check to make sure user has permission to 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);
|
||||
}
|
||||
|
||||
/* Make sure we are not mucking with the template database */
|
||||
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 */
|
||||
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 */
|
||||
@ -285,20 +285,20 @@ check_permissions(char *command,
|
||||
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"))
|
||||
{
|
||||
|
||||
elog(ABORT, "destroydb: database %s does not exist.", dbname);
|
||||
elog(ERROR, "destroydb: database %s does not exist.", dbname);
|
||||
|
||||
}
|
||||
else if (dbfound && !strcmp(command, "destroydb")
|
||||
&& 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)
|
||||
FreeFile(fp);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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,
|
||||
numberOfAttributes = length(attributeList);
|
||||
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,
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(ABORT, "DefineIndex: %s relation not found",
|
||||
elog(ERROR, "DefineIndex: %s relation not found",
|
||||
heapRelationName);
|
||||
}
|
||||
relationId = tuple->t_oid;
|
||||
|
||||
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)
|
||||
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
|
||||
@ -124,7 +124,7 @@ DefineIndex(char *heapRelationName,
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(ABORT, "DefineIndex: %s access method not found",
|
||||
elog(ERROR, "DefineIndex: %s access method not found",
|
||||
accessMethodName);
|
||||
}
|
||||
accessMethodId = tuple->t_oid;
|
||||
@ -168,7 +168,7 @@ DefineIndex(char *heapRelationName,
|
||||
nargs = length(funcIndex->args);
|
||||
if (nargs > INDEX_MAX_KEYS)
|
||||
{
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"Too many args to function, limit of %d",
|
||||
INDEX_MAX_KEYS);
|
||||
}
|
||||
@ -250,7 +250,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(ABORT, "ExtendIndex: %s index not found",
|
||||
elog(ERROR, "ExtendIndex: %s index not found",
|
||||
indexRelationName);
|
||||
}
|
||||
indexId = tuple->t_oid;
|
||||
@ -264,7 +264,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(ABORT, "ExtendIndex: %s is not an index",
|
||||
elog(ERROR, "ExtendIndex: %s is not an index",
|
||||
indexRelationName);
|
||||
}
|
||||
|
||||
@ -290,7 +290,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
|
||||
pfree(predString);
|
||||
}
|
||||
if (oldPred == NULL)
|
||||
elog(ABORT, "ExtendIndex: %s is not a partial index",
|
||||
elog(ERROR, "ExtendIndex: %s is not a partial index",
|
||||
indexRelationName);
|
||||
|
||||
/*
|
||||
@ -334,7 +334,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
|
||||
ObjectIdGetDatum(indproc),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
elog(ABORT, "ExtendIndex: index procedure not found");
|
||||
elog(ERROR, "ExtendIndex: index procedure not found");
|
||||
|
||||
namecpy(&(funcInfo->funcName),
|
||||
&(((Form_pg_proc) GETSTRUCT(tuple))->proname));
|
||||
@ -388,7 +388,7 @@ CheckPredExpr(Node *predicate, List *rangeTable, Oid baseRelOid)
|
||||
else if (or_clause(predicate) || and_clause(predicate))
|
||||
clauses = ((Expr *) predicate)->args;
|
||||
else
|
||||
elog(ABORT, "Unsupported partial-index predicate expression type");
|
||||
elog(ERROR, "Unsupported partial-index predicate expression type");
|
||||
|
||||
foreach(clause, clauses)
|
||||
{
|
||||
@ -409,11 +409,11 @@ CheckPredClause(Expr *predicate, List *rangeTable, Oid baseRelOid)
|
||||
!IsA(pred_var, Var) ||
|
||||
!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)
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"Partial-index predicates may refer only to the base relation");
|
||||
}
|
||||
|
||||
@ -435,7 +435,7 @@ FuncIndexArgs(IndexElem *funcIndex,
|
||||
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(ABORT, "DefineIndex: %s class not found",
|
||||
elog(ERROR, "DefineIndex: %s class not found",
|
||||
funcIndex->class);
|
||||
}
|
||||
*opOidP = tuple->t_oid;
|
||||
@ -457,7 +457,7 @@ FuncIndexArgs(IndexElem *funcIndex,
|
||||
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"DefineIndex: attribute \"%s\" not found",
|
||||
arg);
|
||||
}
|
||||
@ -488,7 +488,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
|
||||
attribute = lfirst(rest);
|
||||
|
||||
if (attribute->name == NULL)
|
||||
elog(ABORT, "missing attribute for define index");
|
||||
elog(ERROR, "missing attribute for define index");
|
||||
|
||||
tuple = SearchSysCacheTuple(ATTNAME,
|
||||
ObjectIdGetDatum(relId),
|
||||
@ -496,7 +496,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
|
||||
0, 0);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"DefineIndex: attribute \"%s\" not found",
|
||||
attribute->name);
|
||||
}
|
||||
@ -510,7 +510,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
|
||||
attribute->class = GetDefaultOpClass(attform->atttypid);
|
||||
if (attribute->class == NULL)
|
||||
{
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"Can't find a default operator class for type %d.",
|
||||
attform->atttypid);
|
||||
}
|
||||
@ -522,7 +522,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
|
||||
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(ABORT, "DefineIndex: %s class not found",
|
||||
elog(ERROR, "DefineIndex: %s class not found",
|
||||
attribute->class);
|
||||
}
|
||||
*opOidP++ = tuple->t_oid;
|
||||
@ -565,12 +565,12 @@ RemoveIndex(char *name)
|
||||
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(ABORT, "index \"%s\" nonexistent", name);
|
||||
elog(ERROR, "index \"%s\" nonexistent", name);
|
||||
}
|
||||
|
||||
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,
|
||||
((Form_pg_class) GETSTRUCT(tuple))->relkind);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* 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,
|
||||
* we don't have untrusted functions any more. The 4.2
|
||||
* 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)
|
||||
{
|
||||
@ -275,7 +275,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest)
|
||||
|
||||
if (!HeapTupleIsValid(languageTuple)) {
|
||||
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"Unrecognized language specified in a CREATE FUNCTION: "
|
||||
"'%s'. Recognized languages are sql, C, internal "
|
||||
"and the created procedural languages.",
|
||||
@ -285,7 +285,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest)
|
||||
/* Check that this language is a PL */
|
||||
languageStruct = (Form_pg_language) GETSTRUCT(languageTuple);
|
||||
if (!(languageStruct->lanispl)) {
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"Language '%s' isn't defined as PL", languageName);
|
||||
}
|
||||
|
||||
@ -294,7 +294,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest)
|
||||
* restricted to be defined by postgres superusers only
|
||||
*/
|
||||
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' "
|
||||
"language.",
|
||||
languageName);
|
||||
@ -313,7 +313,7 @@ CreateFunction(ProcedureStmt *stmt, CommandDest dest)
|
||||
interpret_AS_clause(languageName, stmt->as, &prosrc_str, &probin_str);
|
||||
|
||||
if (strcmp(languageName, "sql") != 0 && lanisPL == false && !superuser())
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"Only users with Postgres superuser privilege are permitted "
|
||||
"to create a function "
|
||||
"in the '%s' language. Others may use the 'sql' language "
|
||||
@ -388,7 +388,7 @@ DefineOperator(char *oprName,
|
||||
{
|
||||
/* see gram.y, must be setof */
|
||||
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)
|
||||
{
|
||||
@ -396,14 +396,14 @@ DefineOperator(char *oprName,
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "type for leftarg is malformed.");
|
||||
elog(ERROR, "type for leftarg is malformed.");
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "rightarg"))
|
||||
{
|
||||
/* see gram.y, must be setof */
|
||||
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)
|
||||
{
|
||||
@ -411,7 +411,7 @@ DefineOperator(char *oprName,
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "type for rightarg is malformed.");
|
||||
elog(ERROR, "type for rightarg is malformed.");
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "procedure"))
|
||||
@ -474,7 +474,7 @@ DefineOperator(char *oprName,
|
||||
*/
|
||||
if (functionName == NULL)
|
||||
{
|
||||
elog(ABORT, "Define: \"procedure\" unspecified");
|
||||
elog(ERROR, "Define: \"procedure\" unspecified");
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@ -579,16 +579,16 @@ DefineAggregate(char *aggName, List *parameters)
|
||||
* make sure we have our required definitions
|
||||
*/
|
||||
if (baseType == NULL)
|
||||
elog(ABORT, "Define: \"basetype\" unspecified");
|
||||
elog(ERROR, "Define: \"basetype\" unspecified");
|
||||
if (stepfunc1Name != NULL)
|
||||
{
|
||||
if (stepfunc1Type == NULL)
|
||||
elog(ABORT, "Define: \"stype1\" unspecified");
|
||||
elog(ERROR, "Define: \"stype1\" unspecified");
|
||||
}
|
||||
if (stepfunc2Name != NULL)
|
||||
{
|
||||
if (stepfunc2Type == NULL)
|
||||
elog(ABORT, "Define: \"stype2\" unspecified");
|
||||
elog(ERROR, "Define: \"stype2\" unspecified");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -635,7 +635,7 @@ DefineType(char *typeName, List *parameters)
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
@ -699,7 +699,7 @@ DefineType(char *typeName, List *parameters)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "DefineType: \"%s\" alignment not recognized",
|
||||
elog(ERROR, "DefineType: \"%s\" alignment not recognized",
|
||||
a);
|
||||
}
|
||||
}
|
||||
@ -714,9 +714,9 @@ DefineType(char *typeName, List *parameters)
|
||||
* make sure we have our required definitions
|
||||
*/
|
||||
if (inputName == NULL)
|
||||
elog(ABORT, "Define: \"input\" unspecified");
|
||||
elog(ERROR, "Define: \"input\" unspecified");
|
||||
if (outputName == NULL)
|
||||
elog(ABORT, "Define: \"output\" unspecified");
|
||||
elog(ERROR, "Define: \"output\" unspecified");
|
||||
|
||||
/* ----------------
|
||||
* now have TypeCreate do all the real work.
|
||||
@ -766,7 +766,7 @@ static char *
|
||||
defGetString(DefElem *def)
|
||||
{
|
||||
if (nodeTag(def->arg) != T_String)
|
||||
elog(ABORT, "Define: \"%s\" = what?", def->defname);
|
||||
elog(ERROR, "Define: \"%s\" = what?", def->defname);
|
||||
return (strVal(def->arg));
|
||||
}
|
||||
|
||||
@ -779,6 +779,6 @@ defGetTypeLength(DefElem *def)
|
||||
!strcasecmp(strVal(def->arg), "variable"))
|
||||
return -1; /* variable length */
|
||||
|
||||
elog(ABORT, "Define: \"%s\" = what?", def->defname);
|
||||
elog(ERROR, "Define: \"%s\" = what?", def->defname);
|
||||
return -1;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ CreateProceduralLanguage(CreatePLangStmt * stmt)
|
||||
*/
|
||||
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");
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ CreateProceduralLanguage(CreatePLangStmt * stmt)
|
||||
0, 0, 0);
|
||||
if (HeapTupleIsValid(langTup))
|
||||
{
|
||||
elog(ABORT, "Language %s already exists", languageName);
|
||||
elog(ERROR, "Language %s already exists", languageName);
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@ -96,12 +96,12 @@ CreateProceduralLanguage(CreatePLangStmt * stmt)
|
||||
0);
|
||||
if (!HeapTupleIsValid(procTup))
|
||||
{
|
||||
elog(ABORT, "PL handler function %s() doesn't exist",
|
||||
elog(ERROR, "PL handler function %s() doesn't exist",
|
||||
stmt->plhandler);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ DropProceduralLanguage(DropPLangStmt * stmt)
|
||||
*/
|
||||
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");
|
||||
}
|
||||
|
||||
@ -171,12 +171,12 @@ DropProceduralLanguage(DropPLangStmt * stmt)
|
||||
0, 0, 0);
|
||||
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)
|
||||
{
|
||||
elog(ABORT, "Language %s isn't a created procedural language",
|
||||
elog(ERROR, "Language %s isn't a created procedural language",
|
||||
languageName);
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ DropProceduralLanguage(DropPLangStmt * stmt)
|
||||
|
||||
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));
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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,
|
||||
{
|
||||
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);
|
||||
}
|
||||
@ -629,7 +629,7 @@ tg_rewriteParamsInExpr(Node *expression, QueryTreeList *inputQlist)
|
||||
}
|
||||
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[])
|
||||
{
|
||||
if (parameterCount == 8)
|
||||
{
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"getParamTypes: Ingredients cannot take > 8 arguments");
|
||||
}
|
||||
t = elem->inTypes->val[j];
|
||||
if (strcmp(t, "opaque") == 0)
|
||||
{
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"getParamTypes: Ingredient functions cannot take type 'opaque'");
|
||||
}
|
||||
else
|
||||
@ -733,7 +733,7 @@ getParamTypes(TgElement * elem, Oid typev[])
|
||||
toid = TypeGet(elem->inTypes->val[j], &defined);
|
||||
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)
|
||||
{
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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 */
|
||||
typeId1 = TypeGet(typeName1, &defined);
|
||||
if (!OidIsValid(typeId1))
|
||||
{
|
||||
elog(ABORT, "RemoveOperator: type '%s' does not exist", typeName1);
|
||||
elog(ERROR, "RemoveOperator: type '%s' does not exist", typeName1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,7 @@ RemoveOperator(char *operatorName, /* operator name */
|
||||
typeId2 = TypeGet(typeName2, &defined);
|
||||
if (!OidIsValid(typeId2))
|
||||
{
|
||||
elog(ABORT, "RemoveOperator: type '%s' does not exist", typeName2);
|
||||
elog(ERROR, "RemoveOperator: type '%s' does not exist", typeName2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -105,7 +105,7 @@ RemoveOperator(char *operatorName, /* operator name */
|
||||
if (!pg_ownercheck(userName,
|
||||
(char *) ObjectIdGetDatum(tup->t_oid),
|
||||
OPROID))
|
||||
elog(ABORT, "RemoveOperator: operator '%s': permission denied",
|
||||
elog(ERROR, "RemoveOperator: operator '%s': permission denied",
|
||||
operatorName);
|
||||
#endif
|
||||
ItemPointerCopy(&tup->t_ctid, &itemPointerData);
|
||||
@ -115,20 +115,20 @@ RemoveOperator(char *operatorName, /* operator name */
|
||||
{
|
||||
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,
|
||||
typeName1,
|
||||
typeName2);
|
||||
}
|
||||
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,
|
||||
typeName1);
|
||||
}
|
||||
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,
|
||||
typeName2);
|
||||
}
|
||||
@ -272,7 +272,7 @@ RemoveType(char *typeName) /* type name to be removed */
|
||||
#ifndef NO_SECURITY
|
||||
userName = GetPgUserName();
|
||||
if (!pg_ownercheck(userName, typeName, TYPNAME))
|
||||
elog(ABORT, "RemoveType: type '%s': permission denied",
|
||||
elog(ERROR, "RemoveType: type '%s': permission denied",
|
||||
typeName);
|
||||
#endif
|
||||
|
||||
@ -290,7 +290,7 @@ RemoveType(char *typeName) /* type name to be removed */
|
||||
{
|
||||
heap_endscan(scan);
|
||||
heap_close(relation);
|
||||
elog(ABORT, "RemoveType: type '%s' does not exist",
|
||||
elog(ERROR, "RemoveType: type '%s' does not exist",
|
||||
typeName);
|
||||
}
|
||||
typeOid = tup->t_oid;
|
||||
@ -308,7 +308,7 @@ RemoveType(char *typeName) /* type name to be removed */
|
||||
|
||||
if (!HeapTupleIsValid(tup))
|
||||
{
|
||||
elog(ABORT, "RemoveType: type '%s': array stub not found",
|
||||
elog(ERROR, "RemoveType: type '%s': array stub not found",
|
||||
typeName);
|
||||
}
|
||||
typeOid = tup->t_oid;
|
||||
@ -364,7 +364,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
|
||||
|
||||
if (!HeapTupleIsValid(tup))
|
||||
{
|
||||
elog(ABORT, "RemoveFunction: type '%s' not found", typename);
|
||||
elog(ERROR, "RemoveFunction: type '%s' not found", typename);
|
||||
}
|
||||
argList[i] = tup->t_oid;
|
||||
}
|
||||
@ -380,7 +380,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
|
||||
userName = GetPgUserName();
|
||||
if (!pg_func_ownercheck(userName, functionName, nargs, argList))
|
||||
{
|
||||
elog(ABORT, "RemoveFunction: function '%s': permission denied",
|
||||
elog(ERROR, "RemoveFunction: function '%s': permission denied",
|
||||
functionName);
|
||||
}
|
||||
#endif
|
||||
@ -420,7 +420,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
|
||||
/* ok, function has been found */
|
||||
|
||||
if (the_proc->prolang == INTERNALlanguageId)
|
||||
elog(ABORT, "RemoveFunction: function \"%s\" is built-in",
|
||||
elog(ERROR, "RemoveFunction: function \"%s\" is built-in",
|
||||
functionName);
|
||||
|
||||
ItemPointerCopy(&tup->t_ctid, &itemPointerData);
|
||||
@ -457,7 +457,7 @@ RemoveAggregate(char *aggName, char *aggType)
|
||||
basetypeID = TypeGet(aggType, &defined);
|
||||
if (!OidIsValid(basetypeID))
|
||||
{
|
||||
elog(ABORT, "RemoveAggregate: type '%s' does not exist", aggType);
|
||||
elog(ERROR, "RemoveAggregate: type '%s' does not exist", aggType);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -473,12 +473,12 @@ RemoveAggregate(char *aggName, char *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);
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "RemoveAggregate: aggregate '%s': permission denied",
|
||||
elog(ERROR, "RemoveAggregate: aggregate '%s': permission denied",
|
||||
aggName);
|
||||
}
|
||||
}
|
||||
@ -505,12 +505,12 @@ RemoveAggregate(char *aggName, char *aggType)
|
||||
heap_close(relation);
|
||||
if (aggType)
|
||||
{
|
||||
elog(ABORT, "RemoveAggregate: aggregate '%s' for '%s' does not exist",
|
||||
elog(ERROR, "RemoveAggregate: aggregate '%s' for '%s' does not exist",
|
||||
aggName, aggType);
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "RemoveAggregate: aggregate '%s' for all types does not exist",
|
||||
elog(ERROR, "RemoveAggregate: aggregate '%s' for all types does not exist",
|
||||
aggName);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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,
|
||||
* normally, only the owner of a class can change its schema.
|
||||
*/
|
||||
if (IsSystemRelationName(relname))
|
||||
elog(ABORT, "renameatt: class \"%s\" is a system catalog",
|
||||
elog(ERROR, "renameatt: class \"%s\" is a system catalog",
|
||||
relname);
|
||||
#ifndef NO_SECURITY
|
||||
if (!IsBootstrapProcessingMode() &&
|
||||
!pg_ownercheck(userName, relname, RELNAME))
|
||||
elog(ABORT, "renameatt: you do not own class \"%s\"",
|
||||
elog(ERROR, "renameatt: you do not own class \"%s\"",
|
||||
relname);
|
||||
#endif
|
||||
|
||||
@ -109,7 +109,7 @@ renameatt(char *relname,
|
||||
relrdesc = heap_openr(relname);
|
||||
if (!RelationIsValid(relrdesc))
|
||||
{
|
||||
elog(ABORT, "renameatt: unknown relation: \"%s\"",
|
||||
elog(ERROR, "renameatt: unknown relation: \"%s\"",
|
||||
relname);
|
||||
}
|
||||
myrelid = relrdesc->rd_id;
|
||||
@ -134,7 +134,7 @@ renameatt(char *relname,
|
||||
relrdesc = heap_open(childrelid);
|
||||
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);
|
||||
}
|
||||
childname = (relrdesc->rd_rel->relname).data;
|
||||
@ -149,7 +149,7 @@ renameatt(char *relname,
|
||||
if (!PointerIsValid(reltup))
|
||||
{
|
||||
heap_close(relrdesc);
|
||||
elog(ABORT, "renameatt: relation \"%s\" nonexistent",
|
||||
elog(ERROR, "renameatt: relation \"%s\" nonexistent",
|
||||
relname);
|
||||
return;
|
||||
}
|
||||
@ -160,12 +160,12 @@ renameatt(char *relname,
|
||||
if (!PointerIsValid(oldatttup))
|
||||
{
|
||||
heap_close(attrdesc);
|
||||
elog(ABORT, "renameatt: attribute \"%s\" nonexistent",
|
||||
elog(ERROR, "renameatt: attribute \"%s\" nonexistent",
|
||||
oldattname);
|
||||
}
|
||||
if (((AttributeTupleForm) GETSTRUCT(oldatttup))->attnum < 0)
|
||||
{
|
||||
elog(ABORT, "renameatt: system attribute \"%s\" not renamed",
|
||||
elog(ERROR, "renameatt: system attribute \"%s\" not renamed",
|
||||
oldattname);
|
||||
}
|
||||
|
||||
@ -174,7 +174,7 @@ renameatt(char *relname,
|
||||
{
|
||||
pfree(oldatttup);
|
||||
heap_close(attrdesc);
|
||||
elog(ABORT, "renameatt: attribute \"%s\" exists",
|
||||
elog(ERROR, "renameatt: attribute \"%s\" exists",
|
||||
newattname);
|
||||
}
|
||||
|
||||
@ -223,13 +223,13 @@ renamerel(char oldrelname[], char newrelname[])
|
||||
|
||||
if (IsSystemRelationName(oldrelname))
|
||||
{
|
||||
elog(ABORT, "renamerel: system relation \"%s\" not renamed",
|
||||
elog(ERROR, "renamerel: system relation \"%s\" not renamed",
|
||||
oldrelname);
|
||||
return;
|
||||
}
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@ -240,7 +240,7 @@ renamerel(char oldrelname[], char newrelname[])
|
||||
if (!PointerIsValid(oldreltup))
|
||||
{
|
||||
heap_close(relrdesc);
|
||||
elog(ABORT, "renamerel: relation \"%s\" does not exist",
|
||||
elog(ERROR, "renamerel: relation \"%s\" does not exist",
|
||||
oldrelname);
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ renamerel(char oldrelname[], char newrelname[])
|
||||
{
|
||||
pfree(oldreltup);
|
||||
heap_close(relrdesc);
|
||||
elog(ABORT, "renamerel: relation \"%s\" exists",
|
||||
elog(ERROR, "renamerel: relation \"%s\" exists",
|
||||
newrelname);
|
||||
}
|
||||
|
||||
@ -257,7 +257,7 @@ renamerel(char oldrelname[], char newrelname[])
|
||||
strcpy(oldpath, relpath(oldrelname));
|
||||
strcpy(newpath, relpath(newrelname));
|
||||
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),
|
||||
newrelname,
|
||||
|
@ -175,7 +175,7 @@ DefineSequence(CreateSeqStmt *seq)
|
||||
buf = ReadBuffer(rel, P_NEW);
|
||||
|
||||
if (!BufferIsValid(buf))
|
||||
elog(ABORT, "DefineSequence: ReadBuffer failed");
|
||||
elog(ERROR, "DefineSequence: ReadBuffer failed");
|
||||
|
||||
page = (PageHeader) BufferGetPage(buf);
|
||||
|
||||
@ -188,7 +188,7 @@ DefineSequence(CreateSeqStmt *seq)
|
||||
heap_insert(rel, tuple);
|
||||
|
||||
if (WriteBuffer(buf) == STATUS_ERROR)
|
||||
elog(ABORT, "DefineSequence: WriteBuffer failed");
|
||||
elog(ERROR, "DefineSequence: WriteBuffer failed");
|
||||
|
||||
RelationUnsetLockForWrite(rel);
|
||||
heap_close(rel);
|
||||
@ -251,7 +251,7 @@ nextval(struct varlena * seqin)
|
||||
if (rescnt > 0)
|
||||
break; /* stop caching */
|
||||
if (seq->is_cycled != 't')
|
||||
elog(ABORT, "%s.nextval: got MAXVALUE (%d)",
|
||||
elog(ERROR, "%s.nextval: got MAXVALUE (%d)",
|
||||
elm->name, maxv);
|
||||
next = minv;
|
||||
}
|
||||
@ -267,7 +267,7 @@ nextval(struct varlena * seqin)
|
||||
if (rescnt > 0)
|
||||
break; /* stop caching */
|
||||
if (seq->is_cycled != 't')
|
||||
elog(ABORT, "%s.nextval: got MINVALUE (%d)",
|
||||
elog(ERROR, "%s.nextval: got MINVALUE (%d)",
|
||||
elm->name, minv);
|
||||
next = maxv;
|
||||
}
|
||||
@ -288,7 +288,7 @@ nextval(struct varlena * seqin)
|
||||
seq->is_called = 't';
|
||||
|
||||
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);
|
||||
RelationUnsetSingleWLockPage(elm->rel, &iptr);
|
||||
@ -311,7 +311,7 @@ currval(struct varlena * seqin)
|
||||
|
||||
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;
|
||||
@ -334,18 +334,18 @@ read_info(char *caller, SeqTable elm, Buffer *buf)
|
||||
RelationSetSingleWLockPage(elm->rel, &iptr);
|
||||
|
||||
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);
|
||||
|
||||
*buf = ReadBuffer(elm->rel, 0);
|
||||
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);
|
||||
sm = (sequence_magic *) PageGetSpecialPointer(page);
|
||||
|
||||
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);
|
||||
Assert(ItemIdIsUsed(lp));
|
||||
@ -395,12 +395,12 @@ init_sequence(char *caller, char *name)
|
||||
temp->rel = heap_openr(name);
|
||||
|
||||
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);
|
||||
|
||||
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 */
|
||||
{ /* SeqTable - check relid ! */
|
||||
@ -484,18 +484,18 @@ init_params(CreateSeqStmt *seq, SequenceTupleForm new)
|
||||
else if (!strcasecmp(defel->defname, "cycle"))
|
||||
{
|
||||
if (defel->arg != (Node *) NULL)
|
||||
elog(ABORT, "DefineSequence: CYCLE ??");
|
||||
elog(ERROR, "DefineSequence: CYCLE ??");
|
||||
new->is_cycled = 't';
|
||||
}
|
||||
else
|
||||
elog(ABORT, "DefineSequence: option \"%s\" not recognized",
|
||||
elog(ERROR, "DefineSequence: option \"%s\" not recognized",
|
||||
defel->defname);
|
||||
}
|
||||
|
||||
if (increment_by == (DefElem *) NULL) /* INCREMENT BY */
|
||||
new->increment_by = 1;
|
||||
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 (new->increment_by > 0)
|
||||
@ -514,7 +514,7 @@ init_params(CreateSeqStmt *seq, SequenceTupleForm new)
|
||||
new->min_value = get_param(min_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);
|
||||
|
||||
if (last_value == (DefElem *) NULL) /* START WITH */
|
||||
@ -526,16 +526,16 @@ init_params(CreateSeqStmt *seq, SequenceTupleForm new)
|
||||
new->last_value = get_param(last_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);
|
||||
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);
|
||||
|
||||
if (cache_value == (DefElem *) NULL) /* CACHE */
|
||||
new->cache_value = 1;
|
||||
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);
|
||||
|
||||
}
|
||||
@ -545,11 +545,11 @@ static int
|
||||
get_param(DefElem *def)
|
||||
{
|
||||
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)
|
||||
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);
|
||||
}
|
||||
|
@ -68,16 +68,16 @@ CreateTrigger(CreateTrigStmt * stmt)
|
||||
int i;
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
rel = heap_openr(stmt->relname);
|
||||
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);
|
||||
|
||||
@ -87,7 +87,7 @@ CreateTrigger(CreateTrigStmt * stmt)
|
||||
if (stmt->row)
|
||||
TRIGGER_SETT_ROW(tgtype);
|
||||
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++)
|
||||
{
|
||||
@ -95,21 +95,21 @@ CreateTrigger(CreateTrigStmt * stmt)
|
||||
{
|
||||
case 'i':
|
||||
if (TRIGGER_FOR_INSERT(tgtype))
|
||||
elog(ABORT, "CreateTrigger: double INSERT event specified");
|
||||
elog(ERROR, "CreateTrigger: double INSERT event specified");
|
||||
TRIGGER_SETT_INSERT(tgtype);
|
||||
break;
|
||||
case 'd':
|
||||
if (TRIGGER_FOR_DELETE(tgtype))
|
||||
elog(ABORT, "CreateTrigger: double DELETE event specified");
|
||||
elog(ERROR, "CreateTrigger: double DELETE event specified");
|
||||
TRIGGER_SETT_DELETE(tgtype);
|
||||
break;
|
||||
case 'u':
|
||||
if (TRIGGER_FOR_UPDATE(tgtype))
|
||||
elog(ABORT, "CreateTrigger: double UPDATE event specified");
|
||||
elog(ERROR, "CreateTrigger: double UPDATE event specified");
|
||||
TRIGGER_SETT_UPDATE(tgtype);
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "CreateTrigger: unknown event specified");
|
||||
elog(ERROR, "CreateTrigger: unknown event specified");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -125,7 +125,7 @@ CreateTrigger(CreateTrigStmt * stmt)
|
||||
Form_pg_trigger pg_trigger = (Form_pg_trigger) GETSTRUCT(tuple);
|
||||
|
||||
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);
|
||||
else
|
||||
found++;
|
||||
@ -139,7 +139,7 @@ CreateTrigger(CreateTrigStmt * stmt)
|
||||
if (!HeapTupleIsValid(tuple) ||
|
||||
((Form_pg_proc) GETSTRUCT(tuple))->prorettype != 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)
|
||||
{
|
||||
@ -150,12 +150,12 @@ CreateTrigger(CreateTrigStmt * stmt)
|
||||
0, 0, 0);
|
||||
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)
|
||||
{
|
||||
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)
|
||||
if (!PointerIsValid(tuple))
|
||||
{
|
||||
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;
|
||||
RelationInvalidateHeapTuple(relrdesc, tuple);
|
||||
@ -266,12 +266,12 @@ DropTrigger(DropTrigStmt * stmt)
|
||||
|
||||
#ifndef NO_SECURITY
|
||||
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
|
||||
|
||||
rel = heap_openr(stmt->relname);
|
||||
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);
|
||||
|
||||
@ -293,7 +293,7 @@ DropTrigger(DropTrigStmt * stmt)
|
||||
found++;
|
||||
}
|
||||
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);
|
||||
if (tgfound > 1)
|
||||
elog(NOTICE, "DropTrigger: found (and deleted) %d trigger %s on relation %s",
|
||||
@ -308,7 +308,7 @@ DropTrigger(DropTrigStmt * stmt)
|
||||
if (!PointerIsValid(tuple))
|
||||
{
|
||||
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;
|
||||
RelationInvalidateHeapTuple(relrdesc, tuple);
|
||||
@ -400,7 +400,7 @@ RelationBuildTriggers(Relation relation)
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
continue;
|
||||
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);
|
||||
|
||||
pg_trigger = (Form_pg_trigger) GETSTRUCT(tuple);
|
||||
@ -422,7 +422,7 @@ RelationBuildTriggers(Relation relation)
|
||||
Anum_pg_trigger_tgargs,
|
||||
tgrel->rd_att, &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);
|
||||
if (build->tgnargs > 0)
|
||||
{
|
||||
@ -433,7 +433,7 @@ RelationBuildTriggers(Relation relation)
|
||||
Anum_pg_trigger_tgargs,
|
||||
tgrel->rd_att, &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);
|
||||
p = (char *) VARDATA(val);
|
||||
build->tgargs = (char **) palloc(build->tgnargs * sizeof(char *));
|
||||
@ -452,7 +452,7 @@ RelationBuildTriggers(Relation relation)
|
||||
}
|
||||
|
||||
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,
|
||||
NAMEDATALEN, relation->rd_rel->relname.data);
|
||||
|
||||
@ -616,7 +616,7 @@ ExecCallTriggerFunc(Trigger * trigger)
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(procTuple))
|
||||
{
|
||||
elog(ABORT, "ExecCallTriggerFunc(): Cache lookup for proc %ld failed",
|
||||
elog(ERROR, "ExecCallTriggerFunc(): Cache lookup for proc %ld failed",
|
||||
ObjectIdGetDatum(trigger->tgfoid));
|
||||
}
|
||||
procStruct = (Form_pg_proc) GETSTRUCT(procTuple);
|
||||
@ -626,7 +626,7 @@ ExecCallTriggerFunc(Trigger * trigger)
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(langTuple))
|
||||
{
|
||||
elog(ABORT, "ExecCallTriggerFunc(): Cache lookup for language %ld failed",
|
||||
elog(ERROR, "ExecCallTriggerFunc(): Cache lookup for language %ld failed",
|
||||
ObjectIdGetDatum(procStruct->prolang));
|
||||
}
|
||||
langStruct = (Form_pg_language) GETSTRUCT(langTuple);
|
||||
@ -840,7 +840,7 @@ GetTupleForTrigger(Relation relation, ItemPointer tid, bool before)
|
||||
b = ReadBuffer(relation, ItemPointerGetBlockNumber(tid));
|
||||
|
||||
if (!BufferIsValid(b))
|
||||
elog(ABORT, "GetTupleForTrigger: failed ReadBuffer");
|
||||
elog(ERROR, "GetTupleForTrigger: failed ReadBuffer");
|
||||
|
||||
dp = (PageHeader) BufferGetPage(b);
|
||||
lp = PageGetItemId(dp, ItemPointerGetOffsetNumber(tid));
|
||||
@ -863,7 +863,7 @@ GetTupleForTrigger(Relation relation, ItemPointer tid, bool before)
|
||||
if (!tuple)
|
||||
{
|
||||
ReleaseBuffer(b);
|
||||
elog(ABORT, "GetTupleForTrigger: (am)invalid tid");
|
||||
elog(ERROR, "GetTupleForTrigger: (am)invalid tid");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ void DefineUser(CreateUserStmt *stmt) {
|
||||
pg_user = GetPgUserName();
|
||||
if (pg_aclcheck(UserRelationName, pg_user, ACL_RD | ACL_WR | ACL_AP) != ACLCHECK_OK) {
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@ -135,7 +135,7 @@ void DefineUser(CreateUserStmt *stmt) {
|
||||
RelationUnsetLockForWrite(pg_user_rel);
|
||||
heap_close(pg_user_rel);
|
||||
UserAbortTransactionBlock();
|
||||
elog(ABORT, "defineUser: user \"%s\" has already been created", stmt->user);
|
||||
elog(ERROR, "defineUser: user \"%s\" has already been created", stmt->user);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -213,7 +213,7 @@ extern void AlterUser(AlterUserStmt *stmt) {
|
||||
pg_user = GetPgUserName();
|
||||
if (pg_aclcheck(UserRelationName, pg_user, ACL_RD | ACL_WR) != ACLCHECK_OK) {
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@ -243,7 +243,7 @@ extern void AlterUser(AlterUserStmt *stmt) {
|
||||
RelationUnsetLockForWrite(pg_user_rel);
|
||||
heap_close(pg_user_rel);
|
||||
UserAbortTransactionBlock();
|
||||
elog(ABORT, "alterUser: user \"%s\" does not exist", stmt->user);
|
||||
elog(ERROR, "alterUser: user \"%s\" does not exist", stmt->user);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -323,7 +323,7 @@ extern void RemoveUser(char* user) {
|
||||
pg_user = GetPgUserName();
|
||||
if (pg_aclcheck(UserRelationName, pg_user, ACL_RD | ACL_WR) != ACLCHECK_OK) {
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@ -355,7 +355,7 @@ extern void RemoveUser(char* user) {
|
||||
RelationUnsetLockForWrite(pg_user_rel);
|
||||
heap_close(pg_user_rel);
|
||||
UserAbortTransactionBlock();
|
||||
elog(ABORT, "removeUser: user \"%s\" does not exist", user);
|
||||
elog(ERROR, "removeUser: user \"%s\" does not exist", user);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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()
|
||||
int fd;
|
||||
|
||||
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);
|
||||
|
||||
@ -207,7 +207,7 @@ vc_shutdown()
|
||||
{
|
||||
/* on entry, not in a transaction */
|
||||
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 */
|
||||
VacuumRunning = false;
|
||||
@ -438,7 +438,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
|
||||
List *le;
|
||||
|
||||
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);
|
||||
attnums = (int *) palloc(attr_cnt * sizeof(int));
|
||||
foreach(le, va_cols)
|
||||
@ -454,7 +454,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
|
||||
attnums[tcnt++] = i;
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -1139,7 +1139,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
|
||||
InvalidOffsetNumber, LP_USED);
|
||||
if (newoff == InvalidOffsetNumber)
|
||||
{
|
||||
elog(ABORT, "\
|
||||
elog(ERROR, "\
|
||||
failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
|
||||
tlen, ToVpd->vpd_blkno, ToVpd->vpd_free,
|
||||
ToVpd->vpd_nusd, ToVpd->vpd_noff);
|
||||
@ -1789,7 +1789,7 @@ vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelst
|
||||
rsdesc = heap_beginscan(rd, false, false, 1, &rskey);
|
||||
|
||||
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);
|
||||
|
||||
/* overwrite the existing statistics in the tuple */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "attempted to define virtual relation with no attrs");
|
||||
elog(ERROR, "attempted to define virtual relation with no attrs");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.84 1998/01/05 03:32:18 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.85 1998/01/05 16:39:16 momjian Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@ -590,17 +590,17 @@ alter_clause: ADD opt_column columnDef
|
||||
Node *lp = lfirst($3);
|
||||
|
||||
if (length($3) != 1)
|
||||
elog(ABORT,"ALTER TABLE/ADD() allows one column only",NULL);
|
||||
elog(ERROR,"ALTER TABLE/ADD() allows one column only",NULL);
|
||||
$$ = lp;
|
||||
}
|
||||
| DROP opt_column ColId
|
||||
{ elog(ABORT,"ALTER TABLE/DROP COLUMN not yet implemented",NULL); }
|
||||
{ elog(ERROR,"ALTER TABLE/DROP COLUMN not yet implemented",NULL); }
|
||||
| ALTER opt_column ColId SET DEFAULT default_expr
|
||||
{ elog(ABORT,"ALTER TABLE/ALTER COLUMN/SET DEFAULT not yet implemented",NULL); }
|
||||
{ elog(ERROR,"ALTER TABLE/ALTER COLUMN/SET DEFAULT not yet implemented",NULL); }
|
||||
| ALTER opt_column ColId DROP DEFAULT
|
||||
{ elog(ABORT,"ALTER TABLE/ALTER COLUMN/DROP DEFAULT not yet implemented",NULL); }
|
||||
{ elog(ERROR,"ALTER TABLE/ALTER COLUMN/DROP DEFAULT not yet implemented",NULL); }
|
||||
| ADD ConstraintElem
|
||||
{ elog(ABORT,"ALTER TABLE/ADD CONSTRAINT not yet implemented",NULL); }
|
||||
{ elog(ERROR,"ALTER TABLE/ADD CONSTRAINT not yet implemented",NULL); }
|
||||
;
|
||||
|
||||
|
||||
@ -811,11 +811,11 @@ default_expr: AexprConst
|
||||
| default_expr '*' default_expr
|
||||
{ $$ = nconc( $1, lcons( makeString( "*"), $3)); }
|
||||
| default_expr '=' default_expr
|
||||
{ elog(ABORT,"boolean expressions not supported in DEFAULT",NULL); }
|
||||
{ elog(ERROR,"boolean expressions not supported in DEFAULT",NULL); }
|
||||
| default_expr '<' default_expr
|
||||
{ elog(ABORT,"boolean expressions not supported in DEFAULT",NULL); }
|
||||
{ elog(ERROR,"boolean expressions not supported in DEFAULT",NULL); }
|
||||
| default_expr '>' default_expr
|
||||
{ elog(ABORT,"boolean expressions not supported in DEFAULT",NULL); }
|
||||
{ elog(ERROR,"boolean expressions not supported in DEFAULT",NULL); }
|
||||
| ':' default_expr
|
||||
{ $$ = lcons( makeString( ":"), $2); }
|
||||
| ';' default_expr
|
||||
@ -848,7 +848,7 @@ default_expr: AexprConst
|
||||
| default_expr Op default_expr
|
||||
{
|
||||
if (!strcmp("<=", $2) || !strcmp(">=", $2))
|
||||
elog(ABORT,"boolean expressions not supported in DEFAULT",NULL);
|
||||
elog(ERROR,"boolean expressions not supported in DEFAULT",NULL);
|
||||
$$ = nconc( $1, lcons( makeString( $2), $3));
|
||||
}
|
||||
| Op default_expr
|
||||
@ -1200,13 +1200,13 @@ TriggerOneEvent: INSERT { $$ = 'i'; }
|
||||
TriggerForSpec: FOR name name
|
||||
{
|
||||
if ( strcmp ($2, "each") != 0 )
|
||||
elog(ABORT,"parser: syntax error near %s",$2);
|
||||
elog(ERROR,"parser: syntax error near %s",$2);
|
||||
if ( strcmp ($3, "row") == 0 )
|
||||
$$ = TRUE;
|
||||
else if ( strcmp ($3, "statement") == 0 )
|
||||
$$ = FALSE;
|
||||
else
|
||||
elog(ABORT,"parser: syntax error near %s",$3);
|
||||
elog(ERROR,"parser: syntax error near %s",$3);
|
||||
}
|
||||
;
|
||||
|
||||
@ -1379,7 +1379,7 @@ opt_direction: FORWARD { $$ = FORWARD; }
|
||||
|
||||
fetch_how_many: Iconst
|
||||
{ $$ = $1;
|
||||
if ($1 <= 0) elog(ABORT,"Please specify nonnegative count for fetch",NULL); }
|
||||
if ($1 <= 0) elog(ERROR,"Please specify nonnegative count for fetch",NULL); }
|
||||
| ALL { $$ = 0; /* 0 means fetch all tuples*/ }
|
||||
| /*EMPTY*/ { $$ = 1; /*default*/ }
|
||||
;
|
||||
@ -1597,7 +1597,7 @@ RecipeStmt: EXECUTE RECIPE recipe_name
|
||||
{
|
||||
RecipeStmt *n;
|
||||
if (!IsTransactionBlock())
|
||||
elog(ABORT,"EXECUTE RECIPE may only be used in begin/end transaction blocks",NULL);
|
||||
elog(ERROR,"EXECUTE RECIPE may only be used in begin/end transaction blocks",NULL);
|
||||
|
||||
n = makeNode(RecipeStmt);
|
||||
n->recipeName = $3;
|
||||
@ -1725,7 +1725,7 @@ MathOp: '+' { $$ = "+"; }
|
||||
|
||||
oper_argtypes: name
|
||||
{
|
||||
elog(ABORT,"parser: argument type missing (use NONE for unary operators)",NULL);
|
||||
elog(ERROR,"parser: argument type missing (use NONE for unary operators)",NULL);
|
||||
}
|
||||
| name ',' name
|
||||
{ $$ = makeList(makeString($1), makeString($3), -1); }
|
||||
@ -2063,7 +2063,7 @@ VacuumStmt: VACUUM opt_verbose opt_analyze
|
||||
n->vacrel = $4;
|
||||
n->va_spec = $5;
|
||||
if ( $5 != NIL && !$4 )
|
||||
elog(ABORT,"parser: syntax error at or near \"(\"",NULL);
|
||||
elog(ERROR,"parser: syntax error at or near \"(\"",NULL);
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
;
|
||||
@ -2240,7 +2240,7 @@ CursorStmt: DECLARE name opt_binary CURSOR FOR
|
||||
* -- mao
|
||||
*/
|
||||
if (!IsTransactionBlock())
|
||||
elog(ABORT,"Named portals may only be used in begin/end transaction blocks",NULL);
|
||||
elog(ERROR,"Named portals may only be used in begin/end transaction blocks",NULL);
|
||||
|
||||
n->portalname = $2;
|
||||
n->binary = $3;
|
||||
@ -2444,7 +2444,7 @@ having_clause: HAVING a_expr { $$ = $2; }
|
||||
from_clause: FROM '(' relation_expr join_expr JOIN relation_expr join_spec ')'
|
||||
{
|
||||
$$ = NIL;
|
||||
elog(ABORT,"JOIN not yet implemented",NULL);
|
||||
elog(ERROR,"JOIN not yet implemented",NULL);
|
||||
}
|
||||
| FROM from_list { $$ = $2; }
|
||||
| /*EMPTY*/ { $$ = NIL; }
|
||||
@ -2453,7 +2453,7 @@ from_clause: FROM '(' relation_expr join_expr JOIN relation_expr join_spec ')'
|
||||
from_list: from_list ',' from_val
|
||||
{ $$ = lappend($1, $3); }
|
||||
| from_val CROSS JOIN from_val
|
||||
{ elog(ABORT,"CROSS JOIN not yet implemented",NULL); }
|
||||
{ elog(ERROR,"CROSS JOIN not yet implemented",NULL); }
|
||||
| from_val
|
||||
{ $$ = lcons($1, NIL); }
|
||||
;
|
||||
@ -2480,19 +2480,19 @@ from_val: relation_expr AS ColLabel
|
||||
|
||||
join_expr: NATURAL join_expr { $$ = NULL; }
|
||||
| FULL join_outer
|
||||
{ elog(ABORT,"FULL OUTER JOIN not yet implemented",NULL); }
|
||||
{ elog(ERROR,"FULL OUTER JOIN not yet implemented",NULL); }
|
||||
| LEFT join_outer
|
||||
{ elog(ABORT,"LEFT OUTER JOIN not yet implemented",NULL); }
|
||||
{ elog(ERROR,"LEFT OUTER JOIN not yet implemented",NULL); }
|
||||
| RIGHT join_outer
|
||||
{ elog(ABORT,"RIGHT OUTER JOIN not yet implemented",NULL); }
|
||||
{ elog(ERROR,"RIGHT OUTER JOIN not yet implemented",NULL); }
|
||||
| OUTER_P
|
||||
{ elog(ABORT,"OUTER JOIN not yet implemented",NULL); }
|
||||
{ elog(ERROR,"OUTER JOIN not yet implemented",NULL); }
|
||||
| INNER_P
|
||||
{ elog(ABORT,"INNER JOIN not yet implemented",NULL); }
|
||||
{ elog(ERROR,"INNER JOIN not yet implemented",NULL); }
|
||||
| UNION
|
||||
{ elog(ABORT,"UNION JOIN not yet implemented",NULL); }
|
||||
{ elog(ERROR,"UNION JOIN not yet implemented",NULL); }
|
||||
| /*EMPTY*/
|
||||
{ elog(ABORT,"INNER JOIN not yet implemented",NULL); }
|
||||
{ elog(ERROR,"INNER JOIN not yet implemented",NULL); }
|
||||
;
|
||||
|
||||
join_outer: OUTER_P { $$ = NULL; }
|
||||
@ -2653,13 +2653,13 @@ Numeric: FLOAT opt_float
|
||||
opt_float: '(' Iconst ')'
|
||||
{
|
||||
if ($2 < 1)
|
||||
elog(ABORT,"precision for FLOAT must be at least 1",NULL);
|
||||
elog(ERROR,"precision for FLOAT must be at least 1",NULL);
|
||||
else if ($2 < 7)
|
||||
$$ = xlateSqlType("float4");
|
||||
else if ($2 < 16)
|
||||
$$ = xlateSqlType("float8");
|
||||
else
|
||||
elog(ABORT,"precision for FLOAT must be less than 16",NULL);
|
||||
elog(ERROR,"precision for FLOAT must be less than 16",NULL);
|
||||
}
|
||||
| /*EMPTY*/
|
||||
{
|
||||
@ -2670,14 +2670,14 @@ opt_float: '(' Iconst ')'
|
||||
opt_numeric: '(' Iconst ',' Iconst ')'
|
||||
{
|
||||
if ($2 != 9)
|
||||
elog(ABORT,"NUMERIC precision %d must be 9",$2);
|
||||
elog(ERROR,"NUMERIC precision %d must be 9",$2);
|
||||
if ($4 != 0)
|
||||
elog(ABORT,"NUMERIC scale %d must be zero",$4);
|
||||
elog(ERROR,"NUMERIC scale %d must be zero",$4);
|
||||
}
|
||||
| '(' Iconst ')'
|
||||
{
|
||||
if ($2 != 9)
|
||||
elog(ABORT,"NUMERIC precision %d must be 9",$2);
|
||||
elog(ERROR,"NUMERIC precision %d must be 9",$2);
|
||||
}
|
||||
| /*EMPTY*/
|
||||
{
|
||||
@ -2688,15 +2688,15 @@ opt_numeric: '(' Iconst ',' Iconst ')'
|
||||
opt_decimal: '(' Iconst ',' Iconst ')'
|
||||
{
|
||||
if ($2 > 9)
|
||||
elog(ABORT,"DECIMAL precision %d exceeds implementation limit of 9",$2);
|
||||
elog(ERROR,"DECIMAL precision %d exceeds implementation limit of 9",$2);
|
||||
if ($4 != 0)
|
||||
elog(ABORT,"DECIMAL scale %d must be zero",$4);
|
||||
elog(ERROR,"DECIMAL scale %d must be zero",$4);
|
||||
$$ = NULL;
|
||||
}
|
||||
| '(' Iconst ')'
|
||||
{
|
||||
if ($2 > 9)
|
||||
elog(ABORT,"DECIMAL precision %d exceeds implementation limit of 9",$2);
|
||||
elog(ERROR,"DECIMAL precision %d exceeds implementation limit of 9",$2);
|
||||
$$ = NULL;
|
||||
}
|
||||
| /*EMPTY*/
|
||||
@ -2722,14 +2722,14 @@ Character: character '(' Iconst ')'
|
||||
else
|
||||
yyerror("parse error");
|
||||
if ($3 < 1)
|
||||
elog(ABORT,"length for '%s' type must be at least 1",$1);
|
||||
elog(ERROR,"length for '%s' type must be at least 1",$1);
|
||||
else if ($3 > 4096)
|
||||
/* we can store a char() of length up to the size
|
||||
* of a page (8KB) - page headers and friends but
|
||||
* just to be safe here... - ay 6/95
|
||||
* XXX note this hardcoded limit - thomas 1997-07-13
|
||||
*/
|
||||
elog(ABORT,"length for type '%s' cannot exceed 4096",$1);
|
||||
elog(ERROR,"length for type '%s' cannot exceed 4096",$1);
|
||||
|
||||
/* we actually implement this sort of like a varlen, so
|
||||
* the first 4 bytes is the length. (the difference
|
||||
@ -2762,7 +2762,7 @@ character: CHARACTER opt_varying opt_charset opt_collate
|
||||
}
|
||||
};
|
||||
if ($4 != NULL)
|
||||
elog(ABORT,"COLLATE %s not yet implemented",$4);
|
||||
elog(ERROR,"COLLATE %s not yet implemented",$4);
|
||||
$$ = type;
|
||||
}
|
||||
| CHAR opt_varying { $$ = xlateSqlType($2? "varchar": "char"); }
|
||||
@ -3098,7 +3098,7 @@ a_expr: attr opt_indirection
|
||||
*/
|
||||
| EXISTS '(' SubSelect ')'
|
||||
{
|
||||
elog(ABORT,"EXISTS not yet implemented",NULL);
|
||||
elog(ERROR,"EXISTS not yet implemented",NULL);
|
||||
$$ = $3;
|
||||
}
|
||||
| EXTRACT '(' extract_list ')'
|
||||
@ -3428,7 +3428,7 @@ trim_list: a_expr FROM expr_list
|
||||
|
||||
in_expr: SubSelect
|
||||
{
|
||||
elog(ABORT,"IN (SUBSELECT) not yet implemented",NULL);
|
||||
elog(ERROR,"IN (SUBSELECT) not yet implemented",NULL);
|
||||
$$ = $1;
|
||||
}
|
||||
| in_expr_nodes
|
||||
@ -3445,7 +3445,7 @@ in_expr_nodes: AexprConst
|
||||
|
||||
not_in_expr: SubSelect
|
||||
{
|
||||
elog(ABORT,"NOT IN (SUBSELECT) not yet implemented",NULL);
|
||||
elog(ERROR,"NOT IN (SUBSELECT) not yet implemented",NULL);
|
||||
$$ = $1;
|
||||
}
|
||||
| not_in_expr_nodes
|
||||
@ -3606,7 +3606,7 @@ relation_name: SpecialRuleRelation
|
||||
/* disallow refs to variable system tables */
|
||||
if (strcmp(LogRelationName, $1) == 0
|
||||
|| strcmp(VariableRelationName, $1) == 0)
|
||||
elog(ABORT,"%s cannot be accessed by users",$1);
|
||||
elog(ERROR,"%s cannot be accessed by users",$1);
|
||||
else
|
||||
$$ = $1;
|
||||
StrNCpy(saved_relname, $1, NAMEDATALEN);
|
||||
@ -3765,14 +3765,14 @@ SpecialRuleRelation: CURRENT
|
||||
if (QueryIsRule)
|
||||
$$ = "*CURRENT*";
|
||||
else
|
||||
elog(ABORT,"CURRENT used in non-rule query",NULL);
|
||||
elog(ERROR,"CURRENT used in non-rule query",NULL);
|
||||
}
|
||||
| NEW
|
||||
{
|
||||
if (QueryIsRule)
|
||||
$$ = "*NEW*";
|
||||
else
|
||||
elog(ABORT,"NEW used in non-rule query",NULL);
|
||||
elog(ERROR,"NEW used in non-rule query",NULL);
|
||||
}
|
||||
;
|
||||
|
||||
@ -3800,7 +3800,7 @@ makeRowExpr(char *opr, List *largs, List *rargs)
|
||||
Node *larg, *rarg;
|
||||
|
||||
if (length(largs) != length(rargs))
|
||||
elog(ABORT,"Unequal number of entries in row expression",NULL);
|
||||
elog(ERROR,"Unequal number of entries in row expression",NULL);
|
||||
|
||||
if (lnext(largs) != NIL)
|
||||
expr = makeRowExpr(opr,lnext(largs),lnext(rargs));
|
||||
@ -3828,7 +3828,7 @@ makeRowExpr(char *opr, List *largs, List *rargs)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT,"Operator '%s' not implemented for row expressions",opr);
|
||||
elog(ERROR,"Operator '%s' not implemented for row expressions",opr);
|
||||
}
|
||||
|
||||
#if FALSE
|
||||
@ -3858,7 +3858,7 @@ mapTargetColumns(List *src, List *dst)
|
||||
ResTarget *d;
|
||||
|
||||
if (length(src) != length(dst))
|
||||
elog(ABORT,"CREATE TABLE/AS SELECT has mismatched column count",NULL);
|
||||
elog(ERROR,"CREATE TABLE/AS SELECT has mismatched column count",NULL);
|
||||
|
||||
while ((src != NIL) && (dst != NIL))
|
||||
{
|
||||
@ -4069,7 +4069,7 @@ makeConstantList( A_Const *n)
|
||||
{
|
||||
char *defval = NULL;
|
||||
if (nodeTag(n) != T_A_Const) {
|
||||
elog(ABORT,"Cannot handle non-constant parameter",NULL);
|
||||
elog(ERROR,"Cannot handle non-constant parameter",NULL);
|
||||
|
||||
} else if (n->val.type == T_Float) {
|
||||
defval = (char*) palloc(20+1);
|
||||
@ -4086,7 +4086,7 @@ makeConstantList( A_Const *n)
|
||||
strcat( defval, "'");
|
||||
|
||||
} else {
|
||||
elog(ABORT,"Internal error in makeConstantList(): cannot encode node",NULL);
|
||||
elog(ERROR,"Internal error in makeConstantList(): cannot encode node",NULL);
|
||||
};
|
||||
|
||||
#ifdef PARSEDEBUG
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* 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 .
|
||||
errno = 0;
|
||||
yylval.ival = strtol((char *)literal,&endptr,2);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(ABORT,"Bad binary integer input '%s'",literal);
|
||||
elog(ERROR,"Bad binary integer input '%s'",literal);
|
||||
return (ICONST);
|
||||
}
|
||||
<xh>{xhinside} |
|
||||
<xb>{xbinside} {
|
||||
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);
|
||||
llen += yyleng;
|
||||
}
|
||||
@ -225,7 +225,7 @@ other .
|
||||
errno = 0;
|
||||
yylval.ival = strtol((char *)literal,&endptr,16);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(ABORT,"Bad hexadecimal integer input '%s'",literal);
|
||||
elog(ERROR,"Bad hexadecimal integer input '%s'",literal);
|
||||
return (ICONST);
|
||||
}
|
||||
|
||||
@ -242,13 +242,13 @@ other .
|
||||
<xq>{xqdouble} |
|
||||
<xq>{xqinside} {
|
||||
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);
|
||||
llen += yyleng;
|
||||
}
|
||||
<xq>{xqembedded} {
|
||||
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);
|
||||
*(literal+llen) = '\'';
|
||||
llen += yyleng;
|
||||
@ -256,7 +256,7 @@ other .
|
||||
|
||||
<xq>{xqliteral} {
|
||||
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);
|
||||
llen += yyleng;
|
||||
}
|
||||
@ -276,7 +276,7 @@ other .
|
||||
}
|
||||
<xd>{xdinside} {
|
||||
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);
|
||||
llen += yyleng;
|
||||
}
|
||||
@ -318,7 +318,7 @@ other .
|
||||
errno = 0;
|
||||
yylval.ival = strtol((char *)yytext,&endptr,10);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(ABORT,"Bad integer input '%s'",yytext);
|
||||
elog(ERROR,"Bad integer input '%s'",yytext);
|
||||
return (ICONST);
|
||||
}
|
||||
{real}/{space}*-{number} {
|
||||
@ -328,7 +328,7 @@ other .
|
||||
errno = 0;
|
||||
yylval.dval = strtod(((char *)yytext),&endptr);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(ABORT,"Bad float8 input '%s'",yytext);
|
||||
elog(ERROR,"Bad float8 input '%s'",yytext);
|
||||
CheckFloat8Val(yylval.dval);
|
||||
return (FCONST);
|
||||
}
|
||||
@ -338,7 +338,7 @@ other .
|
||||
errno = 0;
|
||||
yylval.ival = strtol((char *)yytext,&endptr,10);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(ABORT,"Bad integer input '%s'",yytext);
|
||||
elog(ERROR,"Bad integer input '%s'",yytext);
|
||||
return (ICONST);
|
||||
}
|
||||
{real} {
|
||||
@ -347,7 +347,7 @@ other .
|
||||
errno = 0;
|
||||
yylval.dval = strtod((char *)yytext,&endptr);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(ABORT,"Bad float input '%s'",yytext);
|
||||
elog(ERROR,"Bad float input '%s'",yytext);
|
||||
CheckFloat8Val(yylval.dval);
|
||||
return (FCONST);
|
||||
}
|
||||
@ -377,7 +377,7 @@ other .
|
||||
|
||||
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()
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* See acl.h.
|
||||
@ -120,7 +120,7 @@ ChangeAcl(char *relname,
|
||||
*/
|
||||
relation = heap_openr(RelationRelationName);
|
||||
if (!RelationIsValid(relation))
|
||||
elog(ABORT, "ChangeAcl: could not open '%s'??",
|
||||
elog(ERROR, "ChangeAcl: could not open '%s'??",
|
||||
RelationRelationName);
|
||||
fmgr_info(NameEqualRegProcedure, &relkey[0].sk_func, &relkey[0].sk_nargs);
|
||||
relkey[0].sk_argument = NameGetDatum(relname);
|
||||
@ -134,7 +134,7 @@ ChangeAcl(char *relname,
|
||||
{
|
||||
heap_endscan(hsdp);
|
||||
heap_close(relation);
|
||||
elog(ABORT, "ChangeAcl: class \"%s\" not found",
|
||||
elog(ERROR, "ChangeAcl: class \"%s\" not found",
|
||||
relname);
|
||||
return;
|
||||
}
|
||||
@ -205,7 +205,7 @@ get_grosysid(char *groname)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "non-existent group \"%s\"", groname);
|
||||
elog(ERROR, "non-existent group \"%s\"", groname);
|
||||
}
|
||||
return (id);
|
||||
}
|
||||
@ -370,7 +370,7 @@ aclcheck(Acl *acl, AclId id, AclIdType idtype, AclMode mode)
|
||||
case ACL_IDTYPE_WORLD:
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "aclcheck: bogus ACL id type: %d", idtype);
|
||||
elog(ERROR, "aclcheck: bogus ACL id type: %d", idtype);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -393,7 +393,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
|
||||
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(htp))
|
||||
elog(ABORT, "pg_aclcheck: user \"%s\" not found",
|
||||
elog(ERROR, "pg_aclcheck: user \"%s\" not found",
|
||||
usename);
|
||||
id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid;
|
||||
|
||||
@ -445,9 +445,9 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(htp))
|
||||
{
|
||||
elog(ABORT, "pg_aclcheck: class \"%s\" not found",
|
||||
elog(ERROR, "pg_aclcheck: class \"%s\" not found",
|
||||
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))
|
||||
{
|
||||
@ -528,7 +528,7 @@ pg_ownercheck(char *usename,
|
||||
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(htp))
|
||||
elog(ABORT, "pg_ownercheck: user \"%s\" not found",
|
||||
elog(ERROR, "pg_ownercheck: user \"%s\" not found",
|
||||
usename);
|
||||
user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid;
|
||||
|
||||
@ -550,30 +550,30 @@ pg_ownercheck(char *usename,
|
||||
{
|
||||
case OPROID:
|
||||
if (!HeapTupleIsValid(htp))
|
||||
elog(ABORT, "pg_ownercheck: operator %ld not found",
|
||||
elog(ERROR, "pg_ownercheck: operator %ld not found",
|
||||
PointerGetDatum(value));
|
||||
owner_id = ((OperatorTupleForm) GETSTRUCT(htp))->oprowner;
|
||||
break;
|
||||
case PRONAME:
|
||||
if (!HeapTupleIsValid(htp))
|
||||
elog(ABORT, "pg_ownercheck: function \"%s\" not found",
|
||||
elog(ERROR, "pg_ownercheck: function \"%s\" not found",
|
||||
value);
|
||||
owner_id = ((Form_pg_proc) GETSTRUCT(htp))->proowner;
|
||||
break;
|
||||
case RELNAME:
|
||||
if (!HeapTupleIsValid(htp))
|
||||
elog(ABORT, "pg_ownercheck: class \"%s\" not found",
|
||||
elog(ERROR, "pg_ownercheck: class \"%s\" not found",
|
||||
value);
|
||||
owner_id = ((Form_pg_class) GETSTRUCT(htp))->relowner;
|
||||
break;
|
||||
case TYPNAME:
|
||||
if (!HeapTupleIsValid(htp))
|
||||
elog(ABORT, "pg_ownercheck: type \"%s\" not found",
|
||||
elog(ERROR, "pg_ownercheck: type \"%s\" not found",
|
||||
value);
|
||||
owner_id = ((TypeTupleForm) GETSTRUCT(htp))->typowner;
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "pg_ownercheck: invalid cache id: %d",
|
||||
elog(ERROR, "pg_ownercheck: invalid cache id: %d",
|
||||
cacheid);
|
||||
break;
|
||||
}
|
||||
@ -594,7 +594,7 @@ pg_func_ownercheck(char *usename,
|
||||
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(htp))
|
||||
elog(ABORT, "pg_func_ownercheck: user \"%s\" not found",
|
||||
elog(ERROR, "pg_func_ownercheck: user \"%s\" not found",
|
||||
usename);
|
||||
user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid;
|
||||
|
||||
@ -635,7 +635,7 @@ pg_aggr_ownercheck(char *usename,
|
||||
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(htp))
|
||||
elog(ABORT, "pg_aggr_ownercheck: user \"%s\" not found",
|
||||
elog(ERROR, "pg_aggr_ownercheck: user \"%s\" not found",
|
||||
usename);
|
||||
user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* 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,
|
||||
{
|
||||
relname = strVal(lfirst(arg));
|
||||
if (IsSystemRelationName(relname))
|
||||
elog(ABORT, "class \"%s\" is a system catalog",
|
||||
elog(ERROR, "class \"%s\" is a system catalog",
|
||||
relname);
|
||||
rel = heap_openr(relname);
|
||||
if (RelationIsValid(rel))
|
||||
{
|
||||
if (stmt->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);
|
||||
if (!(stmt->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);
|
||||
heap_close(rel);
|
||||
}
|
||||
#ifndef NO_SECURITY
|
||||
if (!pg_ownercheck(userName, relname, RELNAME))
|
||||
elog(ABORT, "you do not own class \"%s\"",
|
||||
elog(ERROR, "you do not own class \"%s\"",
|
||||
relname);
|
||||
#endif
|
||||
}
|
||||
@ -263,11 +263,11 @@ ProcessUtility(Node * parsetree,
|
||||
|
||||
relname = stmt->relname;
|
||||
if (IsSystemRelationName(relname))
|
||||
elog(ABORT, "class \"%s\" is a system catalog",
|
||||
elog(ERROR, "class \"%s\" is a system catalog",
|
||||
relname);
|
||||
#ifndef NO_SECURITY
|
||||
if (!pg_ownercheck(userName, relname, RELNAME))
|
||||
elog(ABORT, "you do not own class \"%s\"",
|
||||
elog(ERROR, "you do not own class \"%s\"",
|
||||
relname);
|
||||
#endif
|
||||
|
||||
@ -327,7 +327,7 @@ ProcessUtility(Node * parsetree,
|
||||
{
|
||||
relname = strVal(lfirst(i));
|
||||
if (!pg_ownercheck(userName, relname, RELNAME))
|
||||
elog(ABORT, "you do not own class \"%s\"",
|
||||
elog(ERROR, "you do not own class \"%s\"",
|
||||
relname);
|
||||
}
|
||||
#endif
|
||||
@ -413,7 +413,7 @@ ProcessUtility(Node * parsetree,
|
||||
relname = stmt->object->relname;
|
||||
aclcheck_result = pg_aclcheck(relname, userName, ACL_RU);
|
||||
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
|
||||
commandTag = "CREATE";
|
||||
CHECK_IF_ABORTED();
|
||||
@ -453,11 +453,11 @@ ProcessUtility(Node * parsetree,
|
||||
case INDEX:
|
||||
relname = stmt->name;
|
||||
if (IsSystemRelationName(relname))
|
||||
elog(ABORT, "class \"%s\" is a system catalog index",
|
||||
elog(ERROR, "class \"%s\" is a system catalog index",
|
||||
relname);
|
||||
#ifndef NO_SECURITY
|
||||
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
|
||||
RemoveIndex(relname);
|
||||
break;
|
||||
@ -472,7 +472,7 @@ ProcessUtility(Node * parsetree,
|
||||
aclcheck_result = pg_aclcheck(relationName, userName, ACL_RU);
|
||||
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
|
||||
RemoveRewriteRule(rulename);
|
||||
@ -494,7 +494,7 @@ ProcessUtility(Node * parsetree,
|
||||
ruleName = MakeRetrieveViewRuleName(viewName);
|
||||
relationName = RewriteGetRuleEventRel(ruleName);
|
||||
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);
|
||||
#endif
|
||||
RemoveView(viewName);
|
||||
@ -546,7 +546,7 @@ ProcessUtility(Node * parsetree,
|
||||
|
||||
case T_VersionStmt:
|
||||
{
|
||||
elog(ABORT, "CREATE VERSION is not currently implemented");
|
||||
elog(ERROR, "CREATE VERSION is not currently implemented");
|
||||
}
|
||||
break;
|
||||
|
||||
@ -609,7 +609,7 @@ ProcessUtility(Node * parsetree,
|
||||
filename = stmt->filename;
|
||||
closeAllVfds();
|
||||
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);
|
||||
load_file(filename);
|
||||
}
|
||||
@ -754,7 +754,7 @@ ProcessUtility(Node * parsetree,
|
||||
*
|
||||
*/
|
||||
default:
|
||||
elog(ABORT, "ProcessUtility: command #%d unsupported",
|
||||
elog(ERROR, "ProcessUtility: command #%d unsupported",
|
||||
nodeTag(parsetree));
|
||||
break;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Routines for handling of 'SET var TO',
|
||||
* '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)
|
||||
while (isspace(*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 */
|
||||
if (!(*str))
|
||||
@ -94,7 +94,7 @@ get_token(char **tok, char **val, const char *str)
|
||||
}
|
||||
else if ((val == NULL) || (*str != '='))
|
||||
{
|
||||
elog(ABORT, "Syntax error near (%s)", str);
|
||||
elog(ERROR, "Syntax error near (%s)", str);
|
||||
};
|
||||
|
||||
str++; /* '=': get value */
|
||||
@ -105,7 +105,7 @@ get_token(char **tok, char **val, const char *str)
|
||||
str++;
|
||||
|
||||
if (*str == ',' || !(*str))
|
||||
elog(ABORT, "Syntax error near (=%s)", str);
|
||||
elog(ERROR, "Syntax error near (=%s)", str);
|
||||
|
||||
start = str;
|
||||
|
||||
@ -131,7 +131,7 @@ get_token(char **tok, char **val, const char *str)
|
||||
if (*str == ',')
|
||||
return (++str);
|
||||
|
||||
elog(ABORT, "Syntax error near (%s)", str);
|
||||
elog(ERROR, "Syntax error near (%s)", str);
|
||||
|
||||
return str;
|
||||
}
|
||||
@ -172,10 +172,10 @@ parse_geqo(const char *value)
|
||||
|
||||
rest = get_token(&tok, &val, value);
|
||||
if (tok == NULL)
|
||||
elog(ABORT, "Value undefined");
|
||||
elog(ERROR, "Value undefined");
|
||||
|
||||
if ((rest) && (*rest != '\0'))
|
||||
elog(ABORT, "Unable to parse '%s'", value);
|
||||
elog(ERROR, "Unable to parse '%s'", value);
|
||||
|
||||
if (strcasecmp(tok, "on") == 0)
|
||||
{
|
||||
@ -185,7 +185,7 @@ parse_geqo(const char *value)
|
||||
{
|
||||
geqo_rels = pg_atoi(val, sizeof(int32), '\0');
|
||||
if (geqo_rels <= 1)
|
||||
elog(ABORT, "Bad value for # of relations (%s)", val);
|
||||
elog(ERROR, "Bad value for # of relations (%s)", val);
|
||||
PFREE(val);
|
||||
}
|
||||
_use_geqo_ = true;
|
||||
@ -194,11 +194,11 @@ parse_geqo(const char *value)
|
||||
else if (strcasecmp(tok, "off") == 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;
|
||||
}
|
||||
else
|
||||
elog(ABORT, "Bad value for GEQO (%s)", value);
|
||||
elog(ERROR, "Bad value for GEQO (%s)", value);
|
||||
|
||||
PFREE(tok);
|
||||
return TRUE;
|
||||
@ -242,7 +242,7 @@ parse_r_plans(const char *value)
|
||||
else if (strcasecmp(value, "off") == 0)
|
||||
_use_right_sided_plans_ = false;
|
||||
else
|
||||
elog(ABORT, "Bad value for Right-sided Plans (%s)", value);
|
||||
elog(ERROR, "Bad value for Right-sided Plans (%s)", value);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -392,7 +392,7 @@ parse_date(const char *value)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "Bad value for date style (%s)", tok);
|
||||
elog(ERROR, "Bad value for date style (%s)", tok);
|
||||
}
|
||||
PFREE(tok);
|
||||
}
|
||||
@ -490,7 +490,7 @@ parse_timezone(const char *value)
|
||||
strcpy(tzbuf, "TZ=");
|
||||
strcat(tzbuf, tok);
|
||||
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();
|
||||
PFREE(tok);
|
||||
@ -528,13 +528,13 @@ reset_timezone()
|
||||
strcpy(tzbuf, "TZ=");
|
||||
strcat(tzbuf, TZvalue);
|
||||
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
|
||||
{
|
||||
strcpy(tzbuf, "=");
|
||||
if (putenv(tzbuf) != 0)
|
||||
elog(ABORT, "Unable to clear TZ environment variable", NULL);
|
||||
elog(ERROR, "Unable to clear TZ environment variable", NULL);
|
||||
}
|
||||
tzset();
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
for (id = s, len = 0; isalnum(*s) || *s == '_'; ++len, ++s)
|
||||
;
|
||||
if (len > sizeof(NameData))
|
||||
elog(ABORT, "getid: identifier cannot be >%d characters",
|
||||
elog(ERROR, "getid: identifier cannot be >%d characters",
|
||||
sizeof(NameData));
|
||||
if (len > 0)
|
||||
memmove(n, id, len);
|
||||
@ -102,11 +102,11 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
|
||||
}
|
||||
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 */
|
||||
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')
|
||||
aip->ai_idtype = ACL_IDTYPE_WORLD;
|
||||
@ -123,7 +123,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
|
||||
*modechg = ACL_MODECHG_EQL;
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "aclparse: mode change flag must use \"%s\"",
|
||||
elog(ERROR, "aclparse: mode change flag must use \"%s\"",
|
||||
ACL_MODECHG_STR);
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
|
||||
aip->ai_mode |= ACL_RU;
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "aclparse: mode flags must use \"%s\"",
|
||||
elog(ERROR, "aclparse: mode flags must use \"%s\"",
|
||||
ACL_MODE_STR);
|
||||
}
|
||||
}
|
||||
@ -156,7 +156,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
|
||||
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(name),
|
||||
0, 0, 0);
|
||||
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;
|
||||
break;
|
||||
case ACL_IDTYPE_GID:
|
||||
@ -188,10 +188,10 @@ makeacl(int n)
|
||||
Size size;
|
||||
|
||||
if (n < 0)
|
||||
elog(ABORT, "makeacl: invalid size: %d\n", n);
|
||||
elog(ERROR, "makeacl: invalid size: %d\n", n);
|
||||
size = ACL_N_SIZE(n);
|
||||
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);
|
||||
new_acl->size = size;
|
||||
new_acl->ndim = 1;
|
||||
@ -216,18 +216,18 @@ aclitemin(char *s)
|
||||
AclItem *aip;
|
||||
|
||||
if (!s)
|
||||
elog(ABORT, "aclitemin: null string");
|
||||
elog(ERROR, "aclitemin: null string");
|
||||
|
||||
aip = (AclItem *) palloc(sizeof(AclItem));
|
||||
if (!aip)
|
||||
elog(ABORT, "aclitemin: palloc failed");
|
||||
elog(ERROR, "aclitemin: palloc failed");
|
||||
s = aclparse(s, aip, &modechg);
|
||||
if (modechg != ACL_MODECHG_EQL)
|
||||
elog(ABORT, "aclitemin: cannot accept anything but = ACLs");
|
||||
elog(ERROR, "aclitemin: cannot accept anything but = ACLs");
|
||||
while (isspace(*s))
|
||||
++s;
|
||||
if (*s)
|
||||
elog(ABORT, "aclitemin: extra garbage at end of specification");
|
||||
elog(ERROR, "aclitemin: extra garbage at end of specification");
|
||||
return (aip);
|
||||
}
|
||||
|
||||
@ -257,7 +257,7 @@ aclitemout(AclItem *aip)
|
||||
|
||||
p = out = palloc(strlen("group =arwR ") + 1 + NAMEDATALEN);
|
||||
if (!out)
|
||||
elog(ABORT, "aclitemout: palloc failed");
|
||||
elog(ERROR, "aclitemout: palloc failed");
|
||||
*p = '\0';
|
||||
|
||||
switch (aip->ai_idtype)
|
||||
@ -296,7 +296,7 @@ aclitemout(AclItem *aip)
|
||||
case ACL_IDTYPE_WORLD:
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "aclitemout: bad ai_idtype: %d", aip->ai_idtype);
|
||||
elog(ERROR, "aclitemout: bad ai_idtype: %d", aip->ai_idtype);
|
||||
break;
|
||||
}
|
||||
while (*p)
|
||||
@ -420,7 +420,7 @@ aclinsert3(Acl *old_acl, AclItem *mod_aip, unsigned modechg)
|
||||
new_aip = ACL_DAT(new_acl);
|
||||
if (dst == 0)
|
||||
{ /* start */
|
||||
elog(ABORT, "aclinsert3: insertion before world ACL??");
|
||||
elog(ERROR, "aclinsert3: insertion before world ACL??");
|
||||
}
|
||||
else if (dst >= num)
|
||||
{ /* end */
|
||||
@ -534,7 +534,7 @@ aclremove(Acl *old_acl, AclItem *mod_aip)
|
||||
new_aip = ACL_DAT(new_acl);
|
||||
if (dst == 0)
|
||||
{ /* start */
|
||||
elog(ABORT, "aclremove: removal of the world ACL??");
|
||||
elog(ERROR, "aclremove: removal of the world ACL??");
|
||||
}
|
||||
else if (dst == old_num - 1)
|
||||
{ /* end */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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 */
|
||||
}
|
||||
for (q = p; isdigit(*q); q++);
|
||||
if (*q != ']')
|
||||
elog(ABORT, "array_in: missing ']' in array declaration");
|
||||
elog(ERROR, "array_in: missing ']' in array declaration");
|
||||
*q = '\0';
|
||||
dim[ndim] = atoi(p);
|
||||
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;
|
||||
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;
|
||||
ndim++;
|
||||
}
|
||||
@ -171,7 +171,7 @@ array_in(char *string, /* input array in external form */
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "array_in: Need to specify dimension");
|
||||
elog(ERROR, "array_in: Need to specify dimension");
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -179,7 +179,7 @@ array_in(char *string, /* input array in external form */
|
||||
while (isspace(*p))
|
||||
p++;
|
||||
if (strncmp(p, ASSGN, strlen(ASSGN)))
|
||||
elog(ABORT, "array_in: missing assignment operator");
|
||||
elog(ERROR, "array_in: missing assignment operator");
|
||||
p += strlen(ASSGN);
|
||||
while (isspace(*p))
|
||||
p++;
|
||||
@ -249,7 +249,7 @@ array_in(char *string, /* input array in external form */
|
||||
memmove((char *) ARR_LBOUND(retval), (char *) lBound, ndim * sizeof(int));
|
||||
memmove(ARR_DATA_PTR(retval), dataPtr, bytes);
|
||||
#endif
|
||||
elog(ABORT, "large object arrays not supported");
|
||||
elog(ERROR, "large object arrays not supported");
|
||||
}
|
||||
pfree(string_save);
|
||||
return ((char *) retval);
|
||||
@ -302,7 +302,7 @@ _ArrayCount(char *str, int dim[], int typdelim)
|
||||
* Signal a premature end of the string. DZ -
|
||||
* 2-9-1996
|
||||
*/
|
||||
elog(ABORT, "malformed array constant: %s", str);
|
||||
elog(ERROR, "malformed array constant: %s", str);
|
||||
break;
|
||||
case '\"':
|
||||
scanning_string = !scanning_string;
|
||||
@ -425,7 +425,7 @@ _ReadArrayStr(char *arrayStr,
|
||||
p++;
|
||||
nest_level++;
|
||||
if (nest_level > ndim)
|
||||
elog(ABORT, "array_in: illformed array constant");
|
||||
elog(ERROR, "array_in: illformed array constant");
|
||||
indx[nest_level - 1] = 0;
|
||||
indx[ndim - 1] = 0;
|
||||
}
|
||||
@ -460,7 +460,7 @@ _ReadArrayStr(char *arrayStr,
|
||||
}
|
||||
*q = '\0';
|
||||
if (i >= nitems)
|
||||
elog(ABORT, "array_in: illformed array constant");
|
||||
elog(ERROR, "array_in: illformed array constant");
|
||||
values[i] = (*inputproc) (p, typelem);
|
||||
p = ++q;
|
||||
if (!eoArray)
|
||||
@ -544,27 +544,27 @@ _ReadLOArray(char *str,
|
||||
if (!strcmp(word, "-chunk"))
|
||||
{
|
||||
if (str == NULL)
|
||||
elog(ABORT, "array_in: access pattern file required");
|
||||
elog(ERROR, "array_in: access pattern file required");
|
||||
str = _AdvanceBy1word(str, &accessfile);
|
||||
}
|
||||
else if (!strcmp(word, "-noreorg"))
|
||||
{
|
||||
if (str == NULL)
|
||||
elog(ABORT, "array_in: chunk file required");
|
||||
elog(ERROR, "array_in: chunk file required");
|
||||
str = _AdvanceBy1word(str, &chunkfile);
|
||||
}
|
||||
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)
|
||||
elog(ABORT, "array_in: missing file name");
|
||||
elog(ERROR, "array_in: missing file name");
|
||||
lobjId = lo_creat(0);
|
||||
*fd = lo_open(lobjId, INV_READ);
|
||||
if (*fd < 0)
|
||||
elog(ABORT, "Large object create failed");
|
||||
elog(ERROR, "Large object create failed");
|
||||
retStr = inputfile;
|
||||
*nbytes = strlen(retStr) + 2;
|
||||
|
||||
@ -573,7 +573,7 @@ _ReadLOArray(char *str,
|
||||
FILE *afd;
|
||||
|
||||
if ((afd = AllocateFile(accessfile, "r")) == NULL)
|
||||
elog(ABORT, "unable to open access pattern file");
|
||||
elog(ERROR, "unable to open access pattern file");
|
||||
*chunkFlag = true;
|
||||
retStr = _ChunkArray(*fd, afd, ndim, dim, baseSize, nbytes,
|
||||
chunkfile);
|
||||
@ -836,7 +836,7 @@ array_ref(ArrayType *array,
|
||||
* fixed length arrays -- these are assumed to be 1-d
|
||||
*/
|
||||
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;
|
||||
return _ArrayCast(retval, reftype, elmlen);
|
||||
}
|
||||
@ -964,7 +964,7 @@ array_clip(ArrayType *array,
|
||||
|
||||
for (i = 0; i < n; 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);
|
||||
|
||||
if (ARR_IS_LO(array))
|
||||
@ -980,7 +980,7 @@ array_clip(ArrayType *array,
|
||||
rsize;
|
||||
|
||||
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
|
||||
lo_name = (char *) ARR_DATA_PTR(array);
|
||||
if ((fd = LOopen(lo_name, ARR_IS_INV(array) ? INV_READ : O_RDONLY)) < 0)
|
||||
@ -1098,7 +1098,7 @@ array_set(ArrayType *array,
|
||||
* fixed length arrays -- these are assumed to be 1-d
|
||||
*/
|
||||
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;
|
||||
ArrayCastAndSet(dataPtr, (bool) reftype, elmlen, pos);
|
||||
return ((char *) array);
|
||||
@ -1110,7 +1110,7 @@ array_set(ArrayType *array,
|
||||
|
||||
if (!SanityCheckInput(ndim, n, dim, lb, indx))
|
||||
{
|
||||
elog(ABORT, "array_set: array bound exceeded");
|
||||
elog(ERROR, "array_set: array bound exceeded");
|
||||
return ((char *) array);
|
||||
}
|
||||
offset = GetOffset(n, dim, lb, indx);
|
||||
@ -1225,7 +1225,7 @@ array_assgn(ArrayType *array,
|
||||
if (array == (ArrayType *) NULL)
|
||||
RETURN_NULL;
|
||||
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);
|
||||
lb = ARR_LBOUND(array);
|
||||
@ -1239,7 +1239,7 @@ array_assgn(ArrayType *array,
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
if (lowerIndx[i] > upperIndx[i])
|
||||
elog(ABORT, "lowerIndex larger than upperIndx");
|
||||
elog(ERROR, "lowerIndex larger than upperIndx");
|
||||
|
||||
if (ARR_IS_LO(array))
|
||||
{
|
||||
@ -1315,7 +1315,7 @@ system_cache_lookup(Oid element_type,
|
||||
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@ -1350,7 +1350,7 @@ _ArrayCast(char *value, bool byval, int len)
|
||||
case 4:
|
||||
return ((Datum) *(int32 *) value);
|
||||
default:
|
||||
elog(ABORT, "array_ref: byval and elt len > 4!");
|
||||
elog(ERROR, "array_ref: byval and elt len > 4!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1734,7 +1734,7 @@ _array_newLO(int *fd, int flag)
|
||||
strcpy(saveName, p);
|
||||
#ifdef LOARRAY
|
||||
if ((*fd = LOcreat(saveName, 0600, flag)) < 0)
|
||||
elog(ABORT, "Large object create failed");
|
||||
elog(ERROR, "Large object create failed");
|
||||
#endif
|
||||
return (p);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
break;
|
||||
}
|
||||
|
||||
elog(ABORT,"Bad boolean external representation '%s'", b);
|
||||
elog(ERROR,"Bad boolean external representation '%s'", b);
|
||||
/* not reached */
|
||||
return (FALSE);
|
||||
} /* boolin() */
|
||||
|
@ -9,7 +9,7 @@
|
||||
* workings can be found in the book "Software Solutions in C" by
|
||||
* 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>
|
||||
@ -156,10 +156,10 @@ printf( "cashin- precision %d; decimal %c; thousands %c; currency %c; positive %
|
||||
s++;
|
||||
|
||||
if (*s != '\0')
|
||||
elog(ABORT, "Bad money external representation %s", str);
|
||||
elog(ERROR, "Bad money external representation %s", str);
|
||||
|
||||
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);
|
||||
|
||||
@ -257,7 +257,7 @@ cash_out(Cash *in_value)
|
||||
if (minus)
|
||||
{
|
||||
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 */
|
||||
if (convention == 0)
|
||||
@ -270,7 +270,7 @@ cash_out(Cash *in_value)
|
||||
else
|
||||
{
|
||||
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);
|
||||
}
|
||||
@ -346,7 +346,7 @@ cash_pl(Cash *c1, Cash *c2)
|
||||
return (NULL);
|
||||
|
||||
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);
|
||||
|
||||
@ -366,7 +366,7 @@ cash_mi(Cash *c1, Cash *c2)
|
||||
return (NULL);
|
||||
|
||||
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);
|
||||
|
||||
@ -386,7 +386,7 @@ cash_mul_flt8(Cash *c, float8 *f)
|
||||
return (NULL);
|
||||
|
||||
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));
|
||||
|
||||
@ -419,10 +419,10 @@ cash_div_flt8(Cash *c, float8 *f)
|
||||
return (NULL);
|
||||
|
||||
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)
|
||||
elog(ABORT, "cash_div: divide by 0.0 error");
|
||||
elog(ERROR, "cash_div: divide by 0.0 error");
|
||||
|
||||
*result = rint(*c / *f);
|
||||
|
||||
@ -441,7 +441,7 @@ cash_mul_flt4(Cash *c, float4 *f)
|
||||
return (NULL);
|
||||
|
||||
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));
|
||||
|
||||
@ -474,10 +474,10 @@ cash_div_flt4(Cash *c, float4 *f)
|
||||
return (NULL);
|
||||
|
||||
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)
|
||||
elog(ABORT, "cash_div: divide by 0.0 error");
|
||||
elog(ERROR, "cash_div: divide by 0.0 error");
|
||||
|
||||
*result = rint(*c / *f);
|
||||
|
||||
@ -497,7 +497,7 @@ cash_mul_int4(Cash *c, int4 i)
|
||||
return (NULL);
|
||||
|
||||
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));
|
||||
|
||||
@ -530,10 +530,10 @@ cash_div_int4(Cash *c, int4 i)
|
||||
return (NULL);
|
||||
|
||||
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)
|
||||
elog(ABORT, "cash_idiv: divide by 0 error");
|
||||
elog(ERROR, "cash_idiv: divide by 0 error");
|
||||
|
||||
*result = rint(*c / i);
|
||||
|
||||
@ -553,7 +553,7 @@ cash_mul_int2(Cash *c, int2 s)
|
||||
return (NULL);
|
||||
|
||||
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));
|
||||
|
||||
@ -586,10 +586,10 @@ cash_div_int2(Cash *c, int2 s)
|
||||
return (NULL);
|
||||
|
||||
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)
|
||||
elog(ABORT, "cash_div: divide by 0 error");
|
||||
elog(ERROR, "cash_div: divide by 0 error");
|
||||
|
||||
*result = rint(*c / s);
|
||||
|
||||
@ -609,7 +609,7 @@ cashlarger(Cash *c1, Cash *c2)
|
||||
return (NULL);
|
||||
|
||||
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);
|
||||
|
||||
@ -629,7 +629,7 @@ cashsmaller(Cash *c1, Cash *c2)
|
||||
return (NULL);
|
||||
|
||||
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);
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* 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,
|
||||
else
|
||||
cfd = LOopen(chunkfile, O_RDONLY);
|
||||
if (cfd < 0)
|
||||
elog(ABORT, "Unable to open chunk file");
|
||||
elog(ERROR, "Unable to open chunk file");
|
||||
#endif
|
||||
|
||||
strcpy(cInfo.lo_name, chunkfile);
|
||||
@ -148,11 +148,11 @@ GetChunkSize(FILE *fd,
|
||||
*/
|
||||
fscanf(fd, "%d", &N);
|
||||
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 (j = 0; j < ndim + 1; j++)
|
||||
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
|
||||
@ -413,12 +413,12 @@ seek_and_read(int pos, int size, char buff[], int fp, int from)
|
||||
|
||||
/* Assuming only one file */
|
||||
if (lo_lseek(fp, pos, from) < 0)
|
||||
elog(ABORT, "File seek error");
|
||||
elog(ERROR, "File seek error");
|
||||
#ifdef LOARRAY
|
||||
v = (struct varlena *) LOread(fp, size);
|
||||
#endif
|
||||
if (VARSIZE(v) - VARHDRSZ < size)
|
||||
elog(ABORT, "File read error");
|
||||
elog(ERROR, "File read error");
|
||||
memmove(buff, VARDATA(v), size);
|
||||
pfree(v);
|
||||
return (1);
|
||||
|
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* This code is actually (almost) unused.
|
||||
@ -129,14 +129,14 @@ reltimein(char *str)
|
||||
char lowstr[MAXDATELEN + 1];
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(ABORT, "Bad (null) date external representation", NULL);
|
||||
elog(ERROR, "Bad (null) date external representation", NULL);
|
||||
|
||||
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)
|
||||
|| (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
|
||||
printf("reltimein- %d fields are type %d (DTK_DATE=%d)\n", nf, dtype, DTK_DATE);
|
||||
@ -153,7 +153,7 @@ reltimein(char *str)
|
||||
return (INVALID_RELTIME);
|
||||
}
|
||||
|
||||
elog(ABORT, "Bad reltime (internal coding error) '%s'", str);
|
||||
elog(ERROR, "Bad reltime (internal coding error) '%s'", str);
|
||||
return (INVALID_RELTIME);
|
||||
} /* reltimein() */
|
||||
|
||||
@ -361,7 +361,7 @@ reltime_timespan(RelativeTime reltime)
|
||||
month;
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
char lowstr[MAXDATELEN + 1];
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(ABORT, "Bad (null) date external representation", NULL);
|
||||
elog(ERROR, "Bad (null) date external representation", NULL);
|
||||
|
||||
#ifdef DATEDEBUG
|
||||
printf("date_in- input string is %s\n", str);
|
||||
#endif
|
||||
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 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)
|
||||
{
|
||||
@ -96,15 +96,15 @@ date_in(char *str)
|
||||
break;
|
||||
|
||||
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)
|
||||
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)
|
||||
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])
|
||||
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);
|
||||
|
||||
date = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(2000, 1, 1));
|
||||
@ -239,7 +239,7 @@ date_datetime(DateADT dateVal)
|
||||
result = PALLOCTYPE(DateTime);
|
||||
|
||||
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
|
||||
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)
|
||||
#endif
|
||||
|
||||
if (tm2datetime(tm, fsec, &tz, result) != 0)
|
||||
elog(ABORT, "Datetime out of range", NULL);
|
||||
elog(ERROR, "Datetime out of range", NULL);
|
||||
|
||||
return (result);
|
||||
} /* date_datetime() */
|
||||
@ -267,10 +267,10 @@ datetime_date(DateTime *datetime)
|
||||
char *tzn;
|
||||
|
||||
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))
|
||||
elog(ABORT, "Unable to convert datetime to date", NULL);
|
||||
elog(ERROR, "Unable to convert datetime to date", NULL);
|
||||
|
||||
if (DATETIME_IS_EPOCH(*datetime))
|
||||
{
|
||||
@ -285,7 +285,7 @@ datetime_date(DateTime *datetime)
|
||||
else
|
||||
{
|
||||
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));
|
||||
@ -310,7 +310,7 @@ abstime_date(AbsoluteTime abstime)
|
||||
case INVALID_ABSTIME:
|
||||
case NOSTART_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
|
||||
@ -440,18 +440,18 @@ time_in(char *str)
|
||||
int ftype[MAXDATEFIELDS];
|
||||
|
||||
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)
|
||||
|| (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))
|
||||
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))
|
||||
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))
|
||||
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);
|
||||
|
||||
@ -565,10 +565,10 @@ datetime_time(DateTime *datetime)
|
||||
char *tzn;
|
||||
|
||||
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))
|
||||
elog(ABORT, "Unable to convert datetime to date", NULL);
|
||||
elog(ERROR, "Unable to convert datetime to date", NULL);
|
||||
|
||||
if (DATETIME_IS_EPOCH(*datetime))
|
||||
{
|
||||
@ -583,7 +583,7 @@ datetime_time(DateTime *datetime)
|
||||
else
|
||||
{
|
||||
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);
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"datumGetSize: Error: type=%ld, byVaL with len=%d",
|
||||
(long) type, len);
|
||||
}
|
||||
@ -78,7 +78,7 @@ datumGetSize(Datum value, Oid type, bool byVal, Size len)
|
||||
s = (struct varlena *) DatumGetPointer(value);
|
||||
if (!PointerIsValid(s))
|
||||
{
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"datumGetSize: Invalid Datum Pointer");
|
||||
}
|
||||
size = (Size) VARSIZE(s);
|
||||
@ -132,7 +132,7 @@ datumCopy(Datum value, Oid type, bool byVal, Size len)
|
||||
s = (char *) palloc(realSize);
|
||||
if (s == NULL)
|
||||
{
|
||||
elog(ABORT, "datumCopy: out of memory\n");
|
||||
elog(ERROR, "datumCopy: out of memory\n");
|
||||
}
|
||||
memmove(s, DatumGetPointer(value), realSize);
|
||||
res = (Datum) s;
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
char lowstr[MAXDATELEN + 1];
|
||||
|
||||
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)
|
||||
|| (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);
|
||||
|
||||
@ -121,7 +121,7 @@ datetime_in(char *str)
|
||||
{
|
||||
case DTK_DATE:
|
||||
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
|
||||
printf("datetime_in- date is %f\n", *result);
|
||||
@ -150,7 +150,7 @@ datetime_in(char *str)
|
||||
break;
|
||||
|
||||
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);
|
||||
@ -225,11 +225,11 @@ timespan_in(char *str)
|
||||
fsec = 0;
|
||||
|
||||
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)
|
||||
|| (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);
|
||||
|
||||
@ -241,12 +241,12 @@ timespan_in(char *str)
|
||||
#if FALSE
|
||||
TIMESPAN_INVALID(span);
|
||||
#endif
|
||||
elog(ABORT, "Bad timespan external representation '%s'", str);
|
||||
elog(ERROR, "Bad timespan external representation '%s'", str);
|
||||
}
|
||||
break;
|
||||
|
||||
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);
|
||||
@ -272,7 +272,7 @@ timespan_out(TimeSpan *span)
|
||||
return (NULL);
|
||||
|
||||
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);
|
||||
|
||||
@ -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);
|
||||
#endif
|
||||
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
|
||||
@ -1106,10 +1106,10 @@ timespan_div(TimeSpan *span1, float8 *arg2)
|
||||
return NULL;
|
||||
|
||||
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)
|
||||
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->time = JROUND(span1->time / *arg2);
|
||||
@ -1238,7 +1238,7 @@ datetime_age(DateTime *datetime1, DateTime *datetime2)
|
||||
|
||||
if (tm2timespan(tm, fsec, result) != 0)
|
||||
{
|
||||
elog(ABORT, "Unable to decode datetime", NULL);
|
||||
elog(ERROR, "Unable to decode datetime", NULL);
|
||||
}
|
||||
|
||||
#if FALSE
|
||||
@ -1255,7 +1255,7 @@ datetime_age(DateTime *datetime1, DateTime *datetime2)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "Unable to decode datetime", NULL);
|
||||
elog(ERROR, "Unable to decode datetime", NULL);
|
||||
}
|
||||
|
||||
return (result);
|
||||
@ -1436,7 +1436,7 @@ datetime_trunc(text *units, DateTime *datetime)
|
||||
{
|
||||
#if FALSE
|
||||
/* 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
|
||||
*result = 0;
|
||||
|
||||
@ -1480,7 +1480,7 @@ datetime_trunc(text *units, DateTime *datetime)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(ABORT, "Datetime units '%s' not supported", lowunits);
|
||||
elog(ERROR, "Datetime units '%s' not supported", lowunits);
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
@ -1513,7 +1513,7 @@ datetime_trunc(text *units, DateTime *datetime)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
@ -1526,7 +1526,7 @@ datetime_trunc(text *units, DateTime *datetime)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "Datetime units '%s' not recognized", lowunits);
|
||||
elog(ERROR, "Datetime units '%s' not recognized", lowunits);
|
||||
result = NULL;
|
||||
}
|
||||
}
|
||||
@ -1580,7 +1580,7 @@ timespan_trunc(text *units, TimeSpan *timespan)
|
||||
if (TIMESPAN_IS_INVALID(*timespan))
|
||||
{
|
||||
#if FALSE
|
||||
elog(ABORT, "Timespan is not finite", NULL);
|
||||
elog(ERROR, "Timespan is not finite", NULL);
|
||||
#endif
|
||||
result = NULL;
|
||||
|
||||
@ -1623,12 +1623,12 @@ timespan_trunc(text *units, TimeSpan *timespan)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(ABORT, "Timespan units '%s' not supported", lowunits);
|
||||
elog(ERROR, "Timespan units '%s' not supported", lowunits);
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
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
|
||||
@ -1652,7 +1652,7 @@ timespan_trunc(text *units, TimeSpan *timespan)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "Timespan units '%s' not recognized", units);
|
||||
elog(ERROR, "Timespan units '%s' not recognized", units);
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
@ -1708,7 +1708,7 @@ datetime_part(text *units, DateTime *datetime)
|
||||
{
|
||||
#if FALSE
|
||||
/* 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
|
||||
*result = 0;
|
||||
|
||||
@ -1774,7 +1774,7 @@ datetime_part(text *units, DateTime *datetime)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(ABORT, "Datetime units '%s' not supported", lowunits);
|
||||
elog(ERROR, "Datetime units '%s' not supported", lowunits);
|
||||
*result = 0;
|
||||
}
|
||||
|
||||
@ -1790,28 +1790,28 @@ datetime_part(text *units, DateTime *datetime)
|
||||
|
||||
case DTK_DOW:
|
||||
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));
|
||||
break;
|
||||
|
||||
case DTK_DOY:
|
||||
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)
|
||||
- date2j(tm->tm_year, 1, 1) + 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(ABORT, "Datetime units '%s' not supported", lowunits);
|
||||
elog(ERROR, "Datetime units '%s' not supported", lowunits);
|
||||
*result = 0;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "Datetime units '%s' not recognized", lowunits);
|
||||
elog(ERROR, "Datetime units '%s' not recognized", lowunits);
|
||||
*result = 0;
|
||||
}
|
||||
}
|
||||
@ -1864,7 +1864,7 @@ timespan_part(text *units, TimeSpan *timespan)
|
||||
if (TIMESPAN_IS_INVALID(*timespan))
|
||||
{
|
||||
#if FALSE
|
||||
elog(ABORT, "Timespan is not finite", NULL);
|
||||
elog(ERROR, "Timespan is not finite", NULL);
|
||||
#endif
|
||||
*result = 0;
|
||||
|
||||
@ -1925,7 +1925,7 @@ timespan_part(text *units, TimeSpan *timespan)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(ABORT, "Timespan units '%s' not yet supported", units);
|
||||
elog(ERROR, "Timespan units '%s' not yet supported", units);
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
@ -1949,7 +1949,7 @@ timespan_part(text *units, TimeSpan *timespan)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "Timespan units '%s' not recognized", units);
|
||||
elog(ERROR, "Timespan units '%s' not recognized", units);
|
||||
*result = 0;
|
||||
}
|
||||
|
||||
@ -2005,7 +2005,7 @@ datetime_zone(text *zone, DateTime *datetime)
|
||||
* could 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);
|
||||
result = NULL;
|
||||
|
||||
}
|
||||
@ -2018,7 +2018,7 @@ datetime_zone(text *zone, DateTime *datetime)
|
||||
dt = dt2local(dt, tz);
|
||||
|
||||
if (datetime2tm(dt, NULL, tm, &fsec, NULL) != 0)
|
||||
elog(ABORT, "Datetime not legal", NULL);
|
||||
elog(ERROR, "Datetime not legal", NULL);
|
||||
|
||||
up = upzone;
|
||||
lp = lowzone;
|
||||
@ -2039,7 +2039,7 @@ datetime_zone(text *zone, DateTime *datetime)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "Time zone '%s' not recognized", lowzone);
|
||||
elog(ERROR, "Time zone '%s' not recognized", lowzone);
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ filename_in(char *file)
|
||||
/* printf("name: %s\n"); */
|
||||
if ((pw = getpwnam(name)) == NULL)
|
||||
{
|
||||
elog(ABORT, "No such user: %s\n", name);
|
||||
elog(ERROR, "No such user: %s\n", name);
|
||||
ind = 0;
|
||||
}
|
||||
else
|
||||
@ -112,7 +112,7 @@ filename_in(char *file)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "Couldn't find %s in your environment", environment);
|
||||
elog(ERROR, "Couldn't find %s in your environment", environment);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -132,6 +132,6 @@ filename_out(char *s)
|
||||
return ((char *) NULL);
|
||||
ret = (char *) palloc(strlen(s) + 1);
|
||||
if (!ret)
|
||||
elog(ABORT, "filename_out: palloc failed");
|
||||
elog(ERROR, "filename_out: palloc failed");
|
||||
return (strcpy(ret, s));
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
return;
|
||||
#else
|
||||
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)
|
||||
elog(ABORT, "Bad float4 input format -- underflow");
|
||||
elog(ERROR, "Bad float4 input format -- underflow");
|
||||
return;
|
||||
#endif /* UNSAFE_FLOATS */
|
||||
}
|
||||
@ -186,9 +186,9 @@ CheckFloat8Val(double val)
|
||||
return;
|
||||
#else
|
||||
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)
|
||||
elog(ABORT, "Bad float8 input format -- underflow");
|
||||
elog(ERROR, "Bad float8 input format -- underflow");
|
||||
return;
|
||||
#endif /* UNSAFE_FLOATS */
|
||||
}
|
||||
@ -210,7 +210,7 @@ float4in(char *num)
|
||||
errno = 0;
|
||||
val = strtod(num, &endptr);
|
||||
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
|
||||
@ -257,7 +257,7 @@ float8in(char *num)
|
||||
errno = 0;
|
||||
val = strtod(num, &endptr);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(ABORT, "Bad float8 input format '%s'", num);
|
||||
elog(ERROR, "Bad float8 input format '%s'", num);
|
||||
|
||||
CheckFloat8Val(val);
|
||||
*result = val;
|
||||
@ -515,7 +515,7 @@ float4div(float32 arg1, float32 arg2)
|
||||
return (float32) NULL;
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(ABORT, "float4div: divide by zero error");
|
||||
elog(ERROR, "float4div: divide by zero error");
|
||||
|
||||
val = *arg1 / *arg2;
|
||||
|
||||
@ -609,7 +609,7 @@ float8div(float64 arg1, float64 arg2)
|
||||
result = (float64) palloc(sizeof(float64data));
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(ABORT, "float8div: divide by zero error");
|
||||
elog(ERROR, "float8div: divide by zero error");
|
||||
|
||||
val = *arg1 / *arg2;
|
||||
CheckFloat8Val(val);
|
||||
@ -806,10 +806,10 @@ dtoi4(float64 num)
|
||||
int32 result;
|
||||
|
||||
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))
|
||||
elog(ABORT, "dtoi4: integer out of range", NULL);
|
||||
elog(ERROR, "dtoi4: integer out of range", NULL);
|
||||
|
||||
result = rint(*num);
|
||||
return (result);
|
||||
@ -825,10 +825,10 @@ dtoi2(float64 num)
|
||||
int16 result;
|
||||
|
||||
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))
|
||||
elog(ABORT, "dtoi2: integer out of range", NULL);
|
||||
elog(ERROR, "dtoi2: integer out of range", NULL);
|
||||
|
||||
result = rint(*num);
|
||||
return (result);
|
||||
@ -874,10 +874,10 @@ ftoi4(float32 num)
|
||||
int32 result;
|
||||
|
||||
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))
|
||||
elog(ABORT, "ftoi4: integer out of range", NULL);
|
||||
elog(ERROR, "ftoi4: integer out of range", NULL);
|
||||
|
||||
result = rint(*num);
|
||||
return (result);
|
||||
@ -893,10 +893,10 @@ ftoi2(float32 num)
|
||||
int16 result;
|
||||
|
||||
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))
|
||||
elog(ABORT, "ftoi2: integer out of range", NULL);
|
||||
elog(ERROR, "ftoi2: integer out of range", NULL);
|
||||
|
||||
result = rint(*num);
|
||||
return (result);
|
||||
@ -1052,7 +1052,7 @@ dpow(float64 arg1, float64 arg2)
|
||||
#else
|
||||
if (!finite(*result))
|
||||
#endif
|
||||
elog(ABORT, "pow() result is out of range");
|
||||
elog(ERROR, "pow() result is out of range");
|
||||
|
||||
CheckFloat8Val(*result);
|
||||
return (result);
|
||||
@ -1083,7 +1083,7 @@ dexp(float64 arg1)
|
||||
#else
|
||||
if (!finite(*result))
|
||||
#endif
|
||||
elog(ABORT, "exp() result is out of range");
|
||||
elog(ERROR, "exp() result is out of range");
|
||||
|
||||
CheckFloat8Val(*result);
|
||||
return (result);
|
||||
@ -1107,9 +1107,9 @@ dlog1(float64 arg1)
|
||||
|
||||
tmp = *arg1;
|
||||
if (tmp == 0.0)
|
||||
elog(ABORT, "can't take log of zero");
|
||||
elog(ERROR, "can't take log of zero");
|
||||
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);
|
||||
|
||||
CheckFloat8Val(*result);
|
||||
@ -1185,7 +1185,7 @@ float48div(float32 arg1, float64 arg2)
|
||||
result = (float64) palloc(sizeof(float64data));
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(ABORT, "float48div: divide by zero");
|
||||
elog(ERROR, "float48div: divide by zero");
|
||||
|
||||
*result = *arg1 / *arg2;
|
||||
CheckFloat8Val(*result);
|
||||
@ -1255,7 +1255,7 @@ float84div(float64 arg1, float32 arg2)
|
||||
result = (float64) palloc(sizeof(float64data));
|
||||
|
||||
if (*arg2 == 0.0)
|
||||
elog(ABORT, "float48div: divide by zero");
|
||||
elog(ERROR, "float48div: divide by zero");
|
||||
|
||||
*result = *arg1 / *arg2;
|
||||
CheckFloat8Val(*result);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
{
|
||||
*cp++ = LDELIM;
|
||||
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++ = RDELIM;
|
||||
*cp++ = DELIM;
|
||||
@ -364,11 +364,11 @@ box_in(char *str)
|
||||
y;
|
||||
|
||||
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)))
|
||||
|| (*s != '\0'))
|
||||
elog(ABORT, "Bad box external representation '%s'", str);
|
||||
elog(ERROR, "Bad box external representation '%s'", str);
|
||||
|
||||
/* reorder corners if necessary... */
|
||||
if (box->high.x < box->low.x)
|
||||
@ -1058,10 +1058,10 @@ path_in(char *str)
|
||||
int depth = 0;
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(ABORT, "Bad (null) path external representation");
|
||||
elog(ERROR, "Bad (null) path external representation");
|
||||
|
||||
if ((npts = pair_count(str, ',')) <= 0)
|
||||
elog(ABORT, "Bad path external representation '%s'", str);
|
||||
elog(ERROR, "Bad path external representation '%s'", str);
|
||||
|
||||
s = str;
|
||||
while (isspace(*s))
|
||||
@ -1082,7 +1082,7 @@ path_in(char *str)
|
||||
|
||||
if ((!path_decode(TRUE, npts, s, &isopen, &s, &(path->p[0])))
|
||||
&& (!((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);
|
||||
|
||||
@ -1367,10 +1367,10 @@ point_in(char *str)
|
||||
char *s;
|
||||
|
||||
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))
|
||||
elog(ABORT, "Bad point external representation '%s'", str);
|
||||
elog(ERROR, "Bad point external representation '%s'", str);
|
||||
|
||||
point = PALLOCTYPE(Point);
|
||||
|
||||
@ -1549,13 +1549,13 @@ lseg_in(char *str)
|
||||
char *s;
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(ABORT, " Bad (null) lseg external representation", NULL);
|
||||
elog(ERROR, " Bad (null) lseg external representation", NULL);
|
||||
|
||||
lseg = PALLOCTYPE(LSEG);
|
||||
|
||||
if ((!path_decode(TRUE, 2, str, &isopen, &s, &(lseg->p[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]);
|
||||
|
||||
@ -2037,7 +2037,7 @@ dist_cpoly(CIRCLE *circle, POLYGON *poly)
|
||||
LSEG seg;
|
||||
|
||||
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))
|
||||
{
|
||||
@ -2242,7 +2242,7 @@ Point *
|
||||
close_pb(Point *pt, BOX *box)
|
||||
{
|
||||
/* think about this one for a while */
|
||||
elog(ABORT, "close_pb not implemented", NULL);
|
||||
elog(ERROR, "close_pb not implemented", NULL);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@ -2273,7 +2273,7 @@ Point *
|
||||
close_sb(LSEG *lseg, BOX *box)
|
||||
{
|
||||
/* think about this one for a while */
|
||||
elog(ABORT, "close_sb not implemented", NULL);
|
||||
elog(ERROR, "close_sb not implemented", NULL);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@ -2282,7 +2282,7 @@ Point *
|
||||
close_lb(LINE *line, BOX *box)
|
||||
{
|
||||
/* think about this one for a while */
|
||||
elog(ABORT, "close_lb not implemented", NULL);
|
||||
elog(ERROR, "close_lb not implemented", NULL);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@ -2531,7 +2531,7 @@ make_bound_box(POLYGON *poly)
|
||||
}
|
||||
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)
|
||||
char *s;
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(ABORT, " Bad (null) polygon external representation");
|
||||
elog(ERROR, " Bad (null) polygon external representation");
|
||||
|
||||
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);
|
||||
poly = PALLOC(size);
|
||||
@ -2567,7 +2567,7 @@ poly_in(char *str)
|
||||
|
||||
if ((!path_decode(FALSE, npts, str, &isopen, &s, &(poly->p[0])))
|
||||
|| (*s != '\0'))
|
||||
elog(ABORT, "Bad polygon external representation '%s'", str);
|
||||
elog(ERROR, "Bad polygon external representation '%s'", str);
|
||||
|
||||
make_bound_box(poly);
|
||||
|
||||
@ -2870,7 +2870,7 @@ point_div(Point *p1, Point *p2)
|
||||
div = (p2->x * p2->x) + (p2->y * p2->y);
|
||||
|
||||
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->y = ((p2->x * p1->y) - (p2->y * p1->x)) / div;
|
||||
@ -3139,7 +3139,7 @@ path_center(PATH *path)
|
||||
if (!PointerIsValid(path))
|
||||
return (NULL);
|
||||
|
||||
elog(ABORT, "path_center not implemented", NULL);
|
||||
elog(ERROR, "path_center not implemented", NULL);
|
||||
|
||||
result = PALLOCTYPE(Point);
|
||||
result = NULL;
|
||||
@ -3158,7 +3158,7 @@ path_poly(PATH *path)
|
||||
return (NULL);
|
||||
|
||||
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);
|
||||
poly = PALLOC(size);
|
||||
@ -3197,7 +3197,7 @@ upgradepath(PATH *path)
|
||||
return (NULL);
|
||||
|
||||
if (!isoldpath(path))
|
||||
elog(ABORT, "upgradepath: path already upgraded?", NULL);
|
||||
elog(ERROR, "upgradepath: path already upgraded?", NULL);
|
||||
|
||||
npts = (path->npts - 1);
|
||||
size = offsetof(PATH, p[0]) +(sizeof(path->p[0]) * npts);
|
||||
@ -3463,7 +3463,7 @@ circle_in(char *str)
|
||||
int depth = 0;
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(ABORT, " Bad (null) circle external representation", NULL);
|
||||
elog(ERROR, " Bad (null) circle external representation", NULL);
|
||||
|
||||
circle = PALLOCTYPE(CIRCLE);
|
||||
|
||||
@ -3483,7 +3483,7 @@ circle_in(char *str)
|
||||
}
|
||||
|
||||
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)
|
||||
s++;
|
||||
@ -3491,7 +3491,7 @@ circle_in(char *str)
|
||||
s++;
|
||||
|
||||
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)
|
||||
{
|
||||
@ -3505,12 +3505,12 @@ circle_in(char *str)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ABORT, "Bad circle external representation '%s'", str);
|
||||
elog(ERROR, "Bad circle external representation '%s'", str);
|
||||
}
|
||||
}
|
||||
|
||||
if (*s != '\0')
|
||||
elog(ABORT, "Bad circle external representation '%s'", str);
|
||||
elog(ERROR, "Bad circle external representation '%s'", str);
|
||||
|
||||
return (circle);
|
||||
} /* circle_in() */
|
||||
@ -3532,13 +3532,13 @@ circle_out(CIRCLE *circle)
|
||||
*cp++ = LDELIM_C;
|
||||
*cp++ = LDELIM;
|
||||
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++ = RDELIM;
|
||||
*cp++ = DELIM;
|
||||
if (!single_encode(circle->radius, cp))
|
||||
elog(ABORT, "Unable to format circle", NULL);
|
||||
elog(ERROR, "Unable to format circle", NULL);
|
||||
|
||||
cp += strlen(cp);
|
||||
*cp++ = RDELIM_C;
|
||||
@ -4000,7 +4000,7 @@ circle_poly(int npts, CIRCLE *circle)
|
||||
return (NULL);
|
||||
|
||||
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);
|
||||
poly = PALLOC(size);
|
||||
@ -4036,7 +4036,7 @@ poly_circle(POLYGON *poly)
|
||||
return (NULL);
|
||||
|
||||
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);
|
||||
|
||||
@ -4059,7 +4059,7 @@ poly_circle(POLYGON *poly)
|
||||
circle->radius /= poly->npts;
|
||||
|
||||
if (FPzero(circle->radius))
|
||||
elog(ABORT, "Unable to convert polygon to circle", NULL);
|
||||
elog(ERROR, "Unable to convert polygon to circle", NULL);
|
||||
|
||||
return (circle);
|
||||
} /* poly_circle() */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
i4toi2(int32 arg1)
|
||||
{
|
||||
if (arg1 < SHRT_MIN)
|
||||
elog(ABORT, "i4toi2: '%d' causes int2 underflow", arg1);
|
||||
elog(ERROR, "i4toi2: '%d' causes int2 underflow", arg1);
|
||||
if (arg1 > SHRT_MAX)
|
||||
elog(ABORT, "i4toi2: '%d' causes int2 overflow", arg1);
|
||||
elog(ERROR, "i4toi2: '%d' causes int2 overflow", arg1);
|
||||
|
||||
return ((int16) arg1);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
ftype[MAXDATEFIELDS];
|
||||
|
||||
if (!PointerIsValid(str))
|
||||
elog(ABORT, "Bad (null) abstime external representation", NULL);
|
||||
elog(ERROR, "Bad (null) abstime external representation", NULL);
|
||||
|
||||
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)
|
||||
|| (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
|
||||
printf("nabstimein- %d fields are type %d (DTK_DATE=%d)\n", nf, dtype, DTK_DATE);
|
||||
@ -296,7 +296,7 @@ nabstimein(char *str)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(ABORT, "Bad abstime (internal coding error) '%s'", str);
|
||||
elog(ERROR, "Bad abstime (internal coding error) '%s'", str);
|
||||
result = INVALID_ABSTIME;
|
||||
break;
|
||||
};
|
||||
@ -547,7 +547,7 @@ abstime_datetime(AbsoluteTime abstime)
|
||||
DateTime *result;
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
errno = 0;
|
||||
l = strtol(s, &badp, 10);
|
||||
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))
|
||||
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)
|
||||
{
|
||||
@ -70,12 +70,12 @@ pg_atoi(char *s, int size, int c)
|
||||
if (l < INT_MIN)
|
||||
{
|
||||
errno = ERANGE;
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
|
||||
}
|
||||
if (l > INT_MAX)
|
||||
{
|
||||
errno = ERANGE;
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
|
||||
}
|
||||
#endif /* HAS_LONG_LONG */
|
||||
break;
|
||||
@ -83,28 +83,28 @@ pg_atoi(char *s, int size, int c)
|
||||
if (l < SHRT_MIN)
|
||||
{
|
||||
errno = ERANGE;
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
|
||||
}
|
||||
if (l > SHRT_MAX)
|
||||
{
|
||||
errno = ERANGE;
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
|
||||
}
|
||||
break;
|
||||
case sizeof(int8):
|
||||
if (l < SCHAR_MIN)
|
||||
{
|
||||
errno = ERANGE;
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
|
||||
}
|
||||
if (l > SCHAR_MAX)
|
||||
{
|
||||
errno = ERANGE;
|
||||
elog(ABORT, "pg_atoi: error reading \"%s\": %m", s);
|
||||
elog(ERROR, "pg_atoi: error reading \"%s\": %m", s);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
elog(ABORT, "pg_atoi: invalid result size: %d", size);
|
||||
elog(ERROR, "pg_atoi: invalid result size: %d", size);
|
||||
}
|
||||
return ((int32) l);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
StrNCpy(oc->name.data, inptr, NAMEDATALEN);
|
||||
}
|
||||
else
|
||||
elog(ABORT, "Bad input data for type oidname");
|
||||
elog(ERROR, "Bad input data for type oidname");
|
||||
|
||||
return oc;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* 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)
|
||||
rev[oldest].cre_s = (char *) NULL;
|
||||
pg95_regerror(regcomp_result, &rev[oldest].cre_re, errMsg,
|
||||
sizeof(errMsg));
|
||||
elog(ABORT, "regcomp failed with error %s", errMsg);
|
||||
elog(ERROR, "regcomp failed with error %s", errMsg);
|
||||
}
|
||||
|
||||
/* not reached */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
proc = heap_openr(ProcedureRelationName);
|
||||
if (!RelationIsValid(proc))
|
||||
{
|
||||
elog(ABORT, "regprocin: could not open %s",
|
||||
elog(ERROR, "regprocin: could not open %s",
|
||||
ProcedureRelationName);
|
||||
return (0);
|
||||
}
|
||||
@ -59,7 +59,7 @@ regprocin(char *proname)
|
||||
if (!HeapScanIsValid(procscan))
|
||||
{
|
||||
heap_close(proc);
|
||||
elog(ABORT, "regprocin: could not being scan of %s",
|
||||
elog(ERROR, "regprocin: could not being scan of %s",
|
||||
ProcedureRelationName);
|
||||
return (0);
|
||||
}
|
||||
@ -104,7 +104,7 @@ regprocout(RegProcedure proid)
|
||||
proc = heap_openr(ProcedureRelationName);
|
||||
if (!RelationIsValid(proc))
|
||||
{
|
||||
elog(ABORT, "regprocout: could not open %s",
|
||||
elog(ERROR, "regprocout: could not open %s",
|
||||
ProcedureRelationName);
|
||||
return (0);
|
||||
}
|
||||
@ -118,7 +118,7 @@ regprocout(RegProcedure proid)
|
||||
if (!HeapScanIsValid(procscan))
|
||||
{
|
||||
heap_close(proc);
|
||||
elog(ABORT, "regprocout: could not being scan of %s",
|
||||
elog(ERROR, "regprocout: could not being scan of %s",
|
||||
ProcedureRelationName);
|
||||
return (0);
|
||||
}
|
||||
@ -176,7 +176,7 @@ oid8types(Oid (*oidArray)[])
|
||||
type = heap_openr(TypeRelationName);
|
||||
if (!RelationIsValid(type))
|
||||
{
|
||||
elog(ABORT, "int8typeout: could not open %s",
|
||||
elog(ERROR, "int8typeout: could not open %s",
|
||||
TypeRelationName);
|
||||
return (0);
|
||||
}
|
||||
@ -196,7 +196,7 @@ oid8types(Oid (*oidArray)[])
|
||||
if (!HeapScanIsValid(typescan))
|
||||
{
|
||||
heap_close(type);
|
||||
elog(ABORT, "int8typeout: could not being scan of %s",
|
||||
elog(ERROR, "int8typeout: could not being scan of %s",
|
||||
TypeRelationName);
|
||||
return (0);
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
0, 0);
|
||||
if (!HeapTupleIsValid(atp))
|
||||
{
|
||||
elog(ABORT, "getattdisbursion: no attribute tuple %d %d",
|
||||
elog(ERROR, "getattdisbursion: no attribute tuple %d %d",
|
||||
relid, attnum);
|
||||
return (0);
|
||||
}
|
||||
@ -304,7 +304,7 @@ getattdisbursion(Oid relid, AttrNumber attnum)
|
||||
*/
|
||||
if (!HeapTupleIsValid(atp))
|
||||
{
|
||||
elog(ABORT, "getattdisbursion: no relation tuple %d", relid);
|
||||
elog(ERROR, "getattdisbursion: no relation tuple %d", relid);
|
||||
return (0);
|
||||
}
|
||||
ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples;
|
||||
@ -357,7 +357,7 @@ gethilokey(Oid relid,
|
||||
*low = "n";
|
||||
|
||||
/*
|
||||
* XXX elog(ABORT, "gethilokey: statistic tuple not
|
||||
* XXX elog(ERROR, "gethilokey: statistic tuple not
|
||||
* found");
|
||||
*/
|
||||
return;
|
||||
@ -417,9 +417,9 @@ btreesel(Oid operatorObjectId,
|
||||
}
|
||||
|
||||
if (!PointerIsValid(result))
|
||||
elog(ABORT, "Btree Selectivity: bad pointer");
|
||||
elog(ERROR, "Btree Selectivity: bad pointer");
|
||||
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);
|
||||
}
|
||||
@ -465,7 +465,7 @@ btreenpage(Oid operatorObjectId,
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(atp))
|
||||
{
|
||||
elog(ABORT, "btreenpage: no index tuple %d", indexrelid);
|
||||
elog(ERROR, "btreenpage: no index tuple %d", indexrelid);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -503,7 +503,7 @@ hashsel(Oid operatorObjectId,
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(atp))
|
||||
{
|
||||
elog(ABORT, "hashsel: no index tuple %d", indexrelid);
|
||||
elog(ERROR, "hashsel: no index tuple %d", indexrelid);
|
||||
return (0);
|
||||
}
|
||||
ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples;
|
||||
@ -530,9 +530,9 @@ hashsel(Oid operatorObjectId,
|
||||
}
|
||||
|
||||
if (!PointerIsValid(result))
|
||||
elog(ABORT, "Hash Table Selectivity: bad pointer");
|
||||
elog(ERROR, "Hash Table Selectivity: bad pointer");
|
||||
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);
|
||||
|
||||
@ -559,7 +559,7 @@ hashnpage(Oid operatorObjectId,
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(atp))
|
||||
{
|
||||
elog(ABORT, "hashsel: no index tuple %d", indexrelid);
|
||||
elog(ERROR, "hashsel: no index tuple %d", indexrelid);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
ObjectIdGetDatum(setoid),
|
||||
0, 0, 0);
|
||||
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
|
||||
@ -145,7 +145,7 @@ SetDefine(char *querystr, char *typename)
|
||||
setoid = newtup->t_oid;
|
||||
}
|
||||
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);
|
||||
|
||||
if (RelationGetRelationTupleForm(procrel)->relhasindex)
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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)
|
||||
}
|
||||
|
||||
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);
|
||||
*(int32 *) result = typlen;
|
||||
@ -145,7 +145,7 @@ varcharin(char *s, int dummy, int typlen)
|
||||
}
|
||||
|
||||
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);
|
||||
*(int32 *) result = typlen;
|
||||
@ -199,7 +199,7 @@ int32
|
||||
bpcharlen(char *arg)
|
||||
{
|
||||
if (!PointerIsValid(arg))
|
||||
elog(ABORT, "Bad (null) char() external representation", NULL);
|
||||
elog(ERROR, "Bad (null) char() external representation", NULL);
|
||||
|
||||
return(bcTruelen(arg));
|
||||
} /* bpcharlen() */
|
||||
@ -355,7 +355,7 @@ int32
|
||||
varcharlen(char *arg)
|
||||
{
|
||||
if (!PointerIsValid(arg))
|
||||
elog(ABORT, "Bad (null) varchar() external representation", NULL);
|
||||
elog(ERROR, "Bad (null) varchar() external representation", NULL);
|
||||
|
||||
return(vcTruelen(arg));
|
||||
} /* vclen() */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* 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 @@
|
||||
*
|
||||
* Non-printable characters must be passed as '\nnn' (octal) and are
|
||||
* converted to internal form. '\' must be passed as '\\'.
|
||||
* elog(ABORT, ...) if bad form.
|
||||
* elog(ERROR, ...) if bad form.
|
||||
*
|
||||
* BUGS:
|
||||
* The input is scaned twice.
|
||||
@ -46,7 +46,7 @@ byteain(char *inputText)
|
||||
text *result;
|
||||
|
||||
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++)
|
||||
if (*tp++ == '\\')
|
||||
@ -56,7 +56,7 @@ byteain(char *inputText)
|
||||
else if (!isdigit(*tp++) ||
|
||||
!isdigit(*tp++) ||
|
||||
!isdigit(*tp++))
|
||||
elog(ABORT, "Bad input string for type bytea");
|
||||
elog(ERROR, "Bad input string for type bytea");
|
||||
}
|
||||
tp = inputText;
|
||||
byte += VARHDRSZ;
|
||||
@ -195,7 +195,7 @@ int32
|
||||
textlen(text *t)
|
||||
{
|
||||
if (!PointerIsValid(t))
|
||||
elog(ABORT,"Null input to textlen");
|
||||
elog(ERROR,"Null input to textlen");
|
||||
|
||||
return (VARSIZE(t) - VARHDRSZ);
|
||||
} /* textlen() */
|
||||
@ -537,7 +537,7 @@ byteaGetByte(text *v, int32 n)
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -595,7 +595,7 @@ byteaSetByte(text *v, int32 n, int32 newByte)
|
||||
|
||||
if (n >= len)
|
||||
{
|
||||
elog(ABORT,
|
||||
elog(ERROR,
|
||||
"byteaSetByte: index (=%d) out of range [0..%d]",
|
||||
n, len - 1);
|
||||
}
|
||||
@ -606,7 +606,7 @@ byteaSetByte(text *v, int32 n, int32 newByte)
|
||||
res = (text *) palloc(VARSIZE(v));
|
||||
if (res == NULL)
|
||||
{
|
||||
elog(ABORT, "byteaSetByte: Out of memory (%d bytes requested)",
|
||||
elog(ERROR, "byteaSetByte: Out of memory (%d bytes requested)",
|
||||
VARSIZE(v));
|
||||
}
|
||||
memmove((char *) res, (char *) v, VARSIZE(v));
|
||||
@ -641,7 +641,7 @@ byteaSetBit(text *v, int32 n, int32 newBit)
|
||||
*/
|
||||
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");
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user