↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

支持中的版本: 当前版本 (18) / 17 / 16 / 15 / 14
开发中的版本: 19 / 20devel
已结束支持的版本: 13 / 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1
历史版本。 PostgreSQL 9.1 已结束支持。 2016-10-27. 请参阅 当前版本手册.

45.58. pg_prepared_xacts #

视图pg_prepared_xacts显示当前准备进行两阶段提交的事务的信息 (详见PREPARE TRANSACTION)。

pg_prepared_xacts 为每个预备事务包含一行。事务提交或回滚时,对应条目会被移除。

表 45.59. pg_prepared_xacts 列

NameTypeReferencesDescription
transactionxid  Numeric transaction identifier of the prepared transaction
gidtext  Global transaction identifier that was assigned to the transaction
preparedtimestamp with time zone  Time at which the transaction was prepared for commit
ownernamepg_authid.rolname Name of the user that executed the transaction
databasenamepg_database.datname Name of the database in which the transaction was executed

当访问pg_prepared_xacts视图时,内部事务管理器数据结构会被暂时锁定,并为视图制作一份副本用以显示。这确保视图生成一致的结果集,同时不会不必要地阻塞正常操作。尽管如此,如果频繁访问该视图,可能会对数据库性能产生一些影响。

报告文档问题

阅读 上游文档. 反馈更正前请先核对 当前版本手册.