SELECT
table_name,
pg_size_pretty(pg_total_relation_size(quote_ident(table_name))),
pg_total_relation_size(quote_ident(table_name))
FROM information_schema.tables
WHERE '<database>' = table_schema
ORDER BY 3 DESC
LIMIT 20;
SELECT
table_name,
pg_size_pretty(pg_total_relation_size(quote_ident(table_name))),
pg_total_relation_size(quote_ident(table_name))
FROM information_schema.tables
WHERE '<database>' = table_schema
ORDER BY 3 DESC
LIMIT 20;