# HG changeset patch # User Julien Cristau # Date 1450106392 -3600 # Node ID de59a60a9e40cc90785e9c206d474bf9c9a9c52a # Parent 894c14f08380286eebd633d624a303dc5a48b410 [dataimport] Fallback from COPY to executemany (closes #9135780) If we can't build a suitable COPY command (e.g. because data has unsupported type), use executemany instead. Regression introduced in 3.20.0. diff -r 894c14f08380 -r de59a60a9e40 dataimport.py --- a/dataimport.py Mon Dec 14 12:11:44 2015 +0100 +++ b/dataimport.py Mon Dec 14 16:19:52 2015 +0100 @@ -380,8 +380,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: