How it works
Vectors fill after commit. Automatic sync needs shared_preload_libraries = 'postvec' and a restart. Until an ANN index exists, search scans the vector column sequentially.
Runtime
CREATE EXTENSION exposes the SQL surface immediately. Automatic sync needs shared_preload_libraries = 'postvec', a restart and a worker for that database. SELECT postvec.start_worker() starts that worker now, as a superuser, so the database is served before the restart. Inference runs in the launcher by default; postvec-server runs the same jobs in a separate process.
Write path
Between the application commit and the worker writing the vector, the column is NULL or stale. A commit wakes the worker, so the gap is normally just inference time. See eventual consistency.
search() embeds the query synchronously.
Durable and transient state
| Durable (dumped) | Cache (not dumped) |
|---|---|
| registry, jobs, jobs_dead, migrations | postvec.models, worker heartbeat |
A restore needs matching files, cluster configuration, a model refresh and doctor. Backup has the checklist.
Operational constraints
- Vectors fill after commit.
status()reports readiness. - The worker needs preload to survive a restart. Every database named in
postvec.databasemust exist. A missing name makes the worker fail and respawn on an escalating quarantine, 15 s to 5 min, until the database appears; a worker that lives past 30 s resets the ladder. Managed databases cannot preload: they run the worker in postvec-server instead. - ANN indexes are opt-in. Missing ANN is a common reason search is slow.
index_mode => 'auto'is available; in the extension the build is blocking, while the managed sync worker builds on its own connection withCREATE INDEX CONCURRENTLY. - A new library and
ALTER EXTENSIONbelong in one window. Until then the worker pauses. adopt()'smodelis an assertion. The wrong name makessearch()embed into an incompatible space.