pgref.dev/sqlite/errors/SQLITE_OK_LOAD_PERMANENTLY
SQLITE_OK_LOAD_PERMANENTLYSUCCESSTier 1 — Safe⚠️ MEDIUM confidence

Extension loaded permanently into SQLite

Category: ExtensionVersions: 3.14.0+

🔴 Production Risk Error

None — success code for extension loading.

What this means

SQLITE_OK_LOAD_PERMANENTLY (256) is returned by an extension's entry point function to signal that the extension should be loaded permanently into the SQLite library rather than just for the current database connection.

Why it happens

  1. 1Not an error — returned intentionally by extension entry points that want permanent registration.

How to reproduce

sqlite3_load_extension() when the extension entry point returns SQLITE_OK_LOAD_PERMANENTLY.

trigger — this will ERROR
/* In C extension code:
int sqlite3_myext_init(sqlite3 *db, char **err, const sqlite3_api_routines *api) {
  SQLITE_EXTENSION_INIT2(api);
  // Register functions ...
  return SQLITE_OK_LOAD_PERMANENTLY; // loads into all future connections too
}
Extension registered for all subsequent database connections.

Fix 1

Why this works

No fix needed — this is the correct return value for stateless extensions that should be globally available.

Version notes

Sources

📚 Official docs: https://www.sqlite.org/rescode.html#ok_load_permanently

🔧 Source ref: sqlite3.h — SQLITE_OK_LOAD_PERMANENTLY = 256

📖 Further reading: SQLite run-time loadable extensions

Confidence assessment

⚠️ MEDIUM confidence

Stable.

See also

📄 Reference pages

SQLite loadable extensions
⚙️ This error reference was generated with AI assistance and reviewed for accuracy. Examples are provided to illustrate common scenarios and may not cover every case. Always test fixes in a development environment before applying to production. Spotted an error? Suggest a correction →