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