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

From David Fetter
Subject Re: Usability fail with psql's \dp command
Date
Msg-id 20180728203644.GQ17411@fetter.org
Whole thread Raw
In response to Usability fail with psql's \dp command  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Usability fail with psql's \dp command
Re: Usability fail with psql's \dp command
List 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

pgsql-hackers by date:

Previous
From: Dmitry Igrishin
Date:
Subject: Re: Usability fail with psql's \dp command
Next
From: Michael Paquier
Date:
Subject: Re: add verbosity to pg_basebackup for sync