Error Codes

This section is a reference for all of the error messages and codes returned by the system. Each class of messages is listed in its own subsection. See also Recoverable Error Codes.

Common Expected Exceptions

CO001    E    BufferManager
CO002    E    Metadata
YB001    E    QueryNotReady
YB002    X    OutOfMemoryInRowPacket    Not enough space reserved in RowPacket
YB003    X    MissingQueryParameterData Missing data for query parameter
YB004    X    OutOfHashMemory           Hash table too big
YB005    X    SpillingSort              Attempting to spill a sort to disc
YB006    X    TempTableOutOfMemory      Temp table exceeded max size
YB007    X    MissingTempTable          Temp table cannot be found or is not readable
YB008    X    NoSuchExecutionID         ExecutionID not found
YB009    X    NoSuchNodeID              NodeID not found
YB010    X    InvalidRegistration       Invalid worker registration.
YB011    XS   InvalidTreeTopology       The plan tree is incorrectly built
YB012    X    Parse                     Invalid input string
YB013    X    ExternalDataSocketError   External data socket error
YB014    X    InvalidBulkData           The bulk load data stream was invalid
YB015    X    InvalidBulkDataCompression The bulk load data stream was invalid (bad compression)
YB016    X    InvalidBulkDataLength     The bulk load data stream was invalid (bad length)
YB017    X    InvalidBulkDataCrc        The bulk load data stream was invalid (bad CRC)
YB018    X    ExternalConnectTimeout    External client establishing connection timed out
YB019    X    JSONInvalidKey            The key for this json object is invalid / null / not a string
YB020    E    NestingTooDeep            Nesting of statement too deep
YB021    E    SequenceError             Invalid sequence values or overflow
YB022    E    BulkClientError           Ybload Error
YB023    E    UnloadClientError         Ybunload Error
YB024    X    MaxSeqnoExceeded          Maximum number of rows per transaction exceeded
YB042    X    InjectedError             Injected Error # 
YB999    X    ERRCODE_CONFIGURATION_ERROR general configuration error

# WL Error codes from the work load manager
WL001    E    ERRCODE_WORKLOAD_ADMIN_CANCELLED                               admin cancelled
WL002    E    ERRCODE_WORKLOAD_WAIT_TIME_EXCEEDED                            wait time exceeded
WL003    E    ERRCODE_WORKLOAD_EXECUTION_TIME_EXCEEDED                       execution time exceeded
WL004    E    ERRCODE_WORKLOAD_ROWCOUNT_EXCEEDED                             row count exceeded
WL005    E    ERRCODE_WORKLOAD_MEMORY_EXCEEDED                               memory exceeded
WL006    E    ERRCODE_WORKLOAD_OTEHR_ERROR                                   WLM other error
WL007    E    ERRCODE_WORKLOAD_SHUTTING_DOWN                                 WLM shutting down
WL008    E    ERRCODE_WORKLOAD_COMPILE_ERROR                                 compile error
WL009    E    ERRCODE_WORKLOAD_CONFIG_ERROR                                  WLM configuration error
WL009    E    ERRCODE_WORKLOAD_CANNOT_MOVE_QUERY                             cannot move query
WL010    E    ERRCODE_WORKLOAD_CANNOT_RESTART_QUERY                          cannot restart query
WL011    E    ERRCODE_WORKLOAD_PRIOR_QUERY_NOT_COMPLETED                     prior query for session not complete
WL012    E    ERRCODE_WORKLOAD_QUERY_CANNOT_THROTTLE                         query would deadlock session on throttle
WL013    E    ERRCODE_WORKLOAD_COMPILE_SHUTDOWN                              query compilation was cancelled by shutdown signal
WL014    E    ERRCODE_WORKLOAD_RULE_ABORT                                    WLM rule aborted query
WL015    E    ERRCODE_WORKLOAD_RESOURCE_POOL_FULL                            WLM resource pool queue full
WL016    E    ERRCODE_WORKLOAD_RESTART_CLIENT_WAIT                           query cancelled during restart due to client wait
WL017    E    ERRCODE_WORKLOAD_CANCEL_CLIENT_WAIT                            query cancelling and so client wait should not proceed

# WM Error codes from the worker manager
WM001    E   ERRCODE_WORKER_OFFLINE                                          worker offline
WM002    E   ERRCODE_SYSTEM_NOT_READY                                        system not ready
WM003    E   ERRCODE_CANCEL_FOR_RESTART                                      Query restarting
WM004    E   ERRCODE_MISMATCHED_WORKER_ID                                    mismatched worker id
WM005    E   ERRCODE_WORKER_CONFIG_ERROR                                     worker misconfigured

# Error codes during compilation
CC001   E   ERRCODE_EXPRESSION_TOO_COMPLEX   Expression too complex
CC002   E   ERRCODE_INVALID_DATETIME_TOKEN   Invalid date or timestamp unit
CC003   E   ERRCODE_INVALID_ARGUMENT_TYPE    Invalid function argument type 

# Datetime related
22008   XS  DateTimeInvalidChar Invalid character for date time pattern 

# Errors thrown by the EE
EEOOM     E   ERRCODE_QUERY_OOM                Query out of memory

Common Unexpected Exceptions

Base: UnexpectedException

YU___    E    TempUnknownCode          unknown error (temporary)
YU001    X    InvalidWriteSeqno        invalid write sequence number
YU002    X    NoSuchWorkerID           invalid worker id
YU003    X    NoSuchAuthKey            invalid authorization key
YU004    X    InvalidWriteGid          invalid write gid
YU005    X    CompilerError            compiler error in Lime
YU006    X    UnexpectTopology         compiler error in PG
YU007    XS   UDFError                 Error evaluating user defined function  

# Error codes for the cluster manager
CM001   E   ERRCODE_PARITY_REBUILD_FAILED    Parity rebuild failed
CM002   E   ERRCODE_CLUSTER_CONFIG_ERROR     unable to update cluster state
CM003   E   ERRCODE_FSCK_ERROR               failed to FSCK 

# Error where Lime has supplied bad input to the execution engine that we can't handle
EEX01   E   InvalidTypeSystemInput    Invalid compiler input to type system  

# Error codes for backup
BK001   E   ERRCODE_

# BAR2
BR001   E   ERRCODE_BAR2_NO_VALID_BACKUP                     No valid backup in a backup set
BR003   E   ERRCODE_BAR2_NO_VALID_SNAPSHOT_IN_TARGET         Target does not contain required snapshot
BR004   E   ERRCODE_BAR2_TARGET_MODIFIED                     Target has been modified
BR005   E   ERRCODE_BAR2_NOTHING_TO_RESTORE                  Target does not contain snapshot to be restored
BR006   E   ERRCODE_BAR2_CROSS_DB_VIEW                       Cannot restore cross-DB view
BR007   E   ERRCODE_BAR2_RESTORE_TO_NON_EMPTY_DB             Cannot restore to target DB
BR008   E   ERRCODE_BAR2_NO_VALID_SNAPSHOT_IN_BACKUP_SET     Cannot locate snapshot in backup set
BR011   E   ERRCODE_BAR2_INVALID_LOCATION                    Cannot find DB metadata for incremental / cumulative backup

# Format:
#  <error code> <flags> <name> <optional description>
# where flags are:
# W - warning# E - error
# X - generate exception class
# S - add string parameter exception constructors

Kernel Unexpected Exceptions

Base: UnexpectedException 
KU000    XS  NotImplemented                                                Feature not implemented
KUSEG    E   Segv                                                          Segfault
KU001    XS  InvalidConfigAttributeIndex                                   Invalid config attribute index
KU002    XS  InvalidConfigTypeName                                         Invalid config type name
KU003    XS  IOValidation                                                  Malformed IORequest
KU004    XS  InvalidIORequest                                              Malformed IORequest
KU005    XS  InvalidNVMeIORequest                                          Malformed NVMe IORequest
KU006    XS  FBDDriverFailure                                              FakeBlockDevice driver failure
KU007    XS  NVMeDriverFailure                                             NMVe driver failure
KU008    XS  UnexpectedTCPSocketError                                      Unexpected TCP socket error
KU009    X   ScheduleFailure                                               Failed to schedule task
KU010    XS  IBDriverFailure                                               IB driver failure
KU011    X   FileSystemMissingPrefix                                       Could not find file with prefix for Parity
KU012    X   FileSystemNonUniquePrefix                                     Too many files with prefix for Parity
KU013        FILESYSTEMOUTOFINODE                                          Out of inode on file system
KU016        FPGADRIVERFAILURE                                             FPGA driver failure
KU017        BOUNCEBUFFERDRIVERFAILURE                                     Bounce buffer driver failure
KUSEG        SEGV                                                          Segfault
KUUUU    E   UnexpectedException                                           Generic UnexpectedException
KUXXX    XS  FileSystemOutOfINode                                          Out of inode on file system

Kernel Expected Exceptions

Base: ExpectedException 
KE001    E   MissingFile                                                   File not found
KE002    E   OutOfMemory                                                   Out of memory
KE003    X   ShuttingDown                                                  Shutting down
KE004    X   QueueFull                                                     Queue full
KE005    X   InvalidTopology                                               Invalid system topology
KE006    XS  InvalidConfig                                                 Invalid config
KE007    E   MissingID                                                     Missing id
KE008    E   UnknownConfigAttribute                                        Unkown config attribute
KE009    E   ConfigParsingError                                            Config parsing error
KE010    X   FileRead                                                      File read exception
KE011    X   FileWrite                                                     File write exception
KE012    X   OutOfRange                                                    Out of range
KE013    E   ArithmeticError                                               Arithmetic error
KE014    X   SystemBusy                                                    System busy
KE015    X   FileSystemSpaceFull                                           File system full
KE016    X   FileSystemCorrupt                                             File system corrupt
KE017    X   FileSystemMissingFile                                         Missing file
KE018    X   FileSystemMetadataFull                                        Metadata storage full
KE019    X   FileSystemOutOfBounds                                         File system out of bounds
KE020    X   FileSystemBusy                                                File system busy
KE021    X   FileSystemDuplicateName                                       File system duplicate name
KE022    XS  TCPSocketError                                                TCP socket error
KE023    XS  RPCProtocolError                                              RPC protocol error
KE024    X   BadArguments                                                  Bad arguments
KE025    X   FileSystemUnsupportedDeviceSize                               Unsupported device size
KE026    X   MissingShard                                                  Missing one or more shards from FSCK
KE027    X   MissingKRI                                                    Missing one or more KRI from FSCK
KE028    X   UnreconstructableFile                                         File is unreconstructable
KE029    X   SpillLimitsExceeded                                           WLM assigned limits exceeded during spill
KE030    X   FileNotVisibleInGC                                            Given file is not visible to GC transaction
KE031    X   FileSystemSpillFull                                           File system space reserved for spilling full
KE032    X   SpillLimitExceeded                                            Attempt to use spill space above limit
KE033    x   BadTimeZone                                                   Bad Time Zone passed to query
KE036        TCPSOCKETTIMEOUT                                              TCP socket timeout
KE038        RPCCHANNELCLOSED                                              RPC channel closed
KE039        RPCCHANNELBROKEN                                              RPC channel broken

Class 00 - Successful Completion

00000    S   ERRCODE_SUCCESSFUL_COMPLETION                                 successful_completion

Class 01 - Warning

# do not use this class for failure conditions
01000    W   ERRCODE_WARNING                                               warning
0100C    W   ERRCODE_WARNING_DYNAMIC_RESULT_SETS_RETURNED                  dynamic_result_sets_returned
01008    W   ERRCODE_WARNING_IMPLICIT_ZERO_BIT_PADDING                     implicit_zero_bit_padding
01003    W   ERRCODE_WARNING_NULL_VALUE_ELIMINATED_IN_SET_FUNCTION         null_value_eliminated_in_set_function
01007    W   ERRCODE_WARNING_PRIVILEGE_NOT_GRANTED                         privilege_not_granted
01006    W   ERRCODE_WARNING_PRIVILEGE_NOT_REVOKED                         privilege_not_revoked
01004    W   ERRCODE_WARNING_STRING_DATA_RIGHT_TRUNCATION                  string_data_right_truncation
01P01    W   ERRCODE_WARNING_DEPRECATED_FEATURE                            deprecated_feature

Class 02 - No Data (also a warning class per the SQL standard)

# do not use this class for failure conditions
02000    W   ERRCODE_NO_DATA                                               no_data
02001    W   ERRCODE_NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED            no_additional_dynamic_result_sets_returned

Class 03 - SQL Statement Not Yet Complete

03000    E   ERRCODE_SQL_STATEMENT_NOT_YET_COMPLETE                        sql_statement_not_yet_complete

Class 08 - Connection Exception

08000    E   ERRCODE_CONNECTION_EXCEPTION                                  connection_exception
08003    E   ERRCODE_CONNECTION_DOES_NOT_EXIST                             connection_does_not_exist
08006    E   ERRCODE_CONNECTION_FAILURE                                    connection_failure
08001    E   ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION           sqlclient_unable_to_establish_sqlconnection
08004    E   ERRCODE_SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION     sqlserver_rejected_establishment_of_sqlconnection
08007    E   ERRCODE_TRANSACTION_RESOLUTION_UNKNOWN                        transaction_resolution_unknown
08P01    E   ERRCODE_PROTOCOL_VIOLATION                                    protocol_violation
08P02    E   ERRCODE_INVALID_EXECID                                        invalid_execution_id

Class 09 - Triggered Action Exception

09000    E   ERRCODE_TRIGGERED_ACTION_EXCEPTION                            triggered_action_exception

Class 0A - Feature Not Supported

0A000    E   ERRCODE_FEATURE_NOT_SUPPORTED                                 feature_not_supported

Class 0B - Invalid Transaction Initiation

0B000    E   ERRCODE_INVALID_TRANSACTION_INITIATION                        invalid_transaction_initiation

Class 0F - Locator Exception

0F000    E   ERRCODE_LOCATOR_EXCEPTION                                     locator_exception
0F001    E   ERRCODE_L_E_INVALID_SPECIFICATION                             invalid_locator_specification

Class 0L - Invalid Grantor

0L000    E   ERRCODE_INVALID_GRANTOR                                       invalid_grantor
0LP01    E   ERRCODE_INVALID_GRANT_OPERATION                               invalid_grant_operation

Class 0P - Invalid Role Specification

0P000    E   ERRCODE_INVALID_ROLE_SPECIFICATION                            invalid_role_specification

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

Class 20 - Case Not Found

20000    E   ERRCODE_CASE_NOT_FOUND                                        case_not_found

Class 21 - Cardinality Violation

# this means something returned the wrong number of rows
21000    E   ERRCODE_CARDINALITY_VIOLATION                                 more_than_one_row_returned_by_a_sub-select_used_as_an_expression
21001    E   ERRCODE_CARDINALITY_DUPLICATE                                 data_contains_duplicate_values

Class 22 - Data Exception

22000    E   ERRCODE_DATA_EXCEPTION                                        data_exception
2202E    E   ERRCODE_ARRAY_SUBSCRIPT_ERROR                                 array_subscript_error
22021    E   ERRCODE_CHARACTER_NOT_IN_REPERTOIRE                           character_not_in_repertoire
22008    E   ERRCODE_DATETIME_FIELD_OVERFLOW                               datetime_field_overflow
22031    E   ERRCODE_DATETIME_VALUE_OUT_OF_RANGE                           datetime value out of range
22012    E   ERRCODE_DIVISION_BY_ZERO                                      division_by_zero
22005    E   ERRCODE_ERROR_IN_ASSIGNMENT                                   error_in_assignment
2200B    E   ERRCODE_ESCAPE_CHARACTER_CONFLICT                             escape_character_conflict
22022    E   ERRCODE_INDICATOR_OVERFLOW                                    indicator_overflow
22015    E   ERRCODE_INTERVAL_FIELD_OVERFLOW                               interval_field_overflow
2201E    E   ERRCODE_INVALID_ARGUMENT_FOR_LOG                              invalid_argument_for_logarithm
22014    E   ERRCODE_INVALID_ARGUMENT_FOR_NTILE                            invalid_argument_for_ntile_function
22016    E   ERRCODE_INVALID_ARGUMENT_FOR_NTH_VALUE                        invalid_argument_for_nth_value_function
2201F    E   ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION                   invalid_argument_for_power_function
2201G    E   ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION            invalid_argument_for_width_bucket_function
22018    E   ERRCODE_INVALID_CHARACTER_VALUE_FOR_CAST                      invalid_character_value_for_cast
22007    E   ERRCODE_INVALID_DATETIME_FORMAT                               invalid_datetime_format
22019    E   ERRCODE_INVALID_ESCAPE_CHARACTER                              invalid_escape_character
2200D    E   ERRCODE_INVALID_ESCAPE_OCTET                                  invalid_escape_octet
22025    E   ERRCODE_INVALID_ESCAPE_SEQUENCE                               invalid_escape_sequence
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
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
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
22027    E   ERRCODE_TRIM_ERROR                                            trim_error
22024    E   ERRCODE_UNTERMINATED_C_STRING                                 unterminated_c_string
2200F    E   ERRCODE_ZERO_LENGTH_CHARACTER_STRING                          zero_length_character_string
22P01    E   ERRCODE_FLOATING_POINT_EXCEPTION                              floating_point_exception
22P02    E   ERRCODE_INVALID_TEXT_REPRESENTATION                           invalid_text_representation
22P03    E   ERRCODE_INVALID_BINARY_REPRESENTATION                         invalid_binary_representation
22P04    E   ERRCODE_BAD_COPY_FILE_FORMAT                                  bad_copy_file_format
22P05    E   ERRCODE_UNTRANSLATABLE_CHARACTER                              untranslatable_character
2200L    E   ERRCODE_NOT_AN_XML_DOCUMENT                                   not_an_xml_document
2200M    E   ERRCODE_INVALID_XML_DOCUMENT                                  invalid_xml_document
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_RANGE_PARTITION_VALUE_ERROR                           inserted_value_is_out_of_bounds_of_a_range-partition

Class 23 - Integrity Constraint Violation

23000    E   ERRCODE_INTEGRITY_CONSTRAINT_VIOLATION                        integrity_constraint_violation
23001    E   ERRCODE_RESTRICT_VIOLATION                                    restrict_violation
23502    E   ERRCODE_NOT_NULL_VIOLATION                                    not_null_violation
23503    E   ERRCODE_FOREIGN_KEY_VIOLATION                                 foreign_key_violation
23505    E   ERRCODE_UNIQUE_VIOLATION                                      unique_violation
23514    E   ERRCODE_CHECK_VIOLATION                                       check_violation
23P01    E   ERRCODE_EXCLUSION_VIOLATION                                   exclusion_violation

Class 24 - Invalid Cursor State

24000    E   ERRCODE_INVALID_CURSOR_STATE                                  invalid_cursor_state

Class 25 - Invalid Transaction State

25000    E   ERRCODE_INVALID_TRANSACTION_STATE                             invalid_transaction_state
25001    E   ERRCODE_ACTIVE_SQL_TRANSACTION                                active_sql_transaction
25002    E   ERRCODE_BRANCH_TRANSACTION_ALREADY_ACTIVE                     branch_transaction_already_active
25008    E   ERRCODE_HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL             held_cursor_requires_same_isolation_level
25003    E   ERRCODE_INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION      inappropriate_access_mode_for_branch_transaction
25004    E   ERRCODE_INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION  inappropriate_isolation_level_for_branch_transaction
25005    E   ERRCODE_NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION      no_active_sql_transaction_for_branch_transaction
25006    E   ERRCODE_READ_ONLY_SQL_TRANSACTION                             read_only_sql_transaction
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

Class 26 - Invalid SQL Statement Name

# (prepared statements)
26000    E   ERRCODE_INVALID_SQL_STATEMENT_NAME                            invalid_sql_statement_name

Class 27 - Triggered Data Change Violation

27000    E   ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION                       triggered_data_change_violation

Class 28 - Invalid Authorization Specification

28000    E   ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION                   invalid_authorization_specification
28P01    E   ERRCODE_INVALID_PASSWORD                                      invalid_password

Class 2B - Dependent Privilege Descriptors Still Exist

2B000    E   ERRCODE_DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST           dependent_privilege_descriptors_still_exist
2BP01    E   ERRCODE_DEPENDENT_OBJECTS_STILL_EXIST                         dependent_objects_still_exist

Class 2D - Invalid Transaction Termination

2D000    E   ERRCODE_INVALID_TRANSACTION_TERMINATION                       invalid_transaction_termination

Class 2F - SQL Routine Exception

2F000    E   ERRCODE_SQL_ROUTINE_EXCEPTION                                 sql_routine_exception
2F005    E   ERRCODE_S_R_E_FUNCTION_EXECUTED_NO_RETURN_STATEMENT           function_executed_no_return_statement
2F002    E   ERRCODE_S_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED                modifying_sql_data_not_permitted
2F003    E   ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED              prohibited_sql_statement_attempted
2F004    E   ERRCODE_S_R_E_READING_SQL_DATA_NOT_PERMITTED                  reading_sql_data_not_permitted

Class 34 - Invalid Cursor Name

34000    E   ERRCODE_INVALID_CURSOR_NAME                                   invalid_cursor_name

Class 38 - External Routine Exception

38000    E    ERRCODE_EXTERNAL_ROUTINE_EXCEPTION                            external_routine_exception
38001    E    ERRCODE_E_R_E_CONTAINING_SQL_NOT_PERMITTED                    containing_sql_not_permitted
38002    E    ERRCODE_E_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED                modifying_sql_data_not_permitted
38003    E    ERRCODE_E_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED              prohibited_sql_statement_attempted
38004    E    ERRCODE_E_R_E_READING_SQL_DATA_NOT_PERMITTED                  reading_sql_data_not_permitted 

Class 39 - External Routine Invocation Exception

39000   E    ERRCODE_EXTERNAL_ROUTINE_INVOCATION_EXCEPTION                 external_routine_invocation_exception
39001    E   ERRCODE_E_R_I_E_INVALID_SQLSTATE_RETURNED                     invalid_sqlstate_returned
39004    E   ERRCODE_E_R_I_E_NULL_VALUE_NOT_ALLOWED                        null_value_not_allowed
39P01    E   ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED                     trigger_protocol_violated
39P02    E   ERRCODE_E_R_I_E_SRF_PROTOCOL_VIOLATED                         srf_protocol_violated
39P03    E   ERRCODE_E_R_I_E_EVENT_TRIGGER_PROTOCOL_VIOLATED               event_trigger_protocol_violated

Class 3B - Savepoint Exception

3B000    E   ERRCODE_SAVEPOINT_EXCEPTION                                   savepoint_exception
3B001    E   ERRCODE_S_E_INVALID_SPECIFICATION                             invalid_savepoint_specification Section: 

Class 3D - Invalid Catalog Name

3D000    E   ERRCODE_INVALID_CATALOG_NAME                                  invalid_catalog_name 

Class 3F - Invalid Schema Name

3F000    E   ERRCODE_INVALID_SCHEMA_NAME                                   invalid_schema_name

Class 40 - Transaction Rollback

40000    E   ERRCODE_TRANSACTION_ROLLBACK                                  transaction_rollback
40002    E   ERRCODE_T_R_INTEGRITY_CONSTRAINT_VIOLATION                    transaction_integrity_constraint_violation
40001    E   ERRCODE_T_R_SERIALIZATION_FAILURE                             serialization_failure
40003    E   ERRCODE_T_R_STATEMENT_COMPLETION_UNKNOWN                      statement_completion_unknown
40P01    E   ERRCODE_T_R_DEADLOCK_DETECTED                                 deadlock_detected

Class 42 - Syntax Error or Access Rule Violation

42000    E   ERRCODE_SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION                 syntax_error_or_access_rule_violation
42601    E   ERRCODE_SYNTAX_ERROR                                          syntax_error
42501    E   ERRCODE_INSUFFICIENT_PRIVILEGE                                insufficient_privilege
42846    E   ERRCODE_CANNOT_COERCE                                         cannot_coerce
42803    E   ERRCODE_GROUPING_ERROR                                        grouping_error
42P20    E   ERRCODE_WINDOWING_ERROR                                       windowing_error
42P19    E   ERRCODE_INVALID_RECURSION                                     invalid_recursion
42830    E   ERRCODE_INVALID_FOREIGN_KEY                                   invalid_foreign_key
42602    E   ERRCODE_INVALID_NAME                                          invalid_name
42622    E   ERRCODE_NAME_TOO_LONG                                         name_too_long
42939    E   ERRCODE_RESERVED_NAME                                         reserved_name
42804    E   ERRCODE_DATATYPE_MISMATCH                                     datatype_mismatch
42P18    E   ERRCODE_INDETERMINATE_DATATYPE                                indeterminate_datatype
42P21    E   ERRCODE_COLLATION_MISMATCH                                    collation_mismatch
42P22    E   ERRCODE_INDETERMINATE_COLLATION                               indeterminate_collation
42809    E   ERRCODE_WRONG_OBJECT_TYPE                                     wrong_object_type 

# Note: for ERRCODE purposes, we divide nameable objects into these categories:
# databases, schemas, prepared statements, cursors, tables, columns,
# functions (including operators), and all else ("objects").
# (The first four categories are mandated by the existence of separate
# SQLSTATE classes; in this file, however, we group
# the ERRCODE names with all the rest under class 42.) Parameters are
# sort-of-named objects and get their own ERRCODE.
# The same breakdown is used for "duplicate" and "ambiguous" complaints,
# as well as complaints associated with incorrect declarations. 

42703    E   ERRCODE_UNDEFINED_COLUMN                                      undefined_column
42883    E   ERRCODE_UNDEFINED_FUNCTION                                    undefined_function
42P01    E   ERRCODE_UNDEFINED_TABLE                                       undefined_table
42P02    E   ERRCODE_UNDEFINED_PARAMETER                                   undefined_parameter
42P23    E   ERRCODE_RELATION_NOT_FOUND                                    relation_not_found
42704    E   ERRCODE_UNDEFINED_OBJECT                                      undefined_object
42701    E   ERRCODE_DUPLICATE_COLUMN                                      duplicate_column
42P03    E   ERRCODE_DUPLICATE_CURSOR                                      duplicate_cursor
42P04    E   ERRCODE_DUPLICATE_DATABASE                                    duplicate_database
42723    E   ERRCODE_DUPLICATE_FUNCTION                                    duplicate_function
42P05    E   ERRCODE_DUPLICATE_PSTATEMENT                                  duplicate_prepared_statement
42P06    E   ERRCODE_DUPLICATE_SCHEMA                                      duplicate_schema
42P07    E   ERRCODE_DUPLICATE_TABLE                                       duplicate_table
42712    E   ERRCODE_DUPLICATE_ALIAS                                       duplicate_alias
42710    E   ERRCODE_DUPLICATE_OBJECT                                      duplicate_object
42711    E   ERRCODE_DUPLICATE_TARGET_ROW                                  duplicate_target_row
42702    E   ERRCODE_AMBIGUOUS_COLUMN                                      ambiguous_column
42725    E   ERRCODE_AMBIGUOUS_FUNCTION                                    ambiguous_function
42P08    E   ERRCODE_AMBIGUOUS_PARAMETER                                   ambiguous_parameter
42P09    E   ERRCODE_AMBIGUOUS_ALIAS                                       ambiguous_alias
42P10    E   ERRCODE_INVALID_COLUMN_REFERENCE                              invalid_column_reference
42611    E   ERRCODE_INVALID_COLUMN_DEFINITION                             invalid_column_definition
42P11    E   ERRCODE_INVALID_CURSOR_DEFINITION                             invalid_cursor_definition
42P12    E   ERRCODE_INVALID_DATABASE_DEFINITION                           invalid_database_definition
42P13    E   ERRCODE_INVALID_FUNCTION_DEFINITION                           invalid_function_definition
42P14    E   ERRCODE_INVALID_PSTATEMENT_DEFINITION                         invalid_prepared_statement_definition
42P15    E   ERRCODE_INVALID_SCHEMA_DEFINITION                             invalid_schema_definition
42P16    E   ERRCODE_INVALID_TABLE_DEFINITION                              invalid_table_definition
42P17    E   ERRCODE_INVALID_OBJECT_DEFINITION                             invalid_object_definition
42P42    E   ERRCODE_BACKEND_ONLY                                          backend_only

Class 44 - WITH CHECK OPTION Violation

44000    E   ERRCODE_WITH_CHECK_OPTION_VIOLATION                           with_check_option_violation

Class 53 - Insufficient Resources

# (PostgreSQL-specific error class)
53000    E   ERRCODE_INSUFFICIENT_RESOURCES                                insufficient_resources
53100    E   ERRCODE_DISK_FULL                                             disk_full
53200    E   ERRCODE_OUT_OF_MEMORY                                         out_of_memory
53300    E   ERRCODE_TOO_MANY_CONNECTIONS                                  too_many_connections
53400    E   ERRCODE_CONFIGURATION_LIMIT_EXCEEDED                          configuration_limit_exceeded

Class 54 - Program Limit Exceeded

# this is for wired-in limits, not resource exhaustion problems
54000    E   ERRCODE_PROGRAM_LIMIT_EXCEEDED                                program_limit_exceeded
54001    E   ERRCODE_STATEMENT_TOO_COMPLEX                                 statement_too_complex
54011    E   ERRCODE_TOO_MANY_COLUMNS                                      too_many_columns
54023    E   ERRCODE_TOO_MANY_ARGUMENTS                                    too_many_arguments

Class 55 - Object Not In Prerequisite State

55000    E   ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE                      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

Class 57 - Operator Intervention

57000    E   ERRCODE_OPERATOR_INTERVENTION                                 operator_intervention
57014    E   ERRCODE_QUERY_CANCELED                                        query_canceled
57P01    E   ERRCODE_ADMIN_SHUTDOWN                                        admin_shutdown
57P02    E   ERRCODE_CRASH_SHUTDOWN                                        crash_shutdown
57P03    E   ERRCODE_CANNOT_CONNECT_NOW                                    cannot_connect_now
57P04    E   ERRCODE_DATABASE_DROPPED                                      database_dropped

Class 58 - System Error

58000    E   ERRCODE_SYSTEM_ERROR                                          system_error
58030    E   ERRCODE_IO_ERROR                                              io_error
58P01    E   ERRCODE_UNDEFINED_FILE                                        undefined_file
58P02    E   ERRCODE_DUPLICATE_FILE                                        duplicate_file 

Class F0 - Configuration File Error

F0000    E   ERRCODE_CONFIG_FILE_ERROR                                     config_file_error
F0001    E   ERRCODE_LOCK_FILE_EXISTS                                      lock_file_exists 

Class HV - Foreign Data Wrapper Error (SQL/MED)

# (SQL/MED-specific error class)
HV000    E   ERRCODE_FDW_ERROR                                             fdw_error
HV005    E   ERRCODE_FDW_COLUMN_NAME_NOT_FOUND                             fdw_column_name_not_found
HV002    E   ERRCODE_FDW_DYNAMIC_PARAMETER_VALUE_NEEDED                    fdw_dynamic_parameter_value_needed
HV010    E   ERRCODE_FDW_FUNCTION_SEQUENCE_ERROR                           fdw_function_sequence_error
HV021    E   ERRCODE_FDW_INCONSISTENT_DESCRIPTOR_INFORMATION               fdw_inconsistent_descriptor_information
HV024    E   ERRCODE_FDW_INVALID_ATTRIBUTE_VALUE                           fdw_invalid_attribute_value
HV007    E   ERRCODE_FDW_INVALID_COLUMN_NAME                               fdw_invalid_column_name
HV008    E   ERRCODE_FDW_INVALID_COLUMN_NUMBER                             fdw_invalid_column_number
HV004    E   ERRCODE_FDW_INVALID_DATA_TYPE                                 fdw_invalid_data_type
HV006    E   ERRCODE_FDW_INVALID_DATA_TYPE_DESCRIPTORS                     fdw_invalid_data_type_descriptors
HV091    E   ERRCODE_FDW_INVALID_DESCRIPTOR_FIELD_IDENTIFIER               fdw_invalid_descriptor_field_identifier
HV00B    E   ERRCODE_FDW_INVALID_HANDLE                                    fdw_invalid_handle
HV00C    E   ERRCODE_FDW_INVALID_OPTION_INDEX                              fdw_invalid_option_index
HV00D    E   ERRCODE_FDW_INVALID_OPTION_NAME                               fdw_invalid_option_name
HV090    E   ERRCODE_FDW_INVALID_STRING_LENGTH_OR_BUFFER_LENGTH            fdw_invalid_string_length_or_buffer_length
HV00A    E   ERRCODE_FDW_INVALID_STRING_FORMAT                             fdw_invalid_string_format
HV009    E   ERRCODE_FDW_INVALID_USE_OF_NULL_POINTER                       fdw_invalid_use_of_null_pointer
HV014    E   ERRCODE_FDW_TOO_MANY_HANDLES                                  fdw_too_many_handles
HV001    E   ERRCODE_FDW_OUT_OF_MEMORY                                     fdw_out_of_memory
HV00P    E   ERRCODE_FDW_NO_SCHEMAS                                        fdw_no_schemas
HV00J    E   ERRCODE_FDW_OPTION_NAME_NOT_FOUND                             fdw_option_name_not_found
HV00K    E   ERRCODE_FDW_REPLY_HANDLE                                      fdw_reply_handle
HV00Q    E   ERRCODE_FDW_SCHEMA_NOT_FOUND                                  fdw_schema_not_found
HV00R    E   ERRCODE_FDW_TABLE_NOT_FOUND                                   fdw_table_not_found
HV00L    E   ERRCODE_FDW_UNABLE_TO_CREATE_EXECUTION                        fdw_unable_to_create_execution
HV00M    E   ERRCODE_FDW_UNABLE_TO_CREATE_REPLY                            fdw_unable_to_create_reply
HV00N    E   ERRCODE_FDW_UNABLE_TO_ESTABLISH_CONNECTION                    fdw_unable_to_establish_connection

Class P0: PL/pgSQL Error

P0000    E   ERRCODE_PLPGSQL_ERROR                                         plpgsql_error
P0001    E   ERRCODE_RAISE_EXCEPTION                                       raise_exception
P0002    E   ERRCODE_NO_DATA_FOUND                                         no_data_found
P0003    E   ERRCODE_TOO_MANY_ROWS                                         too_many_rows
P0004    E   ERRCODE_ASSERT_FAILURE                                        assert_failure

Class XX: Internal Error

# (PostgreSQL-specific error class)
XX000    E   ERRCODE_INTERNAL_ERROR                                        internal_error
XX001    E   ERRCODE_DATA_CORRUPTED                                        data_corrupted
XX002    E   ERRCODE_INDEX_CORRUPTED                                       index_corrupted