Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 546D19FA5B9 for ; Wed, 1 Aug 2007 14:14:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 34067-02 for ; Wed, 1 Aug 2007 14:14:53 -0300 (ADT) X-Greylist: delayed 00:28:32.653582 by SQLgrey-1.7.5 Received: from easy2.in-chemnitz.de (easy2.in-chemnitz.de [88.198.17.232]) by postgresql.org (Postfix) with ESMTP id A8DAE9FB1BB for ; Wed, 1 Aug 2007 14:14:54 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by easy2.in-chemnitz.de (Postfix) with ESMTP id 4D2F3B2E25 for ; Wed, 1 Aug 2007 18:46:20 +0200 (CEST) Received: from easy2.in-chemnitz.de ([127.0.0.1]) by localhost (easy.in-chemnitz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eNG12NkQtVk6 for ; Wed, 1 Aug 2007 18:46:20 +0200 (CEST) Received: by easy2.in-chemnitz.de (Postfix, from userid 1013) id 3D3F7B2E24; Wed, 1 Aug 2007 18:46:18 +0200 (CEST) Date: Wed, 1 Aug 2007 18:46:18 +0200 From: Tino Schwarze To: pgsql-admin@postgresql.org Subject: Re: Raw disk space used Message-ID: <20070801164618.GB21243@easy2.in-chemnitz.de> References: <60ps27bd4v.fsf@dba2.int.libertyrms.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/7 X-Sequence-Number: 26338 On Wed, Aug 01, 2007 at 12:34:07PM -0400, Carol Walter wrote: > I've done as you suggested and I've got the correct directories. I > have a second question now. There are forty-four numeric entries in > the directory for the first databases that I looked at. The database > in question has only eight tables. There are eight tables that have > recent dates. Do I need the total of all the files or just the eight > that appear to be the tables that are being updated? Take the whole directory - there are indexes as well. And large tables are split up AFAIK. You may try the following shell script to determine the size of all databases: #!/bin/bash # # Shell script to determine disk usage of PostgreSQL databases. # by Tino Schwarze/Community4you PGDATADIR=/data/pgsql/74 PGPORT=5432 PSQLBIN=/opt/pgsql-7.4.3/bin/psql PGOPTS="-U postgres" echo "PostgreSQL 7.4.3 database sizes" $PSQLBIN $PGOPTS -p $PGPORT -t -F " " -A template1 -c 'select oid,datname from pg_database' | \ while read oid dbname ; do [ "$dbname" != "template1" ] || continue [ "$dbname" != "template0" ] || continue size="`du -sh $PGDATADIR/base/$oid | cut -f 1`" while [ ${#dbname} -lt 16 ] ; do dbname="$dbname " ; done printf "$dbname\t%6s\n" $size done HTH, Tino. -- www.quantenfeuerwerk.de www.spiritualdesign-chemnitz.de www.lebensraum11.de Tino Schwarze * Parkstraße 17h * 09120 Chemnitz