When are access privileges listed by \l, and when are they not? The access privileges listed by \l can change after a grant and revoke:
$ createuser -EP my_readonly
$ psql development
development=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------------------------+----------+----------+-------------+-------------+-----------------------
development | vagrant | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
...
development=# grant usage on schema public to my_readonly;
development=# grant connect on database development to my_readonly;
development=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------------------------+----------+----------+-------------+-------------+----------------------------
development | vagrant | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =Tc/vagrant +
| | | | | vagrant=CTc/vagrant +
| | | | | my_readonly=c/vagrant
...
development=# revoke connect on database development from my_readonly;
REVOKE
development=# revoke usage on schema public from my_readonly;
REVOKE
development=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------------------------+----------+----------+-------------+-------------+-----------------------
development | vagrant | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =Tc/vagrant +
| | | | | vagrant=CTc/vagrant
Why is that? What state changed? I believe the my_readonly user's ability to connect was unchanged through this whole psql session (because I'm guessing the PUBLIC role has connect privileges), but clearly something changed: what is that thing?
Side question: how can I explicitly ask postgres whether PUBLIC in fact does have connect privileges (they may have been revoked -- see Why can a new user select from any table?)?