Skip to content

transaction_isolation

transaction_isolation is the PostgreSQL setting that defines the current transaction’s isolation level.
Note

Fact — official short description: “Sets the current transaction’s isolation level.”

Identity

Type , Valueenum
Upstream pg_settings type
Context , Valueuser
Settable by an ordinary user
Unit , Value
Raw unit
Range , Value
Raw limits in the last observed version
Enum values , Valueserializable, repeatable read, read committed, read uncommitted
— for non-enum types
Category , ValueClient Connection Defaults / Statement Behavior
Upstream classification
Latest boot value , Valueread committed
read committed

Lifecycle

Fact Value
First observed PG9.0 (research boundary)
Present in PG9.0–19 Beta 3
Removed in No
Introduction commit Not asserted: predates the PG9.0 research boundary
Commit date
Discussion

Default history

Measured PG9.0–19 Beta 3 boot defaults
Versions Raw boot_val Unit Human value
PG9.0 not set
PG9.1–11 default default
PG12–19 Beta 3 read committed read committed

How it works

transaction_isolation sets the current transaction’s isolation level. It reflects the current transaction, begins from default_transaction_isolation, and cannot be freely raised after the transaction has performed work.

transaction_isolation is session-settable but represents the current transaction; PostgreSQL restricts changes after the transaction has acquired a snapshot or performed conflicting work.

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

Tuning advice

Tip

Advice. These are workload-specific starting points and must be validated with measurements.

Workload Guidance
OLTP Choose 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.
OLAP For reporting, consider a read-only transaction and an isolation choice that matches snapshot requirements; use deferrability only with read-only serializable work.
Small nodes Do not change transaction_isolation as a generic speed tweak. Higher isolation or long snapshots can amplify contention and vacuum pressure on a small node.

Pigsty

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

Template Effective value Versus upstream boot Source expression
OLTP Unmodified
OLAP Unmodified
CRIT Unmodified
TINY Unmodified
Caution

Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 unmodified; OLAP: PG9.0–19 Beta 3 unmodified; CRIT: PG9.0–19 Beta 3 unmodified; TINY: PG9.0–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

Common pitfalls

  • Changing 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 transaction_isolation globally without a rollback plan and a client or operational compatibility test.

default_transaction_isolation · default_transaction_read_only · transaction_read_only · default_transaction_deferrable · transaction_deferrable

References