我有需要監視的流式複製。所以Zabbix有一個特殊的用戶。我不想使用pg_mongz並決定將自己的查詢設置爲pg_catalog模式的視圖pg_stat_replication以獲取複製狀態。無法訪問PostgreSQL中的流式複製統計信息
當我使用的查詢:
select *
from pg_stat_replication;
返回複製狀態記錄管理。但是當我登錄的監視用戶返回剛:
pid, usesysid, usename, application_name
所以這樣的參數client_addr,客戶端主機,CLIENT_PORT,backend_start,州,sent_location,write_location等都是空的。
首先我授予架構權限,我的用戶和表:
grant usage on schema pg_catalog to usrmonitor;
grant select on all tables in schema pg_catalog to usrmonitor;
,但它並沒有幫助。當我查看視圖時,我發現查詢使用函數並授予執行權:
grant execute on function pg_stat_get_wal_senders() to usrmonitor;
grant execute on function pg_stat_get_activity(integer) to usrmonitor;
但是,select查詢仍然返回空列。可能是什麼問題?