百科 / 错误代码 / Class 22 数据异常
2200T invalid_xml_processing_instruction
ERROR 源码确认 参考 未实测
- 条件名
invalid_xml_processing_instruction- 宏名称
ERRCODE_INVALID_XML_PROCESSING_INSTRUCTION- 启用版本
- 8.3
- 状态
- 活跃
版本覆盖
速览
XML 处理指令违反 XML 语法。PostgreSQL 18.6 的 xmlpi 路径拒绝大小写不敏感地等于 xml 的目标名,或含有 ?> 的非 NULL 内容;两条 guard 都报告 invalid XML processing instruction,并附加对应 DETAIL。
含义
本成员专用于 XML 处理指令语法,包括目标名和内容。xmlpi 用大小写不敏感比较检查目标名,因此 xml、XML 和混合大小写都会命中同一目标 guard。完成该语法检查后才应用 SQL NULL 规则:合法目标配 NULL 内容时返回 NULL;非 NULL 内容含有 ?> 时命中内容 guard。
报文
目标 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 错误。
报文模板
源码里的格式串,不是某一次运行的输出。%s 之类是占位符,实际报文会填入对象名与取值。适用范围一栏是核验时留下的原始英文记录,未经翻译。
invalid XML processing instruction
XML processing instruction target name cannot be "%s".
invalid XML processing instruction
XML processing instruction cannot contain "?>".
诊断
结合完整 message 和 detail 判断是目标名还是指令内容有问题。检查目标名规则,并在保持周围 XML 结构有效的前提下从内容中移除结尾 ?> 序列。不要用本成员规则去修复注释或一般文档错误。
处理
按 detail 指出的目标名或指令内容修正处理指令,保持 XML 结构有效并移除被禁止的处理指令形式。
该分支抛出 ERROR 时,显式事务应先用 ROLLBACK 恢复,或对语句前已建立的保存点执行 ROLLBACK TO SAVEPOINT,再重试;自动提交下只在失败语句结束后重试修正后的动作。事务边界规则见事务与重试指南。
版本
锁定目录从 8.3.0 起记录该条件;固定源码覆盖 PostgreSQL 18.6。
来源
- 上游源码 src/backend/utils/errcodes.txt 第 214 行
- 上游源码 src/backend/utils/adt/xml.c 第 1010–1055 行
- 核验材料 raw/calls/REL_18_6.jsonl
证据
断言
每条断言都写明了是怎么核实的,以及它不覆盖什么。这一层是核验时留下的原始英文记录,照原样呈现,未经翻译。
-
2200T is invalid_xml_processing_instruction in SQLSTATE Class 22.
-
xmlpi rejects the target name xml and reports 2200T with a target-specific DETAIL.
-
xmlpi also rejects a body containing ?> and reports 2200T with a body-specific DETAIL.
-
The locked catalogue records 2200T from 8.3.0 without proving an exact implementation introduction date.
同类错误代码
Class 22 数据异常 下的其他成员。
22000data_exception22001string_data_right_truncation22002null_value_no_indicator_parameter22003numeric_value_out_of_range22004null_value_not_allowed22005error_in_assignment22007invalid_datetime_format22008datetime_field_overflow22009invalid_time_zone_displacement_value2200Bescape_character_conflict2200Cinvalid_use_of_escape_character2200Dinvalid_escape_octet2200Fzero_length_character_string2200Gmost_specific_type_mismatch2200Hsequence_generator_limit_exceeded2200Lnot_an_xml_document2200Minvalid_xml_document2200Ninvalid_xml_content2200Sinvalid_xml_comment22010invalid_indicator_parameter_value22011substring_error22012division_by_zero22013invalid_preceding_or_following_size22014invalid_argument_for_ntile_function22015interval_field_overflow22016invalid_argument_for_nth_value_function22018invalid_character_value_for_cast22019invalid_escape_character2201Binvalid_regular_expression2201Einvalid_argument_for_logarithm2201Finvalid_argument_for_power_function2201Ginvalid_argument_for_width_bucket_function2201Winvalid_row_count_in_limit_clause2201Xinvalid_row_count_in_result_offset_clause22021character_not_in_repertoire22022indicator_overflow22023invalid_parameter_value22024unterminated_c_string22025invalid_escape_sequence22026string_data_length_mismatch22027trim_error2202Earray_subscript_error2202Ginvalid_tablesample_repeat2202Hinvalid_tablesample_argument22030duplicate_json_object_key_value22031invalid_argument_for_sql_json_datetime_function22032invalid_json_text22033invalid_sql_json_subscript22034more_than_one_sql_json_item22035no_sql_json_item22036non_numeric_sql_json_item22037non_unique_keys_in_a_json_object22038singleton_sql_json_item_required22039sql_json_array_not_found2203Asql_json_member_not_found2203Bsql_json_number_not_found2203Csql_json_object_not_found2203Dtoo_many_json_array_elements2203Etoo_many_json_object_members2203Fsql_json_scalar_required2203Gsql_json_item_cannot_be_cast_to_target_type22P01floating_point_exception22P02invalid_text_representation22P03invalid_binary_representation22P04bad_copy_file_format22P05untranslatable_character22P06nonstandard_use_of_escape_character