RefLib

Reference library for AI

Back

postgresql_16:8.3.16 pg_prepared_xacts

PostgreSQL 16 > Internals > System Views > pg_prepared_xacts

The view pg_prepared_xacts displays information about transactions that are currently prepared for two-phase commit (see (see postgresql_16:7.1.158) for details).

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

| Column Type Description | | --- | | transaction xid Numeric transaction identifier of the prepared transaction | | gid text Global transaction identifier that was assigned to the transaction | | prepared timestamptz Time at which the transaction was prepared for commit | | owner name (references pg_authid (see postgresql_16:8.2.8).rolname) Name of the user that executed the transaction | | database name (references pg_database (see postgresql_16:8.2.15).datname) 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.

Back