txid_status()

A function reporting the commit status of a transaction
This entry relates to a PostgreSQL feature which is deprecated and may be desupported in future releases.

txid_status() is a deprecated system function reporting the commit status of a recent transaction.

txid_status() was added in PostgreSQL 8.3.

Usage

txid_status ( bigint ) → text

txid_status() returns one of the following values:

  • committed
  • in progress
  • aborted

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

Change history

Examples

Basic usage example for txid_status():

postgres=# BEGIN ;
BEGIN

postgres=*# SELECT txid_current();
 txid_current 
--------------
          757
(1 row)

postgres=*# SELECT txid_status(757);
 txid_status 
-------------
 in progress
(1 row)

postgres=*# COMMIT;
COMMIT

postgres=# SELECT txid_status(757);
 txid_status 
-------------
 committed
(1 row)

Attempting to retrieve the status of a transaction which has not yet taken place:

postgres=# SELECT txid_status(9999);
ERROR:  transaction ID 9999 is in the future

Categories

Deprecated, System function, Transactions

See also

pg_xact_status()