Rails PostgreSQL socket path

Suppose I have a Postgres cluster running with its Unix domain juice located under / some / custom / path

How to configure my database.yml so that a Rails application can connect to the cluster?

+4
source share
1 answer

In the postgres docs:

host: hostname of the connection. If it starts with a slash, it indicates only a Unix domain connection, not a TCP / IP connection; value is the name of the directory in which the socket file is stored.

The ActiveRecord adapter simply passes through the host parameter, so it is as simple as putting this line in yours database.yml:

host: /path/to/socket/file
+8
source

All Articles