Container images for Crunchy Postgres for Kubernetes with VectorChord extension installed.
Important
The postgres configuration needs to be altered to enable the extension. You can do this by setting shared_preload_libraries in your PostgresCluster spec:
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
spec:
(...)
config:
parameters:
shared_preload_libraries: "vchord.so"Or if you're still using the operator version older than 5.8.0:
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
spec:
(...)
patroni:
dynamicConfiguration:
postgresql:
parameters:
shared_preload_libraries: "vchord.so"Important
The "VectorChord" extension is not enabled by default. You need to enable it and set the search path when initializing the database. You can configure it in your PostgresCluster spec:
apiVersion: v1
kind: ConfigMap
metadata:
name: enable-vchord
data:
init.sql: |-
/c mydatabasename\\
CREATE EXTENSION IF NOT EXISTS vchord CASCADE;
---
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
spec:
(...)
databaseInitSQL:
name: enable-vchord
key: init.sqlTo build the Dockerfile locally, you need to pass the CNPG_TAG and VECTORCHORD_TAG args.
For example:
docker build . --build-arg="CDPG_TAG=ubi9-17.5-2520" --build-arg="VECTORCHORD_TAG=0.4.2"I shamelessly took a lot of code from cloudnative-vectorchord.