Skip to content
Permalink
Browse files

chore: Document how to use unix domain sockets. (#1607)

* chore: Document how to use unix domain sockets. Thanks @aleksabl

* fix formatting
  • Loading branch information
davecramer committed Nov 14, 2019
1 parent cd0b555 commit e64b0a2df8dd5e94a24fbb2e2e197f6d7fed7d9a
Showing with 26 additions and 0 deletions.
  1. +26 −0 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

0 comments on commit e64b0a2

Please sign in to comment.
You can’t perform that action at this time.