Fix a wrong errmsg in AlterRole()

cca5507 <cca5507@qq.com>

From: cca5507 <cca5507@qq.com>
To: pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-01-08T08:43:32Z
Lists: pgsql-hackers

Attachments

Hi,


```
postgres=# create group g1;
CREATE ROLE
postgres=# create role r1 in group g1;
CREATE ROLE
postgres=# set session authorization r1;
SET
postgres=&gt; alter group g1 drop user r1;
ERROR:&nbsp; permission denied to alter role
DETAIL:&nbsp; Only roles with the ADMIN option on role "g1" may add members.
```


The errmsg is "add members", but we are doing a drop.


Here is a small patch to fix it.


--
Regards,
ChangAo Chen

Commits

  1. Fix an ALTER GROUP ... DROP USER error message.

  2. Improve several permission-related error messages.

  3. Make role grant system more consistent with other privileges.