vectorize
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_vectorize | 0.26.1 | RAG | PostgreSQL | Rust |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 1830 | vectorize | No | Yes | Yes | Yes | No | No | vectorize |
| Related | pg_cron pgmq vector vchord vectorscale pg_summarize pg_tiktoken pg4ml pgml pg_later pg_similarity |
|---|
manually upgraded PGRX from 0.16.1 to 0.17.0 by Vonng; shared_preload_libraries should include vectorize and pg_cron.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.26.1 | 1817161514 | pg_vectorize | pg_cron, pgmq, vector |
| RPM | PIGSTY | 0.26.1 | 1817161514 | pg_vectorize_$v | pgmq_$v, pg_cron_$v, pgvector_$v |
| DEB | PIGSTY | 0.26.1 | 1817161514 | postgresql-$v-pg-vectorize | postgresql-$v-pgmq, postgresql-$v-pg-cron, postgresql-$v-pgvector |
Build
You can build the RPM / DEB packages for pg_vectorize using pig build:
pig build pkg pg_vectorize # build RPM / DEB packages
Install
You can install pg_vectorize directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pg_vectorize; # Install for current active PG version
pig ext install -y pg_vectorize -v 18 # PG 18
pig ext install -y pg_vectorize -v 17 # PG 17
pig ext install -y pg_vectorize -v 16 # PG 16
pig ext install -y pg_vectorize -v 15 # PG 15
pig ext install -y pg_vectorize -v 14 # PG 14
dnf install -y pg_vectorize_18 # PG 18
dnf install -y pg_vectorize_17 # PG 17
dnf install -y pg_vectorize_16 # PG 16
dnf install -y pg_vectorize_15 # PG 15
dnf install -y pg_vectorize_14 # PG 14
apt install -y postgresql-18-pg-vectorize # PG 18
apt install -y postgresql-17-pg-vectorize # PG 17
apt install -y postgresql-16-pg-vectorize # PG 16
apt install -y postgresql-15-pg-vectorize # PG 15
apt install -y postgresql-14-pg-vectorize # PG 14
Preload:
shared_preload_libraries = 'pg_cron, vectorize';
Create Extension:
CREATE EXTENSION vectorize CASCADE; -- requires: pg_cron, pgmq, vector
Usage
- Sources: repo README, extension README, v0.26.1 release
vectorize is the PostgreSQL extension from pg_vectorize. Upstream documents two modes: a standalone HTTP service and the in-database SQL extension. For the packaged extension here, the SQL workflow is the relevant one.
Enable The Extension
ALTER SYSTEM SET shared_preload_libraries = 'vectorize,pg_cron';
ALTER SYSTEM SET cron.database_name = 'postgres';
CREATE EXTENSION vectorize CASCADE;
The extension README lists pg_cron, pgmq, and pgvector as dependencies, plus vectorize.embedding_service_url for the embedding service.
Create A Search Job
The high-level SQL API starts with vectorize.table():
SELECT vectorize.table(
job_name => 'product_search_hf',
relation => 'products',
primary_key => 'product_id',
columns => ARRAY['product_name', 'description'],
transformer => 'sentence-transformers/all-MiniLM-L6-v2',
schedule => 'realtime'
);
The extension README says this creates and maintains an embeddings column for the source table.
Search, RAG, And Direct Model Calls
Search with:
SELECT * FROM vectorize.search(
job_name => 'product_search_hf',
query => 'accessories for mobile devices',
return_columns => ARRAY['product_id', 'product_name'],
num_results => 3
);
Upstream also documents:
vectorize.rag()for retrieval-augmented answers.vectorize.generate()for text generation.vectorize.encode()for direct embedding generation.vectorize.import_embeddings()for loading precomputed vectors.
Update Behavior And v0.26.1 Note
The extension README says schedule => '* * * * *' checks for updates every minute, while schedule => 'realtime' creates triggers for immediate refresh on inserts and updates.
The v0.26.1 release note only says “update dependencies”, so there is no upstream user-facing SQL/API delta to document beyond the existing README surface.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.