Re: Fix a wrong errmsg in AlterRole()
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: cca5507 <cca5507@qq.com>, pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-01-08T17:39:31Z
Lists: pgsql-hackers
On Wed, Jan 08, 2025 at 10:29:12AM -0500, Tom Lane wrote: > "=?ISO-8859-1?B?Y2NhNTUwNw==?=" <cca5507@qq.com> writes: >> postgres=> 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." +1. It looks like this goes back to commit ce6b672 (v16). The error message was changed in commit de4d456, which is also a v16 change, so fortunately this has a good chance of back-patching cleanly. -- nathan
Commits
-
Fix an ALTER GROUP ... DROP USER error message.
- c559f61b5471 17.3 landed
- 39e3bcae4486 18.0 landed
- 0b5927dfac26 16.7 landed
-
Improve several permission-related error messages.
- de4d456b406b 16.0 cited
-
Make role grant system more consistent with other privileges.
- ce6b672e4455 16.0 cited