dataimport/pgstore.py
changeset 10981 45bc791275b4
parent 10942 b089858c49a2
parent 10978 6f88cb7b7a84
child 10991 7ceb0971c694
--- a/dataimport/pgstore.py	Fri Dec 11 14:07:51 2015 +0100
+++ b/dataimport/pgstore.py	Tue Dec 15 14:12:59 2015 +0100
@@ -68,8 +68,9 @@
                                columns, encoding='utf-8'):
     """ Execute thread with copy from
     """
-    buf = _create_copyfrom_buffer(data, columns, encoding=encoding)
-    if buf is None:
+    try:
+        buf = _create_copyfrom_buffer(data, columns, encoding=encoding)
+    except ValueError:
         _execmany_thread_not_copy_from(cu, statement, data)
     else:
         if columns is None: