]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- [bug] Added 'terminating connection' to the list
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 25 Sep 2012 20:54:50 +0000 (16:54 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 25 Sep 2012 20:54:50 +0000 (16:54 -0400)
    of messages we use to detect a disconnect with PG, which
    appears to be present in some versions when the server
    is restarted.  [ticket:2570]

CHANGES
lib/sqlalchemy/dialects/postgresql/psycopg2.py

diff --git a/CHANGES b/CHANGES
index 76f1a3547ae16b2f3fc7473f53301e04c5346137..46091f077c2c85c8f864ab4e0776eed90b044d6e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -912,6 +912,11 @@ are also present in 0.8.
     orders them.  Courtesy Gunnlaugur Þór Briem.
     [ticket:2531].
 
+  - [bug] Added 'terminating connection' to the list
+    of messages we use to detect a disconnect with PG, which
+    appears to be present in some versions when the server
+    is restarted.  [ticket:2570]
+
 - mysql
   - [bug] Updated mysqlconnector interface to use
     updated "client flag" and "charset" APIs,
index 1b67a552178126ef8753c4f078b1e86d873f6196..c5eb9b445b8060cf902030b0f39ffedf2efdf48f 100644 (file)
@@ -373,7 +373,8 @@ class PGDialect_psycopg2(PGDialect):
             # these error messages from libpq: interfaces/libpq/fe-misc.c.
             # TODO: these are sent through gettext in libpq and we can't
             # check within other locales - consider using connection.closed
-            return 'closed the connection' in str(e) or \
+            return 'terminating connection' in str(e) or \
+                    'closed the connection' in str(e) or \
                     'connection not open' in str(e) or \
                     'could not receive data from server' in str(e)
         elif isinstance(e, self.dbapi.InterfaceError):