# HG changeset patch # User Adam Chlipala # Date 1314554501 14400 # Node ID daf71c76707e76f21ca506c85debf41e07f00812 # Parent 355a928871ffc59c9e30c19f5f4ffdb15733ed2d Postgres deadlock triggers unlimited retry diff -r 355a928871ff -r daf71c76707e src/postgres.sml --- a/src/postgres.sml Fri Aug 26 09:51:38 2011 -0400 +++ b/src/postgres.sml Sun Aug 28 14:01:41 2011 -0400 @@ -754,6 +754,14 @@ newline], string "}", newline, + string "if (!strcmp(PQresultErrorField(res, PG_DIAG_SQLSTATE), \"40P01\")) {", + box [newline, + string "PQclear(res);", + newline, + string "uw_error(ctx, UNLIMITED_RETRY, \"Deadlock detected\");", + newline], + string "}", + newline, case mode of Settings.Error => box [string "PQclear(res);", newline,