Project

General

Profile

« Previous | Next » 

Revision 5025

sql_io.py: import_csv(): Only do the import in a savepoint if using COPY FROM, to allow autocommits after each insert and thus make rows visible immediately after they are inserted

View differences:

sql_io.py
273 273
    sql.truncate(db, table)
274 274
    
275 275
    # Load the data
276
    sql.with_savepoint(db, lambda: append_csv(db, table, info, stream,
277
        use_copy_from))
276
    def load(): append_csv(db, table, info, stream, use_copy_from)
277
    if use_copy_from: sql.with_savepoint(db, load)
278
    else: load()
278 279
    
279 280
    if has_row_num: sql.add_row_num(db, table, sql.pkey_col)
280 281
    cleanup_table(db, table)

Also available in: Unified diff