I need to connect to some PostgreSQL server providing some credentials, and print a list of available databases on that host for a given user.
I am trying:
Why don't you connect to your Maintenance DB (usually postgres?). I don't know if that'll work. But I believe you'll have to query this database anyway to retrieve the databases available to a given user.
postgres