jed

Error codes

Every jed error carries a stable SQLSTATE code and symbolic name — machine-legible, never matched on prose. This registry is generated at build time from spec/errors/registry.toml. These are the codes you'll see in the live examples and the database tool (for example, 54P01 when a query exceeds its cost ceiling).

SQLSTATENameClassMessage template
08006connection_failureconnection exception{detail}
08007transaction_resolution_unknownconnection exception{detail}
08P01protocol_violationconnection exception{detail}
21000cardinality_violationcardinality violationmore than one row returned by a subquery used as an expression
22000data_exceptiondata exception{detail}
22001string_data_right_truncationdata exception{detail}
22003numeric_value_out_of_rangedata exceptionvalue out of range for type {type}
22004null_value_not_alloweddata exception{detail}
22007invalid_datetime_formatdata exceptioninvalid input syntax for type {type}: {detail}
22008datetime_field_overflowdata exceptiondate/time field value out of range: {detail}
22009invalid_time_zone_displacement_valuedata exceptiontime zone displacement out of range: {detail}
22012division_by_zerodata exceptiondivision by zero
22014invalid_argument_for_ntiledata exceptionargument of ntile must be greater than zero
22016invalid_argument_for_nth_valuedata exceptionargument of nth_value must be greater than zero
22011substring_errordata exceptionnegative substring length not allowed
2201Ginvalid_argument_for_width_bucket_functiondata exception{detail}
2201Einvalid_argument_for_logdata exception{detail}
2201Finvalid_argument_for_power_functiondata exception{detail}
22013invalid_preceding_or_following_sizedata exceptionframe starting or ending offset must not be negative
2200Hsequence_generator_limit_exceededdata exceptionnextval: reached {bound} value of sequence {sequence}
2201Winvalid_row_count_in_limit_clausedata exceptionLIMIT must not be negative
2201Xinvalid_row_count_in_offset_clausedata exceptionOFFSET must not be negative
22021character_not_in_repertoiredata exceptioninvalid byte sequence for encoding \"UTF8\": {detail}
22023invalid_parameter_valuedata exceptioninvalid parameter value: {detail}
22025invalid_escape_sequencedata exception{detail}
2200Cinvalid_use_of_escape_characterdata exception{detail}
2201Binvalid_regular_expressiondata exceptioninvalid regular expression: {detail}
2202Earray_subscript_errordata exception{detail}
22030duplicate_json_object_key_valuedata exceptionduplicate JSON object key value
22039sql_json_array_not_founddata exception{detail}
2203Asql_json_member_not_founddata exception{detail}
2203Bsql_json_number_not_founddata exception{detail}
2203Csql_json_object_not_founddata exception{detail}
2203Fsql_json_scalar_requireddata exception{detail}
22031invalid_argument_for_sql_json_datetime_functiondata exception{detail}
22033invalid_sql_json_subscriptdata exception{detail}
22034more_than_one_sql_json_itemdata exception{detail}
22035no_sql_json_itemdata exception{detail}
22036non_numeric_sql_json_itemdata exception{detail}
22038singleton_sql_json_item_requireddata exception{detail}
22P02invalid_text_representationdata exceptioninvalid input syntax for type {type}: {detail}
22P05untranslatable_characterdata exceptionunsupported Unicode escape sequence
23502not_null_violationintegrity constraint violationnull value in column {name} violates not-null constraint
23505unique_violationintegrity constraint violationduplicate key value violates unique constraint: {name}
23514check_violationintegrity constraint violationnew row for relation {table} violates check constraint {name}
23503foreign_key_violationintegrity constraint violationinsert or update on table {table} violates foreign key constraint {name}
23P01exclusion_violationintegrity constraint violationconflicting key value violates exclusion constraint: {name}
25001active_sql_transactioninvalid transaction statethere is already a transaction in progress
25006read_only_sql_transactioninvalid transaction statecannot execute {statement} in a read-only transaction
25P01no_active_sql_transactioninvalid transaction state{statement} can only be used in transaction blocks
25P02in_failed_sql_transactioninvalid transaction statecurrent transaction is aborted, commands ignored until end of transaction block
25P03idle_in_transaction_session_timeoutinvalid transaction state{detail}
2BP01dependent_objects_still_existdependent objects still existcannot drop type {name} because other objects depend on it: {detail}
2D000invalid_transaction_terminationinvalid transaction terminationinvalid transaction termination
28P01invalid_passwordinvalid authorization specification{detail}
28P02credential_requiredinvalid authorization specification{detail}
28P03credential_not_applicableinvalid authorization specification{detail}
28P04stale_keyinvalid authorization specification{detail}
3B001invalid_savepoint_specificationinvalid savepoint specificationsavepoint does not exist: {name}
38000external_routine_exceptionexternal routine exceptionhost function {name} raised {detail}
42601syntax_errorsyntax error or access rule violationsyntax error: {detail}
42602invalid_namesyntax error or access rule violationinvalid name syntax
42P01undefined_tablesyntax error or access rule violationtable does not exist: {name}
42703undefined_columnsyntax error or access rule violationcolumn does not exist: {name}
42702ambiguous_columnsyntax error or access rule violationcolumn reference {name} is ambiguous
42P09ambiguous_aliassyntax error or access rule violationtable reference {name} is ambiguous
42704undefined_objectsyntax error or access rule violation{kind} does not exist: {name}
42P10invalid_column_referencesyntax error or access rule violationfor SELECT DISTINCT, ORDER BY expressions must appear in select list
42804datatype_mismatchsyntax error or access rule violationdatatype mismatch: {detail}
42846cannot_coercesyntax error or access rule violationcannot cast behavior expression of type {type} to {type}
42830invalid_foreign_keysyntax error or access rule violationthere is no unique constraint matching given keys for referenced table {name}
42701duplicate_columnsyntax error or access rule violationduplicate column name: {name}
42712duplicate_aliassyntax error or access rule violationtable name {name} specified more than once
42P07duplicate_tablesyntax error or access rule violationrelation already exists: {name}
42P16invalid_table_definitionsyntax error or access rule violationinvalid table definition: {detail}
42803grouping_errorsyntax error or access rule violationcolumn {name} must appear in the GROUP BY clause or be used in an aggregate function
42883undefined_functionsyntax error or access rule violationfunction does not exist: {name}
42725ambiguous_functionsyntax error or access rule violationfunction {name} is not unique
42723duplicate_functionsyntax error or access rule violationduplicate function: {detail}
42P18indeterminate_datatypesyntax error or access rule violationcould not determine data type of parameter ${index}
42P19invalid_recursionsyntax error or access rule violation{detail}
42P02undefined_parametersyntax error or access rule violationthere is no parameter ${index}
42P17invalid_object_definitionsyntax error or access rule violationfunctions in index expression must be marked IMMUTABLE
42P20windowing_errorsyntax error or access rule violation{detail}
42P21collation_mismatchsyntax error or access rule violationcollation mismatch between explicit collations {left} and {right}
42P22indeterminate_collationsyntax error or access rule violationcould not determine which collation to use for string comparison
42710duplicate_objectsyntax error or access rule violationconstraint {name} for relation {table} already exists
42939reserved_namesyntax error or access rule violation{kind} name {name} is reserved (the jed_ prefix is reserved for system objects)
42809wrong_object_typesyntax error or access rule violation{name} is not {kind}
42622name_too_longsyntax error or access rule violationidentifier exceeds the maximum length of {max} bytes
428C9generated_alwayssyntax error or access rule violation{detail}
42501insufficient_privilegesyntax error or access rule violationpermission denied for {object}
0A000feature_not_supportedfeature not supportedfeature not supported: {detail}
44000with_check_option_violationwith check option violationnew row violates check option for view \"{view}\"
53300too_many_connectionsinsufficient resources{detail}
54000program_limit_exceededprogram limit exceededSQL statement exceeds the maximum length of {max} bytes
54001statement_too_complexprogram limit exceededstatement too complex: nesting depth exceeds the maximum of {max}
54011too_many_columnsprogram limit exceededcannot use more than {max} columns in an index
54P01cost_limit_exceededprogram limit exceededquery exceeded the cost limit of {limit} (accrued {cost})
54P02session_cost_limit_exceededprogram limit exceededsession exceeded the lifetime cost limit of {limit} (accrued {cost})
54P03temp_storage_limit_exceededprogram limit exceededtemporary table storage exceeded the limit of {limit} bytes
54P04scalar_memory_limit_exceededprogram limit exceededscalar allocations exceeded the limit of {limit} bytes
54P05query_memory_limit_exceededprogram limit exceededquery memory exceeded the limit of {limit} bytes
54P06storage_limit_exceededprogram limit exceededstorage of database \"{database}\" exceeded the limit of {limit} bytes
55000object_not_in_prerequisite_stateobject not in prerequisite state{detail}
55006object_in_useobject not in prerequisite state{detail}
55P03lock_not_availableobject not in prerequisite statecould not obtain the database writer lock
57014query_canceledoperator interventioncanceling statement due to user request
58030io_errorsystem errorI/O error: {detail}
58P01undefined_filesystem errordatabase file does not exist: {path}
58P02duplicate_filesystem errordatabase file already exists: {path}
XX001data_corruptedinternal erroron-disk database file is malformed: {detail}
XX002collation_version_mismatchinternal errorcollation version mismatch: {detail}
XX003unparsable_stored_definitioninternal errorstored definition does not parse in this version of jed: {detail}
jed — an embeddable, strictly-typed SQL database.