diff --git a/debian/copyright b/debian/copyright
index 65cb05636ddf4a2961c355b66470106222390266..8c495fad5c8ae34f0962e4f10022e9d9011ec2b2 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -223,6 +223,36 @@ Files: addons/web/static/lib/fontawesome/css/font-awesome.css
 Copyright: Font Awesome by Dave Gandy - http://fontawesome.io
 License: MIT
 
+Files: odoo/__init__.py
+Copyright: Copyright (C) 2010-2012 Daniele Varrazzo <daniele.varrazzo@gmail.com>
+License:
+  Copyright (c) 2010-2012, Daniele Varrazzo <daniele.varrazzo@gmail.com>
+  All rights reserved.
+  .
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are met:
+  .
+  * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+  * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+  * The name of Daniele Varrazzo may not be used to endorse or promote
+    products derived from this software without specific prior written
+    permission.
+  .
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+Comment: This license only applies to the function 'gevent_wait_callback'
+
 Files: addons/web/static/lib/fontawesome/fonts/*
 Copyright: Font Awesome by Dave Gandy - http://fontawesome.io
 License: OFL-1.1
diff --git a/doc/setup/deploy.rst b/doc/setup/deploy.rst
index 6e54815496addc68accc4e4d51bb05bba82ca4d7..ed1825298e233a9f5af984e1760701c5790cd4b2 100644
--- a/doc/setup/deploy.rst
+++ b/doc/setup/deploy.rst
@@ -214,10 +214,6 @@ Instead you must have a proxy redirecting requests whose URL starts with
 ``/longpolling/`` to the longpolling port. Other request should be proxied to
 the :option:`normal HTTP port <odoo-bin --http-port>`
 
-.. warning:: The livechat worker requires the ``psycogreen`` Python module,
-             which is not always included with all installation packages.
-             It can be manually installed with ``pip install psycogreen``.
-
 Configuration sample
 --------------------
 
diff --git a/odoo/__init__.py b/odoo/__init__.py
index 2814706b57aac3fd041baa2da4bcb4e866fd1ad5..c6fa6e3032a6f07c7b61b8dadcb46bd81c2a3498 100644
--- a/odoo/__init__.py
+++ b/odoo/__init__.py
@@ -18,9 +18,27 @@ evented = False
 if len(sys.argv) > 1 and sys.argv[1] == 'gevent':
     sys.argv.remove('gevent')
     import gevent.monkey
+    import psycopg2
+    from gevent.socket import wait_read, wait_write
     gevent.monkey.patch_all()
-    import psycogreen.gevent
-    psycogreen.gevent.patch_psycopg()
+
+    def gevent_wait_callback(conn, timeout=None):
+        """A wait callback useful to allow gevent to work with Psycopg."""
+        # Copyright (C) 2010-2012 Daniele Varrazzo <daniele.varrazzo@gmail.com>
+        # This function is borrowed from psycogreen module which is licensed
+        # under the BSD license (see in odoo/debian/copyright)
+        while 1:
+            state = conn.poll()
+            if state == psycopg2.extensions.POLL_OK:
+                break
+            elif state == psycopg2.extensions.POLL_READ:
+                wait_read(conn.fileno(), timeout=timeout)
+            elif state == psycopg2.extensions.POLL_WRITE:
+                wait_write(conn.fileno(), timeout=timeout)
+            else:
+                raise psycopg2.OperationalError(
+                    "Bad result from poll: %r" % state)
+    psycopg2.extensions.set_wait_callback(gevent_wait_callback)
     evented = True
 
 # Is the server running in prefork mode (e.g. behind Gunicorn).
diff --git a/requirements.txt b/requirements.txt
index 626cbfb12effcfa2388369fecc4f4cbb98b52570..fda778e7d96c5ea1f05c20d424f148a8b38f2505 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -16,7 +16,6 @@ ofxparse==0.16
 passlib==1.6.5
 Pillow==3.4.1
 psutil==4.3.1
-psycogreen==1.0
 psycopg2==2.7.1
 pydot==1.2.3
 pyldap==2.4.28
diff --git a/setup.cfg b/setup.cfg
index 7fc4abb611a74006ed7d8ec698d927c34f8afbcb..f9127ec44c4445b502684562eea0d2a000df8338 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -27,7 +27,6 @@ requires =
   python3-passlib
   python3-pillow
   python3-psutil
-  python3-psycogreen
   python3-pydot
   python3-pyldap
   python3-pyparsing
diff --git a/setup.py b/setup.py
index 004575e28d41b836eaf993af6c212eff9eddaf3f..437b4b6097509fd6f0a21147bdc9543c82372df5 100644
--- a/setup.py
+++ b/setup.py
@@ -149,7 +149,6 @@ setup(
         'passlib',
         'pillow',  # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
         'psutil',  # windows binary code.google.com/p/psutil/downloads/list
-        'psycogreen',
         'psycopg2 >= 2.2',
         'pydot',
         'pyldap',  # optional
diff --git a/setup/package.dffedora b/setup/package.dffedora
index 5aa1f3a761faf4dd69909bf958164da911091b34..683f34c2d8ff800aeffe2736b89dace5f8f06113 100644
--- a/setup/package.dffedora
+++ b/setup/package.dffedora
@@ -27,7 +27,6 @@ RUN dnf update -d 0 -e 0 -y && \
 	  python3-passlib \
 	  python3-pillow \
 	  python3-psutil \
-	  python3-psycogreen \
 	  python3-pydot \
 	  python3-pyldap \
 	  python3-pyparsing \
diff --git a/setup/win32/winpy_requirements.txt b/setup/win32/winpy_requirements.txt
index 70f696459adede4dbb0176497f376195594def94..458473815ece3554b19ab7e978a4b3c5f5e1952e 100644
--- a/setup/win32/winpy_requirements.txt
+++ b/setup/win32/winpy_requirements.txt
@@ -16,7 +16,6 @@ ofxparse==0.16
 passlib==1.6.5
 Pillow>=3.4.1
 psutil>=4.3.1
-psycogreen==1.0
 psycopg2==2.7.1
 pydot==1.2.3
 pyldap>=2.4.28