Re: Raw disk space used

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Raw disk space used
Date: 2007-08-01 13:25:20
Message-ID: 60ps27bd4v.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

walterc(at)indiana(dot)edu (Carol Walter) writes:
> Is there a way to tell what the raw disk space used by a single
> database is? I know that databases are fluid, but if there is way to
> do even a snap shot view that is a "ball park" figure, I'd be happy.
> My user keeps clammering for this figure.

Sure, you can identify the database via "select oid, * from
pg_catalog.pg_database;"

Then you should be able to head to $PGDATA (where ever the database
data lives), and run "du", and search for the directory whose name is
the "oid" value for the database that you wanted to analyze.

If users are using tablespaces, then tables can live in
user-controlled places, which would make it rather more complex to do
this analysis, but if they have kept to the simpler approach of just
letting data fall where it will, this should do the trick...
--
(reverse (concatenate 'string "gro.mca" "@" "enworbbc"))
http://linuxfinances.info/info/linux.html
"High-level languages are a pretty good indicator that all else is
seldom equal." - Tim Bradshaw, comp.lang.lisp

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Carol Walter 2007-08-01 16:34:07 Re: Raw disk space used
Previous Message Milen A. Radev 2007-08-01 13:03:02 Re: Raw disk space used