Extensions
A project can turn on Postgres extensions from a fixed list. Open Integrations > Postgres extensions in the console to see the list and turn one on, or use the API below.
What is available
Section titled “What is available”The list includes, among others:
| Extension | Use it for |
|---|---|
pgvector |
Vector similarity search over embeddings |
pg_trgm |
Fuzzy text search and autocomplete |
postgis |
Geographic data |
pgcrypto, uuid-ossp |
Hashing and UUID functions |
citext, hstore, ltree, unaccent |
Case-insensitive text, key-value pairs, tree paths and accent-insensitive search |
GET /database/extensions/available returns the full list. Some extensions, such as pg_stat_statements, are available only on a dedicated database, because on the shared database they would read or change state that other projects share.
Turn an extension on
Section titled “Turn an extension on”CREATE EXTENSION is refused in the SQL editor. Turn an extension on in the console, or with the extensions API and a console access token:
curl -X POST https://api.vaif.studio/database/extensions/project/$PROJECT_ID/install \ -H "Authorization: Bearer $VAIF_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "extensionId": "pg_trgm" }'Turning one on needs the admin role on the project, and a plan that includes extensions; see Plans. GET /database/extensions/project/{projectId} lists what is turned on, and DELETE /database/extensions/project/{projectId}/{extensionId} turns one off.
Turn pgvector on with "extensionId": "pgvector". Postgres names it vector, which is the name you see in pg_extension.
What the Schema Engine can create
Section titled “What the Schema Engine can create”Tables are created through the Schema Engine, from the Schema page or a SQL file applied with vaif db push. It applies the column types listed in Schema management and plain indexes on columns. Column types that an extension adds, such as vector or geography, and other index methods, such as GIN, are not among them: a SQL file that declares one is refused, and an index of another method is skipped with a warning. See Migrations.