Project

General

Profile

« Previous | Next » 

Revision 3138

csv2db: Fixed bug where table needed to be a sql_gen.Table object with the proper schema, so that errors_table would be created in the correct schema. Removed no longer needed changing of the search_path.

View differences:

bin/csv2db
46 46
        if level <= verbosity: sys.stderr.write(msg.rstrip('\n')+'\n')
47 47
    db = sql.connect(db_config, log_debug=log)
48 48
    
49
    table = sql_gen.Table(table, schema)
50
    
49 51
    log('Creating errors table')
50 52
    errors_table = sql_io.errors_table(db, table, if_exists=False)
51 53
    sql.drop_table(db, errors_table)
......
78 80
        
79 81
        # Select schema and escape names
80 82
        def esc_name(name): return sql.esc_name(db, name)
81
        sql.run_query(db, 'SET search_path TO '+esc_name(schema))
82 83
        
83 84
        typed_cols = [sql_gen.TypedCol('row_num', 'serial', nullable=False)]+[
84 85
            sql_gen.TypedCol(v, 'text') for v in col_names]

Also available in: Unified diff