Constraint Conflict Resolution in SQLite

Constraint Conflict Resolution in SQLite

In most SQL databases, if you have a UNIQUE, NOT NULL, or CHECK constraint on a table and you try to do an UPDATE or INSERT that violates the constraint, the database will abort the operation in progress, back out any prior changes associated with the same UPDATE or INSERT statement, and return an error. This is the default behavior of SQLite, though SQLite also allows one to define alternative ways for dealing with constraint violations. This article describes those alternatives and how to use them.

Conflict Resolution Algorithms

SQLite defines five constraint conflict resolution algorithms as follows:

ROLLBAC