mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Recover properly if a database is renamed externally. Fixes #2077
This commit is contained in:
@@ -198,7 +198,7 @@ class DatabaseView(PGChildNodeView):
|
||||
connected = True
|
||||
canDrop = canDisConn = False
|
||||
else:
|
||||
conn = self.manager.connection(dbname)
|
||||
conn = self.manager.connection(dbname,did=row['did'])
|
||||
connected = conn.connected()
|
||||
canDrop = canDisConn = True
|
||||
|
||||
|
||||
@@ -1486,6 +1486,9 @@ class ServerManager(object):
|
||||
if hasattr(str, 'decode') and \
|
||||
not isinstance(database, unicode):
|
||||
database = database.decode('utf-8')
|
||||
if did is not None:
|
||||
if did in self.db_info:
|
||||
self.db_info[did]['datname']=database
|
||||
else:
|
||||
if did is None:
|
||||
database = self.db
|
||||
|
||||
Reference in New Issue
Block a user