From db5d7ccac99e4b1f3ea0d09f7fc1b6f0682f336d Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 20 Mar 2003 18:51:16 +0000 Subject: It would also be handy if users could see their own pg_stat_activity queries while the rest remain blank. Kevin Brown --- src/backend/utils/adt/pgstatfuncs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/utils/adt/pgstatfuncs.c') diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index 455da1c2aa9..c2f0ea2c829 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -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; -- cgit v1.2.3