aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/user.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-08-01 00:15:26 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-08-01 00:15:26 +0000
commitc4cf7fb8146d89293c6667d1fcc295c45da52713 (patch)
tree80526e9728d4a325b79e7d6a76551204605673fa /src/backend/commands/user.c
parenta063d4b3ec5d74dad4cf65cdd1dd90e88c968d44 (diff)
downloadpostgresql-c4cf7fb8146d89293c6667d1fcc295c45da52713.tar.gz
postgresql-c4cf7fb8146d89293c6667d1fcc295c45da52713.zip
Adjust 'permission denied' messages to be more useful and consistent.
Diffstat (limited to 'src/backend/commands/user.c')
-rw-r--r--src/backend/commands/user.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index 7f85f0581b6..36416a5232f 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.121 2003/07/28 00:09:14 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.122 2003/08/01 00:15:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -601,7 +601,7 @@ CreateUser(CreateUserStmt *stmt)
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("permission denied")));
+ errmsg("must be superuser to create users")));
if (strcmp(stmt->user, "public") == 0)
ereport(ERROR,
@@ -1023,7 +1023,7 @@ DropUser(DropUserStmt *stmt)
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("permission denied")));
+ errmsg("must be superuser to drop users")));
/*
* Scan the pg_shadow relation to find the usesysid of the user to be
@@ -1194,7 +1194,7 @@ RenameUser(const char *oldname, const char *newname)
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("permission denied")));
+ errmsg("must be superuser to rename users")));
/* rename */
namestrcpy(&(((Form_pg_shadow) GETSTRUCT(tup))->usename), newname);
@@ -1307,7 +1307,7 @@ CreateGroup(CreateGroupStmt *stmt)
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("permission denied")));
+ errmsg("must be superuser to create groups")));
if (strcmp(stmt->name, "public") == 0)
ereport(ERROR,
@@ -1434,7 +1434,7 @@ AlterGroup(AlterGroupStmt *stmt, const char *tag)
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("permission denied")));
+ errmsg("must be superuser to alter groups")));
/*
* Secure exclusive lock to protect our update of the flat group file.
@@ -1678,7 +1678,7 @@ DropGroup(DropGroupStmt *stmt)
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("permission denied")));
+ errmsg("must be superuser to drop groups")));
/*
* Secure exclusive lock to protect our update of the flat group file.
@@ -1742,7 +1742,7 @@ RenameGroup(const char *oldname, const char *newname)
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("permission denied")));
+ errmsg("must be superuser to rename groups")));
/* rename */
namestrcpy(&(((Form_pg_group) GETSTRUCT(tup))->groname), newname);