diff options
author | Peter Eisentraut | 2023-06-29 07:14:55 +0000 |
---|---|---|
committer | Peter Eisentraut | 2023-06-29 07:14:55 +0000 |
commit | 39a584dc90324b7323424d7450df8586ab2a0ca1 (patch) | |
tree | a0b45bcd1bd4c6b769b20be718469b467da01a1a /src/backend | |
parent | dda9f8e7bc2e1e5cc6c77b86ce54786e9df8e0c6 (diff) |
Error message wording improvements
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/commands/user.c | 20 | ||||
-rw-r--r-- | src/backend/storage/ipc/signalfuncs.c | 4 | ||||
-rw-r--r-- | src/backend/utils/init/postinit.c | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index d63d3c58ca8..6b42d4fc34a 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -323,25 +323,25 @@ CreateRole(ParseState *pstate, CreateRoleStmt *stmt) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("permission denied to create role"), - errdetail("Only roles with the %s attribute may create roles with %s.", + errdetail("Only roles with the %s attribute may create roles with the %s attribute.", "SUPERUSER", "SUPERUSER"))); if (createdb && !have_createdb_privilege()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("permission denied to create role"), - errdetail("Only roles with the %s attribute may create roles with %s.", + errdetail("Only roles with the %s attribute may create roles with the %s attribute.", "CREATEDB", "CREATEDB"))); if (isreplication && !has_rolreplication(currentUserId)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("permission denied to create role"), - errdetail("Only roles with the %s attribute may create roles with %s.", + errdetail("Only roles with the %s attribute may create roles with the %s attribute.", "REPLICATION", "REPLICATION"))); if (bypassrls && !has_bypassrls_privilege(currentUserId)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("permission denied to create role"), - errdetail("Only roles with the %s attribute may create roles with %s.", + errdetail("Only roles with the %s attribute may create roles with the %s attribute.", "BYPASSRLS", "BYPASSRLS"))); } @@ -758,7 +758,7 @@ AlterRole(ParseState *pstate, AlterRoleStmt *stmt) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("permission denied to alter role"), - errdetail("Only roles with the %s attribute may alter roles with %s.", + errdetail("Only roles with the %s attribute may alter roles with the %s attribute.", "SUPERUSER", "SUPERUSER"))); if (!superuser() && dissuper) ereport(ERROR, @@ -1031,7 +1031,7 @@ AlterRoleSet(AlterRoleSetStmt *stmt) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("permission denied to alter role"), - errdetail("Only roles with the %s attribute may alter roles with %s.", + errdetail("Only roles with the %s attribute may alter roles with the %s attribute.", "SUPERUSER", "SUPERUSER"))); } else @@ -1171,7 +1171,7 @@ DropRole(DropRoleStmt *stmt) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("permission denied to drop role"), - errdetail("Only roles with the %s attribute may drop roles with %s.", + errdetail("Only roles with the %s attribute may drop roles with the %s attribute.", "SUPERUSER", "SUPERUSER"))); if (!is_admin_of_role(GetUserId(), roleid)) ereport(ERROR, @@ -1426,7 +1426,7 @@ RenameRole(const char *oldname, const char *newname) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("permission denied to rename role"), - errdetail("Only roles with the %s attribute may rename roles with %s.", + errdetail("Only roles with the %s attribute may rename roles with the %s attribute.", "SUPERUSER", "SUPERUSER"))); } else @@ -2141,14 +2141,14 @@ check_role_membership_authorization(Oid currentUserId, Oid roleid, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("permission denied to grant role \"%s\"", GetUserNameFromId(roleid, false)), - errdetail("Only roles with the %s attribute may grant roles with %s.", + errdetail("Only roles with the %s attribute may grant roles with the %s attribute.", "SUPERUSER", "SUPERUSER"))); else ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("permission denied to revoke role \"%s\"", GetUserNameFromId(roleid, false)), - errdetail("Only roles with the %s attribute may revoke roles with %s.", + errdetail("Only roles with the %s attribute may revoke roles with the %s attribute.", "SUPERUSER", "SUPERUSER"))); } } diff --git a/src/backend/storage/ipc/signalfuncs.c b/src/backend/storage/ipc/signalfuncs.c index eabb68a9e17..94ae553b946 100644 --- a/src/backend/storage/ipc/signalfuncs.c +++ b/src/backend/storage/ipc/signalfuncs.c @@ -122,7 +122,7 @@ pg_cancel_backend(PG_FUNCTION_ARGS) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("permission denied to cancel query"), - errdetail("Only roles with the %s attribute may cancel queries of roles with %s.", + errdetail("Only roles with the %s attribute may cancel queries of roles with the %s attribute.", "SUPERUSER", "SUPERUSER"))); if (r == SIGNAL_BACKEND_NOPERMISSION) @@ -228,7 +228,7 @@ pg_terminate_backend(PG_FUNCTION_ARGS) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("permission denied to terminate process"), - errdetail("Only roles with the %s attribute may terminate processes of roles with %s.", + errdetail("Only roles with the %s attribute may terminate processes of roles with the %s attribute.", "SUPERUSER", "SUPERUSER"))); if (r == SIGNAL_BACKEND_NOPERMISSION) diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 561bd13ed24..0f9b92b32eb 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -946,7 +946,7 @@ InitPostgres(const char *in_dbname, Oid dboid, if (nfree < SuperuserReservedConnections) ereport(FATAL, (errcode(ERRCODE_TOO_MANY_CONNECTIONS), - errmsg("remaining connection slots are reserved for roles with %s", + errmsg("remaining connection slots are reserved for roles with the %s attribute", "SUPERUSER"))); if (!has_privs_of_role(GetUserId(), ROLE_PG_USE_RESERVED_CONNECTIONS)) |