百科 / 错误代码 / Class 25 事务状态无效
25005 no_active_sql_transaction_for_branch_transaction
分支事务没有活动 SQL 事务
ERROR 仅定义 参考 不适用
- 条件名
no_active_sql_transaction_for_branch_transaction- 宏名称
ERRCODE_NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION- 启用版本
- 7.4
- 状态
- 活跃
版本覆盖
速览
25005 是分支事务版本的“没有活动 SQL 事务”条件,与 25P01 不同;固定 PostgreSQL 18.6 核心扫描没有解析出自然服务器调用点。
含义
该码属于分支事务家族。普通会话在 BEGIN 外执行 SAVEPOINT 走的是其他页面展示的 25P01 路径,不应改称 25005。
诊断
记录分支 API 操作以及当时是否有活动分支事务。固定扫描没有解析出核心报文,因此精确服务器文本必须来自实际发出该码的实现。
处理
按该 API 契约结束或启动分支事务。不要仅凭名称套用通用回滚步骤,也不要伪造 PL/pgSQL 复现。
可复现案例
在一次性实例上执行过的场景。
branch_transaction_boundary PG 10 / 18
前置条件
- A runner-owned disposable target is provisioned.
触发
Source/definition evidence only; no natural SQL trigger is claimed.
断言
- No fabricated SQL trigger is included; the selected run records a definition/source boundary.
处置
Follow the explicit transaction or source boundary described by the case.
清理
Drop the case schema with an owner connection.
源码报文与运行边界
固定 errcodes.txt 定义了该条件和宏;raw/calls/REL_18_6.jsonl 的解析调用扫描没有直接报错组,因此本批不发布报文模板,也不构造自然 SQL 触发器。
适用边界与案例
本批运行器在 PostgreSQL 18.6 与 10.21 的选定 case 均为 not_applicable,只记录源码边界,没有可复制的 SQL 触发过程。结构化证据 · 案例导出
版本与边界
锁定目录包含生成的历史成员事实。选定的 latest 与 PG10 case 都明确记录为仅源码边界,不算自然运行通过。
来源
证据
断言
每条断言都写明了是怎么核实的,以及它不覆盖什么。这一层是核验时留下的原始英文记录,照原样呈现,未经翻译。
-
25005 is no_active_sql_transaction_for_branch_transaction in Class 25.
-
The exhaustive resolved PostgreSQL 18.6 call scan contains no direct 25005 report group; this batch records definition evidence only.
运行记录
| 目标 | 服务器版本 | 结果 | 覆盖案例 |
|---|---|---|---|
| latest | 18.6 (Homebrew) | not_applicable | branch_transaction_boundary |
| pg10 | 10.21 (Debian 10.21-1.pgdg90+1) | not_applicable | branch_transaction_boundary |
同类错误代码
Class 25 事务状态无效 下的其他成员。
25000invalid_transaction_state25001active_sql_transaction25002branch_transaction_already_active25003inappropriate_access_mode_for_branch_transaction25004inappropriate_isolation_level_for_branch_transaction25006read_only_sql_transaction25007schema_and_data_statement_mixing_not_supported25008held_cursor_requires_same_isolation_level25P01no_active_sql_transaction25P02in_failed_sql_transaction25P03idle_in_transaction_session_timeout25P04transaction_timeout