From: Chris Browne <cbbrowne@acm.org>
To: pgsql-admin@postgresql.org
Subject: Re: Raw disk space used
Date: Wed, 01 Aug 2007 09:25:20 -0400
Message-ID: <60ps27bd4v.fsf@dba2.int.libertyrms.com> (raw)
References: <AB1268D7-687B-45FE-84BC-B8D6B06F1975@indiana.edu>
walterc@indiana.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: cbbrowne@acm.org
Subject: Re: Raw disk space used
In-Reply-To: <60ps27bd4v.fsf@dba2.int.libertyrms.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox