// SQLite error reference

SQLITE_INTERRUPT: interrupted

A running statement was stopped by sqlite3_interrupt(), usually because the user or the application cancelled it.

Result code
SQLITE_INTERRUPT
Name
9
Category
Primary result codes
Error message
interrupted

What it means

SQLITE_INTERRUPT (9) is what a statement returns after sqlite3_interrupt() was called on its connection. Applications call it to cancel long queries, often from another thread when the user presses Cancel or a timeout fires. If the interrupted statement was a write inside an explicit transaction, the transaction may have been rolled back automatically.

Common causes

  • The user cancelled the query in the application.
  • The application's own timeout called sqlite3_interrupt().
  • A progress handler that returns non-zero, which also interrupts the statement.

How to fix it

  1. If you cancelled on purpose, nothing is wrong. Check whether an open transaction is still active before continuing, and roll it back if you are unsure.

    ROLLBACK;
  2. If a timeout interrupted a query that should finish, make it faster: check the plan and add an index for the filter or join.

    EXPLAIN QUERY PLAN SELECT * FROM orders WHERE customer_id = 42;
    CREATE INDEX idx_orders_customer ON orders(customer_id);

Related errors

More primary result codes errors

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.

// fewer errors, faster fixes

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.