Skip to content

Instantly share code, notes, and snippets.

@ismyrnow
Created December 16, 2015 19:27
Show Gist options
  • Save ismyrnow/a88828658437d18040a6 to your computer and use it in GitHub Desktop.
Save ismyrnow/a88828658437d18040a6 to your computer and use it in GitHub Desktop.
Database sizes in postgres
select t1.datname AS db_name,
pg_size_pretty(pg_database_size(t1.datname)) as db_size
from pg_database t1
order by pg_database_size(t1.datname) desc;
-- credit to http://stackoverflow.com/a/18907188/192217
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment