From 3b2119cae405a73bc12db088cfde7a2652e67cda Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Mon, 21 Jul 2014 15:38:53 +0200 Subject: [PATCH] Don't catch all and any errors for retrying batches. In particular a non existing table or column shouldn't be considered as an error we can just retry upon receiving. --- src/pgsql/pgsql.lisp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pgsql/pgsql.lisp b/src/pgsql/pgsql.lisp index 97ead06..f1094dc 100644 --- a/src/pgsql/pgsql.lisp +++ b/src/pgsql/pgsql.lisp @@ -29,7 +29,11 @@ ;; If PostgreSQL signals a data error, process the batch by isolating ;; erroneous data away and retrying the rest. - (cl-postgres-error::database-error (condition) + ((or + cl-postgres-error::data-exception + cl-postgres-error::integrity-violation + cl-postgres-error::insufficient-resources + cl-postgres-error::program-limit-exceeded) (condition) (retry-batch table-name columns batch batch-rows condition)))) ;;; @@ -194,7 +198,11 @@ (incf current-batch-pos current-batch-rows)))) ;; the batch didn't make it, prepare error handling for next turn - (cl-postgres-error::database-error (next-error-in-batch) + ((or + cl-postgres-error::data-exception + cl-postgres-error::integrity-violation + cl-postgres-error::insufficient-resources + cl-postgres-error::program-limit-exceeded) (next-error-in-batch) (setf condition next-error-in-batch