Reference

Vercel Postgres Limits

Learn about Vercel Postgres's technical limitations.
Table of Contents

Vercel Postgres is available on Hobby and Pro plans

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.

Managing your databases using SQL
Deleting databases
Connecting from Serverless and Edge Functions

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:

Accessing the Neon web console is not supported

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 CodeRegion NameLocation
cle1us-east-2Cleveland, USA
iad1us-east-1Washington, D.C., USA
pdx1us-west-2Portland, USA
fra1eu-central-1Frankfurt, Germany
sin1ap-southeast-1Singapore
syd1ap-southeast-2Sydney, 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 the dotenv-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.ts
    import { createPool } from '@vercel/postgres';
    import { POSTGRES_URL } from '$env/static/private';
     
    import { createPool } from '@vercel/postgres';
    export const pool = createPool({
      /* config */
      connectionString: POSTGRES_URL,
    });
Last updated on October 4, 2024