diff --git a/requirements_py2.txt b/requirements_py2.txt
index b205323..83ac8d3 100644
--- a/requirements_py2.txt
+++ b/requirements_py2.txt
@@ -21,7 +21,7 @@ linecache2==1.0.0
 MarkupSafe==0.23
 passlib==1.6.2
 pbr==1.9.1
-psycopg2==2.5.2
+psycopg2==2.6.2
 pycrypto==2.6.1
 pyrsistent==0.11.13
 python-dateutil==2.5.0
diff --git a/requirements_py3.txt b/requirements_py3.txt
index 463f79e..ad6fa02 100644
--- a/requirements_py3.txt
+++ b/requirements_py3.txt
@@ -20,7 +20,7 @@ linecache2==1.0.0
 MarkupSafe==0.23
 passlib==1.6.2
 pbr==1.9.1
-psycopg2==2.5.2
+psycopg2==2.6.2
 pycrypto==2.6.1
 pyrsistent==0.11.13
 python-dateutil==2.5.0
diff --git a/web/pgadmin/utils/driver/psycopg2/__init__.py b/web/pgadmin/utils/driver/psycopg2/__init__.py
index 7b901d4..9c76959 100644
--- a/web/pgadmin/utils/driver/psycopg2/__init__.py
+++ b/web/pgadmin/utils/driver/psycopg2/__init__.py
@@ -1564,9 +1564,13 @@ class Driver(BaseDriver):
 
     @staticmethod
     def qtLiteral(value):
-
-        res = adapt(value).getquoted()
-
+        try:
+            res = adapt(value).getquoted()
+        except UnicodeEncodeError:
+            # We will handle special charcters with utf8 encoding
+            adapted = adapt(value)
+            adapted.encoding = 'utf8'
+            res = adapted.getquoted()
         # Returns in bytes, we need to convert it in string
         if isinstance(res, bytes):
             return res.decode()
