You build pgvectorscale from source, then integrate the extension into each database in your PostgreSQL environment.
To create a pgvectorscale developer environment, you need the following on your local machine:
-
Development packages:
sudo apt-get install make gcc pkg-config clang postgresql-server-dev-16 libssl-dev
-
Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
cargo install --locked cargo-pgrx
You must reinstall cargo-pgrx whenever you update Rust, cargo-pgrx must be built with the same compiler as pgvectorscale.
-
The pgrx development environment:
cargo pgrx init --pg16 pg_config
-
In Terminal, clone this repository and switch to the extension subdirectory:
git clone https://github.com/timescale/pgvectorscale && \ cd pgvectorscale/pgvectorscale
-
Build pgvectorscale:
cargo pgrx install --release
-
Connect to the database:
psql -d "postgres://<username>@<password>:<port>/<database-name>"
-
Add pgvectorscale to your database:
CREATE EXTENSION IF NOT EXISTS vectorscale CASCADE;