Skip to content

Instantly share code, notes, and snippets.

@yassineAlouini
Created February 12, 2019 08:46
Show Gist options
  • Save yassineAlouini/2961d5e27d47296fca0bcf702ba0ab6d to your computer and use it in GitHub Desktop.
Save yassineAlouini/2961d5e27d47296fca0bcf702ba0ab6d to your computer and use it in GitHub Desktop.
Get the size of various PSQL databases
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