---
title: "Postgres extensions"
metaTitle: "Postgres extensions"
metaDescription: "Learn about using Postgres extensions with Prisma Postgres"
tocDepth: 3
toc: true
sidebar_class_name: early-access-badge
---

## Overview

Prisma Postgres supports [PostgreSQL extensions](https://www.postgresql.org/docs/current/sql-createextension.html), such as:

- [`pgvector`](https://github.com/pgvector/pgvector)
- [`citext`](https://www.postgresql.org/docs/current/citext.html)
- [`pg_trgm`](https://www.postgresql.org/docs/current/pgtrgm.html)
- [`fuzzystrmatch`](https://www.postgresql.org/docs/current/fuzzystrmatch.html)
- [`pg_search`](https://pgxn.org/dist/pg_search)
- [`pgcrypto`](https://www.postgresql.org/docs/current/pgcrypto.html)
- [`contrib`](https://www.postgresql.org/docs/current/contrib.html) extensions

See below for a [full list of supported extensions](#all-supported-extensions).

If there are specific extensions you'd like to see in Prisma Postgres, [fill out this form](https://pris.ly/i-want-extensions).

:::warning

Postgres extensions support in Prisma Postgres is currently in [Early Access](/platform/maturity-levels#early-access) and not yet recommended for production scenarios.

:::

## Using extensions with Prisma ORM

Some extensions may already be supported by Prisma Postgres but not yet by Prisma ORM. Native support for some Postgres extensions in Prisma ORM is coming soon. In the meantime, you can still use these extensions with Prisma ORM by using [customized migrations](/orm/prisma-migrate/workflows/customizing-migrations) and [TypedSQL](/orm/prisma-client/using-raw-sql/typedsql) (or another mechanism to send [raw SQL](/orm/prisma-client/using-raw-sql) via in Prisma ORM). 

Let's walk through an example with `pgvector`.

### 1. Create an empty migration file

To customize a migration, first create an empty migration file:

```terminal
npx prisma migrate dev --name add-pgvector --create-only
```

Notice the `--create-only` flag which will create an empty migration file in your migrations directory.

### 2. Create and use the extension in your migration file

In the empty migration file, you can write any custom SQL to be executed in the database:

```sql
-- prisma/migrations/<timestamp>-add-pgvector/migration.sql
CREATE EXTENSION IF NOT EXISTS vector;

CREATE TABLE "Document" (
  id SERIAL PRIMARY KEY,
  title TEXT NOT NULL,
  embedding VECTOR(4) -- use 4 for demo purposes; real-world values are much bigger
);
```

In this case, you:
- install the `pgvector` extension in your database using the `CREATE EXTENSION` statement
- create a `Document` table that uses the `VECTOR` type from that extension

### 3. Execute the migration against the database

Run the following command to execute the migration and apply its changes in your database:

```terminal
npx prisma migrate deploy
```

This command will apply the pending `prisma/migrations/<timestamp>-add-pgvector/migration.sql` migration and create the `Document` table in your database.

### 4. Pull the document table into your Prisma schema

Introspect the database schema with the new `Document` table and update your Prisma schema with it:

<CodeWithResult expanded={true}>
<cmd>

```terminal
npx prisma db pull
```

</cmd>
<cmdResult>

```
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "accelerate.prisma-data.net"

✔ Introspected 3 models and wrote them into prisma/schema.prisma in 3.23s
      
*** WARNING ***

These fields are not supported by Prisma Client, because Prisma currently does not support their types:
  - Model: "Document", field: "embedding", original data type: "vector"

Run prisma generate to generate Prisma Client.
```

</cmdResult>
</CodeWithResult>

The [warning in the CLI output of the command is expected](/orm/prisma-schema/introspection#introspection-warnings-for-unsupported-features) because Prisma ORM doesn't natively support the `VECTOR` type yet.

You Prisma schema will now contain the `Document` model:

```prisma
model Document {
  id        Int                    @id @default(autoincrement())
  title     String
  embedding Unsupported("vector")?
}
```

Because the `VECTOR` type is not yet natively supported by Prisma ORM, it's represented as an [`Unsupported`](/orm/prisma-schema/data-model/models#unsupported-types) type.

### 4. Query with raw SQL

Here's an example query for inserting a new row into the `Document` table:

```ts
await prisma.$executeRaw`
  INSERT INTO "Document" (title, embedding)
  VALUES ('My Title', '[1,22,1,42]'::vector)
`;
```

You can also use [TypedSQL](/orm/prisma-client/using-raw-sql/typedsql) for type-safe SQL queries against your database.

## Temporary limitations

### Limited availability of extensions

Extensions are supported on:
- _all_ instances on Pro and Business plans
- _all_ instances on Free and Starter plans created after August 12th, 2025

Remaining instances will receive support for extensions soon.

If you're using an instance today where PostgreSQL extensions are not supported and you need an extension, [reach out to us](mailto:support@prisma.io) for help.

### No Prisma Studio support for special data types from extensions

Prisma Studio currently doesn't support tables where special types from PostgreSQL extensions are used. It will show an error similar to this one for `pgvector`:

<details>
<summary>Show Prisma Studio error message</summary>

```js
{
  "error": "KnownError { message: \"Raw query failed. Code: `N/A`. Message: `Failed to deserialize column of type 'vector'. If you're using $queryRaw and this column is explicitly marked as `Unsupported` in your Prisma schema, try casting this column to any supported Prisma type such as `String`.`\", meta: Object {\"code\": String(\"N/A\"), \"message\": String(\"Failed to deserialize column of type 'vector'. If you're using $queryRaw and this column is explicitly marked as `Unsupported` in your Prisma schema, try casting this column to any supported Prisma type such as `String`.\")}, error_code: \"P2010\" }",
  "user_facing_error": {
    "is_panic": false,
    "message": "Raw query failed. Code: `N/A`. Message: `Failed to deserialize column of type 'vector'. If you're using $queryRaw and this column is explicitly marked as `Unsupported` in your Prisma schema, try casting this column to any supported Prisma type such as `String`.`",
    "meta": {
      "code": "N/A",
      "message": "Failed to deserialize column of type 'vector'. If you're using $queryRaw and this column is explicitly marked as `Unsupported` in your Prisma schema, try casting this column to any supported Prisma type such as `String`."
    },
    "error_code": "P2010"
  }
}
```

</details>

## All supported extensions

Here’s the full list with corrected URLs:

- [`amcheck`](https://www.postgresql.org/docs/current/amcheck.html)
- [`autoinc`](https://www.postgresql.org/docs/current/contrib-spi.html)
- [`bloom`](https://www.postgresql.org/docs/current/bloom.html)
- [`btree_gin`](https://www.postgresql.org/docs/current/btree-gin.html)
- [`btree_gist`](https://www.postgresql.org/docs/current/btree-gist.html)
- [`citext`](https://www.postgresql.org/docs/current/citext.html)
- [`cube`](https://www.postgresql.org/docs/current/cube.html)
- [`dblink`](https://www.postgresql.org/docs/current/dblink.html)
- [`dict_int`](https://www.postgresql.org/docs/current/dict-int.html)
- [`dict_xsyn`](https://www.postgresql.org/docs/current/dict-xsyn.html)
- [`earthdistance`](https://www.postgresql.org/docs/current/earthdistance.html)
- [`file_fdw`](https://www.postgresql.org/docs/current/file-fdw.html)
- [`fuzzystrmatch`](https://www.postgresql.org/docs/current/fuzzystrmatch.html)
- [`hstore`](https://www.postgresql.org/docs/current/hstore.html)
- [`insert_username`](https://www.postgresql.org/docs/current/contrib-spi.html)
- [`intagg`](https://www.postgresql.org/docs/current/intagg.html)
- [`intarray`](https://www.postgresql.org/docs/current/intarray.html)
- [`isn`](https://www.postgresql.org/docs/current/isn.html)
- [`lo`](https://www.postgresql.org/docs/current/lo.html)
- [`ltree`](https://www.postgresql.org/docs/current/ltree.html)
- [`moddatetime`](https://www.postgresql.org/docs/current/contrib-spi.html)
- [`pageinspect`](https://www.postgresql.org/docs/current/pageinspect.html)
- [`pg_buffercache`](https://www.postgresql.org/docs/current/pgbuffercache.html)
- [`pg_freespacemap`](https://www.postgresql.org/docs/current/pgfreespacemap.html)
- [`pg_prewarm`](https://www.postgresql.org/docs/current/pgprewarm.html)
- [`pg_search`](https://pgxn.org/dist/pg_search/)
- [`pg_stat_statements`](https://www.postgresql.org/docs/current/pgstatstatements.html)
- [`pg_surgery`](https://www.postgresql.org/docs/current/pgsurgery.html)
- [`pg_trgm`](https://www.postgresql.org/docs/current/pgtrgm.html)
- [`pg_visibility`](https://www.postgresql.org/docs/current/pgvisibility.html)
- [`pg_walinspect`](https://www.postgresql.org/docs/current/pgwalinspect.html)
- [`pgcrypto`](https://www.postgresql.org/docs/current/pgcrypto.html)
- [`pgrowlocks`](https://www.postgresql.org/docs/current/pgrowlocks.html)
- [`pgstattuple`](https://www.postgresql.org/docs/current/pgstattuple.html)
- [`plpgsql`](https://www.postgresql.org/docs/current/plpgsql.html)
- [`postgres_fdw`](https://www.postgresql.org/docs/current/postgres-fdw.html)
- [`refint`](https://www.postgresql.org/docs/current/contrib-spi.html)
- [`seg`](https://www.postgresql.org/docs/current/seg.html)
- [`sslinfo`](https://www.postgresql.org/docs/current/sslinfo.html)
- [`tablefunc`](https://www.postgresql.org/docs/current/tablefunc.html)
- [`tcn`](https://www.postgresql.org/docs/current/tcn.html)
- [`tsm_system_rows`](https://www.postgresql.org/docs/current/tsm-system-rows.html)
- [`tsm_system_time`](https://www.postgresql.org/docs/current/tsm-system-time.html)
- [`unaccent`](https://www.postgresql.org/docs/current/unaccent.html)
- [`uuid-ossp`](https://www.postgresql.org/docs/current/uuid-ossp.html)
- [`vector`](https://github.com/pgvector/pgvector)
- [`xml2`](https://www.postgresql.org/docs/current/xml2.html)

## Other extensions are coming soon

Support for the following extensions is going to come soon:

- [`postgis`](https://postgis.net/)

If there are specific extensions you'd like to see, [fill out this form](https://pris.ly/i-want-extensions).