mattes / migrate

Database migrations. CLI and Golang library.
Other
2.29k stars 326 forks source link

[question] Postgresql unix domain socket #291

Open sashabaranov opened 7 years ago

sashabaranov commented 7 years ago

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")
mattes commented 7 years ago

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