Created
February 12, 2019 08:46
-
-
Save yassineAlouini/2961d5e27d47296fca0bcf702ba0ab6d to your computer and use it in GitHub Desktop.
Get the size of various PSQL databases
This file contains hidden or 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 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