Skip to content

Native driver can't connect to UNIX socket with connection string #145

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

Open
sifat144 opened this issue Aug 15, 2023 · 0 comments
Open

Native driver can't connect to UNIX socket with connection string #145

sifat144 opened this issue Aug 15, 2023 · 0 comments

Comments

@sifat144
Copy link
Collaborator

If you use the native API and specify a UNIX socket in the connectionString URL, then the actual string passed to the native API incorrectly includes the port, user, and password parameters. This will force postgres to try to connect using a TCP socket, instead of the given UNIX socket.

This is most likely due to an issue in the ConnectionParameters#getLibpqConnectionString function.

For example, if I specify postgres:///foo for my connectionString, then I would expect this string to be passed to the connect function without alteration. Instead, the connection string ends up as:

user='josh' port='5432' dbname='foo' host=localhost hostaddr=127.0.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant