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
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}
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
22023invalid_parameter_valuedata exceptioninvalid parameter value: {detail}
22025invalid_escape_sequencedata exceptionLIKE pattern must not end with escape character
2201Binvalid_regular_expressiondata exceptioninvalid regular expression: {detail}
2202Earray_subscript_errordata exception{detail}
22030duplicate_json_object_key_valuedata exceptionduplicate JSON object key value
2203Asql_json_item_cannot_be_cast_to_target_typedata exception{detail}
2203Csql_json_object_not_founddata exception{detail}
2203Fsql_json_member_not_founddata 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}
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
25P02in_failed_sql_transactioninvalid transaction statecurrent transaction is aborted, commands ignored until end of transaction block
2BP01dependent_objects_still_existdependent objects still existcannot drop type {name} because other objects depend on it: {detail}
42601syntax_errorsyntax error or access rule violationsyntax error: {detail}
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
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}
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}
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}
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}
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}
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
55000object_not_in_prerequisite_stateobject not in prerequisite state{detail}
55006object_in_useobject not in prerequisite state{detail}
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}
jed — an embeddable, strictly-typed SQL database.