I need to know the size of the database to be able to determine the timeout for a dump and determine when I should debug the DB to reduce its size.
Could this scheme work?
SELECT table_schema, ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables WHERE table_schema='DB_NAME' GROUP BY table_schema ;
SELECT pg_database_size('db_name') / 1048576.0 AS size_in_mb;
1.4m articles
1.4m replys
5 comments
57.0k users