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.

databases-list-in-TablePlus

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.

Download TablePlus for Mac.

Not on Mac? Download TablePlus for Windows.

On Linux? Download TablePlus for Linux

Need a quick edit on the go? Download TablePlus for iOS

TablePlus GUI Tool PostgreSQL