↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / System Information Functions And Operators

pg_current_xact_id

Read the PG 18 manual

Returns the current transaction's ID.

Reading PG 18current·documented in 8 of 27 versions, 13 to 20

Signatures & examples

pg_current_xact_id () → xid8
Returns 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.
Version history 4
  1. 17 → 18 changed
  2. 16 → 17 changed
  3. 15 → 16 changed
  4. 12 → 13 added

Definition snapshot: b7bd9cda · English manual source