Re: WAL's listing in pg_xlog by some sql query

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Sameer Kumar <sameer(dot)kumar(at)ashnik(dot)com>, Alex Ignatov <a(dot)ignatov(at)postgrespro(dot)ru>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: WAL's listing in pg_xlog by some sql query
Date: 2016-06-02 20:34:59
Message-ID: CAKFQuwZdD+AWfBbrxNoW0_5R2NC+O2OgNCFQNmBowXehy9viXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 2, 2016 at 4:29 PM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:

> * Sameer Kumar (sameer(dot)kumar(at)ashnik(dot)com) wrote:
> > On Fri, 3 Jun 2016, 12:14 a.m. Alex Ignatov, <a(dot)ignatov(at)postgrespro(dot)ru>
> > wrote:
> > > Can I list all WAL files in pg_xlog by using some sql query in
> Postgres?
> >
> > Try
> >
> > Select pg_ls_dir('pg_xlog');
>
> Note that this currently requires superuser privileges.
>
> Given the usefulness of this specific query and that it could be used
> without risk of the user being able to gain superuser access through it,
> I'd like to see a new function added which does not have the superuser
> check, but is not allowed to be called by public initially either.
>
> Something along the lines of 'pg_xlog_file_list()', perhaps. There is a
> check in check_postgres.pl which could take advantage of this also.
> Should be a very straight-forward function to write, perhaps good as a
> starter project for someone.
>

​Isn't this the reason we created the newfangled pg_* roles in 9.6?

David J.​

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2016-06-02 20:47:27 Re: WAL's listing in pg_xlog by some sql query
Previous Message Stephen Frost 2016-06-02 20:29:40 Re: WAL's listing in pg_xlog by some sql query