Created
November 19, 2019 16:24
-
-
Save cyberjso/373bc4ff385da9cbceac797c6cb2656b to your computer and use it in GitHub Desktop.
Show the size of a given postgres database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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