v2-0001-Fix-a-wrong-errdetail-in-AlterRole.patch

application/octet-stream

Filename: v2-0001-Fix-a-wrong-errdetail-in-AlterRole.patch
Type: application/octet-stream
Part: 0
Message: Re: Fix a wrong errmsg in AlterRole()

Patch

Format: format-patch
Series: patch v2-0001
Subject: Fix a wrong errdetail in AlterRole().
File+
src/backend/commands/user.c 2 2
From b6cc5cf86bcf17f65e058a93c435ed95dfa743cf Mon Sep 17 00:00:00 2001
From: ChangAo Chen <cca5507@qq.com>
Date: Thu, 9 Jan 2025 10:05:08 +0800
Subject: [PATCH v2] Fix a wrong errdetail in AlterRole().

---
 src/backend/commands/user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index 266635d5e2..c74a9768fc 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -817,12 +817,12 @@ AlterRole(ParseState *pstate, AlterRoleStmt *stmt)
 							   "BYPASSRLS", "BYPASSRLS")));
 	}
 
-	/* To add members to a role, you need ADMIN OPTION. */
+	/* To add/drop members to/from a role, you need ADMIN OPTION. */
 	if (drolemembers && !is_admin_of_role(currentUserId, roleid))
 		ereport(ERROR,
 				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
 				 errmsg("permission denied to alter role"),
-				 errdetail("Only roles with the %s option on role \"%s\" may add members.",
+				 errdetail("Only roles with the %s option on role \"%s\" may add or drop members.",
 						   "ADMIN", rolename)));
 
 	/* Convert validuntil to internal form */
-- 
2.34.1