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

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

Wiki / SQLSTATE

2200T — invalid_xml_processing_instruction

XML 处理指令无效,目标名或内容非法。

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

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

aliases
未知
class name
Data Exception
condition name
invalid_xml_processing_instruction
lang
en
sqlstate
2200T

版本定义 PG 18

2200T

速览 {#at-a-glance}

XML 处理指令违反 XML 语法。PostgreSQL 18.6 的 xmlpi 路径拒绝大小写不敏感地等于 xml 的目标名,或含有 ?> 的非 NULL 内容;两条 guard 都报告 invalid XML processing instruction,并附加对应 DETAIL。

含义 {#meaning}

本成员专用于 XML 处理指令语法,包括目标名和内容。xmlpi 用大小写不敏感比较检查目标名,因此 xml、XML 和混合大小写都会命中同一目标 guard。完成该语法检查后才应用 SQL NULL 规则:合法目标配 NULL 内容时返回 NULL;非 NULL 内容含有 ?> 时命中内容 guard。

报文 {#messages}

目标 guard 以 ERROR 报告 primary:invalid XML processing instruction,DETAIL 为 XML processing instruction target name cannot be "%s".。内容 guard 使用相同 primary,DETAIL 为 XML processing instruction cannot contain "?>".。引用分支没有独立 HINT。%s 是运行时目标名;合法目标下的 NULL 内容不是 2200T 错误。

诊断 {#diagnosis}

结合完整 message 和 detail 判断是目标名还是指令内容有问题。检查目标名规则,并在保持周围 XML 结构有效的前提下从内容中移除结尾 ?> 序列。不要用本成员规则去修复注释或一般文档错误。

处理 {#response}

按 detail 指出的目标名或指令内容修正处理指令,保持 XML 结构有效并移除被禁止的处理指令形式。

该分支抛出 ERROR 时,显式事务应先用 ROLLBACK 恢复,或对语句前已建立的保存点执行 ROLLBACK TO SAVEPOINT,再重试;自动提交下只在失败语句结束后重试修正后的动作。事务边界规则见事务与重试指南。

版本 {#versions}

锁定目录从 8.3.0 起记录该条件;固定源码覆盖 PostgreSQL 18.6。

相关 {#related}

2200L、2200S

来源 {#sources}

固定源码:src/backend/utils/adt/xml.c#L1010-1055。结构化证据记录保留两条 guard、message/detail 变体、NULL 顺序和范围边界。目标名和指令内容是运行时值;本页未运行自然 XML 案例。

比较版本

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

claims · identity
{
  "claim_id": "identity",
  "limits": "",
  "method": "Read fixed definition.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "2200T is invalid_xml_processing_instruction in SQLSTATE Class 22."
}
claims · mechanism.target
{
  "claim_id": "mechanism.target",
  "limits": "The NULL argument check follows the target check and returns NULL after a valid target.",
  "method": "Read the target-name branch and its detail.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.path.xmlpi"
  ],
  "statement": "xmlpi rejects the target name xml and reports 2200T with a target-specific DETAIL."
}
claims · mechanism.body
{
  "claim_id": "mechanism.body",
  "limits": "Do not apply comment or document repairs to this processing-instruction path.",
  "method": "Read the body validation branch.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.path.xmlpi"
  ],
  "statement": "xmlpi also rejects a body containing ?\u003e and reports 2200T with a body-specific DETAIL."
}
claims · history
{
  "claim_id": "history",
  "limits": "",
  "method": "Use catalogue boundary.",
  "position": 3,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "The locked catalogue records 2200T from 8.3.0 without proving an exact implementation introduction date."
}
messages · message.target
{
  "limits": "",
  "message_id": "message.target",
  "path": "",
  "position": 0,
  "raw": {
    "detail_template": "XML processing instruction target name cannot be \"%s\".",
    "id": "message.target",
    "primary_template": "invalid XML processing instruction",
    "severity_source": "ERROR",
    "sources": [
      "src.path.xmlpi"
    ],
    "sqlstate": "2200T"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.xmlpi"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "invalid XML processing instruction",
      "position": 0,
      "role": "",
      "template": "invalid XML processing instruction"
    },
    {
      "kind": "detail",
      "literal": "XML processing instruction target name cannot be \" \".",
      "position": 1,
      "role": "",
      "template": "XML processing instruction target name cannot be \"%s\"."
    }
  ]
}
messages · message.body
{
  "limits": "",
  "message_id": "message.body",
  "path": "",
  "position": 1,
  "raw": {
    "detail_template": "XML processing instruction cannot contain \"?\u003e\".",
    "id": "message.body",
    "primary_template": "invalid XML processing instruction",
    "severity_source": "ERROR",
    "sources": [
      "src.path.xmlpi"
    ],
    "sqlstate": "2200T"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.xmlpi"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "invalid XML processing instruction",
      "position": 0,
      "role": "",
      "template": "invalid XML processing instruction"
    },
    {
      "kind": "detail",
      "literal": "XML processing instruction cannot contain \"?\u003e\".",
      "position": 1,
      "role": "",
      "template": "XML processing instruction cannot contain \"?\u003e\"."
    }
  ]
}
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#L214"
}
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": ""
}
sources · src.path.xmlpi
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/adt/xml.c",
  "position": 2,
  "sha256": "f1c70b5ee5ee9a20a41d9b2c27bc7a8a50dbd47d9489ba462a4a678f7f55f14d",
  "source_id": "src.path.xmlpi",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/xml.c#L1010-L1055"
}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:442eafe8e6a84df21d47b90e60c70d8cc1eb2f83929e95d9dbd9ae387a8fa797

正文语言: zh-Hans · english-manuals:442eafe8e6a84df21d47b90e60c70d8cc1eb2f83929e95d9dbd9ae387a8fa797