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).
This commit is contained in:
Anton Yuzhaninov 2020-03-03 19:21:56 +00:00 committed by GitHub
parent 78201c6108
commit e03e58c5c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()