{"Entry":{"collection":"sql","key":"abort","name":"ABORT","aliases":["abort"],"metadata":{"aliases":["abort"],"changed_in":["6.5","7.0","12"],"changes":[{"from":"6.4","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["description","usage"],"removed":[]},"status":"changed","synopsis":{"added":["ABORT [ TRANSACTION | WORK ]"],"removed":[]},"to":"6.5"},{"from":"6.5","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"changed","synopsis":{"added":["ABORT [ WORK | TRANSACTION ]"],"removed":["ABORT [ TRANSACTION | WORK ]"]},"to":"7.0"},{"from":"7.0","purpose_changed":false,"renamed":{"from_file":"sql-abort.htm","to_file":"sql-abort.html"},"sections":{"added":[],"changed":[],"removed":[]},"status":"changed","synopsis":null,"to":"7.1"},{"from":"7.1","purpose_changed":true,"renamed":null,"sections":{"added":[],"changed":["compatibility"],"removed":[]},"status":"changed","synopsis":null,"to":"7.2"},{"from":"7.3","purpose_changed":false,"renamed":null,"sections":{"added":["parameters","notes","examples","see_also"],"changed":["description","compatibility"],"removed":["usage"]},"status":"changed","synopsis":null,"to":"7.4"},{"from":"9.3","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["notes"],"removed":[]},"status":"changed","synopsis":null,"to":"9.4"},{"from":"11","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":{"added":["ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]"],"removed":[]},"to":"12"}],"content_hash":"47d14b8c83f0da13ed9c6336e3362fab57505095a0d327169008b72e9a7dc953","editorial":{},"first_version":"6.4","group":"transaction","imported_at":"2026-09-30T17:43:39.301312+08:00","last_version":"20","name":"ABORT","object":"","position":13000,"present_in":["6.4","6.5","7.0","7.1","7.2","7.3","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"],"purpose":"abort the current transaction","purpose_zh":"","related":["begin","commit","rollback"],"slug":"abort","source_rev":"a709ab85","synopsis":"ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]","verb":"ABORT"}},"Definition":{"Collection":"sql","Key":"abort","SourceDatabase":"center","Version":"18","SourceTable":"sqlcmd","SourceKey":"abort","SourceRevision":"a709ab85","Facts":{"anchor":"SQL-ABORT","file":"sql-abort.html","lang":"en","name":"ABORT","purpose":"abort the current transaction","purpose_zh":"","related":["begin","commit","rollback"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eABORT\u003c/code\u003e rolls back the current transaction and causes all the updates made by the transaction to be discarded. This command is identical in behavior to the standard \u003cacronym\u003eSQL\u003c/acronym\u003e command \u003ca href=\"/docs/18/sql-rollback.html\" title=\"ROLLBACK\"\u003e\u003ccode class=\"command\"\u003eROLLBACK\u003c/code\u003e\u003c/a\u003e, and is present only for historical reasons.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eWORK\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eTRANSACTION\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eOptional key words. They have no effect.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eAND CHAIN\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eIf \u003ccode class=\"literal\"\u003eAND CHAIN\u003c/code\u003e is specified, a new transaction is immediately started with the same transaction characteristics (see \u003ca href=\"/docs/18/sql-set-transaction.html\" title=\"SET TRANSACTION\"\u003e\u003ccode class=\"command\"\u003eSET TRANSACTION\u003c/code\u003e\u003c/a\u003e) as the just finished one. Otherwise, no new transaction is started.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eUse \u003ca href=\"/docs/18/sql-commit.html\" title=\"COMMIT\"\u003e\u003ccode class=\"command\"\u003eCOMMIT\u003c/code\u003e\u003c/a\u003e to successfully terminate a transaction.\u003c/p\u003e\u003cp\u003eIssuing \u003ccode class=\"command\"\u003eABORT\u003c/code\u003e outside of a transaction block emits a warning and otherwise has no effect.\u003c/p\u003e","key":"notes","title":"Notes"},{"html":"\u003cp\u003eTo abort all changes:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eABORT;\n\u003c/pre\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003eThis command is a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e extension present for historical reasons. \u003ccode class=\"command\"\u003eROLLBACK\u003c/code\u003e is the equivalent standard SQL command.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/begin/?v=18\" title=\"BEGIN\"\u003e\u003cspan class=\"refentrytitle\"\u003eBEGIN\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/commit/?v=18\" title=\"COMMIT\"\u003e\u003cspan class=\"refentrytitle\"\u003eCOMMIT\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/rollback/?v=18\" title=\"ROLLBACK\"\u003e\u003cspan class=\"refentrytitle\"\u003eROLLBACK\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","slug":"18","synopsis_html":"ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]","synopsis_text":"ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"abort","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"ABORT","Summary":"中止当前事务","BodyHTML":"\u003cpre\u003eABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eABORT\u003c/code\u003e回滚当前事务，并丢弃该事务所做的全部更新。这个命令在行为上与标准 \u003cacronym\u003eSQL\u003c/acronym\u003e 命令 \u003ca href=\"/docs/18/sql-rollback.html\" title=\"ROLLBACK\" rel=\"nofollow\"\u003e\u003ccode\u003eROLLBACK\u003c/code\u003e\u003c/a\u003e完全相同，只是出于历史原因而保留。\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e参数\u003c/h2\u003e\u003cdiv\u003e\u003cdl\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eWORK\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003eTRANSACTION\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e可选关键字，没有任何作用。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eAND CHAIN\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e如果指定了\u003ccode\u003eAND CHAIN\u003c/code\u003e，则会立即启动一个新事务，其事务特性与刚刚结束的事务相同（参见\u003ca href=\"/docs/18/sql-set-transaction.html\" title=\"SET TRANSACTION\" rel=\"nofollow\"\u003e\u003ccode\u003eSET TRANSACTION\u003c/code\u003e\u003c/a\u003e）。否则，不会启动新事务。\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e注解\u003c/h2\u003e\u003cp\u003e使用\u003ca href=\"/docs/18/sql-commit.html\" title=\"COMMIT\" rel=\"nofollow\"\u003e\u003ccode\u003eCOMMIT\u003c/code\u003e\u003c/a\u003e可成功地终止一个事务。\u003c/p\u003e\u003cp\u003e在事务块之外发出\u003ccode\u003eABORT\u003c/code\u003e会产生一条警告，除此之外没有效果。\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e示例\u003c/h2\u003e\u003cp\u003e要中止所有更改：\u003c/p\u003e\u003cpre\u003eABORT;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e兼容性\u003c/h2\u003e\u003cp\u003e这个命令是\u003cspan\u003ePostgreSQL\u003c/span\u003e扩展，只是出于历史原因而保留。\u003ccode\u003eROLLBACK\u003c/code\u003e是与之等效的标准 SQL 命令。\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e另见\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/wiki/sql/begin/?v=18\" title=\"BEGIN\" rel=\"nofollow\"\u003e\u003cspan\u003eBEGIN\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/commit/?v=18\" title=\"COMMIT\" rel=\"nofollow\"\u003e\u003cspan\u003eCOMMIT\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/rollback/?v=18\" title=\"ROLLBACK\" rel=\"nofollow\"\u003e\u003cspan\u003eROLLBACK\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","SourceRevision":"1b5ca64c","ContentHash":"b0c9c32e699834b8f0f1658d40f4711861f5b99280d9ea88c9149e6606c21448","Payload":{"purpose_zh":"中止当前事务","sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eABORT\u003c/code\u003e回滚当前事务，并丢弃该事务所做的全部更新。这个命令在行为上与标准 \u003cacronym\u003eSQL\u003c/acronym\u003e 命令 \u003ca href=\"/docs/18/sql-rollback.html\" title=\"ROLLBACK\"\u003e\u003ccode class=\"command\"\u003eROLLBACK\u003c/code\u003e\u003c/a\u003e完全相同，只是出于历史原因而保留。\u003c/p\u003e","key":"description","title":"描述"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eWORK\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eTRANSACTION\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e可选关键字，没有任何作用。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eAND CHAIN\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e如果指定了\u003ccode class=\"literal\"\u003eAND CHAIN\u003c/code\u003e，则会立即启动一个新事务，其事务特性与刚刚结束的事务相同（参见\u003ca href=\"/docs/18/sql-set-transaction.html\" title=\"SET TRANSACTION\"\u003e\u003ccode class=\"command\"\u003eSET TRANSACTION\u003c/code\u003e\u003c/a\u003e）。否则，不会启动新事务。\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"参数"},{"html":"\u003cp\u003e使用\u003ca href=\"/docs/18/sql-commit.html\" title=\"COMMIT\"\u003e\u003ccode class=\"command\"\u003eCOMMIT\u003c/code\u003e\u003c/a\u003e可成功地终止一个事务。\u003c/p\u003e\u003cp\u003e在事务块之外发出\u003ccode class=\"command\"\u003eABORT\u003c/code\u003e会产生一条警告，除此之外没有效果。\u003c/p\u003e","key":"notes","title":"注解"},{"html":"\u003cp\u003e要中止所有更改：\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eABORT;\n\u003c/pre\u003e","key":"examples","title":"示例"},{"html":"\u003cp\u003e这个命令是\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e扩展，只是出于历史原因而保留。\u003ccode class=\"command\"\u003eROLLBACK\u003c/code\u003e是与之等效的标准 SQL 命令。\u003c/p\u003e","key":"compatibility","title":"兼容性"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/begin/?v=18\" title=\"BEGIN\"\u003e\u003cspan class=\"refentrytitle\"\u003eBEGIN\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/commit/?v=18\" title=\"COMMIT\"\u003e\u003cspan class=\"refentrytitle\"\u003eCOMMIT\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/rollback/?v=18\" title=\"ROLLBACK\"\u003e\u003cspan class=\"refentrytitle\"\u003eROLLBACK\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"另见"}],"sections_same_as":"","synopsis_html":"ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]","synopsis_text":"ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","6.4","6.5","7.0","7.1","7.2","7.3","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}
