PostgreSQL - How to list all available databases?
How to list all available databases in PostgreSQL?
1. Using SQL Query
Run this query to list all databases:
SELECT datname FROM pg_database;
2. Using psql
While using psql, you can run the command \list
or \l
.
3. Using TablePlus
In TablePlus, you can see all available via the GUI. click on the database icon at the top left segment panel, or use ⌘ + K
to open list of databases in the current connection and make a switch if you want to.
Note: You can also create new or drop a database from this window.
Need a good GUI tool for PostgreSQL? Check out TablePlus. It’s native, beautiful, and available for free.
Not on Mac? Download TablePlus for Windows.
On Linux? Download TablePlus for Linux
Need a quick edit on the go? Download TablePlus for iOS