// free reference

Database error codes

Paste an error number, a SQLSTATE or a few words of the message. Each entry gives the exact message text, what it means in plain words, the usual causes and a step-by-step fix with SQL.

Same problem, different code

Every database reports the same everyday failures under its own code. If you know the error on one engine, this is where to find it on the others.

Problem SQL Server PostgreSQL MySQL SQLite Oracle
Duplicate key (unique violation) 2627 23505 1062 SQLITE_CONSTRAINT_UNIQUE ORA-00001
Foreign key violation 547 23503 1452 SQLITE_CONSTRAINT_FOREIGNKEY ORA-02291
NOT NULL violation 515 23502 1048 SQLITE_CONSTRAINT_NOTNULL ORA-01400
Table or view does not exist 208 42P01 1146 — ORA-00942
Unknown column 207 42703 1054 — ORA-00904
Deadlock 1205 40P01 1213 — ORA-00060
Login or password rejected 18456 28P01 1045 — ORA-01017
Value too long for column 8152 22001 1406 — ORA-12899
Lock wait timed out / database busy 1222 55P03 1205 SQLITE_BUSY ORA-00054

Database error FAQ

What is the difference between an error number and a SQLSTATE?

An error number is the vendor’s own code, such as SQL Server 2627 or MySQL 1062. A SQLSTATE is the five-character code from the SQL standard, such as 23505 for a unique violation in PostgreSQL. PostgreSQL reports SQLSTATEs as its main code; MySQL reports both; SQL Server drivers map its numbers to SQLSTATEs through ODBC and JDBC.

Where do the error messages on these pages come from?

From each vendor’s official documentation: Microsoft’s Database Engine events and errors reference, the PostgreSQL error codes appendix, the MySQL server and client error references, the SQLite result codes page and Oracle’s database error messages. Each page links its source.

Does searching send my error message anywhere?

No. With JavaScript on, the search runs in your browser over a list of codes downloaded with the page, so what you type stays on your device. Only with JavaScript turned off does the search box fall back to an ordinary form that asks the server for matches.

// fix it where you write it

One SQL client for every database here

SQLly connects to SQL Server, PostgreSQL, MySQL, SQLite, Oracle and more from one native app for macOS, Windows and Linux.