{"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","derived_content_hash":"722c66c4406cb2c5cbe72c636a4d8b3944cd8c724040a21ded222d7eec1609d1","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:eae83299d70b60700a7d5aa582721e8b3d4be840f499331e0234770a5a16f649","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.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"],"repair_provenance":{"original_source_revision":"b7bd9cda","receipt_sha256":"5903fbda7cb7d3d4406e43c1402e57671417e22d5162402844d9b581d8016b6b","repair":"wiki-repair-20261023"},"signature":"pg_current_xact_id_if_assigned () → xid8","signature_count":1,"slug":"pg-current-xact-id-if-assigned","source_rev":"wiki-repair-20261023:eae83299d70b60700a7d5aa582721e8b3d4be840f499331e0234770a5a16f649","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":"wiki-repair-20261023:eae83299d70b60700a7d5aa582721e8b3d4be840f499331e0234770a5a16f649","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":"返回当前事务的 ID；如果尚未分配 ID，则返回 NULL。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","description_zh_html":"返回当前事务的 ID；如果尚未分配 ID，则返回 \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","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":"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":"返回当前事务的 ID；如果尚未分配 ID，则返回 NULL。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","description_zh_html":"返回当前事务的 ID；如果尚未分配 ID，则返回 \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","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":"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-current-xact-id-if-assigned","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_current_xact_id_if_assigned","Summary":"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.","BodyHTML":"Returns the current transaction\u0026#39;s ID, or \u003ccode\u003eNULL\u003c/code\u003e if no ID is assigned yet. (It\u0026#39;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.","SourceRevision":"wiki-repair-20261023:eae83299d70b60700a7d5aa582721e8b3d4be840f499331e0234770a5a16f649","ContentHash":"df231bc4858a9cd24a4d7327a01c3f7ef4383652f5674455d81392a716f8461d","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.","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":"返回当前事务的 ID；如果尚未分配 ID，则返回 NULL。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","description_zh_html":"返回当前事务的 ID；如果尚未分配 ID，则返回 \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","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":"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":"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":"返回当前事务的 ID；如果尚未分配 ID，则返回 NULL。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","description_zh_html":"返回当前事务的 ID；如果尚未分配 ID，则返回 \u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e。（如果事务本来可能是只读的，最好使用此变体，以免不必要地消耗 XID。）如果在子事务中执行，则返回顶层事务 ID。","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":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
