Is there a way to run a check in PostgreSQL to validate each of therecords when there is bad records or etc?