Skip to content
vectorize

vectorize

pg_vectorize : The simplest way to do vector search on Postgres

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
1830
vectorize
pg_vectorize
0.26.1
RAG
PostgreSQL
Rust
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--sLd--
No
Yes
Yes
Yes
no
no
Relationships
Schemasvectorize
Requires
pg_cron
pgmq
vector
See Also
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.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
PIGSTY
0.26.1
18
17
16
15
14
pg_vectorizepg_cron, pgmq, vector
RPM
PIGSTY
0.26.1
18
17
16
15
14
pg_vectorize_$vpgmq_$v, pg_cron_$v, pgvector_$v
DEB
PIGSTY
0.26.1
18
17
16
15
14
postgresql-$v-pg-vectorizepostgresql-$v-pgmq, postgresql-$v-pg-cron, postgresql-$v-pgvector
Linux / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
el8.aarch64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
el9.x86_64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
el9.aarch64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
el10.x86_64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
el10.aarch64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
d12.x86_64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
d12.aarch64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
d13.x86_64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
d13.aarch64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
u22.x86_64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
u22.aarch64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
u24.x86_64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
u24.aarch64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
u26.x86_64
MISS
MISS
MISS
MISS
MISS
u26.aarch64
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PIGSTY 0.26.1
PackageVersionOSORGSIZEFile URL
pg_vectorize_180.26.1el8.x86_64pigsty7.2 MiBpg_vectorize_18-0.26.1-1PIGSTY.el8.x86_64.rpm
pg_vectorize_180.26.1el8.aarch64pigsty6.8 MiBpg_vectorize_18-0.26.1-1PIGSTY.el8.aarch64.rpm
pg_vectorize_180.26.1el9.x86_64pigsty7.0 MiBpg_vectorize_18-0.26.1-1PIGSTY.el9.x86_64.rpm
pg_vectorize_180.26.1el9.aarch64pigsty6.7 MiBpg_vectorize_18-0.26.1-1PIGSTY.el9.aarch64.rpm
pg_vectorize_180.26.1el10.x86_64pigsty7.0 MiBpg_vectorize_18-0.26.1-1PIGSTY.el10.x86_64.rpm
pg_vectorize_180.26.1el10.aarch64pigsty7.3 MiBpg_vectorize_18-0.26.1-1PIGSTY.el10.aarch64.rpm
postgresql-18-pg-vectorize0.26.1d12.x86_64pigsty6.0 MiBpostgresql-18-pg-vectorize_0.26.1-1PIGSTY~bookworm_amd64.deb
postgresql-18-pg-vectorize0.26.1d12.aarch64pigsty5.5 MiBpostgresql-18-pg-vectorize_0.26.1-1PIGSTY~bookworm_arm64.deb
postgresql-18-pg-vectorize0.26.1d13.x86_64pigsty5.9 MiBpostgresql-18-pg-vectorize_0.26.1-1PIGSTY~trixie_amd64.deb
postgresql-18-pg-vectorize0.26.1d13.aarch64pigsty5.5 MiBpostgresql-18-pg-vectorize_0.26.1-1PIGSTY~trixie_arm64.deb
postgresql-18-pg-vectorize0.26.1u22.x86_64pigsty6.7 MiBpostgresql-18-pg-vectorize_0.26.1-1PIGSTY~jammy_amd64.deb
postgresql-18-pg-vectorize0.26.1u22.aarch64pigsty6.4 MiBpostgresql-18-pg-vectorize_0.26.1-1PIGSTY~jammy_arm64.deb
postgresql-18-pg-vectorize0.26.1u24.x86_64pigsty6.7 MiBpostgresql-18-pg-vectorize_0.26.1-1PIGSTY~noble_amd64.deb
postgresql-18-pg-vectorize0.26.1u24.aarch64pigsty6.4 MiBpostgresql-18-pg-vectorize_0.26.1-1PIGSTY~noble_arm64.deb
postgresql-18-pg-vectorize0.26.1u26.aarch64pigsty6.4 MiBpostgresql-18-pg-vectorize_0.26.1-2PIGSTY~resolute_arm64.deb

Source

pig build pkg pg_vectorize;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install pg_vectorize;		# install via package name, for the active PG version
pig install vectorize;		# install by extension name, for the current active PG version

pig install vectorize -v 18;   # install for PG 18
pig install vectorize -v 17;   # install for PG 17
pig install vectorize -v 16;   # install for PG 16
pig install vectorize -v 15;   # install for PG 15
pig install vectorize -v 14;   # install for PG 14

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'pg_cron, vectorize';

Create this extension with:

CREATE EXTENSION vectorize CASCADE; -- requires pg_cron, pgmq, vector

Usage

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.

Last updated on