{"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"}],"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"],"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":"english-manuals:fec6efd20cbde6afb9435afd155f21e792d2d2129a95c1502bdcac4b3cdd43d0","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"default_transaction_deferrable","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"default_transaction_deferrable","SourceRevision":"english-manuals:fec6efd20cbde6afb9435afd155f21e792d2d2129a95c1502bdcac4b3cdd43d0","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.","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","unit":null,"vartype":"bool"},"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":"pgweb","Version":"18","Locale":"zh-Hans","Title":"default_transaction_deferrable","Summary":"","BodyHTML":"\u003cp\u003e当运行在\u003ccode\u003eserializable\u003c/code\u003e隔离级别时，一个可延迟只读 SQL 事务可能在获准继续之前被延迟一段时间。但是，一旦它开始执行就不会产生任何用来保证可串行性的开销；因此串行化代码将没有任何理由因为并发更新而强制它中止，使得这个选项适合于长时间运行的只读事务。\u003c/p\u003e\u003cp\u003e这个参数控制每个新事务的默认可延迟状态。目前它对读写事务或者那些运行在低于\u003ccode\u003eserializable\u003c/code\u003e隔离级别上的事务无效。默认值是\u003ccode\u003eoff\u003c/code\u003e。\u003c/p\u003e\u003cp\u003e更多信息请参考\u003ca href=\"/docs/18/sql-set-transaction.html\" title=\"SET TRANSACTION\" rel=\"nofollow\"\u003e\u003cspan\u003eSET TRANSACTION\u003c/span\u003e\u003c/a\u003e。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"288ebdfd33e71f68d7c0b2296134913a275b0092c29f6ddcb32d28441a16004a","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e当运行在\u003ccode class=\"literal\"\u003eserializable\u003c/code\u003e隔离级别时，一个可延迟只读 SQL 事务可能在获准继续之前被延迟一段时间。但是，一旦它开始执行就不会产生任何用来保证可串行性的开销；因此串行化代码将没有任何理由因为并发更新而强制它中止，使得这个选项适合于长时间运行的只读事务。\u003c/p\u003e\u003cp\u003e这个参数控制每个新事务的默认可延迟状态。目前它对读写事务或者那些运行在低于\u003ccode class=\"literal\"\u003eserializable\u003c/code\u003e隔离级别上的事务无效。默认值是\u003ccode class=\"literal\"\u003eoff\u003c/code\u003e。\u003c/p\u003e\u003cp\u003e更多信息请参考\u003ca href=\"/docs/18/sql-set-transaction.html\" title=\"SET TRANSACTION\"\u003e\u003cspan class=\"refentrytitle\"\u003eSET TRANSACTION\u003c/span\u003e\u003c/a\u003e。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","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}
