dataimport/pgstore.py
changeset 10978 6f88cb7b7a84
parent 10513 7bec01a59f92
child 10981 45bc791275b4
child 10982 20bf21bb16e4
equal deleted inserted replaced
10959:068dd72272f4 10978:6f88cb7b7a84
    62 
    62 
    63 def _execmany_thread_copy_from(cu, statement, data, table,
    63 def _execmany_thread_copy_from(cu, statement, data, table,
    64                                columns, encoding='utf-8'):
    64                                columns, encoding='utf-8'):
    65     """ Execute thread with copy from
    65     """ Execute thread with copy from
    66     """
    66     """
    67     buf = _create_copyfrom_buffer(data, columns, encoding=encoding)
    67     try:
    68     if buf is None:
    68         buf = _create_copyfrom_buffer(data, columns, encoding=encoding)
       
    69     except ValueError:
    69         _execmany_thread_not_copy_from(cu, statement, data)
    70         _execmany_thread_not_copy_from(cu, statement, data)
    70     else:
    71     else:
    71         if columns is None:
    72         if columns is None:
    72             cu.copy_from(buf, table, null='NULL')
    73             cu.copy_from(buf, table, null='NULL')
    73         else:
    74         else: