rubenv / sql-migrate

SQL schema migration tool for Go.
MIT License
3.19k stars 273 forks source link

Is it possible to connect to PostgreSQL using UNIX socket? #97

Closed gh67uyyghj closed 6 years ago

gh67uyyghj commented 6 years ago

Hello there! thanks for the great project! My postgresql is configurated in order to listen to sockets only (no tcp ports opened), is it possible to connect to postgres in that case?

pasztorpisti commented 6 years ago

Since sql-migrate uses the pq library for postgres my guess would be that you can use unix sockets.

The godoc of pq says it supports unix sockets. When the hostname of the datasource setting starts with / it should be treated as a domain socket.