Re: Allow pg_read_all_stats to read pg_stat_progress_* - Mailing list pgsql-hackers

From Andrey M. Borodin
Subject Re: Allow pg_read_all_stats to read pg_stat_progress_*
Date
Msg-id AED5F9D1-6EE7-4559-B261-39F1AD6D1695@yandex-team.ru
Whole thread Raw
In response to Re: Allow pg_read_all_stats to read pg_stat_progress_*  (Magnus Hagander <magnus@hagander.net>)
Responses Re: Allow pg_read_all_stats to read pg_stat_progress_*  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers

> 16 апр. 2020 г., в 17:46, Magnus Hagander <magnus@hagander.net> написал(а):
>
>
> If we do that, it may be better that we define "PGSTAT_VIEW_PRIV()" or
> something like and replace the all occurances of the idiomatic
> condition with it.
>
> You mean something like the attached?
>
> <allow_read_all_stats3.diff>

Is it correct that we use DEFAULT_ROLE_READ_ALL_STATS regardless of inheritance? I'm not familiar with what is
inheritedand what is not, so I think it's better to ask explicitly. 

+#define HAS_PGSTAT_PERMISSIONS(role)     (is_member_of_role(GetUserId(), DEFAULT_ROLE_READ_ALL_STATS) ||
has_privs_of_role(GetUserId(),role)) 

Besides this, the patch looks good to me.
Thanks!

Best regards, Andrey Borodin,


pgsql-hackers by date:

Previous
From: Victor Yegorov
Date:
Subject: Re: Poll: are people okay with function/operator table redesign?
Next
From: Magnus Hagander
Date:
Subject: Re: Allow pg_read_all_stats to read pg_stat_progress_*