Handle the whole of PostgreSQL errors.

In a recent test case about camelCasing column names, another kind of
error did pop up and there's really no point not to handle it correctly.
This commit is contained in:
Dimitri Fontaine 2014-06-16 17:31:41 +02:00
parent ecd4f31d12
commit 0cba5edacd

View File

@ -29,9 +29,7 @@
;; If PostgreSQL signals a data error, process the batch by isolating
;; erroneous data away and retrying the rest.
((or
CL-POSTGRES-ERROR:INTEGRITY-VIOLATION
CL-POSTGRES-ERROR:DATA-EXCEPTION) (condition)
(cl-postgres-error::database-error (condition)
(retry-batch table-name columns batch batch-rows condition))))
;;;
@ -196,10 +194,7 @@
(incf current-batch-pos current-batch-rows))))
;; the batch didn't make it, prepare error handling for next turn
((or
CL-POSTGRES-ERROR:INTEGRITY-VIOLATION
CL-POSTGRES-ERROR:DATA-EXCEPTION)
(next-error-in-batch)
(cl-postgres-error::database-error (next-error-in-batch)
(setf condition next-error-in-batch