lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
9.02k stars 910 forks source link

Support libpq option `hostaddr` #860

Open evantorrie opened 5 years ago

evantorrie commented 5 years ago

Standard libpq supports an option hostaddr which allows the dialer to avoid a DNS lookup. More importantly for my case, it allows a connection with sslmode=verify-full even though my connection is going via a local SSH tunnel to the remote Postgres server.

hochhaus commented 4 years ago

@evantorrie If you supply an IP address to host the underlying call to net.Dial(...) already avoids the DNS lookup. Is your use case to supply both host and hostaddr in a single connection string?