Skip site navigation (1) Skip section navigation (2)

Re: Monitoring Transaction Log size

From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "Ziegelwanger, Silvio" <Silvio(dot)Ziegelwanger(at)fabasoft(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Monitoring Transaction Log size
Date: 2007-01-17 18:29:09
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
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


In response to

pgsql-performance by date

Next:From: Scott MarloweDate: 2007-01-17 18:35:11
Subject: Re: PG8.2.1 choosing slow seqscan over idx scan
Previous:From: Shoaib MirDate: 2007-01-17 18:03:18
Subject: Re: Monitoring Transaction Log size

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group