DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Client Connection Defaults / Statement Behavior

default_transaction_isolation

Sets the transaction isolation level of each new transaction.

  • Default: read committed
  • Type: enum
  • Values: serializable · repeatable read · read committed · read uncommitted
  • Applies: Session (any user)

In plain words

Every transaction runs at an isolation level that decides what it sees of other transactions' changes. The default read committed gives each statement a fresh view; repeatable read and serializable keep one view for the whole transaction and may cancel it if a conflict happens.

For DBAs and operators

Sets the initial value of transaction_isolation. Can be overridden by BEGIN ISOLATION LEVEL … or SET TRANSACTION. Usually set per database/role (ALTER ROLE app SET default_transaction_isolation = 'repeatable read').

  • read uncommitted is accepted but behaves exactly like read committed: PostgreSQL never shows dirty reads.
  • read committed: new snapshot per statement. An UPDATE that finds a row changed by a concurrent committed transaction re-checks it and continues.
  • repeatable read: one snapshot from the first statement on. Concurrent updates of the same row cause ERROR: could not serialize access due to concurrent update
  • serializable: SSI on top of that; dangerous dependency patterns cause ERROR: could not serialize access due to read/write dependencies among transactions

Both errors have SQLSTATE 40001: the application must retry the whole transaction. Raising the level globally without retry logic is a classic cause of sudden application errors. Long repeatable read/serializable transactions also hold back the xmin horizon and therefore vacuum.

How to change it

Any user can change it for their session with SET.

See it in context

Isolation levels Snapshots and visibility MVCC: row versions Life of a SELECT Serializable Snapshot Isolation

Related parameters

transaction_isolation default_transaction_read_only default_transaction_deferrable max_pred_locks_per_transaction

All Client Connection Defaults parameters