What does it mean if \l shows no database privileges for any user whatsoever on a certain database, but, has_database_privilege() confirms ALL privileges are present for a certain role (which is validated by the fact that the role can indeed connect to the database). Is this even a possible situation?
Happening on version 10.15.
1 Answer
If \l shows absolutely no privileges information for a database, it means that the database has default privileges. The default is for PUBLIC to have CONNECT and TEMP (but not CREATE).
has_database_privilege will count privileges of PUBLIC as being possessed by any named user, so it may show 'true' even though \l doesn't explicitly list them.
/l? What login are you using?