{"Entry":{"collection":"guc","key":"default_transaction_isolation","name":"default_transaction_isolation","aliases":[],"metadata":{"baseline":true,"boot_human":"Not specified","boot_val":null,"category":"Client Connection Defaults / Statement Behavior","category_zh":"","changed_in":[],"changes":[{"documentation_changed":true,"fields":{},"from":"7.4","status":"changed","to":"8.0"},{"documentation_changed":true,"fields":{},"from":"8.2","status":"changed","to":"8.3"},{"documentation_changed":true,"fields":{},"from":"9.6","status":"changed","to":"10"}],"content_hash":"fad50fecbe715e05d9fc43f401140cfbc4bf65e02decefc8c8977bf8526551ed","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"read committed"}],"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_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."},"mechanism":["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."],"pitfalls":["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."],"references":[{"title":"PostgreSQL 19 Beta 4: default_transaction_isolation","url":"https://www.postgresql.org/docs/19/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-ISOLATION"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["transaction_isolation","default_transaction_read_only","transaction_read_only","default_transaction_deferrable","transaction_deferrable"],"summary":"default_transaction_isolation is the PostgreSQL setting that defines the transaction isolation level of each new transaction."},"enumvals":[],"first_version":"7.4","group":"Client Connection Defaults","group_slug":"client","imported_at":"2026-09-27T17:57:31.124069+08:00","intro_commit":{},"key":"default_transaction_isolation","last_version":"20","max_val":"","min_val":"","name":"default_transaction_isolation","position":104,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","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":"Each SQL transaction has an isolation level, which can be either “read uncommitted”, “read committed”, “repeatable read”, or “serializable”.","short_desc_zh":"","source_rev":"english-manuals:3d990da206bb154905e8cd5c1a15ea4a7bc28c48dd7fa9c32f59f5bfe10e08ef","unit":"","vartype":"enum"}},"Definition":{"Collection":"guc","Key":"default_transaction_isolation","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"default_transaction_isolation","SourceRevision":"english-manuals:3d990da206bb154905e8cd5c1a15ea4a7bc28c48dd7fa9c32f59f5bfe10e08ef","Facts":{"boot_val":"read committed","category":"Client Connection Defaults / Statement Behavior","context":"user","description":"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.","doc":{"anchor":"GUC-DEFAULT-TRANSACTION-ISOLATION","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"},"documented":true,"enumvals":["serializable","repeatable read","read committed","read uncommitted"],"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"default_transaction_isolation","short_desc":"Sets the transaction isolation level of each new transaction.","source":"pg-settings-source-snapshot","unit":null,"vartype":"enum"},"ManualEvidence":{"doc":{"anchor":"GUC-DEFAULT-TRANSACTION-ISOLATION","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"default_transaction_isolation","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"default_transaction_isolation","Summary":"","BodyHTML":"\u003cp\u003e每个 SQL 事务都有一个隔离级别，可以是\u003cspan\u003e“\u003cspan\u003e读未提交\u003c/span\u003e”\u003c/span\u003e、\u003cspan\u003e“\u003cspan\u003e读已提交\u003c/span\u003e”\u003c/span\u003e、\u003cspan\u003e“\u003cspan\u003e可重复读\u003c/span\u003e”\u003c/span\u003e或者\u003cspan\u003e“\u003cspan\u003e可串行化\u003c/span\u003e”\u003c/span\u003e。这个参数控制每个新事务的默认隔离级别。默认是\u003cspan\u003e“\u003cspan\u003e读已提交\u003c/span\u003e”\u003c/span\u003e。\u003c/p\u003e\u003cp\u003e更多信息请参阅\u003ca href=\"/docs/18/mvcc.html\" rel=\"nofollow\"\u003e第 13 章\u003c/a\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":"e368b5cf3e76232fc84aabaa6061e753178cfc7a2245410e6cc8b58ff9c75c1a","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e每个 SQL 事务都有一个隔离级别，可以是\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e读未提交\u003c/span\u003e”\u003c/span\u003e、\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e读已提交\u003c/span\u003e”\u003c/span\u003e、\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e可重复读\u003c/span\u003e”\u003c/span\u003e或者\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e可串行化\u003c/span\u003e”\u003c/span\u003e。这个参数控制每个新事务的默认隔离级别。默认是\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e读已提交\u003c/span\u003e”\u003c/span\u003e。\u003c/p\u003e\u003cp\u003e更多信息请参阅\u003ca href=\"/docs/18/mvcc.html\" title=\"第 13 章 并发控制\"\u003e第 13 章\u003c/a\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","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
