一、 PostgreSQL 错误信息的设计
- All messages emitted by the PostgreSQL server are assigned five-character error codes that follow the SQL standard’s conventions for “SQLSTATE” codes. Applications that need to know which error condition has occurred should usually test the error code, rather than looking at the textual error message. The error codes are less likely to change across PostgreSQL releases, and also are not subject to change due to localization of error messages. Note that some, but not all, of the error codes produced by PostgreSQL are defined by the SQL standard; some additional error codes for conditions not defined by the standard have been invented or borrowed from other databases.
PostgreSQL 服务器发出的所有消息都分配有五个字符的错误代码,遵循 SQL 标准的“SQLSTATE”代码约定。需要知道发生了哪种错误情况的应用程序通常应该测试错误代码,而不是查看文本错误消息。错误代码不太可能在 PostgreSQL 版本之间更改,并且也不会由于错误消息的本地化而发生更改。请注意,PostgreSQL 产生的一些但不是全部的错误代码是由 SQL 标准定义的;标准未定义的一些附加错误代码已被发明或从其他数据库借用。
- According to the standard, the first two characters of an error code denote a class of errors, while the last three characters indicate a specific condition within that class. Thus, an application that does not recognize the specific error code might still be able to infer what to do from the error class.
根据标准,错误代码的前两个字符表示一类错误,而后三个字符表示该类中的特定条件。因此,无法识别特定错误代码的应用程序可能仍然能够从错误类中推断出要做什么
Table A. lists all the error codes defined in PostgreSQL 15.0. (Some are not actually used at present, but are defined by the SQL standard.) The error classes are also shown. For each error class there is a “standard” error code having the last three characters 000. This code is used only for error conditions that fall within the class but do not have any more-specific code assigned.
表 A.1 列出了 PostgreSQL 15.0 中定义的所有错误代码。 (有些目前没有实际使用,但由SQL标准定义。)还显示了错误类。对于每个错误类别,都有一个最后三个字符为 000 的“标准”错误代码。此代码仅用于属于该类别但没有分配任何更具体代码的错误条件。
- The symbol shown in the column “Condition Name” is the condition name to use in PL/pgSQL. Condition names can be written in either upper or lower case. (Note that PL/pgSQL does not recognize warning, as opposed to error, condition names; those are classes 00, 01, and 02.)
“条件名称”列中显示的符号是在 PL/pgSQL 中使用的条件名称。条件名称可以大写或小写。 (请注意,PL/pgSQL 不识别警告,而不是错误,条件名称;它们是类 00、01 和 02。)
- For some types of errors, the server reports the name of a database object (a table, table column, data type, or constraint) associated with the error; for example, the name of the unique constraint that caused a unique_violation error. Such names are supplied in separate fields of the error report message so that applications need not try to extract them from the possibly-localized human-readable text of the message. As of PostgreSQL 9.3, complete coverage for this feature exists only for errors in SQLSTATE class 23 (integrity constraint violation), but this is likely to be expanded in future.
对于某些类型的错误,服务器会报告与错误相关的数据库对象(表、表列、数据类型或约束)的名称;例如,导致 unique_violation 错误的唯一约束的名称。此类名称在错误报告消息的单独字段中提供,因此应用程序无需尝试从消息的可能本地化的人类可读文本中提取它们。从 PostgreSQL 9.3 开始,此功能的完全覆盖仅存在于 SQLSTATE 类 23 中的错误(违反完整性约束),但将来可能会扩展。
二、 openGauss错误信息设计
-
根据X/Open和SQL Access Group SQL CAE规范(1992)所进行的定义,SQLERROR返回SQLSTATE值。SQLSTATE值是包含五个字符的字符串,由2个字符的SQL错误类和3个字符的子类构成。五个字符包含数值或者大写字母, 代表各种错误或者警告条件的代码。成功的状态是由00000标识的。SQLSTATE代码大多数情况下都是定义在SQL标准里的。
-
openGauss也遵循SQL标准返回错误码的SQLSTATE值,详细说明请参见
三、 PostgreSQL and openGauss error code
错误码SQLSTATE值 | condition name | 错误码含义 | 共有 | PG 独有 | OG 独有 |
---|---|---|---|---|---|
Class 00 — Successful Completion/类 00 - 成功完成 | ✅ | ||||
00000 | successful_completion | 成功完成 | ✅ | ||
Class 01 — Warning/类 01 - 警告 | ✅ | ||||
1000 | warning | 警告 | ✅ | ||
0100C | dynamic_result_sets_returned | 返回了动态结果集 | ✅ | ||
1008 | implicit_zero_bit_padding | 警告,隐含补齐了零比特位 | ✅ | ||
1003 | null_value_eliminated_in_set_function | 在集合函数里消除了NULL | ✅ | ||
1007 | privilege_not_granted | 没有赋予权限 | ✅ | ||
1006 | privilege_not_revoked | 没有撤销权限 | ✅ | ||
1004 | string_data_right_truncation | 字符串数据在右端截断 | ✅ | ||
01P01 | deprecated_feature | 废弃的特性 | ✅ | ||
Class 02 — No Data (this is also a warning class per the SQL standard)/类 02 - 没有数据(按照SQL标准的要求,这也是警告类) | ✅ | ||||
2000 | no_data | 没有数据 | ✅ | ||
2001 | no_additional_dynamic_result_sets_returned | 返回了无附加动态结果集 | ✅ | ||
Class 03 — SQL Statement Not Yet Complete/类 03 - SQL语句尚未结束 | ✅ | ||||
3000 | sql_statement_not_yet_complete | SQL语句尚未结束 | ✅ | ||
Class 08 — Connection Exception/类 08 - 连接异常 | ✅ | ||||
8000 | connection_exception | 连接异常 | ✅ | ||
8003 | connection_does_not_exist | 连接不存在 | ✅ | ||
8006 | connection_failure | 连接失败 | ✅ | ||
8001 | sqlclient_unable_to_establish_sqlconnection | SQL客户端不能建立SQL连接 | ✅ | ||
8004 | sqlserver_rejected_establishment_of_sqlconnection | SQL服务器拒绝建立SQL连接 | ✅ | ||
8007 | transaction_resolution_unknown | 未知的事务解析 | ✅ | ||
08P01 | protocol_violation | 违反协议 | ✅ | ||
Class 09 — Triggered Action Exception/类09 - 触发动作异常 | ✅ | ||||
9000 | triggered_action_exception | 触发动作异常 | ✅ | ||
Class 0A — Feature Not Supported/类 0A - 不支持特性 | ✅ | ||||
0A000 | feature_not_supported | 不支持此特性 | ✅ | ||
0A100 | stream_not_supported | 不支持流 | ✅ | ||
Class 0B — Invalid Transaction Initiation/类 0B - 非法事务初始化 | ✅ | ||||
0B000 | 非法事务初始化 | ✅ | |||
Class 0F — Locator Exception/类 0F - 定位器异常 | ✅ | ||||
0F000 | locator_exception | 定位器异常 | ✅ | ||
0F001 | invalid_locator_specification | 非法的定位器声明 | ✅ | ||
Class 0L — Invalid Grantor/类 0L - 非法赋权者 | ✅ | ||||
0L000 | invalid_grantor | 非法赋权者 | ✅ | ||
0LP01 | invalid_grant_operation | ` | ✅ | ||
Class 0P — Invalid Role Specification/类 0P - 非法角色声明 | ✅ | ||||
0P000 | 非法角色声明 | ✅ | |||
Class 0Z — Diagnostics Exception/类 0Z - 诊断异常 | ✅ | ||||
0Z000 | 诊断异常 | ✅ | |||
0Z002 | stacked_diagnostics_accessed_without_active_handler | 没有在活跃的处理程序下访问堆栈诊断信息 | ✅ | ||
Class 20 — Case Not Found/类 20 - 未找到CASE | ✅ | ||||
20000 | case_not_found | 未找到CASE | ✅ | ||
Class 21 — Cardinality Violation/类 21 - 势违例 | ✅ | ||||
21000 | cardinality_violation | 势违例 | ✅ | ||
Class 22 — Data Exception/类 22 - 数据异常 | ✅ | ||||
22000 | data_exception | 数据异常 | ✅ | ||
2202E | array_subscript_error | 数组下标错误 | ✅ | ||
22021 | character_not_in_repertoire | 字符不被计算机命令系统识别 | ✅ | ||
22008 | datetime_field_overflow | 日期时间字段溢出 | ✅ | ||
22012 | division_by_zero | 被零除 | ✅ | ||
22005 | error_in_assignment | 赋值中出错 | ✅ | ||
2200B | escape_character_conflict | 转义字符冲突 | ✅ | ||
22022 | indicator_overflow | 指示器溢出 | ✅ | ||
22015 | interval_field_overflow | 内部字段溢出 | ✅ | ||
2201E | invalid_argument_for_logarithm | 对数运算的非法参数 | ✅ | ||
22014 | invalid_argument_for_ntile_function | NTILE函数的非法参数 | ✅ | ||
22016 | invalid_argument_for_nth_value_function | N值函数的非法参数 | ✅ | ||
2201F | invalid_argument_for_power_function | 幂函数的非法参数 | ✅ | ||
2201G | invalid_argument_for_width_bucket_function | 宽桶函数的非法参数 | ✅ | ||
22018 | invalid_character_value_for_cast | 类型转换时非法的字符值 | ✅ | ||
22007 | invalid_datetime_format | 非法日期时间格式 | ✅ | ||
22019 | invalid_escape_character | 非法的转义字符 | ✅ | ||
2200D | invalid_escape_octet | 非法的转义字节 | ✅ | ||
22025 | invalid_escape_sequence | 非法转义序列 | ✅ | ||
22P06 | nonstandard_use_of_escape_character | 非标准使用转义字符 | ✅ | ||
22010 | invalid_indicator_parameter_value | 非法指示器参数值 | ✅ | ||
22023 | invalid_parameter_value | 非法参数值 | ✅ | ||
22013 | invalid_preceding_or_following_size | ✅ | |||
2201B | invalid_regular_expression | 非法正则表达式 | ✅ | ||
2201W | invalid_row_count_in_limit_clause | LIMIT子句中行号非法 | ✅ | ||
2201X | invalid_row_count_in_result_offset_clause | 结果集中行号非法 | ✅ | ||
2202H | invalid_tablesample_argument | 非法抽样参数 | ✅ | ||
2202G | invalid_tablesample_repeat | 非法重复抽样 | ✅ | ||
22009 | invalid_time_zone_displacement_value | 非法时区显示值 | ✅ | ||
2200C | invalid_use_of_escape_character | 非法使用转义字符 | ✅ | ||
2200G | most_specific_type_mismatch | 最相关类型不匹配 | ✅ | ||
22004 | null_value_not_allowed | 不允许NULL值 | ✅ | ||
22002 | null_value_no_indicator_parameter | NULL值不能做指示器参数 | ✅ | ||
22003 | numeric_value_out_of_range | 数值越界 | ✅ | ||
22017 | dop_value_out_of_range | 并发数超限 | ✅ | ||
2200H | sequence_generator_limit_exceeded | ✅ | |||
22026 | string_data_length_mismatch | 字符串数据长度不匹配 | ✅ | ||
22028 | regexp_mismatch | 正则表达式不匹配 | ✅ | ||
22001 | string_data_right_truncation | 字符串数据右截断 | ✅ | ||
22011 | substring_error | 抽取子字符串错误 | ✅ | ||
22027 | trim_error | 截断错误 | ✅ | ||
22024 | unterminated_c_string | 未结束的C字符串 | ✅ | ||
2200F | zero_length_character_string | 零长度的字符串 | ✅ | ||
22P01 | floating_point_exception | 浮点异常 | ✅ | ||
22P02 | invalid_text_representation | 非法文本表现形式 | ✅ | ||
22P03 | invalid_binary_representation | 非法二进制表现形式 | ✅ | ||
22P04 | bad_copy_file_format | 错误的COPY格式 | ✅ | ||
22P05 | untranslatable_character | 不可翻译字符 | ✅ | ||
22P06 | cache_lookup_failed | 内存查找失败 | ✅ | ||
22P07 | file_read_failed | 文件读取失败 | ✅ | ||
22P08 | fetch_data_failed | 获取数据失败 | ✅ | ||
2200L | not_an_xml_document | 非XML文件 | ✅ | ||
2200M | invalid_xml_document | 非法的XML文件 | ✅ | ||
2200N | invalid_xml_content | 非法的XML内容 | ✅ | ||
2200O | invalid_xml_error_context | 非法的XML错误信息 | ✅ | ||
2200S | invalid_xml_comment | 非法的XML注释 | ✅ | ||
2200T | invalid_xml_processing_instruction | 非法的XML处理命令 | ✅ | ||
2200X | relation_close_error | 关闭RELATION错误 | ✅ | ||
22030 | duplicate_json_object_key_value | ✅ | |||
22031 | invalid_argument_for_sql_json_datetime_function | ✅ | |||
22032 | invalid_json_text | ✅ | |||
22033 | invalid_sql_json_subscript | ✅ | |||
22034 | more_than_one_sql_json_item | ✅ | |||
22035 | no_sql_json_item | ✅ | |||
22036 | non_numeric_sql_json_item | ✅ | |||
22037 | non_unique_keys_in_a_json_object | ✅ | |||
22038 | singleton_sql_json_item_required | ✅ | |||
22039 | sql_json_array_not_found | ✅ | |||
2203A | sql_json_member_not_found | ✅ | |||
2203B | sql_json_number_not_found | ✅ | |||
2203C | sql_json_object_not_found | ✅ | |||
2203D | too_many_json_array_elements | ✅ | |||
2203E | too_many_json_object_members | ✅ | |||
2203F | sql_json_scalar_required | ✅ | |||
2203G | sql_json_item_cannot_be_cast_to_target_type | ✅ | |||
Class 23 — Integrity Constraint Violation/类 23 - 违反完整性约束 | ✅ | ||||
23000 | integrity_constraint_violation | 违反完整性约束 | ✅ | ||
23001 | restrict_violation | 违反限制 | ✅ | ||
23502 | not_null_violation | 违反非空约束 | ✅ | ||
23503 | foreign_key_violation | 违反外键约束 | ✅ | ||
23505 | unique_violation | 违反唯一约束 | ✅ | ||
23514 | check_violation | 违反CHECK约束 | ✅ | ||
23P01 | exclusion_violation | 违反排他约束 | ✅ | ||
Class 24 — Invalid Cursor State/类 24 - 非法游标状态 | ✅ | ||||
24000 | invalid_cursor_state | 非法游标状态 | ✅ | ||
Class 25 — Invalid Transaction State/类 25 - 非法事务状态 | ✅ | ||||
25000 | invalid_transaction_state | 非法事务状态 | ✅ | ||
25001 | active_sql_transaction | 活跃的SQL状态 | ✅ | ||
25002 | branch_transaction_already_active | 分支事务已激活 | ✅ | ||
25008 | held_cursor_requires_same_isolation_level | 持有的游标要求同样的隔离级别 | ✅ | ||
25003 | inappropriate_access_mode_for_branch_transaction | 分支事务访问方式不当 | ✅ | ||
25004 | inappropriate_isolation_level_for_branch_transaction | 分支事务隔离级别不当 | ✅ | ||
25005 | no_active_sql_transaction_for_branch_transaction | 分支事务没有活跃的SQL事务 | ✅ | ||
25006 | read_only_sql_transaction | 只读的SQL事务 | ✅ | ||
25007 | schema_and_data_statement_mixing_not_supported | 不支持模式和数据语句混合使用 | ✅ | ||
25009 | no_active_sql_transaction | 恢复期间无法启用事务 | ✅ | ||
25010 | in_failed_sql_transaction | 事务ID不存在 | ✅ | ||
25P01 | no_active_sql_transaction | 没有活跃的SQL事务 | ✅ | ||
25P02 | in_failed_sql_transaction | 在失败的SQL事务中 | ✅ | ||
25P03 | idle_in_transaction_session_timeout | ✅ | |||
Class 26 — Invalid SQL Statement Name/类 26 - 非法SQL语句名 | ✅ | ||||
26000 | invalid_sql_statement_name | 非法SQL语句名 | ✅ | ||
Class 27 — Triggered Data Change Violation/类 27 - 触发的数据改变违规 | ✅ | ||||
27000 | triggered_data_change_violation | 触发的数据改变违规 | ✅ | ||
27001 | triggered_invalid_tupl | 触发的元素非法 | ✅ | ||
Class 28 — Invalid Authorization Specification/类 28 - 非法授权声明 | invalid_authorization_specification | ✅ | |||
28000 | invalid_authorization_specification | 非法授权声明 | ✅ | ||
28P01 | invalid_password | 非法密码 | ✅ | ||
28P02 | initial_password_not_modified | 未修改初始密码 | ✅ | ||
类29 - 无效或意外的状态 | ✅ | ||||
29P06 | invalid_cache_plan | 缓存在CACHE中的PLAN无效 | ✅ | ||
Class 2B — Dependent Privilege Descriptors Still Exist/类 2B - 依然存在依赖的优先级描述符 | ✅ | ||||
2B000 | dependent_privilege_descriptors_still_exist | 依然存在依赖的优先级描述符 | ✅ | ||
2BP01 | dependent_objects_still_exist | 依赖性对象仍然存在 | ✅ | ||
Class 2D — Invalid Transaction Termination/类 2D - 非法的事务终止 | ✅ | ||||
2D000 | invalid_transaction_termination | 非法的事务终止 | ✅ | ||
Class 2F — SQL Routine Exception/类 2F - SQL过程异常 | ✅ | ||||
2F000 | sql_routine_exception | SQL过程异常 | ✅ | ||
2F005 | function_executed_no_return_statement | 执行的函数没有返回语句 | ✅ | ||
2F002 | modifying_sql_data_not_permitted | 不允许修改SQL数据 | ✅ | ||
2F003 | prohibited_sql_statement_attempted | 企图使用禁止的SQL语句 | ✅ | ||
2F004 | reading_sql_data_not_permitted | 不允许读取SQL数据 | ✅ | ||
Class 34 — Invalid Cursor Name/类 34 - 非法游标名 | ✅ | ||||
34000 | invalid_cursor_name | 非法游标名 | ✅ | ||
Class 38 — External Routine Exception/类 38 - 外部过程异常 | ✅ | ||||
38000 | external_routine_exception | 外部过程异常 | ✅ | ||
38001 | containing_sql_not_permitted | 不允许包含SQL | ✅ | ||
38002 | modifying_sql_data_not_permitted | 不允许修改SQL数据 | ✅ | ||
38003 | prohibited_sql_statement_attempted | 企图使用禁止的SQL语句 | ✅ | ||
38004 | reading_sql_data_not_permitted | 不允许读取SQL数据 | ✅ | ||
Class 39 — External Routine Invocation Exception/类 39 - 外部过程调用异常 | ✅ | ||||
39000 | external_routine_invocation_exception | 外部过程调用异常 | ✅ | ||
39001 | invalid_sqlstate_returned | 返回了非法的SQLSTATE | ✅ | ||
39004 | null_value_not_allowed | 不允许空值 | ✅ | ||
39P01 | trigger_protocol_violated | 违反触发协议 | ✅ | ||
39P02 | srf_protocol_violated | 违反SRF协议 | ✅ | ||
39P03 | event_trigger_protocol_violated | ✅ | |||
Class 3B — Savepoint Exception/类 3B - 保存点异常 | ✅ | ||||
3B000 | savepoint_exception | 保存点异常 | ✅ | ||
3B001 | invalid_savepoint_specification | 无效的保存点声明 | ✅ | ||
Class 3D — Invalid Catalog Name/类 3D - 非法数据库名 | ✅ | ||||
3D000 | invalid_catalog_name | 非法数据库名 | ✅ | ||
Class 3F — Invalid Schema Name/类 3F - 非法模式名 | ✅ | ||||
3F000 | invalid_schema_name | 非法模式名 | ✅ | ||
3F001 | undefined_schema | 未定义模式 | ✅ | ||
Class 40 — Transaction Rollback/类 40 - 事务回滚 | ✅ | ||||
40000 | transaction_rollback | 事务回滚 | ✅ | ||
40002 | transaction_integrity_constraint_violation | 违反事务完整性约束 | ✅ | ||
40001 | serialization_failure | 串行化失败 | ✅ | ||
40003 | statement_completion_unknown | 未知语句是否结束 | ✅ | ||
40P01 | deadlock_detected | 侦测到死锁 | ✅ | ||
Class 42 — Syntax Error or Access Rule Violation/类 42 - 语法错误或者违反访问规则 | ✅ | ||||
42000 | syntax_error_or_access_rule_violation | 语法错误或者违反访问规则 | ✅ | ||
42601 | syntax_error | 语法错误 | ✅ | ||
42501 | insufficient_privilege | 权限不够 | ✅ | ||
42846 | cannot_coerce | 无法进行类型转换 | ✅ | ||
42803 | grouping_error | 分组错误 | ✅ | ||
42P20 | windowing_error | 窗口错误 | ✅ | ||
42P19 | invalid_recursion | 无效递归 | ✅ | ||
42830 | invalid_foreign_key | 非法的外键 | ✅ | ||
42602 | invalid_name | 非法名称 | ✅ | ||
42622 | name_too_long | 名称太长 | ✅ | ||
42939 | reserved_name | 保留名称 | ✅ | ||
42804 | datatype_mismatch | 数据类型不匹配 | ✅ | ||
42P18 | indeterminate_datatype | 不确定的数据类型 | ✅ | ||
42P21 | collation_mismatch | 排序规则不匹配 | ✅ | ||
42P22 | indeterminate_collation | 不确定的排序规则 | ✅ | ||
42P23 | partition_error | 分区错误 | ✅ | ||
42P24 | invalid_attribute | 非法属性值 | ✅ | ||
42P25 | invalid_agg | 非法聚集函数 | ✅ | ||
42P26 | resource_pool_error | 资源池错误 | ✅ | ||
42P27 | plan_parent_not_found | 未找到父级计划 | ✅ | ||
42P28 | modify_conflicts | 更新冲突 | ✅ | ||
42P29 | distribution_error | 分布错误 | ✅ | ||
42809 | wrong_object_type | 错误的对象类型 | ✅ | ||
428C9 | generated_always | ✅ | |||
42703 | undefined_column | 未定义的字段 | ✅ | ||
42883 | undefined_function | 未定义的函数 | ✅ | ||
42P01 | undefined_table | 未定义的表 | ✅ | ||
42P02 | undefined_parameter | 未定义的参数 | ✅ | ||
42704 | undefined_object | 未定义对象 | ✅ | ||
42701 | duplicate_column | 重复的字段 | ✅ | ||
42P03 | duplicate_cursor | 重复的游标 | ✅ | ||
42P04 | duplicate_database | 重复的数据库 | ✅ | ||
42723 | duplicate_function | 重复的函数 | ✅ | ||
42P05 | duplicate_prepared_statement | 重复的预编译语句 | ✅ | ||
42P06 | duplicate_schema | 重复的模式 | ✅ | ||
42P07 | duplicate_table | 重复的表 | ✅ | ||
42712 | duplicate_alias | 重复的别名 | ✅ | ||
42710 | duplicate_object | 重复的对象 | ✅ | ||
42702 | ambiguous_column | 模糊的字段 | ✅ | ||
42725 | ambiguous_function | 模糊的函数 | ✅ | ||
42P08 | ambiguous_parameter | 模糊的参数 | ✅ | ||
42P09 | ambiguous_alias | 模糊的别名 | ✅ | ||
42P10 | invalid_column_reference | 非法字段引用 | ✅ | ||
42611 | invalid_column_definition | 非法字段定义 | ✅ | ||
42P11 | invalid_cursor_definition | 非法游标定义 | ✅ | ||
42P12 | invalid_database_definition | 非法数据库定义 | ✅ | ||
42P13 | invalid_function_definition | 非法函数定义 | ✅ | ||
42P14 | invalid_prepared_statement_definition | 非法预编译语句定义 | ✅ | ||
42P15 | invalid_schema_definition | 非法模式定义 | ✅ | ||
42P16 | invalid_table_definition | 非法表定义 | ✅ | ||
42P17 | invalid_object_definition | 非法对象定义 | ✅ | ||
Class 44 — WITH CHECK OPTION Violation/类 44 - 违反WITH CHECK选项 | ✅ | ||||
44000 | with_check_option_violation | 违反WITH CHECK选项 | ✅ | ||
Class 53 — Insufficient Resources/类 53 - 资源不足 | ✅ | ||||
53000 | insufficient_resources | 资源不足 | ✅ | ||
53100 | disk_full | 磁盘满 | ✅ | ||
53200 | out_of_memory | 内存耗尽 | ✅ | ||
53300 | too_many_connections | 太多连接 | ✅ | ||
53400 | configuration_limit_exceeded | 超过配置限制 | ✅ | ||
Class 54 — Program Limit Exceeded/类 54 - 超过程序限制 | ✅ | ||||
54000 | program_limit_exceeded | 超过程序限制 | ✅ | ||
54001 | statement_too_complex | 语句太复杂 | ✅ | ||
54011 | too_many_columns | 字段太多 | ✅ | ||
54023 | too_many_arguments | 参数太多 | ✅ | ||
Class 55 — Object Not In Prerequisite State/类 55 - 对象不在预先要求的状态 | ✅ | ||||
55000 | object_not_in_prerequisite_state | 对象不在预先要求的状态 | ✅ | ||
55006 | object_in_use | 对象在使用中(OBJECT_IN_USE) | ✅ | ||
55P02 | cant_change_runtime_param | 无法修改运行时参数 | ✅ | ||
55P03 | lock_not_available | 锁不可获得 | ✅ | ||
55P04 | unsafe_new_enum_value_usage | ✅ | |||
Class 57 — Operator Intervention/类 57 - 操作者干涉 | ✅ | ||||
57000 | operator_intervention | 操作者干涉 | ✅ | ||
57014 | query_canceled | 查询被取消 | ✅ | ||
57015 | query_internal_cancel | 内部查询取消 | ✅ | ||
57P01 | admin_shutdown | 管理员关闭系统 | ✅ | ||
57P02 | crash_shutdown | 崩溃宕机 | ✅ | ||
57P03 | cannot_connect_now | 现在无法连接 | ✅ | ||
57P04 | database_dropped | 丢弃数据库 | ✅ | ||
57P05 | idle_session_timeout | ✅ | |||
Class 58 — System Error/类 58 - 系统错误 | ✅ | ||||
58000 | system_error | 系统错误 | ✅ | ||
58030 | io_error | IO错误 | ✅ | ||
58P01 | undefined_file | 未定义的文件 | ✅ | ||
58P02 | duplicate_file | 重复的文件 | ✅ | ||
Class 72 — Snapshot Failure | ✅ | ||||
72000 | snapshot_too_old | ✅ | |||
Class F0 — Configuration File Error/类 F0 - 配置文件错误 | ✅ | ||||
F0000 | config_file_error | 配置文件错误 | ✅ | ||
F0001 | lock_file_exists | 锁文件存在 | ✅ | ||
Class HV — Foreign Data Wrapper Error (SQL/MED)/类 HV - 外部数据错误(SQL/MED) | ✅ | ||||
HV000 | fdw_error | 外部数据错误 | ✅ | ||
HV005 | fdw_column_name_not_found | 未找到列名 | ✅ | ||
HV002 | fdw_dynamic_parameter_value_needed | 需要动态参数值 | ✅ | ||
HV010 | fdw_function_sequence_error | 函数序列错误 | ✅ | ||
HV021 | fdw_inconsistent_descriptor_information | 描述信息不一致 | ✅ | ||
HV024 | fdw_invalid_attribute_value | 非法属性值 | ✅ | ||
HV007 | fdw_invalid_column_name | 非法列名称 | ✅ | ||
HV008 | fdw_invalid_column_number | 非法列数 | ✅ | ||
HV004 | fdw_invalid_data_type | 非法数据类型 | ✅ | ||
HV006 | fdw_invalid_data_type_descriptors | 非法数据类型描述符 | ✅ | ||
HV091 | fdw_invalid_descriptor_field_identifier | 非法字段标识符 | ✅ | ||
HV00B | fdw_invalid_handle | 非法处理 | ✅ | ||
HV00C | fdw_invalid_option_index | 非法索引选项 | ✅ | ||
HV00D | fdw_invalid_option_name | 非法选项名称 | ✅ | ||
HV090 | fdw_invalid_string_length_or_buffer_length | 非法字符串长度或缓冲区长度 | ✅ | ||
HV00A | fdw_invalid_string_format | 非法字符长格式 | ✅ | ||
HV009 | fdw_invalid_use_of_null_pointer | 非法使用NULL指针 | ✅ | ||
HV014 | fdw_too_many_handles | 太多句柄 | ✅ | ||
HV001 | fdw_out_of_memory | 内存耗尽 | ✅ | ||
HV00P | fdw_no_schemas | 无模式 | ✅ | ||
HV00J | fdw_option_name_not_found | 未找到选项名称 | ✅ | ||
HV00K | fdw_reply_handle | 回复句柄 | ✅ | ||
HV00Q | fdw_schema_not_found | 未找到模式 | ✅ | ||
HV00R | fdw_table_not_found | 未找到表 | ✅ | ||
HV00S | fdw_invalid_server_type | 不正确的服务器类型(FDW_INVALID_SERVER_TYPE) | ✅ | ||
HV00L | fdw_unable_to_create_execution | 无法建立执行 | ✅ | ||
HV00M | fdw_unable_to_create_reply | 不能创建回复 | ✅ | ||
HV00N | fdw_unable_to_establish_connection | 无法建立连接 | ✅ | ||
Class P0 — PL/pgSQL Error/类 P0 - PL/pgSQL错误 | ✅ | ||||
P0000 | plpgsql_error | PLPGSQL错误 | ✅ | ||
P0001 | raise_exception | 抛出异常 | ✅ | ||
P0002 | no_data_found | 未找到数据 | ✅ | ||
P0003 | too_many_rows | 行太多 | ✅ | ||
P0004 | assert_failure | FORALL需要DML操作 | ✅ | ||
Class XX — Internal Error/类 XX - 内部错误 | ✅ | ||||
XX000 | internal_error | 内部错误 | ✅ | ||
XX001 | data_corrupted | 数据损坏 | ✅ | ||
XX002 | index_corrupted | 索引损坏 | ✅ | ||
XX003 | stream_remote_close_socket | 关闭远程流接口 | ✅ | ||
XX004 | unrecognized_node_type | 未知节点类型 | ✅ | ||
XX005 | unexpected_null_value | 异常空值 | ✅ | ||
XX006 | unexpected_node_state | 异常节点状态 | ✅ | ||
XX007 | null_junk_attribute | JUNK列为空 | ✅ | ||
XX008 | optimizer_inconsistent_state | 优化器状态不一致 | ✅ | ||
XX009 | stream_duplicate_query_id | 重复查询编号 | ✅ | ||
XX010 | invalid_buffer | 无效缓冲区 | ✅ | ||
XX011 | invalid_buffer_reference | 无效缓冲区引用 | ✅ | ||
XX012 | node_id_missmatch | 节点编号不匹配 | ✅ | ||
XX013 | cannot_modify_xidbase | 不能修改xid base | ✅ | ||
XX014 | unexpected_chunk_value | TOAST表数据损坏 | ✅ | ||
类 YY - SQL重试错误 | ✅ | ||||
YY001 | connection_reset_by_peer | 对端连接重置 | ✅ | ||
YY002 | stream_connection_reset_by_peer | 对端流重置 | ✅ | ||
YY003 | lock_wait_timeout | 锁等待超时 | ✅ | ||
YY004 | connection_timed_out | 连接超时 | ✅ | ||
YY005 | set_query_error | 查询设置错误 | ✅ | ||
YY006 | out_of_logical_memory | 超出逻辑内存 | ✅ | ||
YY007 | sctp_memory_alloc | 通信库内存分配 | ✅ | ||
YY008 | sctp_no_data_in_buffer | 无通信库缓存数据 | ✅ | ||
YY009 | sctp_release_memory_close | 通信库释放内存关闭 | ✅ | ||
YY010 | sctp_tcp_disconnect | SCTP、TCP断开 | ✅ | ||
YY011 | sctp_disconnect | 通信库断开 | ✅ | ||
YY012 | sctp_remote_close | 通信库远程关闭 | ✅ | ||
YY013 | sctp_wait_poll_unknow | 等待未知通信库通信 | ✅ | ||
YY014 | snapshot_invalid | 无效快照 | ✅ | ||
YY015 | connection_receive_wrong | 通讯接收信息错误 | ✅ | ||
类SI – SPI接口错误 | ✅ | ||||
SP000 | spi_error | SPI接口错误 | ✅ | ||
SP001 | spi_connection_failure | SPI通讯失败 | ✅ | ||
SP002 | spi_finish_failure | SPI完成失败 | ✅ | ||
SP003 | spi_prepare_failure | SPI准备失败 | ✅ | ||
SP004 | spi_cursor_open_failure | SPI游标开启失败 | ✅ | ||
SP005 | spi_execute_failure | SPI执行失败 | ✅ | ||
SP006 | spi_improper_call_function | SPI不当调用 | ✅ | ||
类RB - RBTree错误 | ✅ | ||||
RB001 | rbtree_invalid_node_state | RBTree无效节点状态 | ✅ | ||
RB002 | rbtree_invalid_iterator_order | RBTree无效迭代顺序 | ✅ | ||
类 PD - PL调试器错误 | ✅ | ||||
D0000 | pldebugger_internal_error | PL调试器内部错误 | ✅ | ||
D0001 | duplicate_breakpoint | 重复断点 | ✅ | ||
D0002 | function_hash_is_not_initialized | 哈希函数没有被初始化 | ✅ | ||
D0003 | breakpoint_is_not_present | 断点不存在 | ✅ | ||
D0004 | debug_server_already_is_attached | 已附加调试服务器 | ✅ | ||
D0005 | debug_server_not_attached | 未附加调试服务器 | ✅ | ||
D0006 | debug_server_already_in_sync | 已同步调试服务器 | ✅ | ||
D0007 | debug_target_servers_not_in_sync | 未同步调试服务器 | ✅ | ||
D0008 | target_server_already_in_sync | 已同步目标服务 | ✅ | ||
D0009 | non_existant_variable | 变量不存在 | ✅ | ||
D0010 | invalid_target_session_id | 非法目标会话ID | ✅ | ||
D0011 | invalid_operation | 非法操作 | ✅ | ||
D0012 | maximum_number_of_debug_sessions_reached | 达到最大调试会话数 | ✅ | ||
D0013 | maximum_number_of_breakpoints_reached | 达到最大断点数 | ✅ | ||
类LL - 逻辑解码错误码 | ✅ | ||||
LL001 | logical_decode_error | 逻辑解码错误 | ✅ | ||
LL002 | relfilenodemap | 哈希表搜索错误 | ✅ | ||
表 2 GaussDB Kernel CM错误码SQLSTATE值 | ✅ | ||||
类 c0 - 连接异常(Connection Exception) | ✅ | ||||
c0000 | connection_exception | 连接异常 | ✅ | ||
c0001 | connection_does_not_exist | 连接不存在 | ✅ | ||
c0002 | connection_failure | 连接失败 | ✅ | ||
类 c1 - 环境异常(Environment Exception) | ✅ | ||||
c1000 | out_of_memory | 内存不足 | ✅ | ||
类 c2 - 文件异常(File Exception) | ✅ | ||||
c2000 | open_file_failure | 打开文件失败 | ✅ | ||
c2001 | read_file_failure | 文件读取失败 | ✅ | ||
c2002 | config_file_failure | 配置文件失败 | ✅ | ||
类 c3 - 参数异常(Parameter Exception) | ✅ | ||||
c3000 | parameter_failure | 参数失败 | ✅ | ||
c3001 | environment_variable_failure | 环境变量失败 | ✅ | ||
类 c4 - Etcd异常(Etcd Exception) | ✅ | ||||
c4000 | etcd_open_failure | etcd打开失败 | ✅ | ||
类 c5 - 内部异常(Internal Exception) | ✅ | ||||
c5000 | internal_error | 内部错误 | ✅ |