PostgreSQL Error Codes (PostgreSQL错误代码)

news/2024/5/17 0:13:04/文章来源:https://blog.csdn.net/moshowgame/article/details/136159923

What's PostgreSQL Error Codes

PostgreSQL服务器发出的所有消息都分配了五个字符的错误代码, 这些代码遵循 SQL 的"SQLSTATE"代码的约定。 需要知道发生了什么错误条件的应用程序通常应该检测错误代码,而不是查看文本错误消息。 这些错误代码不太可能随着PostgreSQL的版本的更新而修改, 并且一般也不会随着错误消息的本地化而发生修改。请注意有些(但不是全部) PostgreSQL生成的错误代码是由 SQL 标准定义的; 有些标准里并没有定义的错误条件会被发明或者是从其它数据库借过来。

根据标准,错误代码的头两个字符表示错误类别,而后三个字符表示在该类别内特定的条件。 因此,那些不能识别特定错误代码的应用仍然可以从错误类别中推断要做什么。

表 A-1里面列出了PostgreSQL 9.3.1 定义的所有错误代码(有些实际上目前并没有使用,但是 SQL 标准定义了)。错误类别也列出在此。 对于每个错误类别都有个"标准"的错误代码,它的最后三个字符是000。 这种代码只用于那些落在该类别内,但是没有赋予任何更准确的代码的错误条件。

"条件名"列显示的标志是在PL/pgSQL里面使用的条件名。 条件名大小写无关。(请注意PL/pgSQL并不识别警告, 这一点和错误、条件名正相反;那些是 00,01,02 类别。)

对于某些类型的错误,服务器报告与错误相关的数据库对象的名称(一个表,表字段,数据类型, 或者约束);例如,唯一约束的名字导致了一个unique_violation错误。 类似的名字在单独的错误报告字段信息中提供, 这样应用程序就不用尝试去从可本地化 可读的文本消息中提取它们。 自PostgreSQL 9.3起,对这个特性的完全覆盖只存在于SQLSTATE类23的错误中(违反完整性约束), 但这个将来可能会被扩展。

PostgreSQL Error code List 错误代码列表

错误代码

Error Codes

条件名

Condition Name

Class 00 — Successful Completion
00000successful_completion
Class 01 — Warning
01000warning
0100Cdynamic_result_sets_returned
01008implicit_zero_bit_padding
01003null_value_eliminated_in_set_function
01007privilege_not_granted
01006privilege_not_revoked
01004string_data_right_truncation
01P01deprecated_feature
Class 02 — No Data (this is also a warning class per the SQL standard)
02000no_data
02001no_additional_dynamic_result_sets_returned
Class 03 — SQL Statement Not Yet Complete
03000sql_statement_not_yet_complete
Class 08 — Connection Exception
08000connection_exception
08003connection_does_not_exist
08006connection_failure
08001sqlclient_unable_to_establish_sqlconnection
08004sqlserver_rejected_establishment_of_sqlconnection
08007transaction_resolution_unknown
08P01protocol_violation
Class 09 — Triggered Action Exception
09000triggered_action_exception
Class 0A — Feature Not Supported
0A000feature_not_supported
Class 0B — Invalid Transaction Initiation
0B000invalid_transaction_initiation
Class 0F — Locator Exception
0F000locator_exception
0F001invalid_locator_specification
Class 0L — Invalid Grantor
0L000invalid_grantor
0LP01invalid_grant_operation
Class 0P — Invalid Role Specification
0P000invalid_role_specification
Class 0Z — Diagnostics Exception
0Z000diagnostics_exception
0Z002stacked_diagnostics_accessed_without_active_handler
Class 20 — Case Not Found
20000case_not_found
Class 21 — Cardinality Violation
21000cardinality_violation
Class 22 — Data Exception
22000data_exception
2202Earray_subscript_error
22021character_not_in_repertoire
22008datetime_field_overflow
22012division_by_zero
22005error_in_assignment
2200Bescape_character_conflict
22022indicator_overflow
22015interval_field_overflow
2201Einvalid_argument_for_logarithm
22014invalid_argument_for_ntile_function
22016invalid_argument_for_nth_value_function
2201Finvalid_argument_for_power_function
2201Ginvalid_argument_for_width_bucket_function
22018invalid_character_value_for_cast
22007invalid_datetime_format
22019invalid_escape_character
2200Dinvalid_escape_octet
22025invalid_escape_sequence
22P06nonstandard_use_of_escape_character
22010invalid_indicator_parameter_value
22023invalid_parameter_value
2201Binvalid_regular_expression
2201Winvalid_row_count_in_limit_clause
2201Xinvalid_row_count_in_result_offset_clause
22009invalid_time_zone_displacement_value
2200Cinvalid_use_of_escape_character
2200Gmost_specific_type_mismatch
22004null_value_not_allowed
22002null_value_no_indicator_parameter
22003numeric_value_out_of_range
22026string_data_length_mismatch
22001string_data_right_truncation
22011substring_error
22027trim_error
22024unterminated_c_string
2200Fzero_length_character_string
22P01floating_point_exception
22P02invalid_text_representation
22P03invalid_binary_representation
22P04bad_copy_file_format
22P05untranslatable_character
2200Lnot_an_xml_document
2200Minvalid_xml_document
2200Ninvalid_xml_content
2200Sinvalid_xml_comment
2200Tinvalid_xml_processing_instruction
Class 23 — Integrity Constraint Violation
23000integrity_constraint_violation
23001restrict_violation
23502not_null_violation
23503foreign_key_violation
23505unique_violation
23514check_violation
23P01exclusion_violation
Class 24 — Invalid Cursor State
24000invalid_cursor_state
Class 25 — Invalid Transaction State
25000invalid_transaction_state
25001active_sql_transaction
25002branch_transaction_already_active
25008held_cursor_requires_same_isolation_level
25003inappropriate_access_mode_for_branch_transaction
25004inappropriate_isolation_level_for_branch_transaction
25005no_active_sql_transaction_for_branch_transaction
25006read_only_sql_transaction
25007schema_and_data_statement_mixing_not_supported
25P01no_active_sql_transaction
25P02in_failed_sql_transaction
Class 26 — Invalid SQL Statement Name
26000invalid_sql_statement_name
Class 27 — Triggered Data Change Violation
27000triggered_data_change_violation
Class 28 — Invalid Authorization Specification
28000invalid_authorization_specification
28P01invalid_password
Class 2B — Dependent Privilege Descriptors Still Exist
2B000dependent_privilege_descriptors_still_exist
2BP01dependent_objects_still_exist
Class 2D — Invalid Transaction Termination
2D000invalid_transaction_termination
Class 2F — SQL Routine Exception
2F000sql_routine_exception
2F005function_executed_no_return_statement
2F002modifying_sql_data_not_permitted
2F003prohibited_sql_statement_attempted
2F004reading_sql_data_not_permitted
Class 34 — Invalid Cursor Name
34000invalid_cursor_name
Class 38 — External Routine Exception
38000external_routine_exception
38001containing_sql_not_permitted
38002modifying_sql_data_not_permitted
38003prohibited_sql_statement_attempted
38004reading_sql_data_not_permitted
Class 39 — External Routine Invocation Exception
39000external_routine_invocation_exception
39001invalid_sqlstate_returned
39004null_value_not_allowed
39P01trigger_protocol_violated
39P02srf_protocol_violated
Class 3B — Savepoint Exception
3B000savepoint_exception
3B001invalid_savepoint_specification
Class 3D — Invalid Catalog Name
3D000invalid_catalog_name
Class 3F — Invalid Schema Name
3F000invalid_schema_name
Class 40 — Transaction Rollback
40000transaction_rollback
40002transaction_integrity_constraint_violation
40001serialization_failure
40003statement_completion_unknown
40P01deadlock_detected
Class 42 — Syntax Error or Access Rule Violation
42000syntax_error_or_access_rule_violation
42601syntax_error
42501insufficient_privilege
42846cannot_coerce
42803grouping_error
42P20windowing_error
42P19invalid_recursion
42830invalid_foreign_key
42602invalid_name
42622name_too_long
42939reserved_name
42804datatype_mismatch
42P18indeterminate_datatype
42P21collation_mismatch
42P22indeterminate_collation
42809wrong_object_type
42703undefined_column
42883undefined_function
42P01undefined_table
42P02undefined_parameter
42704undefined_object
42701duplicate_column
42P03duplicate_cursor
42P04duplicate_database
42723duplicate_function
42P05duplicate_prepared_statement
42P06duplicate_schema
42P07duplicate_table
42712duplicate_alias
42710duplicate_object
42702ambiguous_column
42725ambiguous_function
42P08ambiguous_parameter
42P09ambiguous_alias
42P10invalid_column_reference
42611invalid_column_definition
42P11invalid_cursor_definition
42P12invalid_database_definition
42P13invalid_function_definition
42P14invalid_prepared_statement_definition
42P15invalid_schema_definition
42P16invalid_table_definition
42P17invalid_object_definition
Class 44 — WITH CHECK OPTION Violation
44000with_check_option_violation
Class 53 — Insufficient Resources
53000insufficient_resources
53100disk_full
53200out_of_memory
53300too_many_connections
53400configuration_limit_exceeded
Class 54 — Program Limit Exceeded
54000program_limit_exceeded
54001statement_too_complex
54011too_many_columns
54023too_many_arguments
Class 55 — Object Not In Prerequisite State
55000object_not_in_prerequisite_state
55006object_in_use
55P02cant_change_runtime_param
55P03lock_not_available
Class 57 — Operator Intervention
57000operator_intervention
57014query_canceled
57P01admin_shutdown
57P02crash_shutdown
57P03cannot_connect_now
57P04database_dropped
Class 58 — System Error (errors external to PostgreSQL itself)
58000system_error
58030io_error
58P01undefined_file
58P02duplicate_file
Class F0 — Configuration File Error
F0000config_file_error
F0001lock_file_exists
Class HV — Foreign Data Wrapper Error (SQL/MED)
HV000fdw_error
HV005fdw_column_name_not_found
HV002fdw_dynamic_parameter_value_needed
HV010fdw_function_sequence_error
HV021fdw_inconsistent_descriptor_information
HV024fdw_invalid_attribute_value
HV007fdw_invalid_column_name
HV008fdw_invalid_column_number
HV004fdw_invalid_data_type
HV006fdw_invalid_data_type_descriptors
HV091fdw_invalid_descriptor_field_identifier
HV00Bfdw_invalid_handle
HV00Cfdw_invalid_option_index
HV00Dfdw_invalid_option_name
HV090fdw_invalid_string_length_or_buffer_length
HV00Afdw_invalid_string_format
HV009fdw_invalid_use_of_null_pointer
HV014fdw_too_many_handles
HV001fdw_out_of_memory
HV00Pfdw_no_schemas
HV00Jfdw_option_name_not_found
HV00Kfdw_reply_handle
HV00Qfdw_schema_not_found
HV00Rfdw_table_not_found
HV00Lfdw_unable_to_create_execution
HV00Mfdw_unable_to_create_reply
HV00Nfdw_unable_to_establish_connection
Class P0 — PL/pgSQL Error
P0000plpgsql_error
P0001raise_exception
P0002no_data_found
P0003too_many_rows
Class XX — Internal Error
XX000internal_error
XX001data_corrupted
XX002index_corrupted

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_971830.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【leetcode题解C++】51.N皇后 and 76.最小覆盖子串

51. N皇后 按照国际象棋的规则,皇后可以攻击与之处在同一行或同一列或同一斜线上的棋子。 n 皇后问题 研究的是如何将 n 个皇后放置在 nn 的棋盘上,并且使皇后彼此之间不能相互攻击。 给你一个整数 n ,返回所有不同的 n 皇后问题 的解决方…

埋点自动化测试框架设计

大数据时代,多数的web或app产品都会使用第三方或自己开发相应的数据系统,进行用户行为数据或其它信息数据的收集,在这个过程中,埋点是比较重要的一环。埋点收集的数据一般有以下作用: 驱动决策:ABtest、漏斗…

【机构vip教程】Appium自动化(2):Python+Appium环境搭建

windows下搭建pythonappium环境 搭建过程步骤如下: 1、安装jdk并配置好环境变量(jdk版本1.8以上) 2、安装android-sdk并配置好环境变量;具体步骤见:https://www.cnblogs.com/YouJeffrey/p/15243705.html 3、安装安…

伦敦金和现货黄金是一回事吗?

想进入黄金市场的朋友,在网上一搜相关的讯息,可能就懵了。这个市场中好像有几个品种,又是伦敦金又是现货黄金什么的。很多新手投资者想知道,这些伦敦金、现货黄金分别是指什么,下面我们就来讨论一下。 实际上&#xff…

[VulnHub靶机渗透] Fowsniff

🍬 博主介绍👨‍🎓 博主介绍:大家好,我是 hacker-routing ,很高兴认识大家~ ✨主攻领域:【渗透领域】【应急响应】 【python】 【VulnHub靶场复现】【面试分析】 🎉点赞➕评论➕收藏…

洛谷 P1019 [NOIP2000 提高组] 单词接龙

参考代码 #include <bits/stdc.h> using namespace std; string s[25]; int vis[25], ans, now 1, n; void dfs(int k) { ans max(ans, now); for(int i 1; i < n; i) if(vis[i] < 2) { for(int j 0; j < s[k].length(); j) …

【plt.bar绘制条形图or柱状图】:从入门到精通,只需一篇文章!【Matplotlib可视化】

【&#x1f4ca;plt.bar绘制条形图】&#xff1a;从入门到精通&#xff0c;只需一篇文章&#xff01;【Matplotlib】 利用Matplotlib进行数据可视化示例 &#x1f335;文章目录&#x1f335; &#x1f50d; 一、初识plt.bar&#xff1a;条形图的基本概念&#x1f4a1; 二、plt.…

【嵌入式学习】IO网络接口day02.18

1.使用fgets统计给定文件的行数 #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, const char *argv[]) {FILE *fpNULL;if((fpfopen("./test1.txt","r"))NULL){perror("错误信息");return -1…

MCU电源控制(PWR)与低功耗

目录 一、STM32 的内核和外设电源系统管理&#xff1a; 二、MCU电源监控&#xff1a; 三、三种低功耗模式&#xff1a; 1、睡眠模式&#xff1a; 2、停止模式&#xff1a; 3、待机模式&#xff1a; 一、STM32 的内核和外设电源系统管理&#xff1a; ① 电池备份区域&#…

通俗易懂地解释OpenAI Sora视频生成的特点有哪些?与Runway Gen2、Pika有什么区别?缺点是什么?

OpenAI的Sora模型是最近两天最火热的模型。它生成的视频无论是清晰度、连贯性和时间上都有非常好的结果。在Sora之前&#xff0c;业界已经有了很多视频生成工具和平台。但为什么Sora可以引起如此大的关注&#xff1f;Sora生成的视频与此前其它平台生成的视频到底有哪些区别&…

2024年2月前端技术新动态:迈向现代化的全速前进

随着技术的不断进步&#xff0c;前端领域每月都有新的变化和挑战。2024年2月&#xff0c;我们见证了几项重大的技术更新&#xff0c;从Deno的性能提升到Turborepo的重大改进&#xff0c;再到jQuery 4.0.0 Beta的发布&#xff0c;这些变化不仅标志着前端开发向着更现代化、更高效…

EXCEL中不错的xlookup函数

excel中一般要经常用vlookup函数&#xff0c;但其实经常麻烦要正序&#xff0c;从左边到右边&#xff0c;还要数列&#xff0c;挺麻烦的&#xff0c;xlookup的函数还不错&#xff0c;有个不错的一套视频介绍,B站的&#xff0c;地址是&#xff1a;XLOOKUP函数基础用法&#xff0…

IDEA2021版热部署配置

第一步 Settings中搜索compiler 勾选上Build project automatically 第二步 按快捷键 CtrlAltShift/ 选择第一个Registry 勾选上 注&#xff1a;2021版IDEA 被迁移到了这里 第三步 第四步 pom.xml中添加 配置文件中添加 #springdevtools spring.devtools.restart.…

Nginx实战:日志按天分割

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 目录 前言 一、方式1&#xff1a;定时任务执行分割脚本 1.分割日志脚本 2.添加定时任务 二、方式2&#xff1a;logrotate配置分割 1.logrotate简单介绍 2.新增切割ngi…

[C++]二叉搜索树

一、定义 二叉搜索树又称二叉排序树&#xff0c;它或者是一棵空树&#xff0c;或者是具有以下性质的二叉树: 若它的左子树不为空&#xff0c;则左子树上所有节点的值都小于根节点的值若它的右子树不为空&#xff0c;则右子树上所有节点的值都大于根节点的值它的左右子树也分别…

【Java EE初阶十七】网络原理(二)

2. 传输层 2.2 TCP协议 2.2.2 关于可靠传输 4.滑动窗口 前面的三个机制&#xff0c;都是在保证 tcp 的可靠性&#xff1b; TCP 的可靠传输,是会影响传输的效率的.(多出了一些等待 ack 的时间,单位时间内能传输的数据就少了)&#xff1b; 滑动窗口,就让可靠传输对性能的影响,更…

集团企业大数据应用:突破痛点,释放数据价值

在数字经济日益崛起的背景下&#xff0c;集团企业以其管理范围广泛、业务领域多元化和分支机构复杂化的特性&#xff0c;在市场竞争中扮演着重要角色。为了维持和提升这种竞争力&#xff0c;大数据应用成为了集团企业不可或缺的战略工具。然而&#xff0c;在实际应用中&#xf…

安装部署k8s集群

系统&#xff1a; CentOS Linux release 7.9.2009 (Core) 准备3台主机 192.168.44.148k8s-master92.168.44.154k8s-worker01192.168.44.155k8s-worker02 3台主机准备工作 关闭防火墙和selinux systemctl disable firewalld --nowsetenforce 0sed -i s/SELINUXenforcing/SELI…

Vue中 如何监听键盘事件中的按键

在Web前端开发中&#xff0c;键盘事件的处理是非常常见的需求之一。而在Vue框架中&#xff0c;如何监听键盘事件中的按键是一个相对简单但又很实用的功能。本文将为你介绍如何在Vue中监听键盘事件&#xff0c;并演示一些常用的按键操作。 首先&#xff0c;在Vue中监听键盘事件…

《隐私计算简易速速上手小册》第4章:技术挑战与解决方案(2024 最新版)

文章目录 4.1 隐私计算中的技术难题4.1.1 基础知识4.1.2 重点案例:同态加密在金融数据分析中的应用4.1.3 拓展案例 1:安全多方计算在医疗数据共享中的应用4.1.4 拓展案例 2:差分隐私在社交媒体分析中的应用4.2 数据加密与解密的挑战4.2.1 基础知识4.2.2 重点案例:加密的在线…