Contents
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
- PostgreSQL 13
- marked as deprecated (commit 4c04be9b)
- PostgreSQL 8.3
- added (commit 18e3fcc3)
Examples
Basic usage example for txid_current()
:
postgres=# SELECT txid_current(); txid_current -------------- 737 (1 row)
References
- PostgreSQL documentation: Deprecated Transaction ID and Snapshot Information Functions