summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-09-25 16:54:50 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-09-25 16:54:50 -0400
commit21fb19e2c6954df0c0f2e82b140254f32aef32dd (patch)
tree5d764282d070039e8143a935aada0c3a33dd062f
parentc7c17e991cc53d201c8bb1e787efc313bebe8d4a (diff)
downloadsqlalchemy-21fb19e2c6954df0c0f2e82b140254f32aef32dd.tar.gz
- [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]
-rw-r--r--CHANGES5
-rw-r--r--lib/sqlalchemy/dialects/postgresql/psycopg2.py3
2 files changed, 7 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 76f1a3547..46091f077 100644
--- 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,
diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py
index 1b67a5521..c5eb9b445 100644
--- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py
+++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py
@@ -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):