PostgreSQL two types of transaction isolation levels:
Read Committed: The default isolation level in PostgreSQL. When a transaction runs at this isolation level, a select query can see only the data that was committed before the query was started and never see uncommitted data or changes made by other parallel transaction commits while the query was executing. If two transactions are being updated on the same tuple, the second update transaction waits for the first update transaction to commit or rollback. If the first update is rolled back, its effect is ignored, and the second update will continue to update the tuple that was originally discovered. If the first update commits, the system loves that recalculation of the query search criteria (WHERE clause), and if the tuple meets the criteria, the second update resumes its operation, starting with the updated version of the tuple.
Serializable: It provides the strictest transaction isolation. This level simulates a serial transaction execution, as if the transaction were executed sequentially (rather than in parallel). If two transactions are being updated on the same tuple, the serializable transaction waits for the first transaction being updated to commit or rollback. If the first update is rolled back, its impact is ignored, and the serializable transaction can complete its update operation on that tuple. But if the first update commits, the serializable transaction is rolled back and the entire transaction is re-started from the beginning.
PostgreSQL two types of transaction isolation levels