Re: Getting total and free disk space from paths in PGDATA - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Getting total and free disk space from paths in PGDATA
Date
Msg-id 2121786276.2343150.1441746823506.JavaMail.yahoo@mail.yahoo.com
Whole thread Raw
In response to Getting total and free disk space from paths in PGDATA  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Getting total and free disk space from paths in PGDATA  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Michael Paquier <michael.paquier@gmail.com> wrote:

> There is currently no in-core function to query the amount of
> available and free space in a path of PGDATA, with something like that
> for example:
> SELECT * FROM pg_get_diskspace_info('pg_xlog');
>   total_space | free_space
> -------------+------------
>        4812 MB    | 3925 MB
> (1 row)
>
> This would be definitely useful for monitoring purposes to have a look
> at the disk space bloat in PGDATA, pg_xlog, or even pg_log which are
> usually located on different partitions. Some of my customers have
> requested such a thing for a couple of times,

When I was working with Wisconsin Courts we needed something like
this, and wrote it.  It has been used on hundreds of clusters,
24/7, for years.  I see that the last publicly posted updated was
in 2008, but it likely never needed changes after that.  We used it
on Windows and Linux.  At the time, the community rather actively
rejected incorporating it, but maybe in today's world of extensions
it could be put on pgxn.org.

http://www.postgresql.org/message-id/flat/43FDF6D0.EE98.0025.0@wicourts.gov#43FDF6D0.EE98.0025.0@wicourts.gov

http://pgfoundry.org/projects/fsutil/


The license is BSD, so there should be no problem grabbing the source
and using as much (or as little) as you find helpful.


--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: why can the isolation tester handle only one waiting process?
Next
From: Andrew Dunstan
Date:
Subject: Re: pgsql: Improve logging of TAP tests.