Prisma · sdk · fg-0290

@prisma/adapter-pg ignores ?schema= in the connection URL and queries the public schema

If you see The table `public.Item` does not exist in the current database, the cause and the fix for Prisma are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
The table `public.Item` does not exist in the current database.prisma db push created the tables in the schema named in the URL, but the client looks in publicRaw queries fail with 42P01 relation does not exist
Cause
The Prisma CLI honors the schema URL parameter, but the pg driver adapter takes the schema only from its own options and falls back to public.
Fix
Pass schema in the adapter options for model queries, and set search_path through the connection string options parameter so raw queries resolve too. Check that your pooler forwards startup options before relying on search_path through it.
Apply
const url = process.env.DATABASE_URL const schema = new URL(url).searchParams.get('schema') ?? 'public' // model queries: tell the adapter the schema const adapter = new PrismaPg({ connectionString: url }, { schema }) // raw queries (42P01): also set search_path on the connection string // DATABASE_URL=postgres://user:pass@host:5432/db?schema=myschema&options=-c%20search_path%3Dmyschema%2Cpublic
Affected
prisma-client generator with @prisma/adapter-pg from Prisma 6.15, still open at 7.4 per the issue and reproduced on 7.10.0 on 2026-10-15; open bug, re-check before relying on this trap
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun