Re: Usability fail with psql's \dp command - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: Usability fail with psql's \dp command
Date
Msg-id alpine.DEB.2.21.1807311438470.6919@lancre
Whole thread Raw
In response to Usability fail with psql's \dp command  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> One idea is to replace a null ACL value with the actual effective
> permissions, which we could get from the acldefault() function.
> However, acldefault() only exists since 9.2, and in any case
> I'm afraid that might be perceived as mostly clutter.

Here is an poc implementation of this which does not rely on 
"acldefault()". Cannot say I'm thrilled, but it is not too bad either. I 
worked around \ddp with a recursion.

Writing this piece code makes me realize once again the abysmal coverage 
of psql non-regression tests, where basically no \d* functions are tested. 
I think at least this part could be salvage from the patch.

Another benefit of expliciting the defaults is that the documentation can 
be made more straightforward: shown permissions means what you can see, 
which simplifies the description.

Another implementation approach could be to use acldefault() from 9.2, and 
just display (no privileges) and (default privileges) before, as suggested 
on the thread. This would probably help simplify the code.

I find that having "default privileges" written as not very helpful, 
because you have to remember them. Ok, it is all perms for the owner, but 
then there are some objects which also have some permissions to public, 
and do not memorize these exception. Also, some \d* (eg \dT \dD) do not 
display the owner.

I do not perceive as "clutter" the fact that a column advertising "Access 
privileges" provides the access privileges... Mostly it is shown only 
under "+";  For \dp, you ask for it, you get it.

-- 
Fabien.
Attachment

pgsql-hackers by date:

Previous
From: Dave Cramer
Date:
Subject: patch to ensure logical decoding errors early
Next
From: Andres Freund
Date:
Subject: Re: patch to ensure logical decoding errors early