Skip to content

Instantly share code, notes, and snippets.

@cyberjso
Created November 19, 2019 16:24
Show Gist options
  • Save cyberjso/373bc4ff385da9cbceac797c6cb2656b to your computer and use it in GitHub Desktop.
Save cyberjso/373bc4ff385da9cbceac797c6cb2656b to your computer and use it in GitHub Desktop.
Show the size of a given postgres database
select db_name,pg_database_size(db_name) database_size, pg_size_pretty(pg_database_size(db_name)) as database_size_pretty from
(select datname as db_name, pg_database_size(datname) from pg_database
where datname <>'rdsadmin') x
order by database_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment