Re: Fix a wrong errmsg in AlterRole()

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: cca5507 <cca5507@qq.com>
Cc: pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-01-08T15:29:12Z
Lists: pgsql-hackers
"=?ISO-8859-1?B?Y2NhNTUwNw==?=" <cca5507@qq.com> writes:
> postgres=&gt; alter group g1 drop user r1;
> ERROR:  permission denied to alter role
> DETAIL:  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.

Hmm.  Seems simpler to just make the errdetail say "... may add or
drop members."

			regards, tom lane



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.