{"Entry":{"collection":"func","key":"pg-xact-status","name":"pg_xact_status","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"13"}],"content_hash":"cf14447b3b97ddc8ce9438f41e38eef5b22045af1144836597b22396aa0d85cd","derived_content_hash":"e7ad5753df7cdbfc57e46433f339e71de83fd9eb7dbc14ac67b8ad8c3c733dab","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:2f8e1f0e83a05035c5ca2e663abce73b4a5b7ba5890660f1461b233233ab1f9c","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"first_version":"13","group":"info","group_label":"System Information Functions And Operators","groups":["info"],"imported_at":"2026-09-27T17:57:29.335734+08:00","last_version":"20","name":"pg_xact_status","name_key":"pg_xact_status","position":28118,"present_in":["13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"b7bd9cda","receipt_sha256":"3521d74b2eebd0703508439d806cb17993045a8d8bb8aa3e8122efe99ba10405","repair":"wiki-repair-20261023"},"signature":"pg_xact_status ( xid8 ) → text","signature_count":1,"slug":"pg-xact-status","source_rev":"wiki-repair-20261023:2f8e1f0e83a05035c5ca2e663abce73b4a5b7ba5890660f1461b233233ab1f9c","summary":"Reports the commit status of a recent transaction.","summary_zh":""}},"Definition":{"Collection":"func","Key":"pg-xact-status","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"pg-xact-status","SourceRevision":"wiki-repair-20261023:2f8e1f0e83a05035c5ca2e663abce73b4a5b7ba5890660f1461b233233ab1f9c","Facts":{"description":"Reports the commit status of a recent transaction. The result is one of in progress, committed, or aborted, provided that the transaction is recent enough that the system retains the commit status of that transaction. If it is old enough that no references to the transaction survive in the system and the commit status information has been discarded, the result is NULL. Applications might use this function, for example, to determine whether their transaction committed or aborted after the application and database server become disconnected while a COMMIT is in progress. Note that prepared transactions are reported as in progress; applications must check pg_prepared_xacts if they need to determine whether a transaction ID belongs to a prepared transaction.","description_html":"Reports the commit status of a recent transaction. The result is one of \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e, \u003ccode class=\"literal\"\u003ecommitted\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eaborted\u003c/code\u003e, provided that the transaction is recent enough that the system retains the commit status of that transaction. If it is old enough that no references to the transaction survive in the system and the commit status information has been discarded, the result is \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e. Applications might use this function, for example, to determine whether their transaction committed or aborted after the application and database server become disconnected while a \u003ccode class=\"literal\"\u003eCOMMIT\u003c/code\u003e is in progress. Note that prepared transactions are reported as \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e; applications must check \u003ca href=\"/docs/18/view-pg-prepared-xacts.html\" title=\"53.17. pg_prepared_xacts\"\u003e\u003ccode class=\"structname\"\u003epg_prepared_xacts\u003c/code\u003e\u003c/a\u003e if they need to determine whether a transaction ID belongs to a prepared transaction.","description_zh":"报告近期事务的提交状态。只要事务足够新，系统仍保留其提交状态，结果就为 in progress、committed 或 aborted。如果事务已足够旧，系统中不再有对它的引用，且提交状态信息已被丢弃，则返回 NULL。例如，在 COMMIT 进行过程中应用与数据库服务器断开连接时，应用可以用此函数判断事务是提交了还是中止了。注意，预备事务被报告为 in progress；如果需要确定某个事务 ID 是否为预备事务，应用必须检查 pg_prepared_xacts。","description_zh_html":"报告近期事务的提交状态。只要事务足够新，系统仍保留其提交状态，结果就为 \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e、\u003ccode class=\"literal\"\u003ecommitted\u003c/code\u003e 或 \u003ccode class=\"literal\"\u003eaborted\u003c/code\u003e。如果事务已足够旧，系统中不再有对它的引用，且提交状态信息已被丢弃，则返回 \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。例如，在 \u003ccode class=\"literal\"\u003eCOMMIT\u003c/code\u003e 进行过程中应用与数据库服务器断开连接时，应用可以用此函数判断事务是提交了还是中止了。注意，预备事务被报告为 \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e；如果需要确定某个事务 ID 是否为预备事务，应用必须检查 \u003ca href=\"/docs/18/view-pg-prepared-xacts.html\" title=\"53.17. pg_prepared_xacts\"\u003e\u003ccode class=\"structname\"\u003epg_prepared_xacts\u003c/code\u003e\u003c/a\u003e。","doc":{"anchor":"FUNCTIONS-PG-SNAPSHOT","file":"functions-info.html","sha256":"64499116227a087138bb14f29ff6652b200a176d5df3ce2a089c3d5c226b19b3","slug":"18"},"documentation_revision":{"inputs":[{"file":"functions-info.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"64499116227a087138bb14f29ff6652b200a176d5df3ce2a089c3d5c226b19b3","version":"18.7"},{"file":"functions-info.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"f9684137c0b9fb17a691c4d905529d114472a507a007c15058f2703962b611d2","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"group":"info","group_label":"系统信息函数和操作符","lang":"en","layout":"table-new","pages":["functions-info.html"],"prose_only":false,"signatures":[{"description":"Reports the commit status of a recent transaction. The result is one of in progress, committed, or aborted, provided that the transaction is recent enough that the system retains the commit status of that transaction. If it is old enough that no references to the transaction survive in the system and the commit status information has been discarded, the result is NULL. Applications might use this function, for example, to determine whether their transaction committed or aborted after the application and database server become disconnected while a COMMIT is in progress. Note that prepared transactions are reported as in progress; applications must check pg_prepared_xacts if they need to determine whether a transaction ID belongs to a prepared transaction.","description_html":"Reports the commit status of a recent transaction. The result is one of \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e, \u003ccode class=\"literal\"\u003ecommitted\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eaborted\u003c/code\u003e, provided that the transaction is recent enough that the system retains the commit status of that transaction. If it is old enough that no references to the transaction survive in the system and the commit status information has been discarded, the result is \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e. Applications might use this function, for example, to determine whether their transaction committed or aborted after the application and database server become disconnected while a \u003ccode class=\"literal\"\u003eCOMMIT\u003c/code\u003e is in progress. Note that prepared transactions are reported as \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e; applications must check \u003ca href=\"/docs/18/view-pg-prepared-xacts.html\" title=\"53.17. pg_prepared_xacts\"\u003e\u003ccode class=\"structname\"\u003epg_prepared_xacts\u003c/code\u003e\u003c/a\u003e if they need to determine whether a transaction ID belongs to a prepared transaction.","description_zh":"报告近期事务的提交状态。只要事务足够新，系统仍保留其提交状态，结果就为 in progress、committed 或 aborted。如果事务已足够旧，系统中不再有对它的引用，且提交状态信息已被丢弃，则返回 NULL。例如，在 COMMIT 进行过程中应用与数据库服务器断开连接时，应用可以用此函数判断事务是提交了还是中止了。注意，预备事务被报告为 in progress；如果需要确定某个事务 ID 是否为预备事务，应用必须检查 pg_prepared_xacts。","description_zh_html":"报告近期事务的提交状态。只要事务足够新，系统仍保留其提交状态，结果就为 \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e、\u003ccode class=\"literal\"\u003ecommitted\u003c/code\u003e 或 \u003ccode class=\"literal\"\u003eaborted\u003c/code\u003e。如果事务已足够旧，系统中不再有对它的引用，且提交状态信息已被丢弃，则返回 \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。例如，在 \u003ccode class=\"literal\"\u003eCOMMIT\u003c/code\u003e 进行过程中应用与数据库服务器断开连接时，应用可以用此函数判断事务是提交了还是中止了。注意，预备事务被报告为 \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e；如果需要确定某个事务 ID 是否为预备事务，应用必须检查 \u003ca href=\"/docs/18/view-pg-prepared-xacts.html\" title=\"53.17. pg_prepared_xacts\"\u003e\u003ccode class=\"structname\"\u003epg_prepared_xacts\u003c/code\u003e\u003c/a\u003e。","examples":[],"html":"\u003ccode class=\"function\"\u003epg_xact_status\u003c/code\u003e ( \u003ccode class=\"type\"\u003exid8\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"pg_xact_status ( xid8 ) → text","zh_from":"same-version-manual"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-info.html","sha256":"7c33185e79430cfbda432dc4db277115c7ac846afccadfcf904ceb1bf2aa1ba5"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-PG-SNAPSHOT","file":"functions-info.html","sha256":"64499116227a087138bb14f29ff6652b200a176d5df3ce2a089c3d5c226b19b3","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"pg-xact-status","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_xact_status","Summary":"Reports the commit status of a recent transaction. The result is one of in progress, committed, or aborted, provided that the transaction is recent enough that the system retains the commit status of that transaction. If it is old enough that no references to the transaction survive in the system and the commit status information has been discarded, the result is NULL. Applications might use this function, for example, to determine whether their transaction committed or aborted after the application and database server become disconnected while a COMMIT is in progress. Note that prepared transactions are reported as in progress; applications must check pg_prepared_xacts if they need to determine whether a transaction ID belongs to a prepared transaction.","BodyHTML":"Reports the commit status of a recent transaction. The result is one of \u003ccode\u003ein progress\u003c/code\u003e, \u003ccode\u003ecommitted\u003c/code\u003e, or \u003ccode\u003eaborted\u003c/code\u003e, provided that the transaction is recent enough that the system retains the commit status of that transaction. If it is old enough that no references to the transaction survive in the system and the commit status information has been discarded, the result is \u003ccode\u003eNULL\u003c/code\u003e. Applications might use this function, for example, to determine whether their transaction committed or aborted after the application and database server become disconnected while a \u003ccode\u003eCOMMIT\u003c/code\u003e is in progress. Note that prepared transactions are reported as \u003ccode\u003ein progress\u003c/code\u003e; applications must check \u003ca href=\"/docs/18/view-pg-prepared-xacts.html\" rel=\"nofollow\"\u003e\u003ccode\u003epg_prepared_xacts\u003c/code\u003e\u003c/a\u003e if they need to determine whether a transaction ID belongs to a prepared transaction.","SourceRevision":"wiki-repair-20261023:2f8e1f0e83a05035c5ca2e663abce73b4a5b7ba5890660f1461b233233ab1f9c","ContentHash":"fa26d302d225cb122273b755c70d0d34598d3c5685d96cee208f349a69ea32e7","Payload":{"description":"Reports the commit status of a recent transaction. The result is one of in progress, committed, or aborted, provided that the transaction is recent enough that the system retains the commit status of that transaction. If it is old enough that no references to the transaction survive in the system and the commit status information has been discarded, the result is NULL. Applications might use this function, for example, to determine whether their transaction committed or aborted after the application and database server become disconnected while a COMMIT is in progress. Note that prepared transactions are reported as in progress; applications must check pg_prepared_xacts if they need to determine whether a transaction ID belongs to a prepared transaction.","description_html":"Reports the commit status of a recent transaction. The result is one of \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e, \u003ccode class=\"literal\"\u003ecommitted\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eaborted\u003c/code\u003e, provided that the transaction is recent enough that the system retains the commit status of that transaction. If it is old enough that no references to the transaction survive in the system and the commit status information has been discarded, the result is \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e. Applications might use this function, for example, to determine whether their transaction committed or aborted after the application and database server become disconnected while a \u003ccode class=\"literal\"\u003eCOMMIT\u003c/code\u003e is in progress. Note that prepared transactions are reported as \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e; applications must check \u003ca href=\"/docs/18/view-pg-prepared-xacts.html\" title=\"53.17. pg_prepared_xacts\"\u003e\u003ccode class=\"structname\"\u003epg_prepared_xacts\u003c/code\u003e\u003c/a\u003e if they need to determine whether a transaction ID belongs to a prepared transaction.","signatures":[{"description":"Reports the commit status of a recent transaction. The result is one of in progress, committed, or aborted, provided that the transaction is recent enough that the system retains the commit status of that transaction. If it is old enough that no references to the transaction survive in the system and the commit status information has been discarded, the result is NULL. Applications might use this function, for example, to determine whether their transaction committed or aborted after the application and database server become disconnected while a COMMIT is in progress. Note that prepared transactions are reported as in progress; applications must check pg_prepared_xacts if they need to determine whether a transaction ID belongs to a prepared transaction.","description_html":"Reports the commit status of a recent transaction. The result is one of \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e, \u003ccode class=\"literal\"\u003ecommitted\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eaborted\u003c/code\u003e, provided that the transaction is recent enough that the system retains the commit status of that transaction. If it is old enough that no references to the transaction survive in the system and the commit status information has been discarded, the result is \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e. Applications might use this function, for example, to determine whether their transaction committed or aborted after the application and database server become disconnected while a \u003ccode class=\"literal\"\u003eCOMMIT\u003c/code\u003e is in progress. Note that prepared transactions are reported as \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e; applications must check \u003ca href=\"/docs/18/view-pg-prepared-xacts.html\" title=\"53.17. pg_prepared_xacts\"\u003e\u003ccode class=\"structname\"\u003epg_prepared_xacts\u003c/code\u003e\u003c/a\u003e if they need to determine whether a transaction ID belongs to a prepared transaction.","description_zh":"报告近期事务的提交状态。只要事务足够新，系统仍保留其提交状态，结果就为 in progress、committed 或 aborted。如果事务已足够旧，系统中不再有对它的引用，且提交状态信息已被丢弃，则返回 NULL。例如，在 COMMIT 进行过程中应用与数据库服务器断开连接时，应用可以用此函数判断事务是提交了还是中止了。注意，预备事务被报告为 in progress；如果需要确定某个事务 ID 是否为预备事务，应用必须检查 pg_prepared_xacts。","description_zh_html":"报告近期事务的提交状态。只要事务足够新，系统仍保留其提交状态，结果就为 \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e、\u003ccode class=\"literal\"\u003ecommitted\u003c/code\u003e 或 \u003ccode class=\"literal\"\u003eaborted\u003c/code\u003e。如果事务已足够旧，系统中不再有对它的引用，且提交状态信息已被丢弃，则返回 \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。例如，在 \u003ccode class=\"literal\"\u003eCOMMIT\u003c/code\u003e 进行过程中应用与数据库服务器断开连接时，应用可以用此函数判断事务是提交了还是中止了。注意，预备事务被报告为 \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e；如果需要确定某个事务 ID 是否为预备事务，应用必须检查 \u003ca href=\"/docs/18/view-pg-prepared-xacts.html\" title=\"53.17. pg_prepared_xacts\"\u003e\u003ccode class=\"structname\"\u003epg_prepared_xacts\u003c/code\u003e\u003c/a\u003e。","examples":[],"html":"\u003ccode class=\"function\"\u003epg_xact_status\u003c/code\u003e ( \u003ccode class=\"type\"\u003exid8\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"pg_xact_status ( xid8 ) → text","zh_from":"same-version-manual"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"3c59237f6d6c67dcdd1557bf0f5c7b9b37c8446040a1fef6cc18883dedba6751","Text":"pg_xact_status ( xid8 ) → text","Returns":"text","Payload":{"description":"Reports the commit status of a recent transaction. The result is one of in progress, committed, or aborted, provided that the transaction is recent enough that the system retains the commit status of that transaction. If it is old enough that no references to the transaction survive in the system and the commit status information has been discarded, the result is NULL. Applications might use this function, for example, to determine whether their transaction committed or aborted after the application and database server become disconnected while a COMMIT is in progress. Note that prepared transactions are reported as in progress; applications must check pg_prepared_xacts if they need to determine whether a transaction ID belongs to a prepared transaction.","description_html":"Reports the commit status of a recent transaction. The result is one of \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e, \u003ccode class=\"literal\"\u003ecommitted\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eaborted\u003c/code\u003e, provided that the transaction is recent enough that the system retains the commit status of that transaction. If it is old enough that no references to the transaction survive in the system and the commit status information has been discarded, the result is \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e. Applications might use this function, for example, to determine whether their transaction committed or aborted after the application and database server become disconnected while a \u003ccode class=\"literal\"\u003eCOMMIT\u003c/code\u003e is in progress. Note that prepared transactions are reported as \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e; applications must check \u003ca href=\"/docs/18/view-pg-prepared-xacts.html\" title=\"53.17. pg_prepared_xacts\"\u003e\u003ccode class=\"structname\"\u003epg_prepared_xacts\u003c/code\u003e\u003c/a\u003e if they need to determine whether a transaction ID belongs to a prepared transaction.","description_zh":"报告近期事务的提交状态。只要事务足够新，系统仍保留其提交状态，结果就为 in progress、committed 或 aborted。如果事务已足够旧，系统中不再有对它的引用，且提交状态信息已被丢弃，则返回 NULL。例如，在 COMMIT 进行过程中应用与数据库服务器断开连接时，应用可以用此函数判断事务是提交了还是中止了。注意，预备事务被报告为 in progress；如果需要确定某个事务 ID 是否为预备事务，应用必须检查 pg_prepared_xacts。","description_zh_html":"报告近期事务的提交状态。只要事务足够新，系统仍保留其提交状态，结果就为 \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e、\u003ccode class=\"literal\"\u003ecommitted\u003c/code\u003e 或 \u003ccode class=\"literal\"\u003eaborted\u003c/code\u003e。如果事务已足够旧，系统中不再有对它的引用，且提交状态信息已被丢弃，则返回 \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。例如，在 \u003ccode class=\"literal\"\u003eCOMMIT\u003c/code\u003e 进行过程中应用与数据库服务器断开连接时，应用可以用此函数判断事务是提交了还是中止了。注意，预备事务被报告为 \u003ccode class=\"literal\"\u003ein progress\u003c/code\u003e；如果需要确定某个事务 ID 是否为预备事务，应用必须检查 \u003ca href=\"/docs/18/view-pg-prepared-xacts.html\" title=\"53.17. pg_prepared_xacts\"\u003e\u003ccode class=\"structname\"\u003epg_prepared_xacts\u003c/code\u003e\u003c/a\u003e。","examples":[],"html":"\u003ccode class=\"function\"\u003epg_xact_status\u003c/code\u003e ( \u003ccode class=\"type\"\u003exid8\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"pg_xact_status ( xid8 ) → text","zh_from":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
