dozeGitHubGet doze
Registry
Check against your doze

Which doze do you run?

doze 0.1.1newest · 2 Jul 2026doze 0.1.02 Jul 2026Stop checkingKept in this browser only. Nothing is sent anywhere.

PostgreSQL

OfficialSigned

Real local Postgres, declared not scripted.

doze/postgres
$ doze add postgres
Newest
0.2.4 · 2 Nov 2026
Needs
any doze
Runs
Postgres 14 – 18
Platforms
macOS arm64 · Linux arm64 · Linux x86_64
Licence
Apache-2.0

vector

pgvectorComing with postgres 0.3

Store embeddings next to the rows they describe and ask for the nearest ones: a vector column type, exact search, and approximate search with HNSW and IVFFlat indexes, by L2, inner product or cosine distance.

Version0.8.7
Postgres14 – 18
PreloadNo
LicencePostgreSQL
Also calledpgvector

Add it

One line: the newest 0.8.x
doze.hcl
module postgres "postgres" {
  version    = 18
  extensions = ["vector"]
}
Pinned to an exact version
doze.hcl
module postgres "postgres" {
  version = 18
  extension "vector" { version = "0.8.7" }
}

doze fetches the build for your Postgres major and platform once, checks its sha256, pins it in doze.lock and runs CREATE EXTENSION vector. Nothing to install, the same on a Mac and on Linux. A newer pin later runs ALTER EXTENSION vector UPDATE for you.

ExtensionPG 14PG 15PG 16PG 17PG 18
vector0.8.7 · coming0.8.7 · coming0.8.7 · coming0.8.7 · coming0.8.7 · coming

Coming with postgres 0.3, which needs doze 0.2.0 or newer.

Builds per platform

One bundle per extension version, Postgres major and platform, built against doze's own Postgres. Once published, each one's sha256 is pinned in doze.lock on first use. Below: Postgres 18.

PlatformBundleState
macOS arm64pgext-vector-pg18-0.8.7-aarch64-apple-darwin.tar.gzBuilt · not published yet
Linux x86_64pgext-vector-pg18-0.8.7-x86_64-unknown-linux-gnu.tar.gzNot built yet
Linux arm64pgext-vector-pg18-0.8.7-aarch64-unknown-linux-gnu.tar.gzNot built yet

Use it from your code

CREATE EXTENSION is done for you. Make a vector column, then order by distance: <-> is L2, <=> cosine, <#> inner product.

SQL, in your migration
create table items (id bigserial primary key, embedding vector(3));
create index on items using hnsw (embedding vector_l2_ops);

select id from items order by embedding <-> '[3,1,2]' limit 5;
Python · pgvector + psycopg
from pgvector.psycopg import register_vector
import numpy as np, os, psycopg

conn = psycopg.connect(os.environ["DATABASE_URL"])
register_vector(conn)
conn.execute(
  "select id from items order by embedding <-> %s limit 5",
  (np.array([3, 1, 2]),))
Node · pgvector + pg
import pg from "pg";
import pgvector from "pgvector/pg";

const client = new pg.Client(process.env.DATABASE_URL);
await client.connect();
await pgvector.registerTypes(client);
await client.query(
  "select id from items order by embedding <-> $1 limit 5",
  [pgvector.toSql([3, 1, 2])]);
Go · pgvector-go + pgx
import (
  "github.com/pgvector/pgvector-go"
  pgxvec "github.com/pgvector/pgvector-go/pgx"
)

pgxvec.RegisterTypes(ctx, conn)
rows, err := conn.Query(ctx,
  "select id from items order by embedding <-> $1 limit 5",
  pgvector.NewVector([]float32{3, 1, 2}))