This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Description
If I start an adapter that should use an existing database, there is the following error message in the Postgres Log.
2019-09-06 12:44:31.230 UTC [16399] ERROR: relation "metrics_labels" already exists
2019-09-06 12:44:31.230 UTC [16399] CONTEXT: SQL statement "
CREATE TABLE metrics_labels (
id SERIAL PRIMARY KEY,
metric_name TEXT NOT NULL,
labels jsonb,
UNIQUE(metric_name, labels)
)
"
PL/pgSQL function create_prometheus_table(name,name,name,name,name,boolean,boolean,interval) line 45 at EXECUTE
2019-09-06 12:44:31.230 UTC [16399] STATEMENT: SELECT create_prometheus_table($1, normalized_tables => $2, chunk_time_interval => $3, use_timescaledb=> $4)
This could be solved with a simple function that checks if the database already exists before setup.