mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Change some ABORTS to ERROR. Add line number when COPY Failure.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user