diff options
author | Bruce Momjian <bruce@momjian.us> | 1998-01-05 03:35:55 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1998-01-05 03:35:55 +0000 |
commit | 0d9fc5afd6eda651d2ef0a4776e08f02d32a96de (patch) | |
tree | c9f5ac32c61569ba21fc66cf28d383e3972d2199 /src/backend/commands/dbcommands.c | |
parent | 0af9137f14f46a0affba6e57343a76a1e832172f (diff) | |
download | postgresql-0d9fc5afd6eda651d2ef0a4776e08f02d32a96de.tar.gz postgresql-0d9fc5afd6eda651d2ef0a4776e08f02d32a96de.zip |
Change elog(WARN) to elog(ERROR) and elog(ABORT).
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r-- | src/backend/commands/dbcommands.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index dc685022b20..83259a8e208 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.3 1997/12/11 17:36:04 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.4 1998/01/05 03:30:44 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -75,12 +75,12 @@ createdb(char *dbname, char *dbpath) lp = ExpandDatabasePath(loc); if (lp == NULL) - elog(WARN,"Unable to locate path '%s'" + elog(ABORT,"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(WARN,"Unable to create database directory %s",lp); + elog(ABORT,"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(WARN,"Unable to locate path '%s'" + elog(ABORT,"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(WARN, "%s: cannot begin scan of pg_database.", command); + elog(ABORT, "%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(WARN, ...)s, which will abort the xact. As a side effect, the + * elog(ABORT, ...)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(WARN, "user \"%s\" is not allowed to create/destroy databases", + elog(ABORT, "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(WARN, "%s cannot be executed on the template database.", command); + elog(ABORT, "%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(WARN, "%s cannot be executed on an open database", command); + elog(ABORT, "%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(WARN, "createdb: database %s already exists.", dbname); + elog(ABORT, "createdb: database %s already exists.", dbname); } else if (!dbfound && !strcmp(command, "destroydb")) { - elog(WARN, "destroydb: database %s does not exist.", dbname); + elog(ABORT, "destroydb: database %s does not exist.", dbname); } else if (dbfound && !strcmp(command, "destroydb") && dbowner != *userIdP && use_super == false) { - elog(WARN, "%s: database %s is not owned by you.", command, dbname); + elog(ABORT, "%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(WARN, "can't kill vacuum daemon (pid %d) on %s", + elog(ABORT, "can't kill vacuum daemon (pid %d) on %s", pid, dbname); } } |