Skip to content

Instantly share code, notes, and snippets.

@jboursiquot
Created July 17, 2023 00:05
Show Gist options
  • Save jboursiquot/b2fcb7a05354b19da54c8e1475302a94 to your computer and use it in GitHub Desktop.
Save jboursiquot/b2fcb7a05354b19da54c8e1475302a94 to your computer and use it in GitHub Desktop.
pgsql list size on disk of all tables
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