postgresql-jdbc.git / summary / log / commit / refs
commit e64b0a2df8dd5e94a24fbb2e2e197f6d7fed7d9a
Author: Dave Cramer <davecramer@gmail.com>
Commit: GitHub <noreply@github.com>
Date: Thu Nov 14 14:13:59 2019 +0000
chore: Document how to use unix domain sockets. (#1607)
* chore: Document how to use unix domain sockets. Thanks @aleksabl
* fix formatting
docs/documentation/head/connect.md | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/docs/documentation/head/connect.md b/docs/documentation/head/connect.md
index b412da03..e6df9ab2 100644
--- a/docs/documentation/head/connect.md
+++ b/docs/documentation/head/connect.md
@@ -473,6 +473,32 @@ Connection conn = DriverManager.getConnection(url);
`assumeMinServerVersion` with parameter >= 9.4 (backend >= 9.4)</p>
+<a name="unix sockets"></a>
+## Unix sockets
+
+Aleksander Blomskøld has forked junixsocket and added a [Unix SocketFactory](https://github.com/fiken/junixsocket/blob/master/junixsocket-common/src/main/java/org/newsclub/net/unix/socketfactory/PostgresqlAFUNIXSocketFactory.java) that works with the driver.
+His code can be found at [https://github.com/fiken/junixsocket](https://github.com/fiken/junixsocket).
+
+Dependencies for junixsocket are :
+
+```xml
+<dependency>
+ <groupId>no.fiken.oss.junixsocket</groupId>
+ <artifactId>junixsocket-common</artifactId>
+ <version>1.0.2</version>
+</dependency>
+<dependency>
+ <groupId>no.fiken.oss.junixsocket</groupId>
+ <artifactId>junixsocket-native-common</artifactId>
+ <version>1.0.2</version>
+</dependency>
+```
+Simply add
+`?socketFactory=org.newsclub.net.unix.socketfactory.PostgresqlAFUNIXSocketFactory&socketFactoryArg=[path-to-the-unix-socket]`
+to the connection URL.
+
+For many distros the default path is /var/run/postgresql/.s.PGSQL.5432
+
<a name="connection-failover"></a>
## Connection Fail-over
[parent: cd0b555c8045]