curPG.execute(sqlCmd)
cptInsert = 0
curPG.execute('EXECUTE myInsert(%s,%s,%s,%s);', myNewRecord)
allreadyExists = curPG.rowcount < 1
if not allreadyExists:
    cptInsert += 1
if cptInsert % 10000 == 0:
    conPG.commit()
Python-PostgreSQL psycopg2 interface --> executemany