Usability fail with psql's \dp command

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Usability fail with psql's \dp command
Дата
Msg-id 9705.1532803284@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Usability fail with psql's \dp command  (Christophe Pettus <xof@thebuild.com>)
Re: Usability fail with psql's \dp command  (Dmitry Igrishin <dmitigr@gmail.com>)
Re: Usability fail with psql's \dp command  (David Fetter <david@fetter.org>)
Re: Usability fail with psql's \dp command  (Pavel Luzanov <p.luzanov@postgrespro.ru>)
Re: Usability fail with psql's \dp command  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
I noticed today that \dp does not distinguish empty acl fields
(meaning nobody has any privileges) from null acl fields
(which mean default privileges, typically not empty).
For instance

regression=# \c joe joe
You are now connected to database "joe" as user "joe".
joe=> create table jt (f1 int);
CREATE TABLE
joe=> \dp
                            Access privileges
 Schema | Name | Type  | Access privileges | Column privileges | Policies 
--------+------+-------+-------------------+-------------------+----------
 public | jt   | table |                   |                   | 
(1 row)

joe=> insert into jt values(1);
INSERT 0 1
joe=> revoke all on table jt from joe;
REVOKE
joe=> \dp
                            Access privileges
 Schema | Name | Type  | Access privileges | Column privileges | Policies 
--------+------+-------+-------------------+-------------------+----------
 public | jt   | table |                   |                   | 
(1 row)

joe=> insert into jt values(1);
ERROR:  permission denied for table jt

So those are definitely different privilege states, but they look
the same.

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.

What do people think of printing "Default" if the ACL is null?

Alternatively, since the state with an empty ACL is certainly
the unusual case, maybe we should mark that specially, perhaps
by printing "None" or "No privileges".

(I've not looked at the code to see how hard such changes would be.)

            regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Segfault logical replication PG 10.4
Следующее
От: David Fetter
Дата:
Сообщение: Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options