On Wed, Sep 9, 2015 at 6:13 AM, Kevin Grittner wrote: > Michael Paquier wrote: > 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.
That's not surprising to see something similar, thanks for pointing it out! I actually tried duckduckgoing/googling something similar but even this thread did not show up. Something interesting about the thread you pointed out is that statvfs is not that portable: OpenBSD does not include it, and by looking around recent versions don't have it as well. We could fallback to statfs though. A major difference between what I got in mind though compared to what this extension does is to not provide any information about the file system, just the free and available space, the restrictions of genfile.c for path strings applying as well. So this seems more acceptable from the security POV. Currently, we can use pg_stat_file combined with pg_ls_file to have an estimation of the total space used by a path, but any credible use case would need to compare this size with some output from a system call like df. Regards, -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers