Ensure using an alternate role to connect to a database doesn't cause an error when checking recovery state. Fixes #2742

This commit is contained in:
Akshay Joshi
2017-09-28 15:09:49 +01:00
committed by Dave Page
parent 9588d76b75
commit 5a132a547f
2 changed files with 3 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ def recovery_state(connection, postgres_version):
recovery_check_sql = render_template("connect/sql/#{0}#/check_recovery.sql".format(postgres_version))
status, result = connection.execute_dict(recovery_check_sql)
if status:
if status and 'rows' in result and len(result['rows']) > 0:
in_recovery = result['rows'][0]['inrecovery']
wal_paused = result['rows'][0]['isreplaypaused']
else: