PostgreSQL: Show size of all databases

Posted Over 8 years ago. 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 ?

Thomas Eisenbarth
Last edit
Over 8 years ago
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)