Skip to content

Instantly share code, notes, and snippets.

@AndreyStekov
Created April 6, 2015 09:58
Show Gist options
  • Save AndreyStekov/ea09951a120f1400921e to your computer and use it in GitHub Desktop.
Save AndreyStekov/ea09951a120f1400921e to your computer and use it in GitHub Desktop.
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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment