Created
July 17, 2023 00:05
-
-
Save jboursiquot/b2fcb7a05354b19da54c8e1475302a94 to your computer and use it in GitHub Desktop.
pgsql list size on disk of all tables
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 | |
table_schema || '.' || table_name AS table_full_name, | |
pg_size_pretty(pg_total_relation_size('"' || table_schema || '"."' || table_name || '"')) AS size | |
FROM information_schema.tables | |
ORDER BY | |
pg_total_relation_size('"' || table_schema || '"."' || table_name || '"') DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment