Re: growth of the database

From: Hubertus Freiherr von Fuerstenberg <hubertus(dot)fuerstenberg(at)ise(dot)fraunhofer(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: growth of the database
Date: 2007-03-22 10:40:11
Message-ID: 46025D0B.8060805@ise.fraunhofer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

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(dot)fuerstenberg(at)ise(dot)fraunhofer(dot)de
--- Quis custodiet ipsos custodes? ---

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Sabin Coanda 2007-03-22 12:35:37 set password doesn't work
Previous Message Phillip Smith 2007-03-22 02:48:53 Re: Vacuum taking forever

Browse pgsql-sql by date

  From Date Subject
Next Message Susan Evans 2007-03-22 11:55:55 unsubscribe
Previous Message Andrew Sullivan 2007-03-22 01:35:28 Re: Regular Expressions