百科 / 错误代码 / Class 25 事务状态无效
25008 held_cursor_requires_same_isolation_level
持有游标要求相同隔离级别
ERROR 仅定义 参考 不适用
- 条件名
held_cursor_requires_same_isolation_level- 宏名称
ERRCODE_HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL- 启用版本
- 7.4
- 状态
- 活跃
版本覆盖
速览
25008 用于持有游标与操作要求的事务隔离级别不兼容的情况。固定 PostgreSQL 18.6 核心扫描没有该码的直接报错组。
含义
它比 24000 游标状态无效更窄,也不是一般的 40001 可串行化重试路径。游标跨事务持有本身不能证明服务器发出了 25008。
诊断
应记录游标声明、holdability、两个事务的隔离级别以及实际报出的精确 SQLSTATE。当前固定证据没有报文模板或可复制 SQL 触发器。
处理
让持有游标和使用它的事务保持兼容隔离级别,或按 API 契约关闭并重新声明。没有实际状态证据时,不要套用 24000 修复或通用回滚。
可复现案例
在一次性实例上执行过的场景。
held_cursor_isolation_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 有意保持仅源码和 not_applicable 状态。
来源
证据
断言
每条断言都写明了是怎么核实的,以及它不覆盖什么。这一层是核验时留下的原始英文记录,照原样呈现,未经翻译。
-
25008 is held_cursor_requires_same_isolation_level in Class 25.
-
The exhaustive resolved PostgreSQL 18.6 call scan contains no direct 25008 report group; no natural SQL reproduction or message template is claimed.
运行记录
| 目标 | 服务器版本 | 结果 | 覆盖案例 |
|---|---|---|---|
| latest | 18.6 (Homebrew) | not_applicable | held_cursor_isolation_boundary |
| pg10 | 10.21 (Debian 10.21-1.pgdg90+1) | not_applicable | held_cursor_isolation_boundary |
同类错误代码
Class 25 事务状态无效 下的其他成员。
25000invalid_transaction_state25001active_sql_transaction25002branch_transaction_already_active25003inappropriate_access_mode_for_branch_transaction25004inappropriate_isolation_level_for_branch_transaction25005no_active_sql_transaction_for_branch_transaction25006read_only_sql_transaction25007schema_and_data_statement_mixing_not_supported25P01no_active_sql_transaction25P02in_failed_sql_transaction25P03idle_in_transaction_session_timeout25P04transaction_timeout