mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-01-31 18:41:30 +00:00
Update README.md
Allow non-superuser commands to be re-run without (some) errors.
This commit is contained in:
parent
0d4af2b71c
commit
b12adc11e4
@ -178,7 +178,7 @@ ALTER USER postgres_exporter SET SEARCH_PATH TO postgres_exporter,pg_catalog;
|
||||
-- If deploying as non-superuser (for example in AWS RDS), uncomment the GRANT
|
||||
-- line below and replace <MASTER_USER> with your root user.
|
||||
-- GRANT postgres_exporter TO <MASTER_USER>;
|
||||
CREATE SCHEMA postgres_exporter;
|
||||
CREATE SCHEMA IF NOT EXISTS postgres_exporter;
|
||||
GRANT USAGE ON SCHEMA postgres_exporter TO postgres_exporter;
|
||||
|
||||
CREATE FUNCTION get_pg_stat_activity() RETURNS SETOF pg_stat_activity AS
|
||||
@ -187,19 +187,19 @@ LANGUAGE sql
|
||||
VOLATILE
|
||||
SECURITY DEFINER;
|
||||
|
||||
CREATE VIEW postgres_exporter.pg_stat_activity
|
||||
CREATE OR REPLACE VIEW postgres_exporter.pg_stat_activity
|
||||
AS
|
||||
SELECT * from get_pg_stat_activity();
|
||||
|
||||
GRANT SELECT ON postgres_exporter.pg_stat_activity TO postgres_exporter;
|
||||
|
||||
CREATE FUNCTION get_pg_stat_replication() RETURNS SETOF pg_stat_replication AS
|
||||
CREATE OR REPLACE FUNCTION get_pg_stat_replication() RETURNS SETOF pg_stat_replication AS
|
||||
$$ SELECT * FROM pg_catalog.pg_stat_replication; $$
|
||||
LANGUAGE sql
|
||||
VOLATILE
|
||||
SECURITY DEFINER;
|
||||
|
||||
CREATE VIEW postgres_exporter.pg_stat_replication
|
||||
CREATE OR REPLACE VIEW postgres_exporter.pg_stat_replication
|
||||
AS
|
||||
SELECT * FROM get_pg_stat_replication();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user