Interview Question

What is dirty read?

A dirty read observes another transaction’s uncommitted data.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

A dirty read occurs when one transaction reads data written but not committed by another transaction. • The writer could still roll back that value. • SQL isolation levels describe whether this anomaly is allowed. • PostgreSQL does not permit dirty reads, even at Read Uncommitted.

💡 SQL Example

SET TRANSACTION ISOLATION LEVEL READ COMMITTED;

Result

SET

⚡ Quick Revision

A dirty read observes another transaction’s uncommitted data.