Created
June 6, 2014 16:27
-
-
Save mcorsen/5522647841f8157f826f to your computer and use it in GitHub Desktop.
Postgresql 9.1 query to list database sizes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT pg_database.datname, | |
pg_size_pretty(pg_database_size(pg_database.datname)) AS size | |
FROM pg_database | |
ORDER BY pg_database_size(pg_database.datname) DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment