pg_current_xact_id () → xid8Returns the current transaction's ID. It will assign a new one if the current transaction does not have one already (because it has not performed any database updates); see Section 67.1 for details. If executed in a subtransaction, this will return the top-level transaction ID; see Section 67.3 for details.
FUNCTIONS / SYSTEM INFORMATION FUNCTIONS AND OPERATORS
pg_current_xact_id
Read PG 18 manual ↗Returns the current transaction's ID.
Signatures & examples
Version history 4
- PG 17 → 18changed
- PG 16 → 17changed
- PG 15 → 16changed
- PG 12 → 13added
Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source