Re: Disk usage - Mailing list pgsql-general

From Tom Lane
Subject Re: Disk usage
Date
Msg-id 20311.1052404788@sss.pgh.pa.us
Whole thread Raw
In response to Re: Disk usage  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
Responses Re: Disk usage  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-general
"Shridhar Daithankar" <shridhar_daithankar@persistent.co.in> writes:
> On 8 May 2003 at 12:41, Daniel Lublin wrote:
>> I am wondering if there is some utility for postgresql, which can
>> display the amount of disk space that a database (and possibly even
>> more finer grained; a table) occupies?

> du in $PGDATA coupled with oid2name to figure out what is the object you are
> lookng at.

Or do

    vacuum;
    select relname, relpages * 8 from pg_class;

to get table sizes in kilobytes.  relpages is not updated on-the-fly,
only by vacuum, so you need to have done vacuum recently to get
trustworthy numbers.

            regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug or limitation?
Next
From: Jan Wieck
Date:
Subject: Re: record new is unassigned yet