Skip to content

Instantly share code, notes, and snippets.

@AndreyStekov
AndreyStekov / pg_schema_size.sql
Created April 6, 2015 09:58
Get schema size (postgres).
SELECT pg_size_pretty(sum(pg_relation_size(quote_ident(schemaname) || '.' || quote_ident(tablename)))::bigint) FROM pg_tables
WHERE schemaname = 'yourschema'