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

bug: Change in behaviour of connection string parsing #2976

Closed
domdomegg opened this issue May 16, 2023 · 4 comments · Fixed by #2977
Closed

bug: Change in behaviour of connection string parsing #2976

domdomegg opened this issue May 16, 2023 · 4 comments · Fixed by #2977

Comments

@domdomegg
Copy link
Contributor

domdomegg commented May 16, 2023

Bug hasn't been fully confirmed yet, but I suspect there is an issue with the recent changes to pg-connection-string.

I think f305419 (PR #2971) may have inadvertently changed the behaviour of connection string parsing, for strings of the form:

postgresql://myuser:mypass@localhost/mydb?host=/cloudsql/my-project:europe-west2:my-sql-instance

This style connection string I believe was previously recommended in the Google Cloud docs for connecting to Google Cloud SQL instances, because the host includes forward slashes (although might not not have been, and doesn't seem to be the case any more).

@domdomegg
Copy link
Contributor Author

Keywords for searchability:

  • database "localhost/dbname" does not exist
  • Google App Engine
  • Google Cloud SQL Node.js connection string

@domdomegg domdomegg changed the title Change in behaviour of connection string parsing bug: Change in behaviour of connection string parsing May 16, 2023
@elithrar
Copy link

cc @petebacondarwin

@Qrtn
Copy link

Qrtn commented May 16, 2023

I'm also experiencing this (database "localhost/dbname" does not exist) when using Google Cloud SQL Auth Proxy.

Additionally, when the password contains an @ sign, I can't get percent-sign encoding to work anymore (%40 for @).

I've pinned pg@8.10.0 and pg-connection-string@2.5.0 for now to resolve this issue.

@petebacondarwin
Copy link
Collaborator

@Qrtn - hopefully the PR put together by @domdomegg will solve the Google Cloud SQL connection string problem.

Can you provide a reproduction of when an encoded @ in the password doesn't work?
There is this test that is passing in the code: https://github.com/brianc/node-postgres/blob/master/packages/pg-connection-string/test/parse.js#L120

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

Successfully merging a pull request may close this issue.

4 participants