# pgvector

**Source:** https://promtable.com/glossary/pgvector

> pgvector is the Postgres extension that adds vector data types, similarity search, and indexes (IVFFlat, HNSW) — turning Postgres into a usable vector database for RAG workloads in 2026.

---
pgvector is the Postgres extension that adds vector data types, similarity search, and indexes (IVFFlat, HNSW) — turning Postgres into a usable vector database for RAG workloads in 2026.

pgvector ships vector columns (`vector(1536)`), distance operators (`<->` L2, `<#>` inner product, `<=>` cosine), and ANN indexes (IVFFlat, HNSW). Combined with Postgres, it gives you SQL + vectors in one database — no separate Pinecone / Weaviate / Qdrant instance to operate. Trade-offs: pgvector scales to tens of millions of vectors comfortably; dedicated vector DBs scale further and ship features like hybrid search + reranking out of the box. The 2026 sweet spot: pgvector for RAG-in-the-app teams already on Postgres (Supabase, Neon, AWS RDS), dedicated vector DBs for >100M-vector workloads or where vector is the primary access pattern. Most Supabase RAG apps use pgvector.

## When to use

- RAG apps already running Postgres.
- <100M vectors with mixed SQL + similarity queries.

## Common mistakes

- Skipping the ANN index — sequential scans of vectors collapse under load.
- Picking IVFFlat when HNSW is the better default — HNSW is faster and more accurate for most workloads.

## Related terms

- [vector-database](https://promtable.com/glossary/vector-database)
- [embeddings](https://promtable.com/glossary/embeddings)
- [rag](https://promtable.com/glossary/rag)

## Sources

- [pgvector GitHub](https://github.com/pgvector/pgvector)

*Last updated: 2026-06-01*
---

Original page: https://promtable.com/glossary/pgvector
Maintained by Promtable (https://promtable.com). Content: CC BY 4.0. Cite as "Promtable — https://promtable.com/glossary/pgvector".
Contact: info@vibecodingturkey.com.