chore: Add document about enable pgvecto.rs extension when database initialization

Signed-off-by: xieydd <xieydd@gmail.com>
This commit is contained in:
xieydd
2024-04-07 20:18:27 +08:00
parent c004e62de9
commit e0eb7c0607
3 changed files with 13 additions and 6 deletions

View File

@@ -14,7 +14,3 @@ RUN apt install ./pgvectors.deb
USER postgres
# From https://stackoverflow.com/a/42508925
# Note that this way of enabling the plugin only works on database init
# We should investigate alternative ways of enabling it that will always work
COPY install-pgvectors.sql /docker-entrypoint-initdb.d/

View File

@@ -14,3 +14,16 @@ Container images for [cloudnative-pg](https://cloudnative-pg.io/) with the [pgve
> shared_preload_libraries:
> - "vectors.so"
> ```
> [!IMPORTANT]
> The `pgvecto.rs` extension is not enabled by default. You need to enable it and set the search path when database initialization. You can configure it in your Cluster spec:
> ```yaml
> apiVersion: postgresql.cnpg.io/v1
> kind: Cluster
> spec:
> (...)
> bootstrap:
> initdb:
> postInitSQL:
> - ALTER SYSTEM SET search_path TO "$user", public, vectors;
> - CREATE EXTENSION IF NOT EXISTS "vectors";

View File

@@ -1,2 +0,0 @@
ALTER SYSTEM SET shared_preload_libraries = "vectors.so"
ALTER SYSTEM SET search_path = "$user", public, vectors