Skip to content

Instantly share code, notes, and snippets.

@adamharder
Created May 18, 2016 02:37
Show Gist options
  • Select an option

  • Save adamharder/75b3fbb2409a6f8be2a46f0b992adf99 to your computer and use it in GitHub Desktop.

Select an option

Save adamharder/75b3fbb2409a6f8be2a46f0b992adf99 to your computer and use it in GitHub Desktop.
## Show size of all tables
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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment