permissions on system catalogs for non-superuser?

Поиск
Список
Период
Сортировка
Искать

permissions on system catalogs for non-superuser?

От:
Kevin Kempter <kevin@kevinkempterllc.com>
Дата:
Hi List;

we have some monitoring/alert scripts which run sql against the database 
(8.1.4) as a non-superuser. The problem is I get  
when trying to access current_query from pg_stat_activity. 

I ran these grant statements but still no joy:
grant select on pg_stat_activity to monitor_user;
grant select on pg_database to monitor_user;


Here's what I get while logged into psql as monitor_user:

select procpid, current_query from pg_stat_activity;
 procpid |      current_query
---------+--------------------------
   24589 | 
   24601 | 
   24600 | 
   24598 | 
   24596 | 
   24594 | 
   24367 | 
   24511 |  


Thanks in advance

/Kevin

Re: permissions on system catalogs for non-superuser?

От:
Robert Gravsjö <robert@blogg.se>
Дата:
Kevin Kempter wrote:
> Hi List;
> 
> we have some monitoring/alert scripts which run sql against the database 
> (8.1.4) as a non-superuser. The problem is I get  
> when trying to access current_query from pg_stat_activity. 
> 
> I ran these grant statements but still no joy:
> grant select on pg_stat_activity to monitor_user;
> grant select on pg_database to monitor_user;

IIRC you need select priv on pg_authid too.

Regards,
roppert

> 
> 
> Here's what I get while logged into psql as monitor_user:
> 
> select procpid, current_query from pg_stat_activity;
>  procpid |      current_query
> ---------+--------------------------
>    24589 | 
>    24601 | 
>    24600 | 
>    24598 | 
>    24596 | 
>    24594 | 
>    24367 | 
>    24511 |  
> 
> 
> Thanks in advance
> 
> /Kevin
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
> 

FAQ