Postgres defaults to unix socket with no host #229

Closes #229

When there's no host given in a postgres connection url, use the unix
domain default socket. Previously, the default was a localhost TCP
connection. This default behavior is more in line with standard postgres
clients out there, like psql.
This commit is contained in:
Matthew Wraith 2021-08-04 15:22:21 -07:00
parent 6243c2b9a9
commit 8175745cfe
2 changed files with 5 additions and 5 deletions

View file

@ -48,7 +48,7 @@ func connectionString(u *url.URL) string {
// default hostname
if hostname == "" {
hostname = "localhost"
query.Set("host", "/var/run/postgresql")
}
// host param overrides url hostname