热门标签 | HotTags
当前位置:  开发笔记 > 数据库 > 正文

PostgreSQL数据库中的常见错误

J2EE开发各类资源下载清单,史上最全IT资源,点击进入!我们在操作数据库的时候,我们总会遇到很多错误。下面整理了一下常见的错误。错误1FATAL:connectionlimitexceededfornon-superusers原因:非超级用户的连接数(max_connections

J2EE开发各类资源下载清单, 史上最全IT资源,点击进入! 我们在操作数据库的时候,我们总会遇到很多错误。下面整理了一下常见的错误。 错误1 FATAL: connection limit exceeded for non-superusers 原因:非超级用户的连接数(max_connections - superuser_r

J2EE开发各类资源下载清单, 史上最全IT资源,点击进入!

我们在操作数据库的时候,我们总会遇到很多错误。下面整理了一下常见的错误。

错误1

FATAL: connection limit exceeded for non-superusers

原因:非超级用户的连接数(max_connections - superuser_reserved_connections)超过了设定值

解决办法:增加max_connections设定值,但如果增加了过多的话,数据库负担太大还容易产生内存错误。可以记住pg-pool等工具来辅助解决。

错误2

FATAL: sorry, too many clients already

原因:数据库服务器的连接数超过了max_connections设定值。

解决办法:和错误1解决办法类似。

错误3

LOG: checkpoints are occurring too frequently

原因:checkpoint处理正频繁发生。

解决办法:增加checkpoint_segments的值。

错误4

LOG: archive command failed with exit code (X)

原因:archive_command失败了。

解决办法:因为有可能是硬盘没空间了,所以可以把数据库的log删除一些。

错误5

LOG: number of page slots needed (X) exceeds max_fsm_pages (Y)

原因:max_fsm_pages不足了。

解决办法:增加max_fsm_pages的同时进行VACUUM FULL。

错误6

ERROR: current transaction is aborted, commands ignored until end of transaction blockp
原因:数据库操作时,前一次操作中已经发生过错误了。

解决办法: PostgreSQL包級r:ERROR: current transaction is aborted, commands ignored until end of transaction blockp

错误7

ERROR: operator does not exist: character = integer

原因:PostgreSQL8.3以后,取消了默认类型转换。因此需要使比较的类型保持一致。可以看cast函数。

附错误code

Error Code Meaning Condition Name
Class 00 — Successful Completion
00000 SUCCESSFUL COMPLETION successful_completion
Class 01 — Warning
01000 WARNING warning
0100C DYNAMIC RESULT SETS RETURNED dynamic_result_sets_returned
01008 IMPLICIT ZERO BIT PADDING implicit_zero_bit_padding
01003 NULL VALUE ELIMINATED IN SET FUNCTION null_value_eliminated_in_set_function
01007 PRIVILEGE NOT GRANTED privilege_not_granted
01006 PRIVILEGE NOT REVOKED privilege_not_revoked
01004 STRING DATA RIGHT TRUNCATION string_data_right_truncation
01P01 DEPRECATED FEATURE deprecated_feature
Class 02 — No Data (this is also a warning class per the SQL standard)
02000 NO DATA no_data
02001 NO ADDITIONAL DYNAMIC RESULT SETS RETURNED no_additional_dynamic_result_sets_returned
Class 03 — SQL Statement Not Yet Complete
03000 SQL STATEMENT NOT YET COMPLETE sql_statement_not_yet_complete
Class 08 — Connection Exception
08000 CONNECTION EXCEPTION connection_exception
08003 CONNECTION DOES NOT EXIST connection_does_not_exist
08006 CONNECTION FAILURE connection_failure
08001 SQLCLIENT UNABLE TO ESTABLISH SQLCONNECTION sqlclient_unable_to_establish_sqlconnection
08004 SQLSERVER REJECTED ESTABLISHMENT OF SQLCONNECTION sqlserver_rejected_establishment_of_sqlconnection
08007 TRANSACTION RESOLUTION UNKNOWN transaction_resolution_unknown
08P01 PROTOCOL VIOLATION protocol_violation
Class 09 — Triggered Action Exception
09000 TRIGGERED ACTION EXCEPTION triggered_action_exception
Class 0A — Feature Not Supported
0A000 FEATURE NOT SUPPORTED feature_not_supported
Class 0B — Invalid Transaction Initiation
0B000 INVALID TRANSACTION INITIATION invalid_transaction_initiation
Class 0F — Locator Exception
0F000 LOCATOR EXCEPTION locator_exception
0F001 INVALID LOCATOR SPECIFICATION invalid_locator_specification
Class 0L — Invalid Grantor
0L000 INVALID GRANTOR invalid_grantor
0LP01 INVALID GRANT OPERATION invalid_grant_operation
Class 0P — Invalid Role Specification
0P000 INVALID ROLE SPECIFICATION invalid_role_specification
Class 20 — Case Not Found
20000 CASE NOT FOUND case_not_found
Class 21 — Cardinality Violation
21000 CARDINALITY VIOLATION cardinality_violation
Class 22 — Data Exception
22000 DATA EXCEPTION data_exception
2202E ARRAY SUBSCRIPT ERROR array_subscript_error
22021 CHARACTER NOT IN REPERTOIRE character_not_in_repertoire
22008 DATETIME FIELD OVERFLOW datetime_field_overflow
22012 DIVISION BY ZERO pision_by_zero
22005 ERROR IN ASSIGNMENT error_in_assignment
2200B ESCAPE CHARACTER CONFLICT escape_character_conflict
22022 INDICATOR OVERFLOW indicator_overflow
22015 INTERVAL FIELD OVERFLOW interval_field_overflow
2201E INVALID ARGUMENT FOR LOGARITHM invalid_argument_for_logarithm
22014 INVALID ARGUMENT FOR NTILE FUNCTION invalid_argument_for_ntile_function
22016 INVALID ARGUMENT FOR NTH_VALUE FUNCTION invalid_argument_for_nth_value_function
2201F INVALID ARGUMENT FOR POWER FUNCTION invalid_argument_for_power_function
2201G INVALID ARGUMENT FOR WIDTH BUCKET FUNCTION invalid_argument_for_width_bucket_function
22018 INVALID CHARACTER VALUE FOR CAST invalid_character_value_for_cast
22007 INVALID DATETIME FORMAT invalid_datetime_format
22019 INVALID ESCAPE CHARACTER invalid_escape_character
2200D INVALID ESCAPE OCTET invalid_escape_octet
22025 INVALID ESCAPE SEQUENCE invalid_escape_sequence
22P06 NONSTANDARD USE OF ESCAPE CHARACTER nonstandard_use_of_escape_character
22010 INVALID INDICATOR PARAMETER VALUE invalid_indicator_parameter_value
22023 INVALID PARAMETER VALUE invalid_parameter_value
2201B INVALID REGULAR EXPRESSION invalid_regular_expression
2201W INVALID ROW COUNT IN LIMIT CLAUSE invalid_row_count_in_limit_clause
2201X INVALID ROW COUNT IN RESULT OFFSET CLAUSE invalid_row_count_in_result_offset_clause
22009 INVALID TIME ZONE DISPLACEMENT VALUE invalid_time_zone_displacement_value
2200C INVALID USE OF ESCAPE CHARACTER invalid_use_of_escape_character
2200G MOST SPECIFIC TYPE MISMATCH most_specific_type_mismatch
22004 NULL VALUE NOT ALLOWED null_value_not_allowed
22002 NULL VALUE NO INDICATOR PARAMETER null_value_no_indicator_parameter
22003 NUMERIC VALUE OUT OF RANGE numeric_value_out_of_range
22026 STRING DATA LENGTH MISMATCH string_data_length_mismatch
22001 STRING DATA RIGHT TRUNCATION string_data_right_truncation
22011 SUBSTRING ERROR substring_error
22027 TRIM ERROR trim_error
22024 UNTERMINATED C STRING unterminated_c_string
2200F ZERO LENGTH CHARACTER STRING zero_length_character_string
22P01 FLOATING POINT EXCEPTION floating_point_exception
22P02 INVALID TEXT REPRESENTATION invalid_text_representation
22P03 INVALID BINARY REPRESENTATION invalid_binary_representation
22P04 BAD COPY FILE FORMAT bad_copy_file_format
22P05 UNTRANSLATABLE CHARACTER untranslatable_character
2200L NOT AN XML DOCUMENT not_an_xml_document
2200M INVALID XML DOCUMENT invalid_xml_document
2200N INVALID XML CONTENT invalid_xml_content
2200S INVALID XML COMMENT invalid_xml_comment
2200T INVALID XML PROCESSING INSTRUCTION invalid_xml_processing_instruction
Class 23 — Integrity Constraint Violation
23000 INTEGRITY CONSTRAINT VIOLATION integrity_constraint_violation
23001 RESTRICT VIOLATION restrict_violation
23502 NOT NULL VIOLATION not_null_violation
23503 FOREIGN KEY VIOLATION foreign_key_violation
23505 UNIQUE VIOLATION unique_violation
23514 CHECK VIOLATION check_violation
Class 24 — Invalid Cursor State
24000 INVALID CURSOR STATE invalid_cursor_state
Class 25 — Invalid Transaction State
25000 INVALID TRANSACTION STATE invalid_transaction_state
25001 ACTIVE SQL TRANSACTION active_sql_transaction
25002 BRANCH TRANSACTION ALREADY ACTIVE branch_transaction_already_active
25008 HELD CURSOR REQUIRES SAME ISOLATION LEVEL held_cursor_requires_same_isolation_level
25003 INAPPROPRIATE ACCESS MODE FOR BRANCH TRANSACTION inappropriate_access_mode_for_branch_transaction
25004 INAPPROPRIATE ISOLATION LEVEL FOR BRANCH TRANSACTION inappropriate_isolation_level_for_branch_transaction
25005 NO ACTIVE SQL TRANSACTION FOR BRANCH TRANSACTION no_active_sql_transaction_for_branch_transaction
25006 READ ONLY SQL TRANSACTION read_only_sql_transaction
25007 SCHEMA AND DATA STATEMENT MIXING NOT SUPPORTED schema_and_data_statement_mixing_not_supported
25P01 NO ACTIVE SQL TRANSACTION no_active_sql_transaction
25P02 IN FAILED SQL TRANSACTION in_failed_sql_transaction
Class 26 — Invalid SQL Statement Name
26000 INVALID SQL STATEMENT NAME invalid_sql_statement_name
Class 27 — Triggered Data Change Violation
27000 TRIGGERED DATA CHANGE VIOLATION triggered_data_change_violation
Class 28 — Invalid Authorization Specification
28000 INVALID AUTHORIZATION SPECIFICATION invalid_authorization_specification
Class 2B — Dependent Privilege Descriptors Still Exist
2B000 DEPENDENT PRIVILEGE DESCRIPTORS STILL EXIST dependent_privilege_descriptors_still_exist
2BP01 DEPENDENT OBJECTS STILL EXIST dependent_objects_still_exist
Class 2D — Invalid Transaction Termination
2D000 INVALID TRANSACTION TERMINATION invalid_transaction_termination
Class 2F — SQL Routine Exception
2F000 SQL ROUTINE EXCEPTION sql_routine_exception
2F005 FUNCTION EXECUTED NO RETURN STATEMENT function_executed_no_return_statement
2F002 MODIFYING SQL DATA NOT PERMITTED modifying_sql_data_not_permitted
2F003 PROHIBITED SQL STATEMENT ATTEMPTED prohibited_sql_statement_attempted
2F004 READING SQL DATA NOT PERMITTED reading_sql_data_not_permitted
Class 34 — Invalid Cursor Name
34000 INVALID CURSOR NAME invalid_cursor_name
Class 38 — External Routine Exception
38000 EXTERNAL ROUTINE EXCEPTION external_routine_exception
38001 CONTAINING SQL NOT PERMITTED containing_sql_not_permitted
38002 MODIFYING SQL DATA NOT PERMITTED modifying_sql_data_not_permitted
38003 PROHIBITED SQL STATEMENT ATTEMPTED prohibited_sql_statement_attempted
38004 READING SQL DATA NOT PERMITTED reading_sql_data_not_permitted
Class 39 — External Routine Invocation Exception
39000 EXTERNAL ROUTINE INVOCATION EXCEPTION external_routine_invocation_exception
39001 INVALID SQLSTATE RETURNED invalid_sqlstate_returned
39004 NULL VALUE NOT ALLOWED null_value_not_allowed
39P01 TRIGGER PROTOCOL VIOLATED trigger_protocol_violated
39P02 SRF PROTOCOL VIOLATED srf_protocol_violated
Class 3B — Savepoint Exception
3B000 SAVEPOINT EXCEPTION savepoint_exception
3B001 INVALID SAVEPOINT SPECIFICATION invalid_savepoint_specification
Class 3D — Invalid Catalog Name
3D000 INVALID CATALOG NAME invalid_catalog_name
Class 3F — Invalid Schema Name
3F000 INVALID SCHEMA NAME invalid_schema_name
Class 40 — Transaction Rollback
40000 TRANSACTION ROLLBACK transaction_rollback
40002 TRANSACTION INTEGRITY CONSTRAINT VIOLATION transaction_integrity_constraint_violation
40001 SERIALIZATION FAILURE serialization_failure
40003 STATEMENT COMPLETION UNKNOWN statement_completion_unknown
40P01 DEADLOCK DETECTED deadlock_detected
Class 42 — Syntax Error or Access Rule Violation
42000 SYNTAX ERROR OR ACCESS RULE VIOLATION syntax_error_or_access_rule_violation
42601 SYNTAX ERROR syntax_error
42501 INSUFFICIENT PRIVILEGE insufficient_privilege
42846 CANNOT COERCE cannot_coerce
42803 GROUPING ERROR grouping_error
42P20 WINDOWING ERROR windowing_error
42P19 INVALID RECURSION invalid_recursion
42830 INVALID FOREIGN KEY invalid_foreign_key
42602 INVALID NAME invalid_name
42622 NAME TOO LONG name_too_long
42939 RESERVED NAME reserved_name
42804 DATATYPE MISMATCH datatype_mismatch
42P18 INDETERMINATE DATATYPE indeterminate_datatype
42809 WRONG OBJECT TYPE wrong_object_type
42703 UNDEFINED COLUMN undefined_column
42883 UNDEFINED FUNCTION undefined_function
42P01 UNDEFINED TABLE undefined_table
42P02 UNDEFINED PARAMETER undefined_parameter
42704 UNDEFINED OBJECT undefined_object
42701 DUPLICATE COLUMN duplicate_column
42P03 DUPLICATE CURSOR duplicate_cursor
42P04 DUPLICATE DATABASE duplicate_database
42723 DUPLICATE FUNCTION duplicate_function
42P05 DUPLICATE PREPARED STATEMENT duplicate_prepared_statement
42P06 DUPLICATE SCHEMA duplicate_schema
42P07 DUPLICATE TABLE duplicate_table
42712 DUPLICATE ALIAS duplicate_alias
42710 DUPLICATE OBJECT duplicate_object
42702 AMBIGUOUS COLUMN ambiguous_column
42725 AMBIGUOUS FUNCTION ambiguous_function
42P08 AMBIGUOUS PARAMETER ambiguous_parameter
42P09 AMBIGUOUS ALIAS ambiguous_alias
42P10 INVALID COLUMN REFERENCE invalid_column_reference
42611 INVALID COLUMN DEFINITION invalid_column_definition
42P11 INVALID CURSOR DEFINITION invalid_cursor_definition
42P12 INVALID DATABASE DEFINITION invalid_database_definition
42P13 INVALID FUNCTION DEFINITION invalid_function_definition
42P14 INVALID PREPARED STATEMENT DEFINITION invalid_prepared_statement_definition
42P15 INVALID SCHEMA DEFINITION invalid_schema_definition
42P16 INVALID TABLE DEFINITION invalid_table_definition
42P17 INVALID OBJECT DEFINITION invalid_object_definition
Class 44 — WITH CHECK OPTION Violation
44000 WITH CHECK OPTION VIOLATION with_check_option_violation
Class 53 — Insufficient Resources
53000 INSUFFICIENT RESOURCES insufficient_resources
53100 DISK FULL disk_full
53200 OUT OF MEMORY out_of_memory
53300 TOO MANY CONNECTIONS too_many_connections
Class 54 — Program Limit Exceeded
54000 PROGRAM LIMIT EXCEEDED program_limit_exceeded
54001 STATEMENT TOO COMPLEX statement_too_complex
54011 TOO MANY COLUMNS too_many_columns
54023 TOO MANY ARGUMENTS too_many_arguments
Class 55 — Object Not In Prerequisite State
55000 OBJECT NOT IN PREREQUISITE STATE object_not_in_prerequisite_state
55006 OBJECT IN USE object_in_use
55P02 CANT CHANGE RUNTIME PARAM cant_change_runtime_param
55P03 LOCK NOT AVAILABLE lock_not_available
Class 57 — Operator Intervention
57000 OPERATOR INTERVENTION operator_intervention
57014 QUERY CANCELED query_canceled
57P01 ADMIN SHUTDOWN admin_shutdown
57P02 CRASH SHUTDOWN crash_shutdown
57P03 CANNOT CONNECT NOW cannot_connect_now
Class 58 — System Error (errors external toPostgreSQL itself)
58030 IO ERROR io_error
58P01 UNDEFINED FILE undefined_file
58P02 DUPLICATE FILE duplicate_file
Class F0 — Configuration File Error
F0000 CONFIG FILE ERROR config_file_error
F0001 LOCK FILE EXISTS lock_file_exists
Class P0 — PL/pgSQL Error
P0000 PLPGSQL ERROR plpgsql_error
P0001 RAISE EXCEPTION raise_exception
P0002 NO DATA FOUND no_data_found
P0003 TOO MANY ROWS too_many_rows
Class XX — Internal Error
XX000 INTERNAL ERROR internal_error
XX001 DATA CORRUPTED data_corrupted
XX002 INDEX CORRUPTED index_corrupted

推荐阅读
  • 本文探讨了在Windows Server 2008环境下配置Tomcat使用80端口时遇到的问题,包括端口被占用、多项目访问失败等,并提供详细的解决方法和配置建议。 ... [详细]
  • 探讨如何真正掌握Java EE,包括所需技能、工具和实践经验。资深软件教学总监李刚分享了对毕业生简历中常见问题的看法,并提供了详尽的标准。 ... [详细]
  • Windows服务与数据库交互问题解析
    本文探讨了在Windows 10(64位)环境下开发的Windows服务,旨在定期向本地MS SQL Server (v.11)插入记录。尽管服务已成功安装并运行,但记录并未正确插入。我们将详细分析可能的原因及解决方案。 ... [详细]
  • 本文详细介绍了如何使用PHP检测AJAX请求,通过分析预定义服务器变量来判断请求是否来自XMLHttpRequest。此方法简单实用,适用于各种Web开发场景。 ... [详细]
  • 1:有如下一段程序:packagea.b.c;publicclassTest{privatestaticinti0;publicintgetNext(){return ... [详细]
  • 构建基于BERT的中文NL2SQL模型:一个简明的基准
    本文探讨了将自然语言转换为SQL语句(NL2SQL)的任务,这是人工智能领域中一项非常实用的研究方向。文章介绍了笔者在公司举办的首届中文NL2SQL挑战赛中的实践,该比赛提供了金融和通用领域的表格数据,并标注了对应的自然语言与SQL语句对,旨在训练准确的NL2SQL模型。 ... [详细]
  • 在当前众多持久层框架中,MyBatis(前身为iBatis)凭借其轻量级、易用性和对SQL的直接支持,成为许多开发者的首选。本文将详细探讨MyBatis的核心概念、设计理念及其优势。 ... [详细]
  • XNA 3.0 游戏编程:从 XML 文件加载数据
    本文介绍如何在 XNA 3.0 游戏项目中从 XML 文件加载数据。我们将探讨如何将 XML 数据序列化为二进制文件,并通过内容管道加载到游戏中。此外,还会涉及自定义类型读取器和写入器的实现。 ... [详细]
  • MySQL缓存机制深度解析
    本文详细探讨了MySQL的缓存机制,包括主从复制、读写分离以及缓存同步策略等内容。通过理解这些概念和技术,读者可以更好地优化数据库性能。 ... [详细]
  • 使用Python在SAE上开发新浪微博应用的初步探索
    最近重新审视了新浪云平台(SAE)提供的服务,发现其已支持Python开发。本文将详细介绍如何利用Django框架构建一个简单的新浪微博应用,并分享开发过程中的关键步骤。 ... [详细]
  • MySQL 数据库迁移指南:从本地到远程及磁盘间迁移
    本文详细介绍了如何在不同场景下进行 MySQL 数据库的迁移,包括从一个硬盘迁移到另一个硬盘、从一台计算机迁移到另一台计算机,以及解决迁移过程中可能遇到的问题。 ... [详细]
  • Hadoop入门与核心组件详解
    本文详细介绍了Hadoop的基础知识及其核心组件,包括HDFS、MapReduce和YARN。通过本文,读者可以全面了解Hadoop的生态系统及应用场景。 ... [详细]
  • 基于KVM的SRIOV直通配置及性能测试
    SRIOV介绍、VF直通配置,以及包转发率性能测试小慢哥的原创文章,欢迎转载目录?1.SRIOV介绍?2.环境说明?3.开启SRIOV?4.生成VF?5.VF ... [详细]
  • 深入探讨CPU虚拟化与KVM内存管理
    本文详细介绍了现代服务器架构中的CPU虚拟化技术,包括SMP、NUMA和MPP三种多处理器结构,并深入探讨了KVM的内存虚拟化机制。通过对比不同架构的特点和应用场景,帮助读者理解如何选择最适合的架构以优化性能。 ... [详细]
  • 解决JAX-WS动态客户端工厂弃用问题并迁移到XFire
    在处理Java项目中的JAR包冲突时,我们遇到了JaxWsDynamicClientFactory被弃用的问题,并成功将其迁移到org.codehaus.xfire.client。本文详细介绍了这一过程及解决方案。 ... [详细]
author-avatar
mobiledu2502901583
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有