From: | Magnus Hagander <magnus(at)hagander(dot)net> |
---|---|
To: | "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru> |
Cc: | Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Allow pg_read_all_stats to read pg_stat_progress_* |
Date: | 2020-04-20 11:05:35 |
Message-ID: | CABUevExUtXJ7cZLuVeDy5wXbDKSzXRTB1B8_bfVmdO588igw9A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Apr 20, 2020 at 12:43 PM Andrey M. Borodin <x4mmm(at)yandex-team(dot)ru>
wrote:
>
>
> > 16 апр. 2020 г., в 17:46, Magnus Hagander <magnus(at)hagander(dot)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 inherited and 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))
>
It is consistent with all the other uses of DEFAULT_ROLE_READ_ALL_STATS
that I can find.
Besides this, the patch looks good to me.
>
Thanks, I've pushed it now.
--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>
From | Date | Subject | |
---|---|---|---|
Next Message | Stephen Frost | 2020-04-20 11:10:02 | Re: Allow pg_read_all_stats to read pg_stat_progress_* |
Previous Message | Andrey M. Borodin | 2020-04-20 10:43:22 | Re: Allow pg_read_all_stats to read pg_stat_progress_* |