Re: Privilege for seeing queries using pg_stat_get_backend_activity

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marc Munro <marc(at)bloodnok(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Privilege for seeing queries using pg_stat_get_backend_activity
Date: 2006-01-19 17:38:40
Message-ID: 17754.1137692320@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Marc Munro <marc(at)bloodnok(dot)com> writes:
> I want certain users to be able to examine running queries using
> pg_stat_get_backend_activity. Unfortunately, this will only show other
> users' activity if you have superuser privilege.
> I do not want to give monitoring users superuser privilege, but I do
> need to allow them to perform monitoring tasks.
> I've tried tricks with security definer functions but this does not help
> as pg_stat_get_backend_activity explicitly checks for the caller being a
> superuser.

That should work fine, as the test is on the current effective userid
which will change inside a security-definer function. Take a closer
look at what you did, or post a complete example if you can't get it
to work.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ledina Hido 2006-01-19 17:38:51
Previous Message Tom Lane 2006-01-19 17:32:08 Re: create plperlu langage fails