Project

General

Profile

« Previous | Next » 

Revision 5583

sql_io.py: import_csv(): Removed no longer needed manual setting of use_copy_from, which defaults to True in append_csv()

View differences:

lib/sql_io.py
270 270
                inserted_row_ct += 1
271 271
        log('Inserted '+str(inserted_row_ct)+' of '+str(row_ct)+' rows')
272 272

  
273
def import_csv(db, table, stream, use_copy_from=True):
273
def import_csv(db, table, stream):
274 274
    def log(msg, level=1): db.log_debug(msg, level)
275 275
    
276 276
    # Get format info
......
295 295
    sql.truncate(db, table)
296 296
    
297 297
    # Load the data
298
    def load(): append_csv(db, table, info, stream, use_copy_from)
299
    if use_copy_from: sql.with_savepoint(db, load)
300
    else: load()
298
    def load(): append_csv(db, table, info, stream)
299
    sql.with_savepoint(db, load)
301 300
    
302 301
    cleanup_table(db, table)
303 302

  

Also available in: Unified diff