Master reconciliation and statement import ama

I tried this but unfortunately, once an "IntegrityError: duplicate key value …" is caught all subsequent requests cause "InternalError: current transaction is aborted, commands ignored until end of transaction block"