dataimport/pgstore.py
changeset 10981 45bc791275b4
parent 10942 b089858c49a2
parent 10978 6f88cb7b7a84
child 10991 7ceb0971c694
equal deleted inserted replaced
10976:b150016e476c 10981:45bc791275b4
    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: