1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-02 22:58:01 +00:00
Files
til/postgres/list-all-the-databases.md
2016-03-06 14:59:18 -06:00

16 lines
279 B
Markdown

# List All The Databases
There are two ways to list all the available databases. The first is a
`psql` only command:
```
\list
```
The second approach is to query the `pg_database` table. Something like the
following will suffice:
```sql
select datname from pg_database;
```