Re: allow a user to see current_query in pg_stat_activity in 8.4

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Williamson <gwilliamson39(at)yahoo(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: allow a user to see current_query in pg_stat_activity in 8.4
Date: 2012-12-14 03:16:36
Message-ID: 18307.1355454996@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Greg Williamson <gwilliamson39(at)yahoo(dot)com> writes:
> We want to create a role used by a monitor to check for "<IDLE> in Transaction" with the most restrictive permissions we can on a 8.4.13 instance.

> The user has been granted connect privilege to the database and some limited permissions to user tabhles that need to be monitored. But pg_stat_activity shows only "<insufficient privilege>"

Yup. You can only see the query of another session if (1) you are a
superuser, or (2) you are the same user the other session is logged in
as. Table permissions have nothing to do with this.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Haifeng Liu 2012-12-14 03:29:25 Fwd: [ADMIN] Confuse about the behaveior of PreparedStatement.executeBatch (jdbc)
Previous Message Greg Williamson 2012-12-14 02:59:27 allow a user to see current_query in pg_stat_activity in 8.4