Neon Prisma or Drizzle Migration Fails (Pooled Connection)

Share
Workaround available Prisma, Drizzle, Node.js Updated November 14, 2026Based on 3 user reportsHow we research

Quick answer

Run migrations on the direct connection (host without -pooler). Keep the pooled URL for runtime queries only.

Most likely fix: Use a direct URL for migrations

How to fix it

Try these in order — the most common fix is first.

  1. 1. Use a direct URL for migrations

    1. Copy both connection strings from the Connect modal
    2. Prisma 6 and earlier: set directUrl in schema.prisma to the non-pooler URL
    3. Prisma 7: set the url in prisma.config.ts to DATABASE_URL_UNPOOLED
    4. Drizzle: use the non-pooler URL in drizzle.config.ts for drizzle-kit
    Did this fix it?
  2. 2. Add a connect timeout

    1. Append ?sslmode=require&connect_timeout=15 to the migration URL
    Did this fix it?
  3. 3. Avoid session features on the pooler

    1. Use SET LOCAL inside a transaction, or schema-qualified table names instead of SET search_path
    Did this fix it?

Symptoms

prisma migrate or drizzle-kit hangs or errors, P1001 on migrate, SET search_path ignored, prepared statement or session errors.

Why it happens

  • PgBouncer runs in transaction mode: SET, LISTEN/NOTIFY, temp tables and session advisory locks are unreliable
  • Migration tool pointed at the -pooler URL
  • Compute asleep and connect_timeout too short

This guide also covers

  • neon prisma migrate error
  • neon drizzle migration pooler
  • neon prisma p1001
  • neon directUrl

Still not working?

If Neon keeps failing, you're not alone. See every Neon problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us
Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other Neon errors

All 11 Neon errors and fixes →