选择 打开 改范围 完整检索页

pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。

百科 / 错误代码 / Class 25 事务状态无效

25008 held_cursor_requires_same_isolation_level

持有游标要求相同隔离级别

ERROR 仅定义 参考 不适用

类别
Class 25 事务状态无效
严重等级
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.

    核实方式Read the fixed condition row and macro.

    不覆盖The condition is about a held cursor and transaction isolation, not every cursor-state error.

    来源src/backend/utils/errcodes.txt

  • The exhaustive resolved PostgreSQL 18.6 call scan contains no direct 25008 report group; no natural SQL reproduction or message template is claimed.

    核实方式Scan fixed source call records for SQLSTATE 25008.

    不覆盖Do not replace this boundary with 24000 or a fabricated cursor error.

    来源raw/calls/REL_18_6.jsonl

运行记录

目标服务器版本结果覆盖案例
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 事务状态无效 下的其他成员。