From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Nathan Bossart <nathandbossart@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: improving user.c error messages
Date: Mon, 20 Feb 2023 08:54:48 +0100
Message-ID: <e1bbef97-ed13-f6ad-8d21-b2ebc251394b@enterprisedb.com> (raw)
In-Reply-To: <20230207201009.GA450353@nathanxps13>
References: <20230127000936.GA1998073@nathanxps13>
<20230127183119.e5jtyh4g2md57ctb@alvherre.pgsql>
<20230127231507.GA2221340@nathanxps13>
<20230207201009.GA450353@nathanxps13>
On 07.02.23 21:10, Nathan Bossart wrote:
>> ERROR: permission denied to use replication slots
>> DETAIL: You must have REPLICATION privilege.
>>
>> adding the operation to the end seems less awkward (i.e., "You must have
>> REPLICATION privilege to use replication slots."). I don't think there's
>> any information lost by omitting the action in the DETAIL, so perhaps this
>> is just a stylistic choice. I think I'm inclined to add the action to the
>> DETAIL whenever it doesn't make the message lengthy and awkward, and leave
>> it out otherwise. Thoughts?
> Here is a new patch set with this change and some other light editing.
I'm concerned about the loose use of "privilege" here. A privilege is
something I can grant. So if someone doesn't have the "REPLICATION
privilege", as in the above example, I would expect to be able to do
"GRANT REPLICATION TO someuser". Since that is not what is happening,
we should use some other term. The documentation around CREATE USER
uses the terms "attribute" and "option" (and also "privilege") for these
things.
Similarly -- this is an existing issue but we might as well look at it
-- in something like
must be superuser or a role with privileges of the
pg_write_server_files role
the phrase "a role with the privileges of that other role" seems
ambiguous. Doesn't it really mean you must be a member of that role?
I also feel that in sentences like
"You must have %s privilege to create roles."
a "the" is missing.
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: peter.eisentraut@enterprisedb.com, nathandbossart@gmail.com, alvherre@alvh.no-ip.org, tgl@sss.pgh.pa.us, robertmhaas@gmail.com
Subject: Re: improving user.c error messages
In-Reply-To: <e1bbef97-ed13-f6ad-8d21-b2ebc251394b@enterprisedb.com>
* 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