Neon gives every feature branch its own full Postgres database in seconds, and you can attach an expiration timestamp so the branch deletes itself when the work is done. The lakebase architecture separates storage and compute, so a branch shares data with its parent until one of them writes. Creating a branch copies no data and doesn't add load to the parent.

How branches and expiration work together

A Neon branch is a copy-on-write clone. Creating one is a metadata operation, so it takes about the same time for a 1 GB database as for a 500 GB one. Add branch expiration (a TTL) and CI jobs and preview environments delete their own branches.

In the Console, the Automatically delete branch after option is checked by default with 1 day selected. You can pick 1 hour, 1 day, or 7 days, or uncheck it. Branches created from the CLI or API have no default expiration. Set it with --expires-at (CLI) or expires_at (API).

# Create a CI branch off the default branch that deletes itself in 2 hours (macOS)
neon branches create \
  --project-id <project-id> \
  --name ci-pr-1234 \
  --expires-at "$(date -u -v+2H +%Y-%m-%dT%H:%M:%SZ)"

The maximum expiration is 30 days from the time you set it. Protected branches, default branches, and branches that have children of their own can't have expirations attached.

Working with sensitive data?

Use schema-only branches (beta) to copy the schema without any production data, then seed the branch with anonymized fixtures.

Wire it into your pipeline

For Vercel projects, the Neon-managed Vercel integration creates a branch for every preview deployment. With Automatically delete obsolete Neon branches turned on, it deletes the Neon branch after the matching Git branch is deleted (cleanup runs the next time a preview deployment is created). With other CI providers, script the same steps with the Neon CLI or API. Create a branch when the PR opens, run tests against its connection string, and delete it (or let it expire) when the PR closes.

How other managed Postgres services compare

ProviderPer-branch databaseAuto-cleanup
NeonCopy-on-write branch, metadata-only createTTL via expires_at (up to 30 days)
SupabasePreview branch per PR, separate instance (database, Auth, Storage)Preview branch deleted when PR is merged or closed
Aurora PostgresAurora clone, copy-on-write at the storage layerNo built-in TTL; up to 15 copy-on-write clones before the next becomes a full copy
RDS for PostgresNo native per-branch copy. Restore-from-snapshot or pg_dumpManual cleanup

Supabase creates preview branches from GitHub pull requests through its GitHub integration, or from the dashboard. Each branch is a separate environment with its own Supabase instance and API credentials. Preview branches start from migrations and seed data, without production data or storage objects. Dashboard branches (public alpha) can copy production data with the Include data option, which requires the PITR add-on. Preview branches are deleted automatically when the PR is merged or closed. See Supabase branching.

Aurora cloning also uses copy-on-write, so a clone shares pages with the source until either side writes. You can create up to 15 copy-on-write clones; after that, the next clone is a full copy. Clones have no built-in expiration, so you delete them yourself. See Aurora cloning.

RDS for Postgres doesn't offer copy-on-write clones. For a per-branch database, you restore a snapshot to a new DB instance or load a pg_dump. Each copy is a separate instance with its own storage.

Vendor details verified on 2026-09-23 against the linked pages.

Try branching for free

The Free plan includes 10 branches per project so you can wire branching into a CI pipeline before paying anything.