Re: Checking a size of a given database

From: Jeff Frost <jeff(at)frostconsultingllc(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: adey <adey11(at)gmail(dot)com>, chuck(dot)amadi(at)rokcorp(dot)com, postgresql <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Checking a size of a given database
Date: 2007-04-18 06:03:58
Message-ID: Pine.LNX.4.64.0704172301160.9190@discord.home.frostconsultingllc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, 17 Apr 2007, Joshua D. Drake wrote:

> 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

That works great for 8.1+ but I believe the OP wants to do it with 8.0.1.
If so, he'll have to install the dbsize contrib module to do it for the 8.0.1
DB.

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

--
Jeff Frost, Owner <jeff(at)frostconsultingllc(dot)com>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Joe Conway 2007-04-18 06:26:14 Re: who can tell me the correct syntax to use dblink to talk to a table in another database
Previous Message Joshua D. Drake 2007-04-18 04:23:57 Re: Checking a size of a given database