# Extensions (/docs/postgres/database/postgres-extensions) > For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL. Enable and use standard PostgreSQL extensions with Prisma Postgres. Location: Postgres > Database > Extensions Prisma Postgres supports standard [PostgreSQL extensions](https://www.postgresql.org/docs/current/sql-createextension.html). Extensions add functionality such as vector search, full-text search, fuzzy matching, and cryptographic functions to your database. ## Enabling an extension [#enabling-an-extension] Enable any [supported extension](#supported-extensions) using standard SQL: ```sql CREATE EXTENSION IF NOT EXISTS vector; ``` This works from any PostgreSQL client: `psql`, a GUI like TablePlus, a migration file, or a raw SQL query from your application. The `plpgsql` extension is enabled by default on all Prisma Postgres instances. ## Using extensions with Prisma ORM [#using-extensions-with-prisma-orm] Prisma ORM doesn't natively support all extension types yet. For extensions that introduce custom types (like `vector` from pgvector), you can use [customized migrations](https://www.prisma.io/docs/orm/v7/prisma-migrate/workflows/customizing-migrations) and [raw SQL](https://www.prisma.io/docs/orm/v7/prisma-client/using-raw-sql) or [TypedSQL](https://www.prisma.io/docs/orm/v7/prisma-client/using-raw-sql/typedsql) to work with them. The following walkthrough uses pgvector as an example. ### 1. Create an empty migration [#1-create-an-empty-migration] #### bun ```bash bunx prisma migrate dev --name add-pgvector --create-only ``` #### pnpm ```bash pnpm prisma migrate dev --name add-pgvector --create-only ``` #### yarn ```bash yarn prisma migrate dev --name add-pgvector --create-only ``` #### npm ```bash npx prisma migrate dev --name add-pgvector --create-only ``` The `--create-only` flag creates the migration file without applying it, so you can add custom SQL first. ### 2. Add the extension and table to your migration [#2-add-the-extension-and-table-to-your-migration] Edit the generated migration file to enable the extension and create your table: ```sql -- prisma/migrations/-add-pgvector/migration.sql CREATE EXTENSION IF NOT EXISTS vector; CREATE TABLE "Document" ( id SERIAL PRIMARY KEY, title TEXT NOT NULL, embedding VECTOR(4) -- dimensions depend on your embedding model ); ``` ### 3. Apply the migration [#3-apply-the-migration] #### bun ```bash bunx prisma migrate deploy ``` #### pnpm ```bash pnpm prisma migrate deploy ``` #### yarn ```bash yarn prisma migrate deploy ``` #### npm ```bash npx prisma migrate deploy ``` ### 4. Pull the table into your Prisma schema [#4-pull-the-table-into-your-prisma-schema] Introspect your database to update your Prisma schema with the new table: #### bun ```bash bunx prisma db pull ``` #### pnpm ```bash pnpm prisma db pull ``` #### yarn ```bash yarn prisma db pull ``` #### npm ```bash npx prisma db pull ``` Because Prisma ORM doesn't natively support the `VECTOR` type, it will be represented as [`Unsupported`](https://www.prisma.io/docs/orm/v7/prisma-schema/data-model/models#unsupported-types): ```prisma model Document { id Int @id @default(autoincrement()) title String embedding Unsupported("vector")? } ``` ### 5. Query with raw SQL [#5-query-with-raw-sql] Use `$executeRaw` or `$queryRaw` to interact with extension-specific types: ```ts await prisma.$executeRaw` INSERT INTO "Document" (title, embedding) VALUES ('My Title', '[1,22,1,42]'::vector) `; ``` You can also use [TypedSQL](https://www.prisma.io/docs/orm/v7/prisma-client/using-raw-sql/typedsql) for type-safe queries. ## Supported extensions [#supported-extensions] **View all supported extensions** * [`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) *(enabled by default)* * [`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) If you need an extension that is not listed, [request an extension](https://pris.ly/i-want-extensions). ## Limitations [#limitations] * **Prisma Studio** does not support tables that use custom types from extensions (e.g., `VECTOR`). Queries against those tables will return a deserialization error. * **Prisma ORM** does not natively support all extension types. Custom types are represented as [`Unsupported`](https://www.prisma.io/docs/orm/v7/prisma-schema/data-model/models#unsupported-types) in your schema and must be queried with [raw SQL](https://www.prisma.io/docs/orm/v7/prisma-client/using-raw-sql). ## Related pages - [`Backups`](https://www.prisma.io/docs/postgres/database/backups): Manage and restore database backups in Prisma Postgres - [`Connect to Prisma Postgres without Accelerate`](https://www.prisma.io/docs/postgres/database/switch-from-accelerate): Replace a hosted Prisma Postgres Accelerate connection without moving your database or data - [`Connecting to your database`](https://www.prisma.io/docs/postgres/database/connecting-to-your-database): Choose the right Prisma Postgres connection string for your runtime, tool, and workload. - [`Connection pooling`](https://www.prisma.io/docs/postgres/database/connection-pooling): Use Prisma Postgres connection pooling for concurrent application traffic. - [`Query Insights`](https://www.prisma.io/docs/postgres/database/query-insights): Inspect slow queries, connect Prisma calls to SQL, and apply focused fixes with Prisma Postgres.