Re: Usability fail with psql's \dp command

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Usability fail with psql's \dp command
Date: 2018-07-28 20:36:44
Message-ID: 20180728203644.GQ17411@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jul 28, 2018 at 02:41:24PM -0400, Tom Lane wrote:
> 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.

Please find attached a patch to fix this. Would this be a
back-patchable bug?

Best,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Attachment Content-Type Size
0001-Show-that-all-privileges-revoked-is-a-distinct-state.patch text/x-diff 3.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-07-28 22:59:52 Re: add verbosity to pg_basebackup for sync
Previous Message Dmitry Igrishin 2018-07-28 19:15:51 Re: Usability fail with psql's \dp command