Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get all PostgreSQL databases and their sizes
psql -c "SELECT pg_database.datname, pg_database_size(pg_database.datname), pg_size_pretty(pg_database_size(pg_database.datname)) FROM pg_database ORDER BY pg_database_size DESC;" -d <db_name> <db_user>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment