Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Can't get access to streaming replication stats in PostgreSQL

$
0
0

I have streaming replication wich i need to monitor. So there is a special user for Zabbix. I don't want to use pg_mongz and decided to set my own quieries to pg_catalog schema's view pg_stat_replication to get replication state. When I use query:

select * from pg_stat_replication;

it returns replication state record for admin. But when I loged as monitoring user it returns just: pid, usesysid, usename, application_name. So such parameters as client_addr, client_hostname, client_port, backend_start, state, sent_location, write_location, etc. are empty.

First I granted rights to my user on schema and tables:

grant usage on schema pg_catalog to usrmonitor;
grant select on all tables in schema pg_catalog to usrmonitor;

but it didn't help. When I looked at view I found that query uses functions and granted execution:

grant execute on function pg_stat_get_wal_senders() to usrmonitor;
grant execute on function pg_stat_get_activity(integer) to usrmonitor;

But the select query still returns empty fileds. What maybe the problem?


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>