// SQLite error reference

SQLITE_FULL: database or disk is full

A write failed because the disk, or the partition used for temporary files, ran out of space, or the database hit its max_page_count limit.

Result code
SQLITE_FULL
Name
13
Category
Primary result codes
Error message
database or disk is full

What it means

SQLITE_FULL (13) means SQLite couldn't finish a write for lack of space. The SQLite documentation points out a common surprise: the space can run out in the temporary directory rather than where the database lives, because large sorts, index builds and VACUUM write temporary files, and the temp partition may be much smaller.

The same code is returned when the database reaches the page limit set with PRAGMA max_page_count.

Common causes

  • The disk holding the database, its journal or its WAL file is full.
  • The temporary directory is on a small partition (for example a small /tmp), and a big ORDER BY, CREATE INDEX or VACUUM filled it.
  • PRAGMA max_page_count caps the database size.
  • A WAL file that has grown very large because checkpoints can't complete.

How to fix it

  1. Free space on the volume, or move the database to a larger one.

  2. Point temporary files at a larger directory with the SQLITE_TMPDIR or TMPDIR environment variable, or keep them in memory if the data fits.

    PRAGMA temp_store = MEMORY;
  3. Check and raise the page limit if one is set.

    PRAGMA max_page_count;
    PRAGMA max_page_count = 2147483646;
  4. In WAL mode, run a checkpoint to shrink the WAL once readers are done.

    PRAGMA wal_checkpoint(TRUNCATE);

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.