DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Client Connection Defaults / Statement Behavior

default_transaction_deferrable

Sets the default deferrable status of new transactions.

  • Default: off
  • Type: bool
  • Applies: Session (any user)

In plain words

Only matters for transactions that are both serializable and read only. With this on, such a transaction may wait a moment at the start until it can get a "safe" snapshot; after that it can never be cancelled by a serialization failure and adds no overhead to others.

For DBAs and operators

Sets the initial value of transaction_deferrable for each new transaction. It has no effect on read-write transactions or isolation levels below serializable.

A deferrable, read-only serializable transaction waits until no concurrent read-write serializable transaction could make its snapshot unsafe. Then it runs with no predicate locking and cannot fail with could not serialize access. Ideal for long reports and pg_dump --serializable-deferrable on systems that use serializable isolation.

The wait is usually short, but under a steady stream of serializable writers it can take a while; the waiting backend shows wait_event = 'SafeSnapshot' in pg_stat_activity. Usually set per session or per role for reporting users rather than globally.

How to change it

Any user can change it for their session with SET.

See it in context

Isolation levels

Related parameters

transaction_deferrable default_transaction_isolation default_transaction_read_only

All Client Connection Defaults parameters