diff --git a/psycopg2da/__init__.py b/psycopg2da/__init__.py index e69de29b..fa81adaf 100644 --- a/psycopg2da/__init__.py +++ b/psycopg2da/__init__.py @@ -0,0 +1 @@ +# empty file diff --git a/psycopg2da/adapter.py b/psycopg2da/adapter.py index 352afc2a..dc796008 100644 --- a/psycopg2da/adapter.py +++ b/psycopg2da/adapter.py @@ -379,11 +379,7 @@ def _handle_psycopg_exception(error): # PostgreSQL releases - if so, the different messages should be added # rather than the existing ones changed so this logic works with # different versions. - if msg.startswith( - 'ERROR: could not serialize access due to concurrent update' - ): - raise Retry(sys.exc_info()) - if msg.startswith('ERROR: deadlock detected'): + if 'could not serialize' in msg or 'deadlock detected' in msg: raise Retry(sys.exc_info()) raise