From 0b8fc7b4930e01f441aca5b95858e412920f3afd Mon Sep 17 00:00:00 2001 From: Matthew Momjian <50788000+mmomjian@users.noreply.github.com> Date: Wed, 21 May 2025 19:19:04 -0400 Subject: [PATCH] fix(docs): more vchord details (#18435) * more details * typo --- .../administration/postgres-standalone.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/docs/docs/administration/postgres-standalone.md b/docs/docs/administration/postgres-standalone.md index bbdd06847b..95a281d0e1 100644 --- a/docs/docs/administration/postgres-standalone.md +++ b/docs/docs/administration/postgres-standalone.md @@ -80,11 +80,14 @@ The easiest option is to have both extensions installed during the migration: 2. Install `pgvector` (`>= 0.7.0, < 1.0.0`). The easiest way to do this is on Debian/Ubuntu by adding the [PostgreSQL Apt repository][pg-apt] and then running `apt install postgresql-NN-pgvector`, where `NN` is your Postgres version (e.g., `16`) 3. [Install VectorChord][vchord-install] 4. Add `shared_preload_libraries= 'vchord.so, vectors.so'` to your `postgresql.conf`, making sure to include _both_ `vchord.so` and `vectors.so`. You may include other libraries here as well if needed -5. If Immich does not have superuser permissions, run the SQL command `CREATE EXTENSION vchord CASCADE;` using psql or your choice of database client -6. Start Immich and wait for the logs `Reindexed face_index` and `Reindexed clip_index` to be output -7. If Immich does not have superuser permissions, run the SQL command `DROP EXTENSION vectors;` -8. Remove the `vectors.so` entry from the `shared_preload_libraries` setting -9. Uninstall pgvecto.rs (e.g. `apt-get purge vectors-pg14` on Debian-based environments, replacing `pg14` as appropriate). `pgvector` must remain install as it provides the data types used by `vchord` +5. Restart the Postgres database +6. If Immich does not have superuser permissions, run the SQL command `CREATE EXTENSION vchord CASCADE;` using psql or your choice of database client +7. Start Immich and wait for the logs `Reindexed face_index` and `Reindexed clip_index` to be output +8. If Immich does not have superuser permissions, run the SQL command `DROP EXTENSION vectors;` +9. Drop the old schema by running `DROP SCHEMA vectors;` +10. Remove the `vectors.so` entry from the `shared_preload_libraries` setting +11. Restart the Postgres database +12. Uninstall pgvecto.rs (e.g. `apt-get purge vectors-pg14` on Debian-based environments, replacing `pg14` as appropriate). `pgvector` must remain installed as it provides the data types used by `vchord` If it is not possible to have both VectorChord and pgvecto.rs installed at the same time, you can perform the migration with more manual steps: @@ -129,11 +132,5 @@ ALTER TABLE face_search ALTER COLUMN embedding SET DATA TYPE vector(512); Note that VectorChord itself uses pgvector types, so you should not uninstall pgvector after following these steps. -### Common errors - -#### Permission denied for view - -If you get the error `driverError: error: permission denied for view pg_vector_index_stat`, you can fix this by connecting to the Immich database and running `GRANT SELECT ON TABLE pg_vector_index_stat TO ;`. - [vchord-install]: https://docs.vectorchord.ai/vectorchord/getting-started/installation.html [pg-apt]: https://www.postgresql.org/download/linux/#generic