Client Area

PostgreSQL Database

2 min readPublished 6 Apr 2026Updated 26 Apr 202661 views

In this article

  • 1Provisioning
  • 2Connection
  • 3Using in Your App
  • 4Backups
  • 5Migrations

PostgreSQL Database

Every App Platform plan includes a managed PostgreSQL 16 database.

Provisioning

Your database is provisioned automatically when your app is created (if your plan includes it). No manual setup needed.

Connection

The DATABASE_URL environment variable is automatically injected:

postgresql://user:password@host:5432/dbname

Using in Your App

Node.js (with Prisma):

javascript
// prisma/schema.prisma
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

Python (with SQLAlchemy):

python
import os
from sqlalchemy import create_engine
engine = create_engine(os.environ['DATABASE_URL'])

Go:

go
db, err := sql.Open("postgres", os.Getenv("DATABASE_URL"))

Backups

  • Automated daily backups run every night
  • Backups retained for 7 days
  • Contact support for restore requests

Migrations

Run database migrations during deploy by adding to your Procfile:

release: npx prisma migrate deploy
web: node server.js

The release process runs once before the web process starts.

Limitations

  • No direct database access (no psql connection from your laptop)
  • Access only through your application code
  • Maximum database size depends on your plan's storage limit
  • One database per app (contact support for additional databases)

Monitoring

Check database usage from the Metrics tab:

  • Connection count
  • Storage used
  • Query performance (via your app's logging)

Was this article helpful?

Your feedback helps us improve our documentation

Still need help? Submit a support ticket