On-disk size of a table/view in Postgres
In Postgres if you want to see how much disk space your relation (including data and any indexes) is taking, you can use pg_total_relation_size(<relation_name>)
SELECT pg_total_relation_size('<relation_name>') as size;
This can be used in conjunction with pg_size_pretty()
to give a more readable output
SELECT pg_size_pretty(pg_total_relation_size('<relation_name>')) as size;
Tweet