rsidList[row[0]] = 0
                insStr = "INSERT INTO snp (rsid, chr, has_sig) VALUES ('{0}', '{1}', {2}) RETURNING id".format(row[0], row[1], hasSig)
                snpInserts[row[0]] = insStr
    
    # Data for reporting
    result.snpLoadEnd = time.time()
    result.totalSnps = len(snpInserts)
           
    # Insert SNP data into postgres
    cursor = postgresConnection.cursor()

    print "Chromosome " + str(curChr) + ". Inserting SNP Data."
    sys.stdout.flush()

    # Log current run start time
    result.snpInsertStart = time.time()
    
    # For each snp, insert record and then grab primary key
    for rsid,snp in snpInserts.iteritems():
        cursor.execute(snp)
        rsidList[rsid] = cursor.fetchone()[0]
        
    # Commit all inserts to pgsql and grab end time
    postgresConnection.commit()
    
    # Log completed time, close pgsql cursor
    result.snpInsertEnd=time.time()
    cursor.close()

    # Clear list of SNPs to free up memory
    snpInserts.clear()