Fixed connection and version number detection issue when the database server is upgraded. Fixes #5507
parent
ba91e3fc1f
commit
92d9c41da7
|
@ -23,5 +23,6 @@ Bug fixes
|
||||||
| `Issue #3787 <https://redmine.postgresql.org/issues/3787>`_ - Disabled the Stop process button after clicking it and added a message 'Terminating the process...' to notify the user.
|
| `Issue #3787 <https://redmine.postgresql.org/issues/3787>`_ - Disabled the Stop process button after clicking it and added a message 'Terminating the process...' to notify the user.
|
||||||
| `Issue #5416 <https://redmine.postgresql.org/issues/5416>`_ - Ensure that the query tool panel gets closed when clicking on the 'Don't Save' button.
|
| `Issue #5416 <https://redmine.postgresql.org/issues/5416>`_ - Ensure that the query tool panel gets closed when clicking on the 'Don't Save' button.
|
||||||
| `Issue #5465 <https://redmine.postgresql.org/issues/5465>`_ - Fixed an issue where the Edge browser version is showing wrong and warning message gets displayed.
|
| `Issue #5465 <https://redmine.postgresql.org/issues/5465>`_ - Fixed an issue where the Edge browser version is showing wrong and warning message gets displayed.
|
||||||
|
| `Issue #5507 <https://redmine.postgresql.org/issues/5507>`_ - Fixed connection and version number detection issue when the database server is upgraded.
|
||||||
| `Issue #5521 <https://redmine.postgresql.org/issues/5521>`_ - Fixed an issue when dumping servers from a desktop pgAdmin app by providing an option '--sqlite-path'.
|
| `Issue #5521 <https://redmine.postgresql.org/issues/5521>`_ - Fixed an issue when dumping servers from a desktop pgAdmin app by providing an option '--sqlite-path'.
|
||||||
| `Issue #5539 <https://redmine.postgresql.org/issues/5539>`_ - Fixed typo in exception keyword.
|
| `Issue #5539 <https://redmine.postgresql.org/issues/5539>`_ - Fixed typo in exception keyword.
|
|
@ -439,28 +439,28 @@ class Connection(BaseConnection):
|
||||||
"Failed to setup the role with error message:\n{0}"
|
"Failed to setup the role with error message:\n{0}"
|
||||||
).format(status)
|
).format(status)
|
||||||
|
|
||||||
if manager.ver is None:
|
# Check database version every time on reconnection
|
||||||
status = _execute(cur, "SELECT version()")
|
status = _execute(cur, "SELECT version()")
|
||||||
|
|
||||||
if status is not None:
|
if status is not None:
|
||||||
self.conn.close()
|
self.conn.close()
|
||||||
self.conn = None
|
self.conn = None
|
||||||
self.wasConnected = False
|
self.wasConnected = False
|
||||||
current_app.logger.error(
|
current_app.logger.error(
|
||||||
"Failed to fetch the version information on the "
|
"Failed to fetch the version information on the "
|
||||||
"established connection to the database server "
|
"established connection to the database server "
|
||||||
"(#{server_id}) for '{conn_id}' with below error "
|
"(#{server_id}) for '{conn_id}' with below error "
|
||||||
"message:{msg}".format(
|
"message:{msg}".format(
|
||||||
server_id=self.manager.sid,
|
server_id=self.manager.sid,
|
||||||
conn_id=conn_id,
|
conn_id=conn_id,
|
||||||
msg=status)
|
msg=status)
|
||||||
)
|
)
|
||||||
return False, status
|
return False, status
|
||||||
|
|
||||||
if cur.rowcount > 0:
|
if cur.rowcount > 0:
|
||||||
row = cur.fetchmany(1)[0]
|
row = cur.fetchmany(1)[0]
|
||||||
manager.ver = row['version']
|
manager.ver = row['version']
|
||||||
manager.sversion = self.conn.server_version
|
manager.sversion = self.conn.server_version
|
||||||
|
|
||||||
status = _execute(cur, """
|
status = _execute(cur, """
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
@ -263,9 +263,6 @@ WHERE db.oid = {0}""".format(did))
|
||||||
|
|
||||||
from pgadmin.browser.server_groups.servers.types import ServerType
|
from pgadmin.browser.server_groups.servers.types import ServerType
|
||||||
|
|
||||||
self.ver = data.get('ver', None)
|
|
||||||
self.sversion = data.get('sversion', None)
|
|
||||||
|
|
||||||
if self.ver and not self.server_type:
|
if self.ver and not self.server_type:
|
||||||
for st in ServerType.types():
|
for st in ServerType.types():
|
||||||
if st.instanceOf(self.ver):
|
if st.instanceOf(self.ver):
|
||||||
|
|
Loading…
Reference in New Issue