Search Postgresql Archives

has_database_privilege is true?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I create a role "test" and it can't (intentionally) login. But why does has_database_privilege() return true if "test" can't connect to the cluster and can't use any database? Is this a bug or am I doing something strange here? Any ideas?

I'm on PostgreSQL 12.4.

Cheers,
Paul


postgres=# create role "test";
CREATE ROLE
postgres=# \du test
            List of roles
 Role name |  Attributes  | Member of 
-----------+--------------+-----------
 test      | Cannot login | {}

postgres=# select has_database_privilege('test', 'postgres', 'connect');
 has_database_privilege 
------------------------
 t
(1 row)

postgres=# select has_database_privilege('test', 'db01', 'connect');
 has_database_privilege 
------------------------
 t
(1 row)

...

postgres=# select datname from pg_database;
  datname  
-----------
 db02
 template0
 template1
 postgres
 db01
(5 rows)







[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux