diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/postgres.sml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/postgres.sml b/src/postgres.sml index 9b64935c..9707096f 100644 --- a/src/postgres.sml +++ b/src/postgres.sml @@ -754,6 +754,14 @@ fun dmlCommon {loc, dml, mode} = 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, |