25002 — 分支事务已活动(branch_transaction_already_active)
分支事务已经活动,范围窄于 25001。
英文手册覆盖始于 PostgreSQL 8.1. 来源历史与运行验证各自保留独立版本边界。
当前阅读 PG 18·选择有来源记录的版本
- aliases
- 未知
- class name
- Invalid Transaction State
- condition name
- branch_transaction_already_active
- lang
- en
- sqlstate
- 25002
版本定义 PG 18
25002 — 分支事务已活动
速览 {#at-a-glance}
25002 表示分支事务已经活动,范围窄于 25001,也不同于 25P02。本文只记录锁定条件定义和 18.6 核心调用扫描未发现直接报文路径的边界。
含义 {#meaning}
它属于 Class 25,但不应作为嵌套事务或普通保存点的总称。核心 errcodes.txt 定义了宏;项目对 18.6 核心解析调用的穷尽扫描没有找到 25002 报告组。
诊断 {#diagnosis}
使用精确 SQLSTATE 和事务上下文,区分分支管理 API、保存点、活动事务块和失败事务。没有核心调用点不代表可以从别的码推断报文或触发器。
处理 {#response}
保留分支管理操作及其事务边界,按创建该分支的 API 处理。本批没有确认安全自然触发,不用 RAISE 代替。
源码报文模板 {#messages}
适用边界 {#case}
本批没有为 25002 构造自然 SQL 触发器;请把它视为源码/协议边界,而不是可直接复制的复现脚本。结构化证据 · 案例导出。
作者证据 ID:identity, source-boundary。选定运行记录:—。
版本与边界 {#versions}
锁定目录在 7.4 已观察到该条件,并在列出的正式快照中均存在。18.6 核心调用扫描没有解析出的路径;扩展或未来源码可能增加路径。
相关 {#related}
对比 25001 活动 SQL 事务、25000 事务状态无效 和 3B000 保存点异常。
来源 {#sources}
src.errcodes.18.6(SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba)src.calls.REL_18_6(SHA-2569ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf)
比较版本
SQLSTATE 证据与已记录的运行版本
claims · identity
{
"claim_id": "identity",
"limits": "This is a narrow transaction-branch state, distinct from 25001 active_sql_transaction and 25P02 in_failed_sql_transaction.",
"method": "Read the fixed errcodes row and macro.",
"position": 0,
"runtime": [],
"sources": [
"src.errcodes.18.6"
],
"statement": "25002 is branch_transaction_already_active in Class 25."
}claims · source-boundary
{
"claim_id": "source-boundary",
"limits": "A missing core call-site is a bounded source observation; do not manufacture it with RAISE or a guessed replication topology.",
"method": "Compare the errcodes macro mapping with all resolved report groups.",
"position": 1,
"runtime": [],
"sources": [
"src.errcodes.18.6",
"src.calls.REL_18_6"
],
"statement": "The exhaustive resolved PostgreSQL 18.6 core call scan has no report group mapped to 25002, so this batch does not claim a safe natural SQL trigger."
}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": ""
}来源引用
定义来源
center · PostgreSQL 18 · english-manuals:81b9ce1e6900c64c430b0e57127110a92322dfad1c2c8aff97ec4457d30dfe6a
正文语言: zh-Hans · english-manuals:81b9ce1e6900c64c430b0e57127110a92322dfad1c2c8aff97ec4457d30dfe6a