{"Entry":{"collection":"guc","key":"transaction_isolation","name":"transaction_isolation","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Client Connection Defaults / Statement Behavior","category_zh":"","changed_in":["9.1","12"],"changes":[{"documentation_changed":false,"fields":{},"from":"8.4","status":"added","to":"9.0"},{"documentation_changed":false,"fields":{"boot_val":{"from":null,"to":"default"}},"from":"9.0","status":"changed","to":"9.1"},{"documentation_changed":true,"fields":{},"from":"9.5","status":"changed","to":"9.6"},{"documentation_changed":false,"fields":{"boot_val":{"from":"default","to":"read committed"},"enumvals":{"from":null,"to":["serializable","repeatable read","read committed","read uncommitted"]},"vartype":{"from":"string","to":"enum"}},"from":"11","status":"changed","to":"12"}],"content_hash":"d75c9baf1f56171b4fad7054aa13a97434ebb94de0c37fddb403910a82405bf2","context":"","default_changed_in":["9.1","12"],"default_history":[{"from":"9.0","to":"9.0","value":"Not specified"},{"from":"9.1","to":"11","value":"default"},{"from":"12","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 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 transaction_isolation as a generic speed tweak. Higher isolation or long snapshots can amplify contention and vacuum pressure on a small node."},"mechanism":["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."],"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."],"references":[{"title":"PostgreSQL 19 Beta 4: transaction_isolation","url":"https://www.postgresql.org/docs/19/runtime-config-client.html#GUC-TRANSACTION-ISOLATION"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["default_transaction_isolation","default_transaction_read_only","transaction_read_only","default_transaction_deferrable","transaction_deferrable"],"summary":"transaction_isolation is the PostgreSQL setting that defines the current transaction's isolation level."},"enumvals":[],"first_version":"9.0","group":"Client Connection Defaults","group_slug":"client","imported_at":"2026-09-27T17:57:32.23125+08:00","intro_commit":{},"key":"transaction_isolation","last_version":"20","max_val":"","min_val":"","name":"transaction_isolation","position":435,"present_in":["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":"This parameter reflects the current transaction's isolation level.","short_desc_zh":"","source_rev":"english-manuals:8557736f4b7249ad7b4f36a1b93c3999277f6bd03290135840e7092c068becfd","unit":"","vartype":"enum"}},"Definition":{"Collection":"guc","Key":"transaction_isolation","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"transaction_isolation","SourceRevision":"english-manuals:8557736f4b7249ad7b4f36a1b93c3999277f6bd03290135840e7092c068becfd","Facts":{"boot_val":"read committed","category":"Client Connection Defaults / Statement Behavior","context":"user","description":"This parameter reflects the current transaction's isolation level. At the beginning of each transaction, it is set to the current value of default_transaction_isolation. Any subsequent attempt to change it is equivalent to a SET TRANSACTION command.","doc":{"anchor":"GUC-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":"transaction_isolation","short_desc":"Sets the current transaction's isolation level.","source":"pg-settings-source-snapshot","unit":null,"vartype":"enum"},"ManualEvidence":{"doc":{"anchor":"GUC-TRANSACTION-ISOLATION","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"transaction_isolation","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"transaction_isolation","Summary":"","BodyHTML":"\u003cp\u003e此参数反映当前事务的隔离级别。在每个事务开始时，它被设置为\u003ca href=\"/docs/18/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-ISOLATION\" rel=\"nofollow\"\u003edefault_transaction_isolation\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":"ea542af3c1ab569438affa1b1e6c0353f76c82bcc22edc4b6c7ee3d36b920636","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e此参数反映当前事务的隔离级别。在每个事务开始时，它被设置为\u003ca href=\"/docs/18/runtime-config-client.html#GUC-DEFAULT-TRANSACTION-ISOLATION\"\u003edefault_transaction_isolation\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","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}
