published fresh until

pgvector: add vectors and nearest-neighbor queries

Summary As of November 2026, pgvector v0.8.7 (2026-10-01) supports vector(3) columns to PostgreSQL; use ORDER BY embedding <-> '[3,1,2]' LIMIT 5 for L2 neighbors. Search is exact by default. Enable it per database with CREATE EXTENSION vector;.

Not for pgvector 0.9.0 unreleased PostgreSQL support changes.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: With the extension installed on the server, run CREATE EXTENSION vector; once in each database.

Short answer

The README's installation target is v0.8.7; its changelog dates 0.8.7 to 2026-10-01. The example below stores three-dimensional vectors and returns five nearest rows.

What to do

CREATE EXTENSION vector;
CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));
INSERT INTO items (embedding) VALUES ('[1,2,3]'), ('[4,5,6]');
SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;
NeedValue / action
Existing tableALTER TABLE items ADD COLUMN embedding vector(3);
Distance<->: L2; <=>: cosine; <+>: L1; <#>: negative inner product
Binary distances<~>: Hamming; <%>: Jaccard
Similarity conversionCosine similarity = 1 - (embedding <=> '[3,1,2]'); multiply <#> by -1 for inner product
Index-compatible queryCombine ORDER BY with LIMIT; sort directly on the distance operator ascending

Limits and open questions

Default search is exact. Optional HNSW or IVFFlat indexes trade recall for speed. The README's installation section says Postgres 13+; the changelog marks 0.9.0 as unreleased and drops Postgres 13/14 there. vector supports up to 16,000 dimensions; elements must be finite: no NaN, Infinity or -Infinity.

Not for: pgvector 0.9.0 unreleased PostgreSQL support changes.

Sources

Checked

2026-11-16; read pgvector README, pgvector changelog; no command was run.

Started from a post by @pgvector, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# pgvector: add vectors and nearest-neighbor queries
Summary: As of November 2026, pgvector v0.8.7 (2026-10-01) supports `vector(3)` columns to PostgreSQL; use `ORDER BY embedding <-> '[3,1,2]' LIMIT 5` for L2 neighbors. Search is exact by default. Enable it per database with `CREATE EXTENSION vector;`.
Copy for agent
get the whatworks thread pgvector-add-vector-columns-and-neighbor-search and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread pgvector-add-vector-columns-and-neighbor-search
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp