{"Entry":{"collection":"sql","key":"begin-work","name":"BEGIN WORK","aliases":[],"metadata":{"aliases":[],"changed_in":[],"changes":[{"from":"6.4","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"removed","synopsis":null,"to":"6.5"}],"content_hash":"412ad7398e703ce97cf120c10aea1debf25be2f946d8cd0bcda727d66c6af938","editorial":{},"first_version":"6.4","group":"transaction","imported_at":"2026-09-27T17:57:27.356656+08:00","last_version":"6.4","name":"BEGIN WORK","object":"WORK","position":13015,"present_in":["6.4"],"purpose":"Begins a transaction","purpose_zh":"","related":[],"slug":"begin-work","source_rev":"b7bd9cda","synopsis":"\nBEGIN [ WORK | TRANSACTION ]\n","verb":"BEGIN"}},"Definition":{"Collection":"sql","Key":"begin-work","SourceDatabase":"center","Version":"6.4","SourceTable":"sqlcmd","SourceKey":"begin-work","SourceRevision":"b7bd9cda","Facts":{"anchor":"","file":"sql-beginwork.htm","lang":"en","name":"BEGIN WORK","purpose":"Begins a transaction","purpose_zh":"","related":[],"sections":[{"html":"\u003cp\u003e\u003cb\u003eBEGIN\u003c/b\u003e initiates a user transaction which \u003cspan class=\"productname\"\u003ePostgres\u003c/span\u003e will guarantee is serializable with respect to all concurrently executing transactions. \u003cspan class=\"productname\"\u003ePostgres\u003c/span\u003e uses two-phase locking to perform this task. If the transaction is committed, \u003cspan class=\"productname\"\u003ePostgres\u003c/span\u003e will ensure either that all updates are done or else that none of them are done. Transactions have the standard ACID (atomic, consistent, isolatable, and durable) property.\u003c/p\u003e\u003cdiv class=\"refsect2\"\u003e\u003ch3\u003eNotes\u003c/h3\u003e\u003cp\u003eThe keyword TRANSACTION is just a cosmetic alternative to WORK. Neither keyword need be specified.\u003c/p\u003e\u003cp\u003eRefer to the \u003cb\u003eLOCK\u003c/b\u003e statement for further information about locking tables inside a transaction.\u003c/p\u003e\u003cp\u003eUse \u003cb\u003eCOMMIT\u003c/b\u003e or \u003cb\u003eROLLBACK\u003c/b\u003e to terminate a transaction.\u003c/p\u003e\u003c/div\u003e","key":"description","title":"Description"},{"html":"\u003cp\u003eTo begin a user transaction:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eBEGIN WORK;\n  \n\u003c/pre\u003e","key":"usage","title":"Usage"},{"html":"\u003cp\u003e\u003cb\u003eBEGIN\u003c/b\u003e is a \u003cspan class=\"productname\"\u003ePostgres\u003c/span\u003e language extension.\u003c/p\u003e\u003cdiv class=\"refsect2\"\u003e\u003ch3\u003eSQL92\u003c/h3\u003e\u003cp\u003eThere is no explicit BEGIN WORK command in \u003cspan class=\"acronym\"\u003eSQL92\u003c/span\u003e; transaction initiation is always implicit and it terminates either with a COMMIT or with a ROLLBACK statement.\u003c/p\u003e\u003c/div\u003e","key":"compatibility","title":"Compatibility"}],"sections_same_as":"","slug":"6.4","synopsis_html":"  \nBEGIN [ WORK | TRANSACTION ]\n  ","synopsis_text":"\nBEGIN [ WORK | TRANSACTION ]\n"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"begin-work","SourceDatabase":"center","Version":"6.4","Locale":"en","Title":"BEGIN WORK","Summary":"Begins a transaction","BodyHTML":"\u003cpre\u003e\nBEGIN [ WORK | TRANSACTION ]\n\u003c/pre\u003e\u003csection\u003e\u003ch2\u003eDescription\u003c/h2\u003e\u003cp\u003e\u003cb\u003eBEGIN\u003c/b\u003e initiates a user transaction which \u003cspan\u003ePostgres\u003c/span\u003e will guarantee is serializable with respect to all concurrently executing transactions. \u003cspan\u003ePostgres\u003c/span\u003e uses two-phase locking to perform this task. If the transaction is committed, \u003cspan\u003ePostgres\u003c/span\u003e will ensure either that all updates are done or else that none of them are done. Transactions have the standard ACID (atomic, consistent, isolatable, and durable) property.\u003c/p\u003e\u003cdiv\u003e\u003ch3\u003eNotes\u003c/h3\u003e\u003cp\u003eThe keyword TRANSACTION is just a cosmetic alternative to WORK. Neither keyword need be specified.\u003c/p\u003e\u003cp\u003eRefer to the \u003cb\u003eLOCK\u003c/b\u003e statement for further information about locking tables inside a transaction.\u003c/p\u003e\u003cp\u003eUse \u003cb\u003eCOMMIT\u003c/b\u003e or \u003cb\u003eROLLBACK\u003c/b\u003e to terminate a transaction.\u003c/p\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eUsage\u003c/h2\u003e\u003cp\u003eTo begin a user transaction:\u003c/p\u003e\u003cpre\u003eBEGIN WORK;\n  \n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eCompatibility\u003c/h2\u003e\u003cp\u003e\u003cb\u003eBEGIN\u003c/b\u003e is a \u003cspan\u003ePostgres\u003c/span\u003e language extension.\u003c/p\u003e\u003cdiv\u003e\u003ch3\u003eSQL92\u003c/h3\u003e\u003cp\u003eThere is no explicit BEGIN WORK command in \u003cspan\u003eSQL92\u003c/span\u003e; transaction initiation is always implicit and it terminates either with a COMMIT or with a ROLLBACK statement.\u003c/p\u003e\u003c/div\u003e\u003c/section\u003e","SourceRevision":"b7bd9cda","ContentHash":"cce2389126f8748e96aadffc6a52a27064865f4165b459a3973c3350f5888246","Payload":{"related":[],"sections":[{"html":"\u003cp\u003e\u003cb\u003eBEGIN\u003c/b\u003e initiates a user transaction which \u003cspan class=\"productname\"\u003ePostgres\u003c/span\u003e will guarantee is serializable with respect to all concurrently executing transactions. \u003cspan class=\"productname\"\u003ePostgres\u003c/span\u003e uses two-phase locking to perform this task. If the transaction is committed, \u003cspan class=\"productname\"\u003ePostgres\u003c/span\u003e will ensure either that all updates are done or else that none of them are done. Transactions have the standard ACID (atomic, consistent, isolatable, and durable) property.\u003c/p\u003e\u003cdiv class=\"refsect2\"\u003e\u003ch3\u003eNotes\u003c/h3\u003e\u003cp\u003eThe keyword TRANSACTION is just a cosmetic alternative to WORK. Neither keyword need be specified.\u003c/p\u003e\u003cp\u003eRefer to the \u003cb\u003eLOCK\u003c/b\u003e statement for further information about locking tables inside a transaction.\u003c/p\u003e\u003cp\u003eUse \u003cb\u003eCOMMIT\u003c/b\u003e or \u003cb\u003eROLLBACK\u003c/b\u003e to terminate a transaction.\u003c/p\u003e\u003c/div\u003e","key":"description","title":"Description"},{"html":"\u003cp\u003eTo begin a user transaction:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eBEGIN WORK;\n  \n\u003c/pre\u003e","key":"usage","title":"Usage"},{"html":"\u003cp\u003e\u003cb\u003eBEGIN\u003c/b\u003e is a \u003cspan class=\"productname\"\u003ePostgres\u003c/span\u003e language extension.\u003c/p\u003e\u003cdiv class=\"refsect2\"\u003e\u003ch3\u003eSQL92\u003c/h3\u003e\u003cp\u003eThere is no explicit BEGIN WORK command in \u003cspan class=\"acronym\"\u003eSQL92\u003c/span\u003e; transaction initiation is always implicit and it terminates either with a COMMIT or with a ROLLBACK statement.\u003c/p\u003e\u003c/div\u003e","key":"compatibility","title":"Compatibility"}],"sections_same_as":"","synopsis_html":"  \nBEGIN [ WORK | TRANSACTION ]\n  ","synopsis_text":"\nBEGIN [ WORK | TRANSACTION ]\n"}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["6.4"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
