Junior — Middle
Kas saaksite loetleda PostgreSQL-is kasutatavate tehingu isolatsiooni taseme tüüpe?
sobes.tech AI
Vastus AI-lt
PostgreSQL supports four standard transaction isolation levels, defined in the SQL standard:
- Read Uncommitted — the lowest level, allows reading data that has not yet been committed (dirty reads). In PostgreSQL, it actually behaves like Read Committed.
- Read Committed — the transaction sees only data that was committed at the start of the query. This is the default level in PostgreSQL.
- Repeatable Read — the transaction sees data as it was at the start, preventing non-repeatable reads.
- Serializable — the strictest level, ensures full isolation of transactions, as if they were executed sequentially.
Example of setting the isolation level in SQL:
BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-- your operations
COMMIT;