Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 9BFC19FB251 for ; Tue, 14 Nov 2006 11:01:22 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 83468-04 for ; Tue, 14 Nov 2006 11:01:17 -0400 (AST) X-Greylist: delayed 00:21:20.850681 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id D02C79FB2B4 for ; Tue, 14 Nov 2006 11:01:16 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from asgaard.lystrup.terma.com (asgaard.lystrup.terma.com [193.163.1.112]) by svr4.postgresql.org (Postfix) with ESMTP id F06E15AF883 for ; Tue, 14 Nov 2006 14:39:53 +0000 (GMT) Received: from munin.leiden.terma.com (localhost.localdomain [127.0.0.1]) by asgaard.lystrup.terma.com (8.13.5/8.12.8) with ESMTP id kAEEdo5h003925 for ; Tue, 14 Nov 2006 15:39:50 +0100 Received: from nlpc17 (int-leiden.birkerod.terma.com [10.1.20.171]) by munin.leiden.terma.com (8.11.6/linuxconf) with SMTP id kAEEdmP03095 for ; Tue, 14 Nov 2006 15:39:48 +0100 Message-ID: <000701c707fa$bd3209a0$ab14010a@nlpc17> From: "Hans Guijt" To: Subject: Finding out free space? Date: Tue, 14 Nov 2006 15:39:49 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50 X-Spam-Level: X-Archive-Number: 200611/139 X-Sequence-Number: 23666 I need to provide an alarm function that will alert my customer when the amount of free space in a database has reached some critical threshold. This problem is not entirely trivial, since free space can be located both in the file system and in the database itself. I'm not looking for a particularly accurate function (and suspect that one is probably not feasible anyway) - anything that comes to within a gigabyte of the actual value is fine with me. Basically I need to figure out two things: 1. Where does Postgres stores its datafiles? This will allow me to figure out how much space is still available on the filing system. 2. How much space is unused within the data files themselves? I'd appreciate a pointer on where I should look for this sort of information. Regards, Hans Guijt