select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

CONFIGURATION / CLIENT CONNECTION DEFAULTS

default_transaction_isolation

Read PG 18 manual ↗

Each SQL transaction has an isolation level, which can be either “read uncommitted”, “read committed”, “repeatable read”, or “serializable”.

Type
enum
Context
user
Measured default
read committed
Unit
Metadata snapshot
18
Allowed values
serializable, repeatable read, read committed, read uncommitted

Definition PG 18 manual

Each SQL transaction has an isolation level, which can be either read uncommitted, read committed, repeatable read, or serializable. This parameter controls the default isolation level of each new transaction. The default is read committed.

Consult Chapter 13 and SET TRANSACTION for more information.

Measured default history
Version intervalDefault
9.0 – 19read committed
Analysis & operational context

Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗

How it works

default_transaction_isolation sets the transaction isolation level of each new transaction. PostgreSQL copies this value into transaction_isolation when each transaction begins; it changes consistency semantics, not merely performance.

default_transaction_isolation is a USER-context setting and can be assigned per role, database, or session; its value is copied when a new transaction starts, so it does not rewrite a transaction already in progress.

The default_ variables seed the corresponding transaction_ state. Isolation, read-only status, deferrability, retries, and snapshot lifetime must be designed together.

Operational considerations

Changing default_transaction_isolation in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.

Changing transaction semantics as a performance experiment and silently weakening an application's consistency contract.

Letting a pooled session retain transaction-related state because checkout or rollback/reset handling is incomplete.

Changing default_transaction_isolation globally without a rollback plan and a client or operational compatibility test.

Workload guidance

OLAP: For reporting, consider a read-only transaction and an isolation choice that matches snapshot requirements; use deferrability only with read-only serializable work.

OLTP: Choose default_transaction_isolation for correctness semantics first. Keep the common OLTP path explicit, then override only transactions whose consistency contract justifies different blocking or retry behavior.

SMALL: Do not change default_transaction_isolation as a generic speed tweak. Higher isolation or long snapshots can amplify contention and vacuum pressure on a small node.

Version history 1
  1. PG 9.6 → 10changed

Related entries

Further reading

Definition snapshot: english-manuals:448a612479783ba53cd71818956… · English manual source