Revision 5581
Added by Aaron Marcuse-Kubitza about 12 years ago
csv2db | ||
---|---|---|
68 | 68 |
|
69 | 69 |
db.set_encoding('LATIN1') |
70 | 70 |
load() # try again with new encoding |
71 |
except sql.DatabaseErrors, e: |
|
72 |
if use_copy_from: # first try |
|
73 |
exc.print_ex(e, plain=True) |
|
74 |
use_copy_from = False |
|
75 |
load() # try again with different approach |
|
76 |
else: raise |
|
77 | 71 |
else: sql_io.cleanup_table(db, table) |
78 | 72 |
|
79 | 73 |
main() |
Also available in: Unified diff
csv2db: Removed no longer needed separate handling of sql.DatabaseErrors, because all recoverable errors caused by COPY FROM (EncodingException and ragged rows) are now handled or avoided