summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/psycopg2.py
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 /lib/sqlalchemy/dialects/postgresql/psycopg2.py
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]
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/psycopg2.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/psycopg2.py3
1 files changed, 2 insertions, 1 deletions
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):