diff --git a/web/pgadmin/tools/sqleditor/__init__.py b/web/pgadmin/tools/sqleditor/__init__.py index c72505a4..aec3faba 100644 --- a/web/pgadmin/tools/sqleditor/__init__.py +++ b/web/pgadmin/tools/sqleditor/__init__.py @@ -1474,7 +1474,7 @@ def query_tool_status(trans_id): errormsg=error_msg ) - if conn and trans_obj and session_obj: + if conn and trans_obj and session_obj and conn.transaction_status() is not None: status = conn.transaction_status() return make_json_response( data={ diff --git a/web/pgadmin/utils/driver/psycopg2/connection.py b/web/pgadmin/utils/driver/psycopg2/connection.py index 315631c0..ea90e62f 100644 --- a/web/pgadmin/utils/driver/psycopg2/connection.py +++ b/web/pgadmin/utils/driver/psycopg2/connection.py @@ -49,6 +49,9 @@ else: _ = gettext +# Use utf_8 decoder instead of ascii for SQL_ASCII database to avoid decode errors +encodings['SQL_ASCII'] = 'utf_8' +encodings['SQLASCII'] = 'utf_8' # Register global type caster which will be applicable to all connections. register_global_typecasters()