Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZNNi-0002PS-HA for pgsql-bugs@arkaria.postgresql.org; Wed, 10 Jan 2018 20:53:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZNNh-0001nB-Td for pgsql-bugs@arkaria.postgresql.org; Wed, 10 Jan 2018 20:53:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eZNNh-0001n0-O7 for pgsql-bugs@lists.postgresql.org; Wed, 10 Jan 2018 20:53:53 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eZNNe-00023Z-Bl for pgsql-bugs@postgresql.org; Wed, 10 Jan 2018 20:53:53 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1eZNNc-00031N-LN; Wed, 10 Jan 2018 15:53:48 -0500 Date: Wed, 10 Jan 2018 15:53:48 -0500 From: Bruce Momjian To: mdevan.r@gmail.com Cc: pgsql-bugs@postgresql.org Subject: Re: [BUGS] BUG #14860: pg_read_all_stats and pg_stat_replication Message-ID: <20180110205348.GF29178@momjian.us> References: <20171018124022.8210.3570@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171018124022.8210.3570@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Oct 18, 2017 at 12:40:22PM +0000, mdevan.r@gmail.com wrote: > The following bug has been logged on the website: > > Bug reference: 14860 > Logged by: Mahadevan R > Email address: mdevan.r@gmail.com > PostgreSQL version: 10.0 > Operating system: any > Description: > > User with pg_read_all_stats privilege is not able to read > some columns (listed below) from the pg_stat_replication > view. This is because these columns come from the function > pg_stat_get_wal_senders(), and this function returns non-null > values only for superuser. > > To reproduce, set up streaming replication, and a user with > pg_read_all_stats privilege and "select * from > pg_stat_replication". The following columns will be null: > > state > sent_lsn > write_lsn > flush_lsn > replay_lsn > sync_priority > sync_state This bug was also reported here: https://www.postgresql.org/message-id/flat/CAK_s-G0c3fXQ_Rpyvj5gHiKnaa9_H1eS%2B2Oopqm1eOK79V%2BFKw%40mail.gmail.com#CAK_s-G0c3fXQ_Rpyvj5gHiKnaa9_H1eS+2Oopqm1eOK79V+FKw@mail.gmail.com and fixed here: commit 6668a54eb8ef639a3182ae9e37e4e67982c44292 Author: Simon Riggs Date: Sat Jan 6 11:48:21 2018 +0000 Default monitoring roles - errata 25fff40798fc4ac11a241bfd9ab0c45c085e2212 introduced default monitoring roles. Apply these corrections: * Allow access to pg_stat_get_wal_senders() by role pg_read_all_stats * Correct comment in pg_stat_get_wal_receiver() to show it is no longer superuser-only. Author: Feike Steenbergen Reviewed-by: Michael Paquier Apply to HEAD, then later backpatch to 10 The fix will appear in the next PG 10 minor release. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +