diff --git a/web/pgadmin/tools/sqleditor/__init__.py b/web/pgadmin/tools/sqleditor/__init__.py index c72505a..fa8b83f 100644 --- a/web/pgadmin/tools/sqleditor/__init__.py +++ b/web/pgadmin/tools/sqleditor/__init__.py @@ -1474,7 +1474,8 @@ 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 315631c..8ca30b3 100644 --- a/web/pgadmin/utils/driver/psycopg2/connection.py +++ b/web/pgadmin/utils/driver/psycopg2/connection.py @@ -49,6 +49,10 @@ else: _ = gettext +# Use utf_8 decoder instead of psycopg2 default 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()