Skip to content

Commit

Permalink
Update error codes (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkuku authored Oct 12, 2024
1 parent 5924c18 commit a4b85e8
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions lib/postgrex/errcodes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# errcodes.txt
# PostgreSQL error codes
#
# Copyright (c) 2003-2015, PostgreSQL Global Development Group
# Copyright (c) 2003-2024, PostgreSQL Global Development Group
#
# This list serves as the basis for generating source files containing error
# codes. It is kept in a common format to make sure all these source files have
Expand All @@ -15,7 +15,10 @@
# src/pl/plpgsql/src/plerrcodes.h
# a list of PL/pgSQL condition names and their SQLSTATE codes
#
# doc/src/sgml/errcodes-list.sgml
# src/pl/tcl/pltclerrcodes.h
# the same, for PL/Tcl
#
# doc/src/sgml/errcodes-table.sgml
# a SGML table of error codes for inclusion in the documentation
#
# The format of this file is one error code per line, with the following
Expand Down Expand Up @@ -138,6 +141,12 @@ Section: Class 0Z - Diagnostics Exception
0Z000 E ERRCODE_DIAGNOSTICS_EXCEPTION diagnostics_exception
0Z002 E ERRCODE_STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER stacked_diagnostics_accessed_without_active_handler

Section: Class 10 - XQuery Error

# recent SQL versions define quite a few codes in this class, but for now
# we are only using this generic one
10608 E ERRCODE_INVALID_ARGUMENT_FOR_XQUERY invalid_argument_for_xquery

Section: Class 20 - Case Not Found

20000 E ERRCODE_CASE_NOT_FOUND case_not_found
Expand Down Expand Up @@ -174,15 +183,19 @@ Section: Class 22 - Data Exception
22P06 E ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER nonstandard_use_of_escape_character
22010 E ERRCODE_INVALID_INDICATOR_PARAMETER_VALUE invalid_indicator_parameter_value
22023 E ERRCODE_INVALID_PARAMETER_VALUE invalid_parameter_value
22013 E ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE invalid_preceding_or_following_size
2201B E ERRCODE_INVALID_REGULAR_EXPRESSION invalid_regular_expression
2201W E ERRCODE_INVALID_ROW_COUNT_IN_LIMIT_CLAUSE invalid_row_count_in_limit_clause
2201X E ERRCODE_INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE invalid_row_count_in_result_offset_clause
2202H E ERRCODE_INVALID_TABLESAMPLE_ARGUMENT invalid_tablesample_argument
2202G E ERRCODE_INVALID_TABLESAMPLE_REPEAT invalid_tablesample_repeat
22009 E ERRCODE_INVALID_TIME_ZONE_DISPLACEMENT_VALUE invalid_time_zone_displacement_value
2200C E ERRCODE_INVALID_USE_OF_ESCAPE_CHARACTER invalid_use_of_escape_character
2200G E ERRCODE_MOST_SPECIFIC_TYPE_MISMATCH most_specific_type_mismatch
22004 E ERRCODE_NULL_VALUE_NOT_ALLOWED null_value_not_allowed
22002 E ERRCODE_NULL_VALUE_NO_INDICATOR_PARAMETER null_value_no_indicator_parameter
22003 E ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE numeric_value_out_of_range
2200H E ERRCODE_SEQUENCE_GENERATOR_LIMIT_EXCEEDED sequence_generator_limit_exceeded
22026 E ERRCODE_STRING_DATA_LENGTH_MISMATCH string_data_length_mismatch
22001 E ERRCODE_STRING_DATA_RIGHT_TRUNCATION string_data_right_truncation
22011 E ERRCODE_SUBSTRING_ERROR substring_error
Expand All @@ -199,6 +212,23 @@ Section: Class 22 - Data Exception
2200N E ERRCODE_INVALID_XML_CONTENT invalid_xml_content
2200S E ERRCODE_INVALID_XML_COMMENT invalid_xml_comment
2200T E ERRCODE_INVALID_XML_PROCESSING_INSTRUCTION invalid_xml_processing_instruction
22030 E ERRCODE_DUPLICATE_JSON_OBJECT_KEY_VALUE duplicate_json_object_key_value
22031 E ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION invalid_argument_for_sql_json_datetime_function
22032 E ERRCODE_INVALID_JSON_TEXT invalid_json_text
22033 E ERRCODE_INVALID_SQL_JSON_SUBSCRIPT invalid_sql_json_subscript
22034 E ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM more_than_one_sql_json_item
22035 E ERRCODE_NO_SQL_JSON_ITEM no_sql_json_item
22036 E ERRCODE_NON_NUMERIC_SQL_JSON_ITEM non_numeric_sql_json_item
22037 E ERRCODE_NON_UNIQUE_KEYS_IN_A_JSON_OBJECT non_unique_keys_in_a_json_object
22038 E ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED singleton_sql_json_item_required
22039 E ERRCODE_SQL_JSON_ARRAY_NOT_FOUND sql_json_array_not_found
2203A E ERRCODE_SQL_JSON_MEMBER_NOT_FOUND sql_json_member_not_found
2203B E ERRCODE_SQL_JSON_NUMBER_NOT_FOUND sql_json_number_not_found
2203C E ERRCODE_SQL_JSON_OBJECT_NOT_FOUND sql_json_object_not_found
2203D E ERRCODE_TOO_MANY_JSON_ARRAY_ELEMENTS too_many_json_array_elements
2203E E ERRCODE_TOO_MANY_JSON_OBJECT_MEMBERS too_many_json_object_members
2203F E ERRCODE_SQL_JSON_SCALAR_REQUIRED sql_json_scalar_required
2203G E ERRCODE_SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE sql_json_item_cannot_be_cast_to_target_type

Section: Class 23 - Integrity Constraint Violation

Expand Down Expand Up @@ -227,6 +257,8 @@ Section: Class 25 - Invalid Transaction State
25007 E ERRCODE_SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED schema_and_data_statement_mixing_not_supported
25P01 E ERRCODE_NO_ACTIVE_SQL_TRANSACTION no_active_sql_transaction
25P02 E ERRCODE_IN_FAILED_SQL_TRANSACTION in_failed_sql_transaction
25P03 E ERRCODE_IDLE_IN_TRANSACTION_SESSION_TIMEOUT idle_in_transaction_session_timeout
25P04 E ERRCODE_TRANSACTION_TIMEOUT transaction_timeout

Section: Class 26 - Invalid SQL Statement Name

Expand Down Expand Up @@ -320,6 +352,7 @@ Section: Class 42 - Syntax Error or Access Rule Violation
42P21 E ERRCODE_COLLATION_MISMATCH collation_mismatch
42P22 E ERRCODE_INDETERMINATE_COLLATION indeterminate_collation
42809 E ERRCODE_WRONG_OBJECT_TYPE wrong_object_type
428C9 E ERRCODE_GENERATED_ALWAYS generated_always

# Note: for ERRCODE purposes, we divide namable objects into these categories:
# databases, schemas, prepared statements, cursors, tables, columns,
Expand Down Expand Up @@ -392,6 +425,7 @@ Section: Class 55 - Object Not In Prerequisite State
55006 E ERRCODE_OBJECT_IN_USE object_in_use
55P02 E ERRCODE_CANT_CHANGE_RUNTIME_PARAM cant_change_runtime_param
55P03 E ERRCODE_LOCK_NOT_AVAILABLE lock_not_available
55P04 E ERRCODE_UNSAFE_NEW_ENUM_VALUE_USAGE unsafe_new_enum_value_usage

Section: Class 57 - Operator Intervention

Expand All @@ -402,6 +436,7 @@ Section: Class 57 - Operator Intervention
57P02 E ERRCODE_CRASH_SHUTDOWN crash_shutdown
57P03 E ERRCODE_CANNOT_CONNECT_NOW cannot_connect_now
57P04 E ERRCODE_DATABASE_DROPPED database_dropped
57P05 E ERRCODE_IDLE_SESSION_TIMEOUT idle_session_timeout

Section: Class 58 - System Error (errors external to PostgreSQL itself)

Expand All @@ -410,6 +445,7 @@ Section: Class 58 - System Error (errors external to PostgreSQL itself)
58030 E ERRCODE_IO_ERROR io_error
58P01 E ERRCODE_UNDEFINED_FILE undefined_file
58P02 E ERRCODE_DUPLICATE_FILE duplicate_file
58P03 E ERRCODE_FILE_NAME_TOO_LONG file_name_too_long

Section: Class F0 - Configuration File Error

Expand Down

0 comments on commit a4b85e8

Please sign in to comment.