Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id EFF769FB9D7 for ; Thu, 22 Mar 2007 11:22:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 07207-08 for ; Thu, 22 Mar 2007 11:22:49 -0300 (ADT) X-Greylist: delayed 03:42:34.595958 by SQLgrey-1.7.4 Received: from mailgw11.fraunhofer.de (mailgw11.fraunhofer.de [153.96.1.23]) by postgresql.org (Postfix) with ESMTP id C2D029FB73C for ; Thu, 22 Mar 2007 11:22:49 -0300 (ADT) Received: from mailgw11.fraunhofer.de (localhost [127.0.0.1]) by mailgw11.fraunhofer.de (8.13.5+/8.13.4) with ESMTP id l2MAeCYN002784 for ; Thu, 22 Mar 2007 11:40:12 +0100 (MET) Received: from mail-gw.ise.fraunhofer.de (sx033.ise.fhg.de [153.96.32.14]) by mailgw11.fraunhofer.de (8.13.5+/8.13.4) with ESMTP id l2MAeCVH002777 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 22 Mar 2007 11:40:12 +0100 (MET) Message-ID: <46025D0B.8060805@ise.fraunhofer.de> Date: Thu, 22 Mar 2007 11:40:11 +0100 From: Hubertus Freiherr von Fuerstenberg Reply-To: hubertus.fuerstenberg@ise.fraunhofer.de Organization: Fraunhofer ISE X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: growth of the database References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Fraunhofer-Email-Policy: accepted X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/300 X-Sequence-Number: 27938 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? ---