SQLITE_CONSTRAINT_VTAB
SQLiteERRORNotableConstraintofficial confidence

Virtual table constraint violation

Production Risk

Medium — DML rejected by virtual table constraint.

What this means

SQLITE_CONSTRAINT_VTAB (2323) is returned by a virtual table's xUpdate method to signal a constraint violation within the virtual table's own logic — not a SQLite core constraint.

Why it happens
  1. 1Custom virtual table rejected an INSERT, UPDATE, or DELETE via xUpdate returning SQLITE_CONSTRAINT.
  2. 2FTS virtual table rejecting an operation that violates its constraints.
How to reproduce

DML on a virtual table where xUpdate returns SQLITE_CONSTRAINT.

trigger — this will error
trigger — this will error
-- FTS5 example: duplicate row ID in direct content mode
INSERT INTO fts_table(rowid, content) VALUES(1, 'hello');
INSERT INTO fts_table(rowid, content) VALUES(1, 'world'); -- constraint

expected output

sqlite3.IntegrityError: constraint failed

Fix 1

Fix 2

Sources
Official documentation ↗

sqlite3.h — SQLITE_CONSTRAINT_VTAB = 2323

SQLite virtual table API

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

← All SQLite errors