equal
deleted
inserted
replaced
66 |
66 |
67 def _execmany_thread_copy_from(cu, statement, data, table, |
67 def _execmany_thread_copy_from(cu, statement, data, table, |
68 columns, encoding='utf-8'): |
68 columns, encoding='utf-8'): |
69 """ Execute thread with copy from |
69 """ Execute thread with copy from |
70 """ |
70 """ |
71 buf = _create_copyfrom_buffer(data, columns, encoding=encoding) |
71 try: |
72 if buf is None: |
72 buf = _create_copyfrom_buffer(data, columns, encoding=encoding) |
|
73 except ValueError: |
73 _execmany_thread_not_copy_from(cu, statement, data) |
74 _execmany_thread_not_copy_from(cu, statement, data) |
74 else: |
75 else: |
75 if columns is None: |
76 if columns is None: |
76 cu.copy_from(buf, table, null=u'NULL') |
77 cu.copy_from(buf, table, null=u'NULL') |
77 else: |
78 else: |