diff --git a/web/pgadmin/utils/driver/psycopg2/__init__.py b/web/pgadmin/utils/driver/psycopg2/__init__.py index 0b06e409a..fb33969e8 100644 --- a/web/pgadmin/utils/driver/psycopg2/__init__.py +++ b/web/pgadmin/utils/driver/psycopg2/__init__.py @@ -760,7 +760,14 @@ class Driver(BaseDriver): @staticmethod def qtLiteral(value): - return adapt(value).getquoted() + + res = adapt(value).getquoted() + + # Returns in bytes, we need to convert it in string + if isinstance(res, bytes): + return res.decode() + else: + return res @staticmethod def ScanKeywordExtraLookup(key):