How to check the size of database in postgresql - 在PostgreSQL 如何查詢資料庫大小

Check database size in postgresql

最近發現 Database backup 越來越大…
很怕Database Server 會用盡 storage…
所以便想查詢資料庫佔用的大小…

解法方法:

select pg_size_pretty(pg_database_size('[DATABASE_NAME]'));

Query to check PostgreSQL database size
Query to check PostgreSQL database size

Hope you find it useful

Chi Yau
Chi Yau
Software Engineer

Interested on Learning new stuff and experience sharing