This article will help you to list all databases and tables in PostgreSQL. First login to PostgreSQL using psql command and run following command from PostgreSQL command prompt.
To List Databases:
You can use any one of below commands to list all databases in PostgreSQL.
postgres=# list postgres=# l
List all Tables in Database:
To list tables of any database first you connect to that database and then view tables in that database. First command will connect you with database (example: mydb) to which you want to see tables and second command will list tables.
postgres=# connect mydb mydb=# dt