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

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

Wiki / SQLSTATE

25008 — 持有游标要求相同隔离级别(held_cursor_requires_same_isolation_level)

持有游标要求与操作相同的事务隔离级别。

英文手册覆盖始于 PostgreSQL 8.1. 来源历史与运行验证各自保留独立版本边界。

当前阅读 PG 18·选择有来源记录的版本

aliases
未知
class name
Invalid Transaction State
condition name
held_cursor_requires_same_isolation_level
lang
en
sqlstate
25008

版本定义 PG 18

25008 — 持有游标要求相同隔离级别(held_cursor_requires_same_isolation_level)

速览 {#at-a-glance}

25008 用于持有游标与操作要求的事务隔离级别不兼容的情况。固定 PostgreSQL 18.6 核心扫描没有该码的直接报错组。

含义 {#meaning}

它比 24000 游标状态无效更窄,也不是一般的 40001 可串行化重试路径。游标跨事务持有本身不能证明服务器发出了 25008。

诊断 {#diagnosis}

应记录游标声明、holdability、两个事务的隔离级别以及实际报出的精确 SQLSTATE。当前固定证据没有报文模板或可复制 SQL 触发器。

处理 {#response}

让持有游标和使用它的事务保持兼容隔离级别,或按 API 契约关闭并重新声明。没有实际状态证据时,不要套用 24000 修复或通用回滚。

源码报文与运行边界 {#messages}

固定 errcodes.txt 定义了该条件和宏;raw/calls/REL_18_6.jsonl 的解析调用扫描没有直接报错组,因此本批不发布报文模板,也不构造自然 SQL 触发器。

适用边界与案例 {#case}

本批运行器在 PostgreSQL 18.6 与 10.21 的选定 case 均为 not_applicable,只记录源码边界,没有可复制的 SQL 触发过程。结构化证据 · 案例导出

版本与边界 {#versions}

生成事实记录锁定目录成员。选定的 latest 与 PG10 case 有意保持仅源码和 not_applicable 状态。

相关 {#related}

24000 游标状态无效、25004 分支事务隔离级别、40001 可串行化失败。

来源 {#sources}

  • src.errcodes.18.6 (SHA-256 6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba)
  • src.calls.REL_18_6 — raw/calls/REL_18_6.jsonl (SHA-256 9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf)

比较版本

SQLSTATE 证据与已记录的运行版本

cases · held_cursor_isolation_boundary
{
  "assertions": [
    "No fabricated SQL trigger is included; the selected run records a definition/source boundary."
  ],
  "case_id": "held_cursor_isolation_boundary",
  "cleanup": "Drop the case schema with an owner connection.",
  "has_snippet": false,
  "position": 0,
  "preconditions": [
    "A runner-owned disposable target is provisioned."
  ],
  "repair": "Follow the explicit transaction or source boundary described by the case.",
  "trigger": "Source/definition evidence only; no natural SQL trigger is claimed.",
  "versions": [
    "10",
    "18"
  ]
}
claims · identity
{
  "claim_id": "identity",
  "limits": "The condition is about a held cursor and transaction isolation, not every cursor-state error.",
  "method": "Read the fixed condition row and macro.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "25008 is held_cursor_requires_same_isolation_level in Class 25."
}
claims · source-boundary
{
  "claim_id": "source-boundary",
  "limits": "Do not replace this boundary with 24000 or a fabricated cursor error.",
  "method": "Scan fixed source call records for SQLSTATE 25008.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.calls.REL_18_6"
  ],
  "statement": "The exhaustive resolved PostgreSQL 18.6 call scan contains no direct 25008 report group; no natural SQL reproduction or message template is claimed."
}
runtimes · runtime.25008-batch2-latest-20260909.latest · 18.6 (Homebrew) · not_applicable
{
  "cases": [
    "held_cursor_isolation_boundary"
  ],
  "limits": "",
  "position": 0,
  "raw": {
    "case_manifest": {
      "path": "verify/cases/25008/cases.json",
      "sha256": "623ed0ec9b97c61d9929e15882992efb4f1022f0a8efe344f5f478da23483101"
    },
    "case_status": "not_applicable",
    "cases": [
      "held_cursor_isolation_boundary"
    ],
    "id": "runtime.25008-batch2-latest-20260909.latest",
    "observed": {
      "case_status": "not_applicable"
    },
    "raw": "verify/results/25008-batch2-latest-20260909/latest/raw.jsonl",
    "raw_sha256": "0889c37455fdb5ff5ebd30e4e4e3125b07e927bff2cdf85ff042fa45993c6bc1",
    "run_id": "25008-batch2-latest-20260909",
    "server_version": "18.6 (Homebrew)",
    "server_version_num": 180006,
    "status": "not_applicable",
    "summary": "verify/results/25008-batch2-latest-20260909/latest/summary.json",
    "summary_sha256": "5414fdc3f348658002eb8f411bb9654983e2052d89611ab005702080615e37c7",
    "target": "latest",
    "target_status": "passed"
  },
  "run_id": "25008-batch2-latest-20260909",
  "runtime_id": "runtime.25008-batch2-latest-20260909.latest",
  "server_version": "18.6 (Homebrew)",
  "status": "not_applicable",
  "target": "latest"
}
runtimes · runtime.25008-batch2-pg10-20260909.pg10 · 10.21 (Debian 10.21-1.pgdg90+1) · not_applicable
{
  "cases": [
    "held_cursor_isolation_boundary"
  ],
  "limits": "",
  "position": 1,
  "raw": {
    "case_manifest": {
      "path": "verify/cases/25008/cases.json",
      "sha256": "623ed0ec9b97c61d9929e15882992efb4f1022f0a8efe344f5f478da23483101"
    },
    "case_status": "not_applicable",
    "cases": [
      "held_cursor_isolation_boundary"
    ],
    "id": "runtime.25008-batch2-pg10-20260909.pg10",
    "observed": {
      "case_status": "not_applicable"
    },
    "raw": "verify/results/25008-batch2-pg10-20260909/pg10/raw.jsonl",
    "raw_sha256": "9ec5edb1763265af64f67283d68eeaa0afff4023dda4686ecaf04dc3e5178726",
    "run_id": "25008-batch2-pg10-20260909",
    "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
    "server_version_num": 100021,
    "status": "not_applicable",
    "summary": "verify/results/25008-batch2-pg10-20260909/pg10/summary.json",
    "summary_sha256": "6bcfef17630470c294b892e305ffc58315f3e7653189d5bfdfc670e1e8988950",
    "target": "pg10",
    "target_status": "passed"
  },
  "run_id": "25008-batch2-pg10-20260909",
  "runtime_id": "runtime.25008-batch2-pg10-20260909.pg10",
  "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
  "status": "not_applicable",
  "target": "pg10"
}
sources · src.errcodes.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/errcodes.txt",
  "position": 0,
  "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
  "source_id": "src.errcodes.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt"
}
sources · src.calls.REL_18_6
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "raw/calls/REL_18_6.jsonl",
  "position": 1,
  "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
  "source_id": "src.calls.REL_18_6",
  "tag": "",
  "url": ""
}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:1bf583fc18764278da22f53f3be26fff40f092f973b68d83bf38cd80c1770b51

正文语言: zh-Hans · english-manuals:1bf583fc18764278da22f53f3be26fff40f092f973b68d83bf38cd80c1770b51