txid_current()

A function returning the current transaction ID
This entry relates to a PostgreSQL feature which is deprecated and may be desupported in future releases.

txid_current() is a deprecated system function returning the current transaction ID.

txid_current() was added in PostgreSQL 8.3.

Usage

txid_current () → bigint

txid_current() returns the current transaction ID as a bigint. Note that a new transaction ID will be assigned if the current transaction does not currently have one.

This function is deprecated following the introduction of the xid8 data type in PostgreSQL 13 and is superseded by pg_current_xact_id().

Change history

Examples

Basic usage example for txid_current():

postgres=# SELECT txid_current();
 txid_current 
--------------
          737
(1 row)

Categories

Deprecated, System function, Transactions

See also

pg_current_xact_id(), txid_current_if_assigned()