Re: Monitor pg_xlog size via SQL with postgres 9.4

Поиск
Список
Период
Сортировка
От Sylvain Marechal
Тема Re: Monitor pg_xlog size via SQL with postgres 9.4
Дата
Msg-id CAJu=pHQW8fgmoarhMgPwNuBzQY0tQ9poZGvkJUn6cLEpmWaNfQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Monitor pg_xlog size via SQL with postgres 9.4  (hubert depesz lubaczewski <depesz@depesz.com>)
Список pgsql-general
Thank you all, I thought there may be a specific posgresql stored procedure that did the work of enumerating the files of the pg_xlog directory to get its full  size, or may be one that gave the full size of the server databases including pg_xlog.
Nevermind, this does the work.

Regards,
Sylvain

2016-09-22 16:05 GMT+02:00 hubert depesz lubaczewski <depesz@depesz.com>:
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


В списке pgsql-general по дате отправления:

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: Monitor pg_xlog size via SQL with postgres 9.4
Следующее
От: Ian Campbell
Дата:
Сообщение: Re: Unstable C Function