PostgreSQL: Show size of all databases

Posted . Visible to the public.

Use this:

SELECT pg_database.datname as "database_name", pg_database_size(pg_database.datname)/1024/1024 AS size_in_mb FROM pg_database ORDER by size_in_mb DESC;

Want to see database sizes in MySQL ?

Profile picture of Thomas Eisenbarth
Thomas Eisenbarth
Last edit
Thomas Eisenbarth
License
Source code in this card is licensed under the MIT License.
Posted by Thomas Eisenbarth to makandra dev (2016-01-14 14:52)