Skip to content

Instantly share code, notes, and snippets.

@ozscosta
Created June 6, 2021 03:39
Show Gist options
  • Save ozscosta/6262d675f9c9e90835122936fab3e887 to your computer and use it in GitHub Desktop.
Save ozscosta/6262d675f9c9e90835122936fab3e887 to your computer and use it in GitHub Desktop.
Tamanho do banco pgsql
select
-- table_name,
-- pg_size_pretty( pg_total_relation_size(quote_ident(table_name))),
-- pg_size_pretty(sum(pg_total_relation_size(quote_ident(table_name))))
pg_size_pretty(sum(pg_total_relation_size(quote_ident(table_name))))
from information_schema.tables
where
table_schema = 'public'
-- order by pg_total_relation_size(quote_ident(table_name)) desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment