Subject: PATCH: Minor patch to fix 'qtLiteral' function in pgAdmin4

From: Murtuza Zabuawala <[email-masked]>
Date: Tue, 5 Jan 2016 19:25:21 +0530

Hi,

Please find minor patch to fix 'qtLiteral' function in pgAdmin4.

_Issue:_
'qtLiteral' functions returns in 'bytes' but we need to convert it in 
string for Python3.

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

-- 
Sent via pgadmin-hackers mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

---

From: Ashesh Vashi <[email-masked]>
Date: Thu, 7 Jan 2016 19:34:11 +0530

Done with small changes.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company
<http://www.enterprisedb.com>

*http://www.linkedin.com/in/asheshvashi*
<http://www.linkedin.com/in/asheshvashi>

On Tue, Jan 5, 2016 at 7:25 PM, Murtuza Zabuawala <
[email-masked]> wrote:

> *Issue:*