cursor = postgresConnection.cursor() print "Chromosome " + str(curChr) + ". Inserting loci data." # Log current run start time and number of loci result.lociInsertStart = time.time() # Insert each locus for locus in lociInserts: cursor.execute(locus) # Commit data to pgsql postgresConnection.commit() # Log end time and total pgsql time result.lociInsertEnd = time.time() # Close pgsql cursor cursor.close() print result.toTerm() resultsFile.write(result.toString() + '\n') sys.stdout.flush() # Create new cursor, create indexes and run test queries cursor = postgresConnection.cursor() # Turn on triggers, create FK index since PGSQL does not # automatically index FKs print "Turning on key checks..." cursor.execute("ALTER TABLE snp ENABLE trigger ALL;")