There should be a constraint, and whatever horked up process is allowing 404s and 500s shouldn't be writing anything into the table.