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

@ -86,4 +86,5 @@ Bug fixes
| `Bug #2707 <https://redmine.postgresql.org/issues/2707>`_ - Disable trigger button does not work on pgAdmin4
| `Bug #2708 <https://redmine.postgresql.org/issues/2708>`_ - Tablespace name should displayed instead of %s(new_tablespace)s with Move Objects to another tablespace
| `Bug #2709 <https://redmine.postgresql.org/issues/2709>`_ - Display user relations in schema prefixed by 'pg'
| `Bug #2713 <https://redmine.postgresql.org/issues/2713>`_ - Exception when the server is restarted
| `Bug #2713 <https://redmine.postgresql.org/issues/2713>`_ - Fix an exception seen sometimes when the server is restarted
| `Bug #2742 <https://redmine.postgresql.org/issues/2742>`_ - Ensure using an alternate role to connect to a database doesn't cause an error when checking recovery state.

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: