migrate icon indicating copy to clipboard operation
migrate copied to clipboard

[question] Postgresql unix domain socket

Open sashabaranov opened this issue 8 years ago • 1 comments

Can someone give definite example of how to connect to postgresql via unix socket?

I've tried the following:

postgres://user:pass@/path/to/sock.sock/db?sslmode=disable
postgres://user:pass@/path/to/sock/dir/db?sslmode=disable
postgres://user:pass@localhost/db?sslmode=disable&host=/path/to/sock.sock

Neither seem to work.

With ordinary lib/pq I use:

db, err := sql.Open("postgres", "user=user password=pass host=/path/to/sock/dir dbname=db sslmode=disable")

sashabaranov avatar Oct 12 '17 16:10 sashabaranov

Interesting. I don't think we have tests for this. I think we would need to implement this.

mattes avatar Oct 12 '17 18:10 mattes