mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
It would also be handy if users could see their own pg_stat_activity
queries while the rest remain blank. Kevin Brown
This commit is contained in:
@ -284,14 +284,14 @@ pg_stat_get_backend_activity(PG_FUNCTION_ARGS)
|
||||
int len;
|
||||
text *result;
|
||||
|
||||
if (!superuser())
|
||||
PG_RETURN_NULL();
|
||||
|
||||
beid = PG_GETARG_INT32(0);
|
||||
|
||||
if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
|
||||
PG_RETURN_NULL();
|
||||
|
||||
if (!superuser() && beentry->userid != GetUserId())
|
||||
PG_RETURN_NULL();
|
||||
|
||||
len = strlen(beentry->activity);
|
||||
result = palloc(VARHDRSZ + len);
|
||||
VARATT_SIZEP(result) = VARHDRSZ + len;
|
||||
|
Reference in New Issue
Block a user