Vercel Postgres Limits
Learn about Vercel Postgres's technical limitations.Vercel Postgres is available on Hobby and Pro plans for customers with existing Vercel Postgres storage. You can create a new Postgres storage with the Neon Marketplace integration if you don't have an existing Vercel Postgres store.
Vercel Postgres provides managed, serverless SQL. It supports nearly all Postgres commands, and is compatible with most Postgres clients. This page outlines the limitations of Vercel Postgres.
Vercel Postgres databases use version 15 of PostgreSQL. The following features are fully supported:
Colocating your database in regions with your Functions ( see available regions )
Access to usage metrics for billing purposes, which you can view in your dashboard under the Usage tab.
Using popular Object Relational Mapping (ORM) tools like Kysely or Prisma
Prisma does not currently support connections with Edge Functions except with the Prisma Data Proxy. We recommend connecting using Kysely or Drizzle instead.
The list below shows what is not currently possible with Vercel Postgres:
- Provisioning a Vercel Postgres database from the Vercel CLI or the Vercel Terraform Provider is not currently supported
- Changing the region of a Vercel Postgres database. You can only select a region when creating a database. To change regions, you must create a new database and migrate your data with a tool like
pg_dump
- Databases for those on Hobby plans are configured with 0.25 logical CPUs
An inactive Vercel Postgres database may experience cold starts.
If your database is not accessed within a 5 minute period, your database will be suspended. The next time it is accessed, you will experience a "cold start" of up to 1 second.
Pro plan users can configure the inactive time threshold to decrease the frequency of cold starts.
Vercel Postgres is a first-party integration with Neon, and many of Neon's features are available with Vercel Postgres. However, there are some differences worth noting:
Database branching is not currently supported, but will be in the future
Configuring multiple Postgres access roles. Primary role credentials can be reset anytime
Vercel Postgres creates a single database as your primary region. You can't change your primary region once your database is created.
We recommend choosing the same region as your Serverless and Edge Functions for the lowest latency.
The following regions are available for Vercel Postgres. You can select a single region, which cannot be changed after your database is created.
Region Code | Region Name | Location |
---|---|---|
cle1 | us-east-2 | Cleveland, USA |
iad1 | us-east-1 | Washington, D.C., USA |
pdx1 | us-west-2 | Portland, USA |
fra1 | eu-central-1 | Frankfurt, Germany |
sin1 | ap-southeast-1 | Singapore |
syd1 | ap-southeast-2 | Sydney, Australia |
Vercel Postgres is a first-party integration with Neon. Supported regions for Vercel Postgres correspond to Neon's available regions. We recommend selecting the same regions for your database as your Edge and Serverless Functions.
Vercel Postgres databases run PostgreSQL version 15. See the Postgres compatibility documentation for more information.
We do not currently support version upgrades. Support for upgrades is coming soon.
@vercel/postgres
reads database credentials from environment variables in process.env
, which are typically populated with variables defined in your .env
file when deploying locally. Vite does not populate process.env
with the contents of your .env
file automatically, meaning you may have issues with SvelteKit, Nuxt, or any other frameworks built on Vite.
There are two workarounds:
-
Populate
process.env
yourself. The following example uses thedotenv-expand
package:vite.config.js// Can also be named nuxt.config.js import dotenvExpand from 'dotenv-expand'; import { loadEnv, defineConfig } from 'vite'; export default defineConfig(({ mode }) => { // Only modify process.env in development mode if (mode === 'development') { const env = loadEnv(mode, process.cwd(), ''); dotenvExpand.expand({ parsed: env }); } return { ... }; });
-
Or, provide the credentials explicitly. The following example creates a client in SvelteKit with
$env/static/private
, which makes the variables in your local.env
files available to your code:src/utils/postgres-pool.tsimport { createPool } from '@vercel/postgres'; import { POSTGRES_URL } from '$env/static/private'; import { createPool } from '@vercel/postgres'; export const pool = createPool({ /* config */ connectionString: POSTGRES_URL, });
Was this helpful?