On Fri, Jun 3, 2016 at 11:23 AM, Sameer Kumar <sameer.kumar@xxxxxxxxxx> wrote: > > > On Fri, Jun 3, 2016 at 4:30 AM Stephen Frost <sfrost@xxxxxxxxxxx> wrote: >> >> * Sameer Kumar (sameer.kumar@xxxxxxxxxx) wrote: >> > On Fri, 3 Jun 2016, 12:14 a.m. Alex Ignatov, <a.ignatov@xxxxxxxxxxxxxx> >> > 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. > > > Can I not wrap it around another user defined function with SECURITY DEFINER > and grant privilege to specific users who can use it? pg_ls_dir() has a check on superuser() embedded in its code. -- Michael -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general