A function returning information about a backend's subtransactions
This entry relates to a PostgreSQL feature which is part of PostgreSQL 16, due to be released in late 2023.

pg_stat_get_backend_subxact() is a system function returning information about the subtransactions of the backend with the specified ID.

pg_stat_get_backend_subxact() was added in PostgreSQL 16.


pg_stat_get_backend_subxact ( integer )
        → seof record ( subxact_count integer, subxact_overflowed boolean )

Change history


Basic usage example for :

postgres=*# SELECT * FROM pg_stat_get_backend_subxact( pg_backend_pid() );
 subxact_count | subxact_overflowed 
(1 row)


System function, Transactions