Grant postgres_exporter role to deployer role

If the deployer role is not superuser (which is the case in AWS RDS,
for example), we need to grant it access to postgres_exporter role
before we can create a schema with AUTHORIZATION postgres_exporter.
This commit is contained in:
Alexander Savchuk 2017-06-09 14:40:29 +12:00 committed by Will Rouesnel
parent 1ec400b707
commit 81194c9219
1 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,8 @@ To be able to collect metrics from pg_stat_activity and pg_stat_replication as n
CREATE USER postgres_exporter PASSWORD 'password';
ALTER USER postgres_exporter SET SEARCH_PATH TO postgres_exporter,pg_catalog;
-- If deploying as non-superuser (for example in AWS RDS)
-- GRANT postgres_exporter TO :MASTER_USER;
CREATE SCHEMA postgres_exporter AUTHORIZATION postgres_exporter;
CREATE FUNCTION postgres_exporter.f_select_pg_stat_activity()