Karthikeyan Sundaram wrote:
> Hi,
>
> Our database is growing fast. I want to create a cronjob that
> should tell me what is the current size of the database on each day.
>
> How can I find this from the database? Is there any pre-written
> scripts written by somebody to share?
>
Hi,
there is an administrative function called pg_database_size(name), as in
SELECT pg_database_size('mydb'); which returns the disk space used by
the database with the specified name.
See Chapter 9.20.
cheers,
Hubertus
--
Hubertus v. Fuerstenberg MAIL: Fraunhofer Institute for Solar Energy Systems
Heidenhofstr.2, 79110 Freiburg, Germany PHONE: +49 (761) 4588 5153 FAX: +49 (761) 4588 9286
EMAIL: hubertus.fuerstenberg@ise.fraunhofer.de --- Quis custodiet ipsos custodes? ---