Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 566689FB2AC for ; Wed, 17 Jan 2007 14:30:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 84894-06-2 for ; Wed, 17 Jan 2007 14:29:26 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from cronos.madness.at (madness.at [217.196.146.217]) by postgresql.org (Postfix) with ESMTP id 0F0229FB2B7 for ; Wed, 17 Jan 2007 14:29:25 -0400 (AST) Received: from mastermind.kaltenbrunner.cc ([83.215.233.60]) by cronos.madness.at with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.62 (FreeBSD)) (envelope-from ) id 1H7FX4-000PDD-Ob; Wed, 17 Jan 2007 19:29:24 +0100 Message-ID: <45AE6AF5.4080306@kaltenbrunner.cc> Date: Wed, 17 Jan 2007 19:29:09 +0100 From: Stefan Kaltenbrunner User-Agent: Icedove 1.5.0.9 (X11/20061220) MIME-Version: 1.0 To: "Joshua D. Drake" CC: "Ziegelwanger, Silvio" , pgsql-performance@postgresql.org Subject: Re: Monitoring Transaction Log size References: <45AE6376.7060606@commandprompt.com> In-Reply-To: <45AE6376.7060606@commandprompt.com> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/267 X-Sequence-Number: 22868 Joshua D. Drake wrote: > Ziegelwanger, Silvio wrote: >> Hi, >> >> >> >> how can I monitor the size of the transaction log files using SQL Statements? > > You can't. You would have to write a custom function to heck the size of > the xlog directory. wel in recent versions of pg it should be pretty easy to do that from within SQL by using pg_ls_dir() and pg_stat_file(). maybe something(rough sketch) along the line of: select sum((pg_stat_file('pg_xlog/' || file)).size) from pg_ls_dir('pg_xlog') as file where file ~ '^[0-9A-F]'; might do the trick Stefan