Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Postgres client won't connect when schema is present in DATABASE_URL #18061

Open
ptrxyz opened this issue Mar 11, 2025 · 0 comments
Open
Assignees
Labels
bug Something isn't working sql Something to do with `sql` in the "bun" module

Comments

@ptrxyz
Copy link

ptrxyz commented Mar 11, 2025

What version of Bun is running?

1.2.5+013fdddc6

What platform is your computer?

Linux 6.13.6-arch1-1 x86_64

What steps can reproduce the bug?

When you connection string contains a schema, Bun's internal Postgres client won't be able to connect:

This works: postgresql://admin:admin@localhost:5432/database
This won't: postgresql://admin:admin@localhost:5432/database?schema=alternative

What is the expected behavior?

Since both are correct, I would expect bun to connect in either case (and change the default schema).

What do you see instead?

I see an error instead:

PostgresError: invalid startup packet layout: expected terminator as last byte
 errno: "08P01",
  code: "ERR_POSTGRES_SERVER_ERROR"

Additional information

No response

@ptrxyz ptrxyz added bug Something isn't working needs triage labels Mar 11, 2025
@alii alii added the sql Something to do with `sql` in the "bun" module label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sql Something to do with `sql` in the "bun" module
Projects
None yet
Development

No branches or pull requests

4 participants