SQLITE_ERROR_MISSING_COLLSEQ
SQLiteERRORNotableCollationofficial confidence

Missing collating sequence

Production Risk

Medium — queries will fail until the collation is registered.

What this means

SQLITE_ERROR_MISSING_COLLSEQ (257) is an extended result code returned when a prepared statement references a collating sequence that has not been registered with sqlite3_create_collation().

Why it happens
  1. 1Using COLLATE mycollation in SQL where mycollation has not been registered.
  2. 2Database file created with a custom collation that is not registered in the current session.
How to reproduce

sqlite3_prepare() or sqlite3_step() when collation is missing.

trigger — this will error
trigger — this will error
-- SQL using unregistered collation:
SELECT * FROM t ORDER BY name COLLATE MY_COLLATION;
-- If MY_COLLATION not registered → SQLITE_ERROR_MISSING_COLLSEQ

expected output

sqlite3.OperationalError: no such collation sequence: MY_COLLATION

Fix 1

Fix 2

Version notes

Sources
Official documentation ↗

sqlite3.h — SQLITE_ERROR_MISSING_COLLSEQ = 257

sqlite3_create_collation()

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All SQLite errors