psql -d appdb -c '\l'

Category: Databases & SQL

psql -d appdb -c '\l'

List all PostgreSQL databases

Lists every database with its owner, encoding, and access privileges by querying pg_database. Add + for sizes. Same output as \list. Related: \du for roles.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.