Thread: Admin details - disk space used

Admin details - disk space used

From
Simon Drabble
Date:
Is it possible somehow to get the space taken up by a database on disk? I know
I can get this as the postgres superuser but it's not particularly clear what
with system tables and stuff, and of course you have to be the postgres user
to do it.

It would be nice to be able to do something like

select diskspace();

and have it return the space taken up by each user table.


If this is a FAQ or in the docs somewhere feel free to flame away - I did look
but not terribly closely as the Braves are losing and I have to keep running
next door.

If it's not possible right now, is it planned? I might take a look at it
myself if it's not planned and other people are interested.


Simon.

--
 "Linux - open doors, not windows."

   Simon Drabble                      It's like karma for your brain.
   simon@eskimo.com


Re: [GENERAL] Admin details - disk space used

From
Bruce Momjian
Date:
> Is it possible somehow to get the space taken up by a database on disk? I know
> I can get this as the postgres superuser but it's not particularly clear what
> with system tables and stuff, and of course you have to be the postgres user
> to do it.
>
> It would be nice to be able to do something like
>
> select diskspace();
>
> and have it return the space taken up by each user table.

Just do an 'ls -l' in pgsql/data/base/dbname.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026