diff options
author | 2011-08-28 14:01:41 -0400 | |
---|---|---|
committer | 2011-08-28 14:01:41 -0400 | |
commit | 15ae1d4983d29b4268c3bcb25e291fe7bf1c33fc (patch) | |
tree | 549acb4e107f7bbc18990a4b002ab38b1e119cf1 | |
parent | a118306d4028d487136aeec92e4c328b1d8f695b (diff) |
Postgres deadlock triggers unlimited retry
-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, |