mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Check for the connection status before executing the statement for
checking the 'server in recovery' information. Thanks Khushboo for reporting the issue.
This commit is contained in:
parent
7f790a7f49
commit
40a9490382
@ -69,13 +69,15 @@ class ServerModule(sg.ServerGroupPluginModule):
|
|||||||
manager = driver.connection_manager(server.id)
|
manager = driver.connection_manager(server.id)
|
||||||
conn = manager.connection()
|
conn = manager.connection()
|
||||||
connected = conn.connected()
|
connected = conn.connected()
|
||||||
|
if connected:
|
||||||
status, in_recovery = conn.execute_scalar("""
|
status, in_recovery = conn.execute_scalar("""
|
||||||
SELECT CASE WHEN usesuper
|
SELECT CASE WHEN usesuper
|
||||||
THEN pg_is_in_recovery()
|
THEN pg_is_in_recovery()
|
||||||
ELSE FALSE
|
ELSE FALSE
|
||||||
END as inrecovery
|
END as inrecovery
|
||||||
FROM pg_user WHERE usename=current_user""")
|
FROM pg_user WHERE usename=current_user""")
|
||||||
|
else:
|
||||||
|
in_recovery = None
|
||||||
|
|
||||||
yield self.generate_browser_node(
|
yield self.generate_browser_node(
|
||||||
"%d" % (server.id),
|
"%d" % (server.id),
|
||||||
|
Loading…
Reference in New Issue
Block a user