diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py index 2c356c1e3..d81420f29 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py @@ -374,7 +374,10 @@ class ColumnsView(PGChildNodeView, DataTypeReader): if k in ('description',): data[k] = v else: - data[k] = json.loads(v, cls=ColParamsJSONDecoder) + try: + data[k] = json.loads(v, cls=ColParamsJSONDecoder) + except TypeError: + data[k] = v required_args = { 'name': 'Name', diff --git a/web/pgadmin/utils/ajax.py b/web/pgadmin/utils/ajax.py index 699583243..f66b33f1e 100644 --- a/web/pgadmin/utils/ajax.py +++ b/web/pgadmin/utils/ajax.py @@ -27,7 +27,12 @@ class DataTypeJSONEncoder(json.JSONEncoder): if isinstance(obj, decimal.Decimal): return float(obj) - return json.JSONEncoder.default(self, obj) + try: + retval = json.JSONEncoder.default(self, obj) + except TypeError: + retval = obj + + return retval class ColParamsJSONDecoder(json.JSONDecoder): diff --git a/web/pgadmin/utils/driver/psycopg2/connection.py b/web/pgadmin/utils/driver/psycopg2/connection.py index b717e18f2..d81c916d2 100644 --- a/web/pgadmin/utils/driver/psycopg2/connection.py +++ b/web/pgadmin/utils/driver/psycopg2/connection.py @@ -1987,8 +1987,6 @@ Failed to reset the connection to the server due to following error: if parameters: mogrified_sql = cursor.mogrify(query, parameters) - if isinstance(mogrified_sql, bytes): - mogrified_sql = mogrified_sql.decode(self.python_encoding) return mogrified_sql else: return query