[GENERAL] Access privileges /yyyy -- role that granted this privilege. - Mailing list pgsql-general

From Jean-Michel Scheiwiler
Subject [GENERAL] Access privileges /yyyy -- role that granted this privilege.
Date
Msg-id CAGbCck8tCc7=Sx3Qh7x9uMwVXOiXaPjLc6fWpqiew-TbgaR9Zg@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] Access privileges /yyyy -- role that granted thisprivilege.  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Hello,

I delve into access privileges and I have a problem (or a miscomprehension) when i type \l, \dn+ or \dp with the /yyyy "role that granted this privilege"  part.


\l for instance

[postgres:~]$psql
psql (9.6.2)
Type "help" for help.

postgres=# create role superman login superuser;
CREATE ROLE
postgres=# create role user01 login ;
CREATE ROLE
postgres=# create role user02 login ;
CREATE ROLE
postgres=# create database db001;
CREATE DATABASE
postgres=# \l db001
                              List of databases
 Name  |  Owner   | Encoding |   Collate   |    Ctype    | Access privileges 
-------+----------+----------+-------------+-------------+-------------------
 db001 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
(1 row)

postgres=# grant connect on database db001 to user01 ;
GRANT
postgres=# \l db001
                                List of databases
 Name  |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-------+----------+----------+-------------+-------------+-----------------------
 db001 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres         +
       |          |          |             |             | postgres=CTc/postgres+
       |          |          |             |             | user01=c/postgres
(1 row)

postgres=# \q
[postgres:~]$psql -U superman postgres
psql (9.6.2)
Type "help" for help.

postgres=# grant connect on database db001 to user02;
GRANT
postgres=# \l db001
                                List of databases
 Name  |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-------+----------+----------+-------------+-------------+-----------------------
 db001 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres         +
       |          |          |             |             | postgres=CTc/postgres+
       |          |          |             |             | user01=c/postgres    +
       |          |          |             |             | user02=c/postgres
(1 row)


I thought i would get   user02=c/superman but instead i get user02=c/postgres => I don't get the "role that granted this privilege" but i get the owner of the database.

The problem is the same with schemas or tables access privileges.

Can you help me figure this out ?

Thank you in advance

Jean-Michel Scheiwiler

pgsql-general by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: [GENERAL] Streaming Replication Without Downtime
Next
From: Murtuza Zabuawala
Date:
Subject: Re: [GENERAL] Load multiple CSV file in Postgres using COPY