pgvector

Extension that turns PostgreSQL into a vector database — no separate DB needed, uses familiar SQL

pgvector is a PostgreSQL extension that adds vector storage and similarity search to the relational database you already run. Instead of deploying a separate vector database, you add a vector column to existing tables and query it with SQL. It supports exact and approximate search (HNSW and IVFFlat indexes), several vector types (single and half precision, binary and sparse), and distance metrics including L2, cosine, inner product, L1, Hamming and Jaccard. Iterative index scans keep filtered queries accurate when a WHERE clause removes many candidates. It is available on most managed Postgres services, including Supabase, Neon and Amazon RDS. Practical applications: adding semantic search to a web app that already uses Postgres, simple RAG pipelines without extra infrastructure, or queries that JOIN vectors with relational data (users, orders, products). Works well with: PostgreSQL/Supabase · LangChain · LlamaIndex · Dify · LightRAG · pgvectorscale (TigerData, performance add-on)

When to use

  • You already use PostgreSQL and need vector search
  • You need ACID transactions and JOINs with relational data
  • You do not want to run a separate database for vectors

When not to use

  • Vector search over billions of vectors
  • You do not use PostgreSQL

At a glance

Pricing
Free
Deployment
Self-hosted
Difficulty
Intermediate
License
PostgreSQL
Languages
python, js, go, rust
Use cases
vector search, rag pipeline, hybrid search
Last verified
2026-10-22 (official documentation)

Works well with

Alternatives in this category

See all 4 tools in Vector Databases — Vector Storage & Search →

⚖️ Compare Vector Databases

Sources

v7.0