File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,30 @@ defmodule Ecto.Adapters.Postgres do
126
126
127
127
config :my_app, MyApp.Repo, types: MyApp.PostgresTypes
128
128
129
+ ## Unix socket connection
130
+
131
+ You may desire to communicate with Postgres via Unix sockets.
132
+ If your PG server is started on the same machine as your code, you could check that:
133
+
134
+ ```bash
135
+ % sudo grep unix_socket_directories /var/lib/postgres/data/postgresql.conf
136
+ unix_socket_directories = '/run/postgresql'
137
+ ```
138
+
139
+ ```bash
140
+ % ls -lah /run/postgresql
141
+ итого 4,0K
142
+ drwxr-xr-x 2 postgres postgres 80 июн 4 10:58 .
143
+ drwxr-xr-x 35 root root 840 июн 4 21:02 ..
144
+ srwxrwxrwx 1 postgres postgres 0 июн 5 07:41 .s.PGSQL.5432
145
+ -rw------- 1 postgres postgres 61 июн 5 07:41 .s.PGSQL.5432.lock
146
+ ```
147
+
148
+ So you have postgresql started and listening on the socket.
149
+ Then you may use it as follows:
150
+
151
+ config :your_app, YourApp.Repo,
152
+ socket_dir: "/run/postgresql"
129
153
"""
130
154
131
155
# Inherit all behaviour from Ecto.Adapters.SQL
You can’t perform that action at this time.
0 commit comments