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