{"Entry":{"collection":"sql","key":"end","name":"END","aliases":["end"],"metadata":{"aliases":["end"],"changed_in":["12"],"changes":[{"from":"6.5","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"added","synopsis":null,"to":"7.0"},{"from":"7.0","purpose_changed":false,"renamed":{"from_file":"sql-end.htm","to_file":"sql-end.html"},"sections":{"added":[],"changed":[],"removed":[]},"status":"changed","synopsis":null,"to":"7.1"},{"from":"7.1","purpose_changed":true,"renamed":null,"sections":{"added":[],"changed":["description"],"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":"11","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":{"added":["END [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]"],"removed":[]},"to":"12"}],"content_hash":"9c69ddffb124d56e9821459f2464a65e5d7968c4e3f4c56edfc5adc947ad2e38","derived_content_hash":"cf2c427057a0554b336bb13656f60c546353a4688c7ab9a401e5c7aadddf1bbb","editorial":{},"first_version":"7.0","group":"transaction","imported_at":"2026-09-30T17:43:39.331404+08:00","last_version":"20","name":"END","object":"","position":13003,"present_in":["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":"commit the current transaction","purpose_zh":"","related":["begin","commit","rollback"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:3440b2eed4acd300062ffca7b56aa03155316f8cb8c3bdef35e1ba50374a8091","receipt_sha256":"e5e77c025342dc64cb10824d8a42fc5f7e8d9e36966538d4e915e8c2257d91ca","repair":"wiki-repair-20261023"},"slug":"end","source_rev":"wiki-repair-20261023:1c07f74c7602cba455fb83fea101418f552705c0b0783542a5004dcc3d334560","synopsis":"END [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]","verb":"END"}},"Definition":{"Collection":"sql","Key":"end","SourceDatabase":"center","Version":"18","SourceTable":"sqlcmd","SourceKey":"end","SourceRevision":"wiki-repair-20261023:1c07f74c7602cba455fb83fea101418f552705c0b0783542a5004dcc3d334560","Facts":{"anchor":"SQL-END","description_zh":"提交当前事务","description_zh_html":"\u003cpre\u003eEND [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003ccode class=\"command\"\u003eEND\u003c/code\u003e 提交当前事务。该事务所做的所有更改都会对其他会话可见，并且如果发生崩溃，也能保证其持久性。该命令是 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 扩展，等效于 \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\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=\"xref\" href=\"/zh/docs/18/sql-set-transaction.html\" title=\"SET TRANSACTION\"\u003e\u003cspan class=\"refentrytitle\"\u003eSET TRANSACTION\u003c/span\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-rollback.html\" title=\"ROLLBACK\"\u003e\u003ccode class=\"command\"\u003eROLLBACK\u003c/code\u003e\u003c/a\u003e 可中止一个事务。\n  \u003c/p\u003e\u003cp\u003e\n   在事务块之外发出 \u003ccode class=\"command\"\u003eEND\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\nEND;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e兼容性\u003c/h2\u003e\u003cp\u003e\n   命令 \u003ccode class=\"command\"\u003eEND\u003c/code\u003e 是 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 扩展，提供了与 SQL 标准规定的 \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\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-end.html","lang":"en","name":"END","purpose":"commit the current transaction","purpose_zh":"提交当前事务","related":["begin","commit","rollback"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eEND\u003c/code\u003e commits the current transaction. All changes made by the transaction become visible to others and are guaranteed to be durable if a crash occurs. This command is a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e extension that is equivalent to \u003ca href=\"/docs/18/sql-commit.html\" title=\"COMMIT\"\u003e\u003ccode class=\"command\"\u003eCOMMIT\u003c/code\u003e\u003c/a\u003e.\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\u003cspan class=\"refentrytitle\"\u003eSET TRANSACTION\u003c/span\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-rollback.html\" title=\"ROLLBACK\"\u003e\u003ccode class=\"command\"\u003eROLLBACK\u003c/code\u003e\u003c/a\u003e to abort a transaction.\u003c/p\u003e\u003cp\u003eIssuing \u003ccode class=\"command\"\u003eEND\u003c/code\u003e when not inside a transaction does no harm, but it will provoke a warning message.\u003c/p\u003e","key":"notes","title":"Notes"},{"html":"\u003cp\u003eTo commit the current transaction and make all changes permanent:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eEND;\n\u003c/pre\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eEND\u003c/code\u003e is a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e extension that provides functionality equivalent to \u003ca href=\"/docs/18/sql-commit.html\" title=\"COMMIT\"\u003e\u003ccode class=\"command\"\u003eCOMMIT\u003c/code\u003e\u003c/a\u003e, which is specified in the SQL standard.\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":"END [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]","synopsis_text":"END [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/sql-end.html","sha256":"2fb6fddbfec40bad9bda44a03f5865c4da605cf144515596a2a8a803c7180463"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-pgdoc"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"end","SourceDatabase":"center","Version":"18","Locale":"en","Title":"END","Summary":"commit the current transaction","BodyHTML":"\u003cpre\u003eEND [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003eDescription\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eEND\u003c/code\u003e commits the current transaction. All changes made by the transaction become visible to others and are guaranteed to be durable if a crash occurs. This command is a \u003cspan\u003ePostgreSQL\u003c/span\u003e extension that is equivalent to \u003ca href=\"/docs/18/sql-commit.html\" title=\"COMMIT\" rel=\"nofollow\"\u003e\u003ccode\u003eCOMMIT\u003c/code\u003e\u003c/a\u003e.\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\u003cspan\u003eSET TRANSACTION\u003c/span\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-rollback.html\" title=\"ROLLBACK\" rel=\"nofollow\"\u003e\u003ccode\u003eROLLBACK\u003c/code\u003e\u003c/a\u003e to abort a transaction.\u003c/p\u003e\u003cp\u003eIssuing \u003ccode\u003eEND\u003c/code\u003e when not inside a transaction does no harm, but it will provoke a warning message.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eExamples\u003c/h2\u003e\u003cp\u003eTo commit the current transaction and make all changes permanent:\u003c/p\u003e\u003cpre\u003eEND;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eCompatibility\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eEND\u003c/code\u003e is a \u003cspan\u003ePostgreSQL\u003c/span\u003e extension that provides functionality equivalent to \u003ca href=\"/docs/18/sql-commit.html\" title=\"COMMIT\" rel=\"nofollow\"\u003e\u003ccode\u003eCOMMIT\u003c/code\u003e\u003c/a\u003e, which is specified in the SQL standard.\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:1c07f74c7602cba455fb83fea101418f552705c0b0783542a5004dcc3d334560","ContentHash":"b040ba982b119ced172925414e036426dbfcfc5493c9ae35da5aaf64bbb1ef0c","Payload":{"related":["begin","commit","rollback"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eEND\u003c/code\u003e commits the current transaction. All changes made by the transaction become visible to others and are guaranteed to be durable if a crash occurs. This command is a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e extension that is equivalent to \u003ca href=\"/docs/18/sql-commit.html\" title=\"COMMIT\"\u003e\u003ccode class=\"command\"\u003eCOMMIT\u003c/code\u003e\u003c/a\u003e.\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\u003cspan class=\"refentrytitle\"\u003eSET TRANSACTION\u003c/span\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-rollback.html\" title=\"ROLLBACK\"\u003e\u003ccode class=\"command\"\u003eROLLBACK\u003c/code\u003e\u003c/a\u003e to abort a transaction.\u003c/p\u003e\u003cp\u003eIssuing \u003ccode class=\"command\"\u003eEND\u003c/code\u003e when not inside a transaction does no harm, but it will provoke a warning message.\u003c/p\u003e","key":"notes","title":"Notes"},{"html":"\u003cp\u003eTo commit the current transaction and make all changes permanent:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eEND;\n\u003c/pre\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eEND\u003c/code\u003e is a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e extension that provides functionality equivalent to \u003ca href=\"/docs/18/sql-commit.html\" title=\"COMMIT\"\u003e\u003ccode class=\"command\"\u003eCOMMIT\u003c/code\u003e\u003c/a\u003e, which is specified in the SQL standard.\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":"END [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]","synopsis_text":"END [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]"}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","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}
