From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: improving user.c error messages
Date: Thu, 26 Jan 2023 14:02:53 -0800
Message-ID: <20230126220253.GA1759865@nathanxps13> (raw)
In-Reply-To: <3165700.1674763663@sss.pgh.pa.us>
References: <20230126002251.GA1506128@nathanxps13>
<20230126090739.nspznasnb4x3v5l4@alvherre.pgsql>
<20230126191358.GA1660026@nathanxps13>
<CA+TgmoYZcZ-PUp7muZEG20Jz4BtgUSngA3p7k=Nk-_8FayO5xQ@mail.gmail.com>
<20230126195929.GB1702315@nathanxps13>
<3165700.1674763663@sss.pgh.pa.us>
On Thu, Jan 26, 2023 at 03:07:43PM -0500, Tom Lane wrote:
> Nathan Bossart <nathandbossart@gmail.com> writes:
>> On Thu, Jan 26, 2023 at 02:42:05PM -0500, Robert Haas wrote:
>>> Basically my question is whether having one error message for all of
>>> those cases is good enough, or whether we should be trying harder.
>
> I think the password case needs to be kept separate, because the
> conditions for it are different (specifically the exception that
> you can alter your own password). Lumping the rest together
> seems OK to me.
Hm. In v2, the error message for both cases is the same:
ERROR: permission denied to alter role
DETAIL: You must have CREATEROLE privilege and ADMIN OPTION on role "regress_priv_user2".
We could add "to change its attributes" and "to change its password" to
separate the two, but I'm not sure that adds much. ISTM the current error
message for ALTER ROLE PASSWORD implies that you can change your own
password, and that's lost with my patch. Perhaps we should add an
errhint() with that information instead. WDYT?
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, alvherre@alvh.no-ip.org
Subject: Re: improving user.c error messages
In-Reply-To: <20230126220253.GA1759865@nathanxps13>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox