Skip to content

Commit

Permalink
Add SQL for grant connect (#303)
Browse files Browse the repository at this point in the history
To resolve the error below, it was necessary to add a new grant to the database postgres.

Error: 'pq: permission denied for database \ "postgres \"'
  • Loading branch information
focabr authored and wrouesnel committed Oct 30, 2019
1 parent d6f7ff1 commit 27d5c99
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -208,6 +208,7 @@ ALTER USER postgres_exporter SET SEARCH_PATH TO postgres_exporter,pg_catalog;
-- GRANT postgres_exporter TO <MASTER_USER>;
CREATE SCHEMA IF NOT EXISTS postgres_exporter;
GRANT USAGE ON SCHEMA postgres_exporter TO postgres_exporter;
GRANT CONNECT ON DATABASE postgres TO postgres_exporter;

CREATE OR REPLACE FUNCTION get_pg_stat_activity() RETURNS SETOF pg_stat_activity AS
$$ SELECT * FROM pg_catalog.pg_stat_activity; $$
Expand Down

0 comments on commit 27d5c99

Please sign in to comment.