Last active
January 4, 2016 16:29
-
-
Save martineg/8647474 to your computer and use it in GitHub Desktop.
PostgreSQL snippets
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 d.datname AS Name, | |
pg_catalog.pg_get_userbyid(d.datdba) AS Owner, | |
pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname)) as size | |
FROM pg_catalog.pg_database d | |
ORDER BY pg_catalog.pg_database_size(d.datname); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It list all databases with their owner and size on disk