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
Able to connect to the postgres unix socket #3013
Comments
I'd be really interested in that too. |
What do you mean by |
To connect to the unix domain socket you have to use the alternative syntax, the URL syntax does not work. Also, the alternative syntax works fine with non-unix domain sockets. |
How can I find docs about connection string? I remember |
Fount it: https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING Also, you still have port number with unix socket seems wrong anyway? |
Having the "port number" is correct as postgres actually uses it. Its described on the link you've found:
|
OK... good to know. Anyway we have found the cause. |
From Unknwon's link: Note, however, that the slash is a reserved character in the hierarchical part of the URI. So, to specify a non-standard Unix-domain socket directory, either omit the host specification in the URI and specify the host as a parameter, or percent-encode the path in the host component of the URI: postgresql:///dbname?host=/var/lib/postgresql Try escaping the slashes :) |
Patch has pushed to fix this issue, please test on |
Thanks! Works fine at rgl/gogs-vagrant@e3de5a3 :-) |
* govendor update code.gitea.io/git Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com> * Greatly improve memory usage Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>
* govendor update code.gitea.io/git Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com> * Greatly improve memory usage Signed-off-by: Duncan Ogilvie <mr.exodia.tpodt@gmail.com>
currently, gogs is using the xorm/pq URL syntax as can be seen at:
https://github.com/gogits/gogs/blob/004fb30ebe403625b2315b284a85124611ba303b/models/models.go#L109
which translates to:
"postgres://git:password@/var/run/postgresql:5432/gogs?sslmode=disable"
but that does not seem to work with an unix domain socket.
but using the alternative syntax does work:
"user=git host=/var/run/postgresql port=5432 dbname=gogs sslmode=disable"
can gogs use the alternative syntax instead?
The text was updated successfully, but these errors were encountered: