SQLITE_ERROR_MISSING_COLLSEQ: no such collation sequence
The SQL, or the schema it touches, uses a collation this connection doesn't have, usually a custom collation registered by another application.
- Result code
SQLITE_ERROR_MISSING_COLLSEQ- Name
257- Category
- Extended result codes
What it means
SQLITE_ERROR_MISSING_COLLSEQ (257) means a statement couldn't be prepared because a collating sequence it names isn't registered on this connection. SQLite has three built-in collations, BINARY, NOCASE and RTRIM; anything else must be registered by the application with sqlite3_create_collation(). A database created by an app that registers its own collation can't be fully used by tools that don't.
Common causes
- The schema declares a column or index with a custom collation, such as one from an ICU extension or an application.
- The extension that provides the collation isn't loaded in this tool or program.
How to fix it
-
Find where the collation is used.
SELECT name, sql FROM sqlite_schema WHERE sql LIKE '%COLLATE%';
-
Load the extension or register the collation in your program before running the statement.
-
Or rebuild the affected column or index with a built-in collation if the custom one isn't needed.
CREATE INDEX idx_users_name ON users(name COLLATE NOCASE);
Related errors
More extended result codes errors
SQLITE_BUSY_RECOVERYanother process is recovering the WALSQLITE_LOCKED_SHAREDCACHErecord locked in shared cacheSQLITE_CONSTRAINT_CHECKCHECK constraint failedSQLITE_ABORT_ROLLBACKstatement aborted by ROLLBACKSQLITE_BUSY_SNAPSHOTstale read can't become a writeSQLITE_IOERR_SHORT_READread returned fewer bytesSQLITE_CANTOPEN_ISDIRthe path is a directorySQLITE_BUSY_TIMEOUTblocking file lock timed out
The code and message text are from the SQLite result and error codes documentation. Browse the full SQLite error list or search every database error.
Work on SQLite in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQLite and the other databases you use.