Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 3FC3E9FB2C3 for ; Fri, 12 Oct 2007 05:51:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 32611-06 for ; Fri, 12 Oct 2007 05:50:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from pne-smtpout2-sn1.fre.skanova.net (pne-smtpout2-sn1.fre.skanova.net [81.228.11.159]) by postgresql.org (Postfix) with ESMTP id 237E59FB2B4 for ; Fri, 12 Oct 2007 05:51:00 -0300 (ADT) Received: from charlie.localnet (194.237.103.55) by pne-smtpout2-sn1.fre.skanova.net (7.2.075) id 46FA233100496C73; Fri, 12 Oct 2007 10:50:58 +0200 Message-ID: <470F3563.9050804@blogg.se> Date: Fri, 12 Oct 2007 10:50:43 +0200 From: =?ISO-8859-1?Q?Robert_Gravsj=F6?= Organization: Blogg Esse User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070807) MIME-Version: 1.0 To: Kevin Kempter CC: pgsql-admin@postgresql.org Subject: Re: permissions on system catalogs for non-superuser? References: <200710111256.11010.kevin@kevinkempterllc.com> In-Reply-To: <200710111256.11010.kevin@kevinkempterllc.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.096 tagged_above=0 required=5 tests=AWL=0.281, BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 200710/107 X-Sequence-Number: 27021 Kevin Kempter wrote: > Hi List; > > we have some monitoring/alert scripts which run sql against the database > (8.1.4) as a non-superuser. The problem is I get > when trying to access current_query from pg_stat_activity. > > I ran these grant statements but still no joy: > grant select on pg_stat_activity to monitor_user; > grant select on pg_database to monitor_user; IIRC you need select priv on pg_authid too. Regards, roppert > > > Here's what I get while logged into psql as monitor_user: > > select procpid, current_query from pg_stat_activity; > procpid | current_query > ---------+-------------------------- > 24589 | > 24601 | > 24600 | > 24598 | > 24596 | > 24594 | > 24367 | > 24511 | > > > Thanks in advance > > /Kevin > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend >