Created
April 1, 2025 07:55
-
-
Save ponceta/4b98c4db4cf033aa482dbd267048b6e1 to your computer and use it in GitHub Desktop.
SELECT PG SCHEMA SIZE
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 nspname AS schema_name, | |
pg_size_pretty(sum(pg_total_relation_size(pg_class.oid))) AS total_size | |
FROM pg_class | |
JOIN pg_namespace ON pg_class.relnamespace = pg_namespace.oid | |
GROUP BY nspname | |
ORDER BY sum(pg_total_relation_size(pg_class.oid)) DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment