SELECT n.nspname as schema, pg_size_pretty(sum(pg_total_relation_size(quote_ident(n.nspname)|| '.' || quote_ident(c.relname)))) as size, sum(pg_total_relation_size(quote_ident(n.nspname)|| '.' || quote_ident(c.relname))) as size_bytes FROM pg_class c JOIN pg_namespace n ON (n.oid = c.relnamespace) JOIN pg_authid a ON ( a.oid = c.relowner ) WHERE relname NOT LIKE 'pg_%' AND relname NOT LIKE 'information%' AND relname NOT LIKE 'sql_%' AND relkind IN ('r') GROUP BY 1 ORDER BY 3 DESC, 1, 2;
--
Melvin Davidson I reserve the right to fantasize. Whether or not you wish to share my fantasy is entirely up to you.