Re: Fix a wrong errmsg in AlterRole()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: cca5507 <cca5507(at)qq(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix a wrong errmsg in AlterRole()
Date: 2025-01-08 15:29:12
Message-ID: 1654750.1736350152@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"=?ISO-8859-1?B?Y2NhNTUwNw==?=" <cca5507(at)qq(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2025-01-08 15:38:58 Re: Separate GUC for replication origins
Previous Message jian he 2025-01-08 15:27:42 using PGOPTIONS in meson