{"Entry":{"collection":"func","key":"pg-current-xact-id-if-assigned","name":"pg_current_xact_id_if_assigned","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"13"},{"descriptions_changed":true,"doc_overhaul":false,"from":"15","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"16"}],"content_hash":"2877433ffc6e4465282373fa558d2b547e85096a303e2dab32a9d3e5acfbfe47","first_version":"13","group":"info","group_label":"System Information Functions And Operators","groups":["info"],"imported_at":"2026-09-27T17:57:29.149128+08:00","last_version":"20","name":"pg_current_xact_id_if_assigned","name_key":"pg_current_xact_id_if_assigned","position":28048,"present_in":["13","14","15","16","17","18","19","20"],"signature":"pg_current_xact_id_if_assigned () → xid8","signature_count":1,"slug":"pg-current-xact-id-if-assigned","source_rev":"b7bd9cda","summary":"Returns the current transaction's ID, or NULL if no ID is assigned yet.","summary_zh":""}},"Definition":{"Collection":"func","Key":"pg-current-xact-id-if-assigned","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"pg-current-xact-id-if-assigned","SourceRevision":"b7bd9cda","Facts":{"description":"Returns the current transaction's ID, or NULL if no ID is assigned yet. (It's best to use this variant if the transaction might otherwise be read-only, to avoid unnecessary consumption of an XID.) If executed in a subtransaction, this will return the top-level transaction ID.","description_html":"Returns the current transaction's ID, or \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e if no ID is assigned yet. (It's best to use this variant if the transaction might otherwise be read-only, to avoid unnecessary consumption of an XID.) If executed in a subtransaction, this will return the top-level transaction ID.","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":"Returns the current transaction's ID, or NULL if no ID is assigned yet. (It's best to use this variant if the transaction might otherwise be read-only, to avoid unnecessary consumption of an XID.) If executed in a subtransaction, this will return the top-level transaction ID.","description_html":"Returns the current transaction's ID, or \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e if no ID is assigned yet. (It's best to use this variant if the transaction might otherwise be read-only, to avoid unnecessary consumption of an XID.) If executed in a subtransaction, this will return the top-level transaction ID.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epg_current_xact_id_if_assigned\u003c/code\u003e () → \u003ccode class=\"returnvalue\"\u003exid8\u003c/code\u003e","returns":"xid8","text":"pg_current_xact_id_if_assigned () → xid8","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-PG-SNAPSHOT","file":"functions-info.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"pg-current-xact-id-if-assigned","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_current_xact_id_if_assigned","Summary":"返回当前事务的 ID；如果尚未分配 ID，则返回NULL。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","BodyHTML":"返回当前事务的 ID；如果尚未分配 ID，则返回\u003ccode\u003eNULL\u003c/code\u003e。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。\u003cpre\u003epg_current_xact_id_if_assigned () → xid8\u003c/pre\u003e返回当前事务的 ID；如果尚未分配 ID，则返回\u003ccode\u003eNULL\u003c/code\u003e。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","SourceRevision":"ca936764","ContentHash":"3f0f942cd9651cfd7090595406af729f0cbd194cdc672e89c3e1b7a0d4d6ca02","Payload":{"description_zh":"返回当前事务的 ID；如果尚未分配 ID，则返回NULL。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","description_zh_html":"返回当前事务的 ID；如果尚未分配 ID，则返回\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","signatures":[{"description_zh":"返回当前事务的 ID；如果尚未分配 ID，则返回NULL。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","description_zh_html":"返回当前事务的 ID；如果尚未分配 ID，则返回\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","returns":"xid8","text":"pg_current_xact_id_if_assigned () → xid8","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":"e53dada973fef7251efeca48c9cebe492dcc8313e74a57029f22588bdd5729d2","Text":"pg_current_xact_id_if_assigned () → xid8","Returns":"xid8","Payload":{"description":"Returns the current transaction's ID, or NULL if no ID is assigned yet. (It's best to use this variant if the transaction might otherwise be read-only, to avoid unnecessary consumption of an XID.) If executed in a subtransaction, this will return the top-level transaction ID.","description_html":"Returns the current transaction's ID, or \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e if no ID is assigned yet. (It's best to use this variant if the transaction might otherwise be read-only, to avoid unnecessary consumption of an XID.) If executed in a subtransaction, this will return the top-level transaction ID.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epg_current_xact_id_if_assigned\u003c/code\u003e () → \u003ccode class=\"returnvalue\"\u003exid8\u003c/code\u003e","returns":"xid8","text":"pg_current_xact_id_if_assigned () → xid8","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
