百科 / 错误代码 / Class 22 数据异常
2203G sql_json_item_cannot_be_cast_to_target_type
ERROR 源码确认 参考 未实测
- 条件名
sql_json_item_cannot_be_cast_to_target_type- 宏名称
ERRCODE_SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE- 启用版本
- 15
- 状态
- 活跃
版本覆盖
速览
2203G 是目录条件 sql_json_item_cannot_be_cast_to_target_type。在固定的 PostgreSQL 18.6 树中,有界搜索只在 errcodes.txt 找到宏定义,没有找到核心代码或 contrib 中实际发出该条件的调用。因此这是一页仅有定义边界的参考;看起来相似的 JSON 转换不能证明服务器使用了这个 SQLSTATE。
含义
固定目录给出了 SQL/JSON 条件名,但 18.6 有界源码扫描没有找到 PostgreSQL 核心代码或 contrib 的发出路径。不能把这个名字扩展成未经证实的 JSONPath、构造器、标量/数组或对象转换场景。扩展或用户自定义 RAISE 可以自行使用该状态码,但那不属于固定源码树的结果。
诊断
保留完整 SQLSTATE、主消息/详细信息/提示、服务器日志上下文、语句,以及产生它的扩展或函数。用这些证据识别真正的发出者,不要只因文字像 JSON、普通类型输入或其他转换失败就归类为 2203G。
报文
本次没有为这个仅有定义的条目解析出固定 PostgreSQL 18.6 主消息、详细信息或提示模板。
处理
这个仅定义条目没有 PostgreSQL 核心代码提供的、有源码依据的处置方法。先确认实际发出者,再修正该发出者的契约并重试受影响的操作。如果实际发出的是 ERROR 且处于显式事务中,先执行 ROLLBACK 或 ROLLBACK TO SAVEPOINT;自动提交模式下先修正原因,再重新提交操作。这个条件定义本身不要求重置连接。
版本
锁定目录从 PostgreSQL 15.0 记录此条件。本次固定源码边界是 PostgreSQL 18.6 REL_18_6;固定源码树中未找到发出者,不能据此确定任何具体实现路径何时引入或其行为,也不能推断扩展或未来版本的行为。
来源
- 上游源码 src/backend/utils/errcodes.txt 第 231 行
证据
断言
每条断言都写明了是怎么核实的,以及它不覆盖什么。这一层是核验时留下的原始英文记录,照原样呈现,未经翻译。
-
2203G is sql_json_item_cannot_be_cast_to_target_type in SQLSTATE Class 22.
-
The fixed PostgreSQL 18.6 source tree contains the macro definition in errcodes.txt but no core or contrib call using ERRCODE_SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE in the bounded scan.
-
The locked catalogue records 2203G from 15.0; that boundary does not prove exact implementation introduction.
同类错误代码
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_comment2200Tinvalid_xml_processing_instruction22010invalid_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_required22P01floating_point_exception22P02invalid_text_representation22P03invalid_binary_representation22P04bad_copy_file_format22P05untranslatable_character22P06nonstandard_use_of_escape_character