mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
psycopg2da: better pattern matching for Retry exceptions; it is now compatible with postgresql 8.0, 8.1 and 8.2 exception messages.
This commit is contained in:
parent
2ae0c32031
commit
fadd1a6938
|
@ -0,0 +1 @@
|
|||
# empty file
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user