pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: 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: Thu, 9 Mar 2023 10:55:54 +0100
Message-ID: <abf97f0d-79b4-217c-2ea8-d081648d9a6d@enterprisedb.com> (raw)
In-Reply-To: <20230220225852.GA3940888@nathanxps13>
References: <20230127000936.GA1998073@nathanxps13>
	<20230127183119.e5jtyh4g2md57ctb@alvherre.pgsql>
	<20230127231507.GA2221340@nathanxps13>
	<20230207201009.GA450353@nathanxps13>
	<e1bbef97-ed13-f6ad-8d21-b2ebc251394b@enterprisedb.com>
	<20230220190210.GA3481922@nathanxps13>
	<20230220225852.GA3940888@nathanxps13>

On 20.02.23 23:58, Nathan Bossart wrote:
>>> 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?
>>
>> Membership alone is not sufficient.  You must also inherit the privileges
>> of the role via the INHERIT option.  I thought about making this something
>> like
>>
>> 	must have the INHERIT option on role %s
>>
>> but I'm not sure that's accurate either.  That wording makes it sound lіke
>> you need to be granted membership to the role directly WITH INHERIT OPTION,
>> but what you really need is membership, direct or indirect, with an INHERIT
>> chain up to the role in question.  However, it looks like "must have the
>> ADMIN option on role %s" is used to mean something similar, so perhaps I am
>> overthinking it.
> 
> For now, I've reworded these as "must inherit privileges of".

I don't have a good mental model of all this role inheritance, 
personally, but I fear that this change makes the messages more jargony 
and less clear.  Maybe the original wording was good enough.

A couple of other thoughts:

"admin option" is sort of a natural language term, I think, so we don't 
need to parametrize it as "%s option".  Also, there are no other 
"options" in this context, I think.

A general thought: It seems we currently don't have any error messages 
that address the user like "You must do this".  Do we want to go there? 
Should we try for a more impersonal wording like

"You must have the %s attribute to create roles."

"Current user must have the %s attribute to create roles."

"%s attribute is required to create roles."

By the way, I'm not sure what the separation between 0001 and 0002 is 
supposed to be.






view thread (32+ messages)  latest in thread

Message-ID: <abf97f0d-79b4-217c-2ea8-d081648d9a6d@enterprisedb.com>
Permalink:  ../abf97f0d-79b4-217c-2ea8-d081648d9a6d@enterprisedb.com/
Also on:    postgresql.org/message-id/abf97f0d-79b4-217c-2ea8-d081648d9a6d@enterprisedb.com

 · 

reply

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: <abf97f0d-79b4-217c-2ea8-d081648d9a6d@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