Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 2B8099FA2BC; Wed, 21 Mar 2007 14:37:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 90155-03; Wed, 21 Mar 2007 14:37:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.pharmaline.de (mail.apoexpress.de [62.153.135.53]) by postgresql.org (Postfix) with ESMTP id 64A259FA4DF; Wed, 21 Mar 2007 14:37:46 -0300 (ADT) Received: from [192.168.5.155] (68.145.108.192) by mail.pharmaline.de with ESMTP (Eudora Internet Mail Server X 3.2.10); Wed, 21 Mar 2007 18:37:44 +0100 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: pgsql-admin@postgresql.org, pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit From: Guido Neitzer Subject: Re: growth of the database Date: Wed, 21 Mar 2007 11:37:44 -0600 To: Karthikeyan Sundaram X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/148 X-Sequence-Number: 24972 On 21.03.2007, at 11:25, Karthikeyan Sundaram wrote: > 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? Be aware of linebreaks ... [Galadriel: cug ] cug $ psql -U postgres -c "select pg_size_pretty (pg_database_size('testdb'));" pg_size_pretty ---------------- 495 MB (1 row)