历史版本。 PostgreSQL 9.1 已结束支持。 2016-10-27. 请参阅 当前版本手册.
45.58. pg_prepared_xacts #
视图pg_prepared_xacts显示当前准备进行两阶段提交的事务的信息
(详见PREPARE TRANSACTION)。
pg_prepared_xacts 为每个预备事务包含一行。事务提交或回滚时,对应条目会被移除。
表 45.59. pg_prepared_xacts 列
| Name | Type | References | Description |
|---|---|---|---|
transaction | xid | Numeric transaction identifier of the prepared transaction | |
gid | text | Global transaction identifier that was assigned to the transaction | |
prepared | timestamp with time zone | Time at which the transaction was prepared for commit | |
owner | name | | Name of the user that executed the transaction |
database | name | | Name of the database in which the transaction was executed |
当访问pg_prepared_xacts视图时,内部事务管理器数据结构会被暂时锁定,并为视图制作一份副本用以显示。这确保视图生成一致的结果集,同时不会不必要地阻塞正常操作。尽管如此,如果频繁访问该视图,可能会对数据库性能产生一些影响。