52.78. pg\_prepared\_xacts

|       52.78. `pg_prepared_xacts`       |                   |                           |                  |                                        |
|:--------------------------------------:|-------------------|---------------------------|------------------|----------------------------------------|
|[Prev](view-pg-prepared-statements.html)|[Up](catalogs.html)|Chapter 52. System Catalogs|[Home](index.html)| [Next](view-pg-publication-tables.html)|

---

## 52.78. `pg_prepared_xacts`

[]()

 The view `pg_prepared_xacts` displays information about transactions that are currently prepared for two-phase commit (see [PREPARE TRANSACTION](sql-prepare-transaction.html) for details).

`pg_prepared_xacts` contains one row per prepared transaction. An entry is removed when the transaction is committed or rolled back.

**Table 52.79. `pg_prepared_xacts` Columns**

|                                                           Column Type<br/><br/> Description                                                           |
|-------------------------------------------------------------------------------------------------------------------------------------------------------|
|                               `transaction` `xid`<br/><br/> Numeric transaction identifier of the prepared transaction                                |
|                               `gid` `text`<br/><br/> Global transaction identifier that was assigned to the transaction                               |
|                               `prepared` `timestamptz`<br/><br/> Time at which the transaction was prepared for commit                                |
|         `owner` `name` (references [`pg_authid`](catalog-pg-authid.html).`rolname`)<br/><br/> Name of the user that executed the transaction          |
|`database` `name` (references [`pg_database`](catalog-pg-database.html).`datname`)<br/><br/> Name of the database in which the transaction was executed|

 When the `pg_prepared_xacts` view is accessed, the internal transaction manager data structures are momentarily locked, and a copy is made for the view to display. This ensures that the view produces a consistent set of results, while not blocking normal operations longer than necessary. Nonetheless there could be some impact on database performance if this view is frequently accessed.

---

|[Prev](view-pg-prepared-statements.html)|[Up](catalogs.html)| [Next](view-pg-publication-tables.html)|
|:---------------------------------------|:-----------------:|---------------------------------------:|
|    52.77. `pg_prepared_statements`     |[Home](index.html) |     52.79. `pg_publication_tables`     |

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>