diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index cea01534a5..3571a9bf2e 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -450,6 +450,7 @@ pg_stat_get_progress_info(PG_FUNCTION_ARGS) ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; MemoryContext per_query_ctx; MemoryContext oldcontext; + Oid user_id = GetUserId(); /* check to see if caller supports us returning a tuplestore */ if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) @@ -521,7 +522,8 @@ pg_stat_get_progress_info(PG_FUNCTION_ARGS) values[1] = ObjectIdGetDatum(beentry->st_databaseid); /* show rest of the values including relid only to role members */ - if (has_privs_of_role(GetUserId(), beentry->st_userid)) + if (has_privs_of_role(user_id, beentry->st_userid) || + is_member_of_role(user_id, DEFAULT_ROLE_READ_ALL_STATS)) { values[2] = ObjectIdGetDatum(beentry->st_progress_command_target); for (i = 0; i < PGSTAT_NUM_PROGRESS_PARAM; i++)