Created
May 6, 2024 11:56
-
-
Save WillCQ97/3053c72c426c0210d7d108a24735d39e to your computer and use it in GitHub Desktop.
Visualizar o tamanho de um banco postgres
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 | |
'TOTAL' AS banco, | |
sum(pg_database_size(datname)) AS tamanho, | |
pg_size_pretty(sum(pg_database_size(datname))) AS tamanho_bonito | |
FROM | |
pg_database | |
WHERE | |
datname NOT IN ('template0', 'template1', 'postgres') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment