pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hubertus Freiherr von Fuerstenberg <hubertus.fuerstenberg@ise.fraunhofer.de>
To: pgsql-sql@postgresql.org
Subject: Re: growth of the database
Date: Thu, 22 Mar 2007 11:40:11 +0100
Message-ID: <46025D0B.8060805@ise.fraunhofer.de> (raw)
In-Reply-To: <BAY131-F39F217C76C71862EB0528AB0740@phx.gbl>
References: <BAY131-F39F217C76C71862EB0528AB0740@phx.gbl>

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? ---



view thread (3+ messages)

Message-ID: <46025D0B.8060805@ise.fraunhofer.de>
Permalink:  ../46025D0B.8060805@ise.fraunhofer.de/
Also on:    postgresql.org/message-id/46025D0B.8060805@ise.fraunhofer.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: hubertus.fuerstenberg@ise.fraunhofer.de
  Subject: Re: growth of the database
  In-Reply-To: <46025D0B.8060805@ise.fraunhofer.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox