--- ../postgresql-7.2.4/src/backend/utils/adt/pgstatfuncs.c Wed Oct 24 22:49:45 2001 +++ src/backend/utils/adt/pgstatfuncs.c Thu Mar 6 20:04:26 2003 @@ -264,12 +264,12 @@ 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);