Re: Monitor pg_xlog size via SQL with postgres 9.4

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Sylvain Marechal <marechal(dot)sylvain2(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Monitor pg_xlog size via SQL with postgres 9.4
Date: 2016-09-22 14:05:01
Message-ID: 20160922140501.mykaf34i3lghhfgc@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 22, 2016 at 02:23:20PM +0200, Sylvain Marechal wrote:
> is there a way to monitor the size of the pg_xlog directory in SQL? The

Assuming you have superuser privileges, it will most likely work:

select sum( (f).size ) from (select pg_stat_file('pg_xlog/' || pg_ls_dir) as f from pg_ls_dir('pg_xlog/')) x where not (f).isdir;

Best regards,

depesz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sylvain Marechal 2016-09-22 15:42:51 Re: Monitor pg_xlog size via SQL with postgres 9.4
Previous Message Francisco Olarte 2016-09-22 13:16:36 Re: Monitor pg_xlog size via SQL with postgres 9.4