Re: [GENERAL] grant select on pg_stat_activity - Mailing list pgsql-performance

From Adrian Klaver
Subject Re: [GENERAL] grant select on pg_stat_activity
Date
Msg-id 56EC7746.80406@aklaver.com
Whole thread Raw
In response to grant select on pg_stat_activity  (avi Singh <avisingh19811981@gmail.com>)
List pgsql-performance
On 03/18/2016 01:09 PM, avi Singh wrote:
> Guys
>          Whats the best way to grant select on pg_stat_activity so that
> non super user can access this view.

They should be able to, see below. If that is not your case, then more
information is needed.

guest@test=> select current_user;
  current_user


--------------


  guest
(1 row)

guest@test=> \du guest
            List of roles
  Role name | Attributes | Member of
-----------+------------+-----------
  guest     |            | {}


guest@test=> select * from pg_stat_activity;
-[ RECORD 1 ]----+--------------------------------
datid            | 16385
datname          | test
pid              | 2622
usesysid         | 1289138
usename          | guest
application_name | psql
client_addr      |
client_hostname  |
client_port      | -1
backend_start    | 2016-03-18 14:41:43.906754-07
xact_start       | 2016-03-18 14:44:22.550742-07
query_start      | 2016-03-18 14:44:22.550742-07
state_change     | 2016-03-18 14:44:22.550746-07
waiting          | f
state            | active
backend_xid      |
backend_xmin     | 58635
query            | select * from pg_stat_activity;

>
> Thanks
> Avi


--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-performance by date:

Previous
From: avi Singh
Date:
Subject: grant select on pg_stat_activity
Next
From: Jeff Janes
Date:
Subject: Re: Searching GIN-index (FTS) and sort by timestamp-column