pg_subtrans_infos
pg_subtrans_infos · Inspect PostgreSQL subtransaction status, parent XIDs, nesting level, and commit timestamps.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100446 | pg_subtrans_infos | pg_subtrans_infos | 1.0 | ADMIN | PostgreSQL | C |
PostgreSQL · 10, 11, 12, 13
Usage
Sources:
- Pinned upstream README
- Version 1.0 SQL API
- Pinned transaction-status implementation
- Pinned extension control file
pg_subtrans_infos version 1.0 reports internal status and parentage for a recent transaction ID. Its single function returns xid, status, immediate parent, top parent, subtransaction depth, and an optional commit timestamp. It is a low-level diagnostic helper, not a durable transaction-history catalog.
Inspect recent lock transactions
Status is committed, aborted, or in progress. commit_timestamp is populated only when track_commit_timestamp is enabled and the corresponding commit-timestamp record is still retained. An ID older than retained pg_xact state produces NULL details, while an ID in the future raises an error.
Retention and compatibility boundaries
The function combines the supplied 32-bit transaction ID with the current epoch. It is suitable only for recent IDs whose pg_xact and pg_subtrans entries have not wrapped or been truncated. Parent information can disappear before other transaction evidence, and the README notes that top_parent_xid can be empty after a transaction is no longer in progress. Never use the result for forensic completeness, business logic, or recovery decisions.
The C module copies PostgreSQL backend logic and calls private subtransaction, commit-timestamp, transaction-status, shared-memory, and lock interfaces. Those APIs and invariants can change in every major release. The README reports tests on PostgreSQL 10 through 12.2, and the pinned code adds branches for 13; it provides no support for 14 or newer.
The catalog marks this extension abandoned. Compile it only against a supported historical server, use it briefly for diagnostics, and remove it afterward. On current PostgreSQL releases, prefer supported monitoring views and logs or port the code with upstream backend tests rather than loading the old binary.