Port 6543 is the transaction pooler. In transaction mode each query can land on a different backend connection, so a prepared statement created on one connection isn't there on the next. postgres-js prepares statements by default.
const client = postgres(process.env.DATABASE_URL!, { prepare: false })
export const db = drizzle({ client })Locally it works because you're probably hitting the local database directly, no pooler in between. Remove the retry wrapper after this, it hides real errors.