def get_current_progress(db, progress_table):
    """How many lines in index.csv have we processed?

    progcoll -> name of the postgres table that maintains processing info.

    This table contains exactly one row, with one integer value,
    that represents the number of input lines processed.

    If starting afresh, the value will be 0.
    """
    sql = ("""
    SELECT progress
      FROM %(progress_table)s
    """ %
        locals())
    return db.execute(sql).fetchone()[0]
