{"Entry":{"collection":"guc","key":"default_transaction_deferrable","name":"default_transaction_deferrable","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Client Connection Defaults / Statement Behavior","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"9.0","status":"added","to":"9.1"}],"content_hash":"c3650ecbd7e76200619f6b758616d782df5cfdbb13db2e98a5daaa4867012ee8","context":"","default_changed_in":[],"default_history":[{"from":"9.1","to":"19","value":"off"}],"derived_content_hash":"d437a6320622ceaa033b571321346e955ff00c5493518a751efe39c7c225afc9","editorial":{"advice":{"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_deferrable 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_deferrable as a generic speed tweak. Higher isolation or long snapshots can amplify contention and vacuum pressure on a small node."},"mechanism":["default_transaction_deferrable sets the default deferrable status of new transactions. The default matters only for read-only serializable transactions, which may wait for a safe snapshot and then avoid serialization failures.","default_transaction_deferrable 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."],"pitfalls":["Changing default_transaction_deferrable 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_deferrable globally without a rollback plan and a client or operational compatibility test."],"references":[{"title":"PostgreSQL 19 Beta 4: default_transaction_deferrable","url":"https://www.postgresql.org/docs/19/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-DEFERRABLE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["default_transaction_isolation","transaction_isolation","default_transaction_read_only","transaction_read_only","transaction_deferrable"],"summary":"default_transaction_deferrable is the PostgreSQL setting that defines the default deferrable status of new transactions."},"enumvals":[],"first_version":"9.1","group":"Client Connection Defaults","group_slug":"client","imported_at":"2026-09-27T17:57:31.117503+08:00","intro_commit":{"authored_at":"2011-02-07T23:46:51+02:00","discussion":[],"hash":"dafaa3efb75ce1aae2e6dbefaf6f3a889dea0d21","subject":"Implement genuine serializable isolation level.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=dafaa3efb75ce1aae2e6dbefaf6f3a889dea0d21"},"key":"default_transaction_deferrable","last_version":"20","max_val":"","min_val":"","name":"default_transaction_deferrable","position":103,"present_in":["9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:fec6efd20cbde6afb9435afd155f21e792d2d2129a95c1502bdcac4b3cdd43d0","receipt_sha256":"1910d3bbcd6c4880314b6d61fa153c7ce72802a52874fd286c3bae531a48ce33","repair":"wiki-repair-20261023"},"short_desc":"When running at the serializable isolation level, a deferrable read-only SQL transaction may be delayed before it is allowed to proceed.","short_desc_zh":"","source_rev":"wiki-repair-20261023:fa7a308dfdfd67d7e763e2eefe949df8f4d556c63feed2e7a18dbf667de28e34","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"default_transaction_deferrable","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"default_transaction_deferrable","SourceRevision":"wiki-repair-20261023:fa7a308dfdfd67d7e763e2eefe949df8f4d556c63feed2e7a18dbf667de28e34","Facts":{"boot_val":"off","category":"Client Connection Defaults / Statement Behavior","context":"user","description":"When running at the serializable isolation level, a deferrable read-only SQL transaction may be delayed before it is allowed to proceed. However, once it begins executing it does not incur any of the overhead required to ensure serializability; so serialization code will have no reason to force it to abort because of concurrent updates, making this option suitable for long-running read-only transactions. This parameter controls the default deferrable status of each new transaction. It currently has no effect on read-write transactions or those operating at isolation levels lower than serializable. The default is off. Consult SET TRANSACTION for more information.","description_zh":"当运行在 serializable 隔离级别时，一个可延迟只读 SQL 事务可能在获准继续之前被延迟一段时间。但是，一旦它开始执行就不会产生任何用来保证可串行性的开销；因此串行化代码将没有任何理由因为并发更新而强制它中止，使得这个选项适合于长时间运行的只读事务。 这个参数控制每个新事务的默认可延迟状态。目前它对读写事务或者那些运行在低于 serializable 隔离级别上的事务无效。默认值是 off。 更多信息请参考 SET TRANSACTION。","description_zh_html":"\u003cp\u003e\n        当运行在 \u003ccode class=\"literal\"\u003eserializable\u003c/code\u003e 隔离级别时，一个可延迟只读 SQL 事务可能在获准继续之前被延迟一段时间。但是，一旦它开始执行就不会产生任何用来保证可串行性的开销；因此串行化代码将没有任何理由因为并发更新而强制它中止，使得这个选项适合于长时间运行的只读事务。\n        \u003c/p\u003e\u003cp\u003e\n        这个参数控制每个新事务的默认可延迟状态。目前它对读写事务或者那些运行在低于 \u003ccode class=\"literal\"\u003eserializable\u003c/code\u003e 隔离级别上的事务无效。默认值是 \u003ccode class=\"literal\"\u003eoff\u003c/code\u003e。\n       \u003c/p\u003e\u003cp\u003e\n        更多信息请参考 \u003ca class=\"xref\" href=\"/zh/docs/18/sql-set-transaction.html\" title=\"SET TRANSACTION\"\u003e\u003cspan class=\"refentrytitle\"\u003eSET TRANSACTION\u003c/span\u003e\u003c/a\u003e。\n       \u003c/p\u003e","doc":{"anchor":"GUC-DEFAULT-TRANSACTION-DEFERRABLE","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"default_transaction_deferrable","short_desc":"Sets the default deferrable status of new transactions.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-client.html","sha256":"1882f8fd5576909c4fcc44af53077378871e05f5be67723f20fe300273024767"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"bool","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-DEFAULT-TRANSACTION-DEFERRABLE","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"default_transaction_deferrable","SourceDatabase":"center","Version":"18","Locale":"en","Title":"default_transaction_deferrable","Summary":"When running at the serializable isolation level, a deferrable read-only SQL transaction may be delayed before it is allowed to proceed. However, once it begins executing it does not incur any of the overhead required to ensure serializability; so serialization code will have no reason to force it to abort because of concurrent updates, making this option suitable for long-running read-only transactions. This parameter controls the default deferrable status of each new transaction. It currently has no effect on read-write transactions or those operating at isolation levels lower than serializable. The default is off. Consult SET TRANSACTION for more information.","BodyHTML":"\u003cp\u003eWhen running at the serializable isolation level, a deferrable read-only SQL transaction may be delayed before it is allowed to proceed. However, once it begins executing it does not incur any of the overhead required to ensure serializability; so serialization code will have no reason to force it to abort because of concurrent updates, making this option suitable for long-running read-only transactions. This parameter controls the default deferrable status of each new transaction. It currently has no effect on read-write transactions or those operating at isolation levels lower than serializable. The default is off. Consult SET TRANSACTION for more information.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:fa7a308dfdfd67d7e763e2eefe949df8f4d556c63feed2e7a18dbf667de28e34","ContentHash":"ae5c44d96694771580644676becb4f868f8107edf01c3d87020a6b7a511dbde5","Payload":{"description":"When running at the serializable isolation level, a deferrable read-only SQL transaction may be delayed before it is allowed to proceed. However, once it begins executing it does not incur any of the overhead required to ensure serializability; so serialization code will have no reason to force it to abort because of concurrent updates, making this option suitable for long-running read-only transactions. This parameter controls the default deferrable status of each new transaction. It currently has no effect on read-write transactions or those operating at isolation levels lower than serializable. The default is off. Consult SET TRANSACTION for more information."}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
