{"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","derived_content_hash":"d984bef39916be51385c72507d5b14a8f779faad37fd0826013a2c48d1fcbc52","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"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:0cedbfa63aaab2ff409b4532b7bbd95d582123648b269a9aad835159ce0dbd11","receipt_sha256":"ddfb3e8709c3b9935d73e96e1fe522812f0c9c6deb72deb85f9abc0227fe0d93","repair":"wiki-repair-20261023"},"slug":"abort","source_rev":"wiki-repair-20261023:65bde87269a7c42fac0c02ae4787003aa8850f937108ef30fc9a3b37b9c51413","synopsis":"ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]","verb":"ABORT"}},"Definition":{"Collection":"sql","Key":"abort","SourceDatabase":"center","Version":"18","SourceTable":"sqlcmd","SourceKey":"abort","SourceRevision":"wiki-repair-20261023:65bde87269a7c42fac0c02ae4787003aa8850f937108ef30fc9a3b37b9c51413","Facts":{"anchor":"SQL-ABORT","description_zh":"中止当前事务","description_zh_html":"\u003cpre\u003eABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003ccode class=\"command\"\u003eABORT\u003c/code\u003e 回滚当前事务，并丢弃该事务所做的全部更新。这个命令在行为上与标准 \u003cacronym class=\"acronym\"\u003eSQL\u003c/acronym\u003e 命令\n   \u003ca class=\"link\" href=\"/zh/docs/18/sql-rollback.html\" title=\"ROLLBACK\"\u003e\u003ccode class=\"command\"\u003eROLLBACK\u003c/code\u003e\u003c/a\u003e 完全相同，只是出于历史原因而保留。\n  \u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e参数\u003c/h2\u003e\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\n      可选关键字，没有任何作用。\n     \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\n      如果指定了 \u003ccode class=\"literal\"\u003eAND CHAIN\u003c/code\u003e，则会立即启动一个新事务，其事务特性与刚刚结束的事务相同（参见 \u003ca class=\"link\" href=\"/zh/docs/18/sql-set-transaction.html\" title=\"SET TRANSACTION\"\u003e\u003ccode class=\"command\"\u003eSET TRANSACTION\u003c/code\u003e\u003c/a\u003e）。否则，不会启动新事务。\n     \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e注解\u003c/h2\u003e\u003cp\u003e\n   使用 \u003ca class=\"link\" href=\"/zh/docs/18/sql-commit.html\" title=\"COMMIT\"\u003e\u003ccode class=\"command\"\u003eCOMMIT\u003c/code\u003e\u003c/a\u003e 可成功地终止一个事务。\n  \u003c/p\u003e\u003cp\u003e\n   在事务块之外发出 \u003ccode class=\"command\"\u003eABORT\u003c/code\u003e 会产生一条警告，除此之外没有效果。\n  \u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e示例\u003c/h2\u003e\u003cp\u003e\n   要中止所有更改：\n\u003c/p\u003e\u003cpre class=\"programlisting\"\u003e\nABORT;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e兼容性\u003c/h2\u003e\u003cp\u003e\n   这个命令是 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 扩展，只是出于历史原因而保留。\u003ccode class=\"command\"\u003eROLLBACK\u003c/code\u003e 是与之等效的标准 SQL 命令。\n  \u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e另见\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/zh/docs/18/sql-begin.html\" title=\"BEGIN\"\u003e\u003cspan class=\"refentrytitle\"\u003eBEGIN\u003c/span\u003e\u003c/a\u003e, \u003ca class=\"xref\" href=\"/zh/docs/18/sql-commit.html\" title=\"COMMIT\"\u003e\u003cspan class=\"refentrytitle\"\u003eCOMMIT\u003c/span\u003e\u003c/a\u003e, \u003ca class=\"xref\" href=\"/zh/docs/18/sql-rollback.html\" title=\"ROLLBACK\"\u003e\u003cspan class=\"refentrytitle\"\u003eROLLBACK\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","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 ]","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/sql-abort.html","sha256":"f4161c474bf8a4ab6a8a86cad3c68e4972bd2803e927ab0f56d9a8dfd23cadd0"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-pgdoc"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"abort","SourceDatabase":"center","Version":"18","Locale":"en","Title":"ABORT","Summary":"abort the current transaction","BodyHTML":"\u003cpre\u003eABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003eDescription\u003c/h2\u003e\u003cp\u003e\u003ccode\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\" rel=\"nofollow\"\u003e\u003ccode\u003eROLLBACK\u003c/code\u003e\u003c/a\u003e, and is present only for historical reasons.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eParameters\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\u003eOptional key words. They have no effect.\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\u003eIf \u003ccode\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\" rel=\"nofollow\"\u003e\u003ccode\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\u003c/section\u003e\u003csection\u003e\u003ch2\u003eNotes\u003c/h2\u003e\u003cp\u003eUse \u003ca href=\"/docs/18/sql-commit.html\" title=\"COMMIT\" rel=\"nofollow\"\u003e\u003ccode\u003eCOMMIT\u003c/code\u003e\u003c/a\u003e to successfully terminate a transaction.\u003c/p\u003e\u003cp\u003eIssuing \u003ccode\u003eABORT\u003c/code\u003e outside of a transaction block emits a warning and otherwise has no effect.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eExamples\u003c/h2\u003e\u003cp\u003eTo abort all changes:\u003c/p\u003e\u003cpre\u003eABORT;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eCompatibility\u003c/h2\u003e\u003cp\u003eThis command is a \u003cspan\u003ePostgreSQL\u003c/span\u003e extension present for historical reasons. \u003ccode\u003eROLLBACK\u003c/code\u003e is the equivalent standard SQL command.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eSee Also\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":"wiki-repair-20261023:65bde87269a7c42fac0c02ae4787003aa8850f937108ef30fc9a3b37b9c51413","ContentHash":"1053afc4e5de0bdf30174a3700998b7ec823b0519090d74c02a57525b1a731a4","Payload":{"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":"","synopsis_html":"ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]","synopsis_text":"ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]"}},"RequestedLocale":"en","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}
