From e03e58c5c741970c997ef64acef070aed9731d61 Mon Sep 17 00:00:00 2001 From: Anton Yuzhaninov Date: Tue, 3 Mar 2020 19:21:56 +0000 Subject: [PATCH] Fix: show size of actually used Redash database (#4706) 'postgres' is a default database name in the Docker image, but if an external database server is used, than Redash database can have a different name (specified in REDASH_DATABASE_URL). --- redash/monitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redash/monitor.py b/redash/monitor.py index 14060473..b6f70547 100644 --- a/redash/monitor.py +++ b/redash/monitor.py @@ -40,7 +40,7 @@ def get_db_sizes(): "Query Results Size", "select pg_total_relation_size('query_results') as size from (select 1) as a", ], - ["Redash DB Size", "select pg_database_size('postgres') as size"], + ["Redash DB Size", "select pg_database_size(current_database()) as size"], ] for query_name, query in queries: result = db.session.execute(query).first()