Docs · Postgres
Supported extensions
OnScalable Postgres databases come with the extensions below installed. Enable the one you need with a single command as your database user; no extra setup or support ticket required.
Enabling an extension
Run the command from psql, a database tool or your app’s migrations (Flyway, Prisma, Alembic, Rails…). Once per database is enough.
CREATE EXTENSION IF NOT EXISTS vector;Bundled extensions
| Extension | What it does |
|---|---|
| vector | pgvector: store embeddings and run similarity search (HNSW, IVFFlat). |
| postgis | PostGIS: geographic types, distance and area queries. |
| postgis_topology | PostGIS topology support. |
| hypopg | Hypothetical indexes: see their effect with EXPLAIN before creating them. |
| pg_stat_statements | Query statistics. Preloaded on the server; just enable it. |
PostgreSQL contrib extensions
| Extension | What it does |
|---|---|
| pgcrypto | Hashing, encryption and gen_random_uuid(). |
| uuid-ossp | UUID generation functions (uuid_generate_v4()). |
| pg_trgm | Trigram similarity; speeds up LIKE/ILIKE searches with an index. |
| unaccent | Accent-insensitive search (e.g. "café" → "cafe"). |
| citext | Case-insensitive text type (handy for email columns). |
| hstore | Key/value column type. |
| ltree | Tree structures and hierarchical paths. |
| btree_gin | GIN indexes for scalar types. |
| btree_gist | GiST indexes for scalar types (e.g. exclusion constraints). |
| fuzzystrmatch | Fuzzy matching such as Levenshtein and soundex. |
| intarray | Operators and indexes for integer arrays. |
| tablefunc | Pivot tables with crosstab. |
| cube, earthdistance | Simple latitude/longitude distance calculations. |
| pg_buffercache, pgstattuple, amcheck | Performance and consistency inspection. |
| postgres_fdw, dblink | Connect to another Postgres database. |
All extensions are available on PostgreSQL 15, 16, 17 and 18.
Example: similarity search with pgvector
CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE documents (
id bigserial PRIMARY KEY,
content text,
embedding vector(1536)
);
CREATE INDEX ON documents USING hnsw (embedding vector_cosine_ops);
SELECT id, content
FROM documents
ORDER BY embedding <=> $1 -- sorgu embedding'i / query embedding
LIMIT 5;Example: distance with PostGIS
CREATE EXTENSION IF NOT EXISTS postgis;
SELECT ST_Distance(
'SRID=4326;POINT(28.9784 41.0082)'::geography, -- İstanbul
'SRID=4326;POINT(32.8597 39.9334)'::geography -- Ankara
) / 1000 AS km;Example: slowest queries
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
SELECT calls, round(mean_exec_time::numeric, 1) AS avg_ms, query
FROM pg_stat_statements
ORDER BY mean_exec_time DESC
LIMIT 10;Need an extension that is not listed? Contact us
