From 7776cd46a71912990956cbc7df222ee6978aa135 Mon Sep 17 00:00:00 2001 From: matthias Date: Wed, 20 Nov 2024 07:36:56 +0100 Subject: [PATCH 1/2] added priv for cpo_exporter --- pkg/cluster/database.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/database.go b/pkg/cluster/database.go index 0d969f29..3130d081 100644 --- a/pkg/cluster/database.go +++ b/pkg/cluster/database.go @@ -97,13 +97,15 @@ const ( ALTER SCHEMA exporter OWNER TO cpo_exporter; CREATE EXTENSION IF NOT EXISTS pgnodemx with SCHEMA exporter; alter extension pgnodemx UPDATE; - CREATE TABLE IF NOT EXISTS exporter.pgbackrestbackupinfo ( + CREATE TABLE IF NOT EXISTS exporter.pgbackrestbackupinfo ( data jsonb NOT NULL, data_time timestamp with time zone DEFAULT now() NOT NULL ) WITH (autovacuum_analyze_scale_factor='0', autovacuum_vacuum_scale_factor='0', autovacuum_vacuum_threshold='2', autovacuum_analyze_threshold='2'); ALTER TABLE exporter.pgbackrestbackupinfo OWNER TO cpo_exporter; + GRANT pg_execute_server_program TO cpo_exorter; + CREATE OR REPLACE FUNCTION exporter.update_pgbackrest_info() RETURNS VOID AS $$ DECLARE @@ -131,7 +133,6 @@ const ( ); END; $$ LANGUAGE plpgsql; - ` ) From 13de4eb40c650749ee5ac9edb9147e0b74ca33ec Mon Sep 17 00:00:00 2001 From: matthias Date: Tue, 26 Nov 2024 08:19:17 +0100 Subject: [PATCH 2/2] add grant for monitoring-user --- pkg/cluster/database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cluster/database.go b/pkg/cluster/database.go index 3130d081..21fd23c6 100644 --- a/pkg/cluster/database.go +++ b/pkg/cluster/database.go @@ -104,7 +104,7 @@ const ( WITH (autovacuum_analyze_scale_factor='0', autovacuum_vacuum_scale_factor='0', autovacuum_vacuum_threshold='2', autovacuum_analyze_threshold='2'); ALTER TABLE exporter.pgbackrestbackupinfo OWNER TO cpo_exporter; - GRANT pg_execute_server_program TO cpo_exorter; + GRANT pg_execute_server_program TO cpo_exporter; CREATE OR REPLACE FUNCTION exporter.update_pgbackrest_info() RETURNS VOID AS $$