Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 040E69FB741 for ; Wed, 18 Apr 2007 01:23:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 65245-04 for ; Wed, 18 Apr 2007 01:23:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id 8B3739FB733 for ; Wed, 18 Apr 2007 01:23:20 -0300 (ADT) Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net [67.76.146.141]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l3I4NNns006718; Tue, 17 Apr 2007 21:23:24 -0700 Message-ID: <46259D5D.3020203@commandprompt.com> Date: Tue, 17 Apr 2007 21:23:57 -0700 From: "Joshua D. Drake" User-Agent: Thunderbird 1.5.0.10 (X11/20070306) MIME-Version: 1.0 To: adey CC: chuck.amadi@rokcorp.com, postgresql Subject: Re: Checking a size of a given database References: <4624A530.40108@rokcorp.com> <1c66bda80704172118k52d45afchccbbe7e4ea5ec2a9@mail.gmail.com> In-Reply-To: <1c66bda80704172118k52d45afchccbbe7e4ea5ec2a9@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.5, clamav-milter version 0.88.5 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Tue, 17 Apr 2007 21:23:24 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/168 X-Sequence-Number: 25232 adey wrote: > I found the following script useful; for calculating database size:- select pg_database_size? http://www.postgresql.org/docs/8.2/static/functions-admin.html > > -- Query returns size of a database calculated from the no. 8k pages > allocated to tables > SELECT > sum( relpages*8/1024 ) as MB > FROM > pg_class > WHERE > -- relname != '' > -- relname = 'tablename' > relnamespace = '2200' > > > On 4/17/07, *Chuck Amadi* > wrote: > > I have been given a task to try a proof of concept of migrating are > active databases from PostgreSQL 8.0.1 to 8.2.3 > > I will install and configPostgreSQL on my local w/s and replicate > the database users etc etc. > > I have had a look inside /var/lib/pgsql/data/base and there are > numerous files (db's) which I believe is where I can check data > base size. > > 1 108012 114465 122407 1261267 1261963 17229 17233 17234 17235 174066 19247 205009 21272 2793694 2794334 333245 333375 > > I am aware that Postgresql creates directories to keep each database > in. > These directories aren't names,they are kept as the *'OID's *of each > database (oid's are*"object identifiers"*). > > Previously I just run pg_dump and thus run ls -lh on the db dump. > Anyway > of checking a size of a given database I have tried > the sql using select pg_database_size ('dbaname'); but no joy. > > Cheers > Chuck > > -- > Chuck Amadi > ROK Corporation Limited > Ty ROK, > Dyffryn Business Park, > Llantwit Major Road, > Llandow, > Vale Of Glamorgan. > CF71 7PY > > Tel: 01446 795 839 > Fax: 01446 794 994 > International Tel: +44 1446 795 839 > > email: chuck.amadi@rokcorp.com > > This email is confidential to the addressee only. If you do not believe > that you are the intended recipient, do not pass it on or copy it in any > way. Please delete it immediately. > > > > ---------------------------(end of > broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > > -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/ Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate PostgreSQL Replication: http://www.commandprompt.com/products/