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

May 3, 2024·
Chi Yau
Chi Yau
· 1 min read
post 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
Authors
App Dev
I’m Chi, a passionate tech enthusiast exploring the latest innovations in GenAI, LLMs, web development, performance tuning, and cybersecurity. As a tech guy at a startup, I aim to share my experiences, insights, and lessons learned in the fast-paced world of technology. Join me on this journey as we dive into the exciting challenges and triumphs of building and scaling tech solutions!