You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
unable to connect to postgres using unix socket #257
since this change #210 there does not appear to be a way to connect to a postgres database using a unix socket. DatabaseURL is using urllib urlsplit to parse the dsn, but in the case of a unix socket, the hostname component will be empty since the "hostname" in case of a socket, begins with /. Prior to the mentioned PR that didn't seem to be a blocking issue since the url string itself was passed to the asyncpg backend, however, now the parsed components are sent instead.
urlquoting the hostname part to preserve the / doesn't work either since the hostname component is not unquoted
In [18]: d=databases.DatabaseURL("postgresql://foo:bar@/bleh:5432/somedb")
In [19]: d.hostnameIn [30]: d=databases.DatabaseURL(f"postgresql://foo:bar@{urllib.parse.quote_plus('/bleh')}:5432/somedb")
In [31]: d.hostnameOut[31]: '%2Fbleh'
I did actually attach a PR to fix this issue, but the tests are failing. I haven't bothered to fix those because I haven't heard anything from the maintainers and I don't know if it solves the issue the way they would have wanted.
Activity
ugtar commentedon Oct 22, 2020
sorry, i didn't see the contributor guidelines.. i'll send a message in chat
ugtar commentedon Nov 4, 2020
I've posted messages in both gitter and discus and haven't gotten any response. As far as I can tell this is still an issue
tabrezm commentedon Jan 11, 2021
I'm using the following workaround until the regression can be fixed:
ugtar commentedon Jan 12, 2021
I did actually attach a PR to fix this issue, but the tests are failing. I haven't bothered to fix those because I haven't heard anything from the maintainers and I don't know if it solves the issue the way they would have wanted.
ugtar commentedon Jan 12, 2021
this seems to be fixed by the fix for #250. closing...