我们在 *** 作数据库的时候,我们总会遇到很多错误。下面整理了一下常见的错误。
错误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 |
---|---|---|
@H_403_102@Class 00 — Successful Completion | ||
00000 | SUCCESSFul COMPLETION | successful_completion |
@H_403_102@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 |
@H_403_102@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 |
@H_403_102@Class 03 — sql Statement Not Yet Complete | ||
03000 | sql STATEMENT NOT YET COMPLETE | sql_statement_not_yet_complete |
@H_403_102@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 |
@H_403_102@Class 09 — Triggered Action Exception | ||
09000 | TRIGGERED ACTION EXCEPTION | triggered_action_exception |
@H_403_102@Class 0A — Feature Not Supported | ||
0A000 | FEATURE NOT SUPPORTED | feature_not_supported |
@H_403_102@Class 0B — InvalID Transaction Initiation | ||
0B000 | INVALID TRANSACTION INITIATION | invalID_transaction_initiation |
@H_403_102@Class 0F — Locator Exception | ||
0F000 | LOCATOR EXCEPTION | locator_exception |
0F001 | INVALID LOCATOR SPECIFICATION | invalID_locator_specification |
@H_403_102@Class 0L — InvalID Grantor | ||
0L000 | INVALID GRANTOR | invalID_grantor |
0LP01 | INVALID GRANT OPERATION | invalID_grant_operation |
@H_403_102@Class 0P — InvalID Role Specification | ||
0P000 | INVALID RolE SPECIFICATION | invalID_role_specification |
@H_403_102@Class 20 — Case Not Found | ||
20000 | CASE NOT FOUND | case_not_found |
@H_403_102@Class 21 — Cardinality Violation | ||
21000 | CARDINAliTY VIolATION | cardinality_violation |
@H_403_102@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 | division_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 |
@H_403_102@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 |
@H_403_102@Class 24 — InvalID Cursor State | ||
24000 | INVALID CURSOR STATE | invalID_cursor_state |
@H_403_102@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 |
@H_403_102@Class 26 — InvalID sql Statement name | ||
26000 | INVALID sql STATEMENT name | invalID_sql_statement_name |
@H_403_102@Class 27 — Triggered Data Change Violation | ||
27000 | TRIGGERED DATA CHANGE VIolATION | triggered_data_change_violation |
@H_403_102@Class 28 — InvalID Authorization Specification | ||
28000 | INVALID AUTHORIZATION SPECIFICATION | invalID_authorization_specification |
@H_403_102@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 |
@H_403_102@Class 2D — InvalID Transaction Termination | ||
2D000 | INVALID TRANSACTION TERMINATION | invalID_transaction_termination |
@H_403_102@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 |
@H_403_102@Class 34 — InvalID Cursor name | ||
34000 | INVALID CURSOR name | invalID_cursor_name |
@H_403_102@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 |
@H_403_102@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 |
@H_403_102@Class 3B — Savepoint Exception | ||
3B000 | SAVEPOINT EXCEPTION | savepoint_exception |
3B001 | INVALID SAVEPOINT SPECIFICATION | invalID_savepoint_specification |
@H_403_102@Class 3D — InvalID Catalog name | ||
3D000 | INVALID CATALOG name | invalID_catalog_name |
@H_403_102@Class 3F — InvalID Schema name | ||
3F000 | INVALID SCHEMA name | invalID_schema_name |
@H_403_102@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 |
@H_403_102@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 |
@H_403_102@Class 44 — WITH CHECK OPTION Violation | ||
44000 | WITH CHECK OPTION VIolATION | with_check_option_violation |
@H_403_102@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 |
@H_403_102@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 |
@H_403_102@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 |
@H_403_102@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 |
@H_403_102@Class 58 — System Error (errors external toPostgresql itself) | ||
58030 | IO ERROR | io_error |
58P01 | UNdefineD file | undefined_file |
58P02 | DUPliCATE file | duplicate_file |
@H_403_102@Class F0 — Configuration file Error | ||
F0000 | CONfig file ERROR | config_file_error |
F0001 | LOCK file EXISTS | lock_file_exists |
@H_403_102@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 |
@H_403_102@Class XX — Internal Error | ||
XX000 | INTERNAL ERROR | internal_error |
XX001 | DATA CORRUPTED | data_corrupted |
XX002 | INDEX CORRUPTED | index_corrupted |
以上是内存溢出为你收集整理的PostgreSQL数据库中的常见错误全部内容,希望文章能够帮你解决PostgreSQL数据库中的常见错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)