1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00

Add List All The Databases as a postgres til

This commit is contained in:
jbranchaud
2016-03-06 14:59:18 -06:00
parent 51f8348457
commit 4ed73fc685
2 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
# 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;
```