DESCRIBE TRANSACTION

描述 事务,包括开始时间和状态(正在运行、已提交、已回滚)。

DESCRIBE 可以缩写为 DESC。

另请参阅:

CURRENT_TRANSACTIONLAST_TRANSACTIONBEGINCOMMITROLLBACKSHOW TRANSACTIONS

语法

{ DESC | DESCRIBE } TRANSACTION <transaction_id>
Copy

参数

transaction_id

指定要描述的事务的标识符。

transaction_id 必须是字面量而非会话变量。

使用说明

  • To post-process the output of this command, you can use the pipe operator (->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.

    The output column names for this command are generated in lowercase. If you consume a result set from this command with the pipe operator or the RESULT_SCAN function, use double-quoted identifiers for the column names in the query to ensure that they match the column names in the output that was scanned. For example, if the name of an output column is type, then specify "type" for the identifier.

输出

命令的输出包括以下列,它们描述了对象的属性和元数据:

描述

id

事务的唯一标识符。

user

运行事务的用户的用户 ID。

session name

执行事务的用户会话的会话 ID。

started_on

创建事务的日期和时间。

state

事务的完成状态,例如:已提交、已回滚或仍在运行。

ended_on

事务完成的日期和时间。

示例

DESC TRANSACTION 1651535571261000000;
Copy
语言: 中文