diff --git a/pkg/cluster/database.go b/pkg/cluster/database.go index 0d969f29..21fd23c6 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_exporter; + CREATE OR REPLACE FUNCTION exporter.update_pgbackrest_info() RETURNS VOID AS $$ DECLARE @@ -131,7 +133,6 @@ const ( ); END; $$ LANGUAGE plpgsql; - ` )