PostgreSQL查找数据库使用的总磁盘空间 [英] Postgresql find total disk space used by a database
本文介绍了PostgreSQL查找数据库使用的总磁盘空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的postgresql服务器中托管了50多个数据库。我需要将其中一些移动到另一台主机上,以释放一些磁盘空间,但是如何测量卷上每个数据库使用的磁盘空间?
I have more than 50 databases hosted in my postgresql server. I need to move some of them on another host, to free-up some disk space,but how can I measure the disk-space used by each database on my volume?
是否存在任何函数来获取我想要的信息?
Is there any function exists to get the information that I want?
推荐答案
SELECT pg_database_size('geekdb')
或
SELECT pg_size_pretty(pg_database_size('geekdb'))
http://www.thegeekstuff.com/2009/05/15-advanced-postgresql -commands-with-examples /
这篇关于PostgreSQL查找数据库使用的总磁盘空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文