pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14860: pg_read_all_stats and pg_stat_replication
2+ messages / 2 participants
[nested] [flat]

* BUG #14860: pg_read_all_stats and pg_stat_replication
@ 2017-10-18 12:40  mdevan.r@gmail.com
  0 siblings, 1 reply; 2+ messages in thread

From: mdevan.r@gmail.com @ 2017-10-18 12:40 UTC (permalink / raw)
  To: pgsql-bugs; +Cc: mdevan.r@gmail.com

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



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [BUGS] BUG #14860: pg_read_all_stats and pg_stat_replication
@ 2018-01-10 20:53  Bruce Momjian <bruce@momjian.us>
  parent: mdevan.r@gmail.com
  0 siblings, 0 replies; 2+ messages in thread

From: Bruce Momjian @ 2018-01-10 20:53 UTC (permalink / raw)
  To: mdevan.r@gmail.com; +Cc: pgsql-bugs

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%4...

and fixed here:

	commit 6668a54eb8ef639a3182ae9e37e4e67982c44292
	Author: Simon Riggs <simon@2ndQuadrant.com>
	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  <bruce@momjian.us>        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 +




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-01-10 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-10-18 12:40 BUG #14860: pg_read_all_stats and pg_stat_replication mdevan.r@gmail.com
2018-01-10 20:53 ` Bruce Momjian <bruce@momjian.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox