Re: [GENERAL] Stats Collector

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Jan Wieck" <JanWieck(at)Yahoo(dot)com>, "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] Stats Collector
Date: 2002-07-31 07:24:39
Message-ID: GNELIHDDFBOCMGBFGEFOGEHBCDAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gerhard Hintermayer 2002-07-31 07:47:12 database shutdown with persistent client connections
Previous Message Bruce Momjian 2002-07-31 03:30:16 Re: getpid() function

Browse pgsql-hackers by date

  From Date Subject
Next Message Mario Weilguni 2002-07-31 07:28:02 Re: Outer join differences
Previous Message Kaare Rasmussen 2002-07-31 07:04:55 Re: Open 7.3 items