{"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","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"],"signature":"pg_xact_status ( xid8 ) → text","signature_count":1,"slug":"pg-xact-status","source_rev":"b7bd9cda","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":"b7bd9cda","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":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-PG-SNAPSHOT","file":"functions-info.html","slug":"18"},"group":"info","group_label":"System Information Functions And Operators","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":"","description_zh_html":"","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":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-PG-SNAPSHOT","file":"functions-info.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"pg-xact-status","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_xact_status","Summary":"报告近期事务的提交状态。只要事务足够新，系统仍保留其提交状态，结果就为in progress、committed或aborted。如果事务已足够旧，系统中不再有对它的引用，且提交状态信息已被丢弃，则返回NULL。例如，在COMMIT进行过程中应用与数据库服务器断开连接时，应用可以用此函数判断事务是提交了还是中止了。注意，预备事务被报告为in progress；如果需要确定某个事务 ID 是否为预备事务，应用必须检查pg_prepared_xacts。","BodyHTML":"报告近期事务的提交状态。只要事务足够新，系统仍保留其提交状态，结果就为\u003ccode\u003ein progress\u003c/code\u003e、\u003ccode\u003ecommitted\u003c/code\u003e或\u003ccode\u003eaborted\u003c/code\u003e。如果事务已足够旧，系统中不再有对它的引用，且提交状态信息已被丢弃，则返回\u003ccode\u003eNULL\u003c/code\u003e。例如，在\u003ccode\u003eCOMMIT\u003c/code\u003e进行过程中应用与数据库服务器断开连接时，应用可以用此函数判断事务是提交了还是中止了。注意，预备事务被报告为\u003ccode\u003ein progress\u003c/code\u003e；如果需要确定某个事务 ID 是否为预备事务，应用必须检查\u003ca href=\"/docs/18/view-pg-prepared-xacts.html\" rel=\"nofollow\"\u003e\u003ccode\u003epg_prepared_xacts\u003c/code\u003e\u003c/a\u003e。\u003cpre\u003epg_xact_status ( xid8 ) → text\u003c/pre\u003e报告近期事务的提交状态。只要事务足够新，系统仍保留其提交状态，结果就为\u003ccode\u003ein progress\u003c/code\u003e、\u003ccode\u003ecommitted\u003c/code\u003e或\u003ccode\u003eaborted\u003c/code\u003e。如果事务已足够旧，系统中不再有对它的引用，且提交状态信息已被丢弃，则返回\u003ccode\u003eNULL\u003c/code\u003e。例如，在\u003ccode\u003eCOMMIT\u003c/code\u003e进行过程中应用与数据库服务器断开连接时，应用可以用此函数判断事务是提交了还是中止了。注意，预备事务被报告为\u003ccode\u003ein progress\u003c/code\u003e；如果需要确定某个事务 ID 是否为预备事务，应用必须检查\u003ca href=\"/docs/18/view-pg-prepared-xacts.html\" rel=\"nofollow\"\u003e\u003ccode\u003epg_prepared_xacts\u003c/code\u003e\u003c/a\u003e。","SourceRevision":"ca936764","ContentHash":"740049041ff29dc19e783831bb5dbc509b4d12afb5b9e5c1f8747c7527fb1acb","Payload":{"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。","signatures":[{"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。","returns":"text","text":"pg_xact_status ( xid8 ) → text","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","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":"","description_zh_html":"","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":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
