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).
| SQLSTATE | Name | Class | Message template |
|---|---|---|---|
| 21000 | cardinality_violation | cardinality violation | more than one row returned by a subquery used as an expression |
| 22000 | data_exception | data exception | {detail} |
| 22001 | string_data_right_truncation | data exception | {detail} |
| 22003 | numeric_value_out_of_range | data exception | value out of range for type {type} |
| 22004 | null_value_not_allowed | data exception | {detail} |
| 22007 | invalid_datetime_format | data exception | invalid input syntax for type {type}: {detail} |
| 22008 | datetime_field_overflow | data exception | date/time field value out of range: {detail} |
| 22012 | division_by_zero | data exception | division by zero |
| 22014 | invalid_argument_for_ntile | data exception | argument of ntile must be greater than zero |
| 22016 | invalid_argument_for_nth_value | data exception | argument of nth_value must be greater than zero |
| 22011 | substring_error | data exception | negative substring length not allowed |
| 2201G | invalid_argument_for_width_bucket_function | data exception | {detail} |
| 2201E | invalid_argument_for_log | data exception | {detail} |
| 2201F | invalid_argument_for_power_function | data exception | {detail} |
| 22013 | invalid_preceding_or_following_size | data exception | frame starting or ending offset must not be negative |
| 2200H | sequence_generator_limit_exceeded | data exception | nextval: reached {bound} value of sequence {sequence} |
| 2201W | invalid_row_count_in_limit_clause | data exception | LIMIT must not be negative |
| 2201X | invalid_row_count_in_offset_clause | data exception | OFFSET must not be negative |
| 22023 | invalid_parameter_value | data exception | invalid parameter value: {detail} |
| 22025 | invalid_escape_sequence | data exception | LIKE pattern must not end with escape character |
| 2201B | invalid_regular_expression | data exception | invalid regular expression: {detail} |
| 2202E | array_subscript_error | data exception | {detail} |
| 22030 | duplicate_json_object_key_value | data exception | duplicate JSON object key value |
| 2203A | sql_json_item_cannot_be_cast_to_target_type | data exception | {detail} |
| 2203C | sql_json_object_not_found | data exception | {detail} |
| 2203F | sql_json_member_not_found | data exception | {detail} |
| 22031 | invalid_argument_for_sql_json_datetime_function | data exception | {detail} |
| 22033 | invalid_sql_json_subscript | data exception | {detail} |
| 22034 | more_than_one_sql_json_item | data exception | {detail} |
| 22035 | no_sql_json_item | data exception | {detail} |
| 22036 | non_numeric_sql_json_item | data exception | {detail} |
| 22038 | singleton_sql_json_item_required | data exception | {detail} |
| 22P02 | invalid_text_representation | data exception | invalid input syntax for type {type}: {detail} |
| 23502 | not_null_violation | integrity constraint violation | null value in column {name} violates not-null constraint |
| 23505 | unique_violation | integrity constraint violation | duplicate key value violates unique constraint: {name} |
| 23514 | check_violation | integrity constraint violation | new row for relation {table} violates check constraint {name} |
| 23503 | foreign_key_violation | integrity constraint violation | insert or update on table {table} violates foreign key constraint {name} |
| 23P01 | exclusion_violation | integrity constraint violation | conflicting key value violates exclusion constraint: {name} |
| 25001 | active_sql_transaction | invalid transaction state | there is already a transaction in progress |
| 25006 | read_only_sql_transaction | invalid transaction state | cannot execute {statement} in a read-only transaction |
| 25P02 | in_failed_sql_transaction | invalid transaction state | current transaction is aborted, commands ignored until end of transaction block |
| 2BP01 | dependent_objects_still_exist | dependent objects still exist | cannot drop type {name} because other objects depend on it: {detail} |
| 42601 | syntax_error | syntax error or access rule violation | syntax error: {detail} |
| 42P01 | undefined_table | syntax error or access rule violation | table does not exist: {name} |
| 42703 | undefined_column | syntax error or access rule violation | column does not exist: {name} |
| 42702 | ambiguous_column | syntax error or access rule violation | column reference {name} is ambiguous |
| 42704 | undefined_object | syntax error or access rule violation | {kind} does not exist: {name} |
| 42P10 | invalid_column_reference | syntax error or access rule violation | for SELECT DISTINCT, ORDER BY expressions must appear in select list |
| 42804 | datatype_mismatch | syntax error or access rule violation | datatype mismatch: {detail} |
| 42830 | invalid_foreign_key | syntax error or access rule violation | there is no unique constraint matching given keys for referenced table {name} |
| 42701 | duplicate_column | syntax error or access rule violation | duplicate column name: {name} |
| 42712 | duplicate_alias | syntax error or access rule violation | table name {name} specified more than once |
| 42P07 | duplicate_table | syntax error or access rule violation | relation already exists: {name} |
| 42P16 | invalid_table_definition | syntax error or access rule violation | invalid table definition: {detail} |
| 42803 | grouping_error | syntax error or access rule violation | column {name} must appear in the GROUP BY clause or be used in an aggregate function |
| 42883 | undefined_function | syntax error or access rule violation | function does not exist: {name} |
| 42P18 | indeterminate_datatype | syntax error or access rule violation | could not determine data type of parameter ${index} |
| 42P19 | invalid_recursion | syntax error or access rule violation | {detail} |
| 42P02 | undefined_parameter | syntax error or access rule violation | there is no parameter ${index} |
| 42P20 | windowing_error | syntax error or access rule violation | {detail} |
| 42P21 | collation_mismatch | syntax error or access rule violation | collation mismatch between explicit collations {left} and {right} |
| 42P22 | indeterminate_collation | syntax error or access rule violation | could not determine which collation to use for string comparison |
| 42710 | duplicate_object | syntax error or access rule violation | constraint {name} for relation {table} already exists |
| 42939 | reserved_name | syntax error or access rule violation | {kind} name {name} is reserved (the jed_ prefix is reserved for system objects) |
| 42809 | wrong_object_type | syntax error or access rule violation | {name} is not {kind} |
| 42622 | name_too_long | syntax error or access rule violation | identifier exceeds the maximum length of {max} bytes |
| 428C9 | generated_always | syntax error or access rule violation | {detail} |
| 42501 | insufficient_privilege | syntax error or access rule violation | permission denied for {object} |
| 0A000 | feature_not_supported | feature not supported | feature not supported: {detail} |
| 54000 | program_limit_exceeded | program limit exceeded | SQL statement exceeds the maximum length of {max} bytes |
| 54001 | statement_too_complex | program limit exceeded | statement too complex: nesting depth exceeds the maximum of {max} |
| 54P01 | cost_limit_exceeded | program limit exceeded | query exceeded the cost limit of {limit} (accrued {cost}) |
| 54P02 | session_cost_limit_exceeded | program limit exceeded | session exceeded the lifetime cost limit of {limit} (accrued {cost}) |
| 54P03 | temp_storage_limit_exceeded | program limit exceeded | temporary table storage exceeded the limit of {limit} bytes |
| 55000 | object_not_in_prerequisite_state | object not in prerequisite state | {detail} |
| 55006 | object_in_use | object not in prerequisite state | {detail} |
| 57014 | query_canceled | operator intervention | canceling statement due to user request |
| 58030 | io_error | system error | I/O error: {detail} |
| 58P01 | undefined_file | system error | database file does not exist: {path} |
| 58P02 | duplicate_file | system error | database file already exists: {path} |
| XX001 | data_corrupted | internal error | on-disk database file is malformed: {detail} |
| XX002 | collation_version_mismatch | internal error | collation version mismatch: {detail} |