Re: [GENERAL] Stats Collector - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Re: [GENERAL] Stats Collector
Date
Msg-id GNELIHDDFBOCMGBFGEFOGEHBCDAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Re: [GENERAL] Stats Collector  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> >> It all works now and I have just submitted it to -patches as a
> new contrib,
> >> but it probably should make its way into the backend one day.
>
> > OK, the big question is how do we want to make stats reset visible to
> > users?  The current patch uses a function call.  Is that how we want to
> > do it?
>
> Should we make it visible at all?  I'm concerned about security.

The function it's calling in the backend:

void
pgstat_reset_counters(void)
{       PgStat_MsgResetcounter msg;
       if (pgStatSock < 0)               return;
       if (!superuser())               elog(ERROR, "Only database superusers can reset statistic
counters");
       pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_RESETCOUNTER);       pgstat_send(&msg, sizeof(msg));
}

Note it does actually check that you're a superuser...

Chris



pgsql-hackers by date:

Previous
From: "Kaare Rasmussen"
Date:
Subject: Re: Open 7.3 items
Next
From: Mario Weilguni
Date:
Subject: Re: Outer join differences