Granting access to pg_stat_statements on a custom role
I'm trying to grant a new role access to query pg_stat_statements using the web console
grant pg_read_all_stats to my_new_user;
grant pg_read_all_stats to my_new_user;
but it fails with
ERROR: 42501: permission denied to grant role "pg_read_all_stats"DETAIL: Only roles with the ADMIN option on role "pg_read_all_stats" may grant this role.
ERROR: 42501: permission denied to grant role "pg_read_all_stats"DETAIL: Only roles with the ADMIN option on role "pg_read_all_stats" may grant this role.
I can query it as
postgres
postgres
but I want a separate user with readonly access and don't know if there's any way to login as supabase_admin to get around the superuser requirement. Is there any other way to allow a user to read this view?
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.