Re: support for Unix Domain socket

From: Lachezar Dobrev <l(dot)dobrev(at)gmail(dot)com>
To: Raj Gandhi <raj01gandhi(at)gmail(dot)com>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: support for Unix Domain socket
Date: 2016-02-26 19:07:28
Message-ID: CA+xsaB0O49sVKWYqa+CFcKVh2Cxcvy2te2H1B_836+CZ=nXP+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Looking at the code it seems that this function is primarily targeted
towards specifying alternate SSL socket implementation, rather than UNIX
sockets. There are a number of socket factories in the PostgreSQL driver:
* org.postgresql.ssl.jdbc4.LibPQFactory
* org.postgresql.ssl.NonValidatingFactory
* org.postgresql.ssl.SingleCertValidatingFactory
and even an abstract base class:
* org.postgresql.ssl.DbKeyStoreSocketFactory

The Java Socket infrastructure is quite tied up to AF_INET and seems it
is infeasible that UNIX Sockets will be supported via a SocketFactory.

2016-02-25 18:11 GMT+02:00 Raj Gandhi <raj01gandhi(at)gmail(dot)com>:

> Hi All,
>
> The change log for Postgres jdbc version 9.4-1208 shows that some support
> was added for unix domain socket
>
> https://jdbc.postgresql.org/documentation/changelog.html#version_9.4-1208
>
> - feat: ability to customize socket factory (e.g. for unix domain
> sockets) PR#457 <https://github.com/pgjdbc/pgjdbc/pull/457> dc1844c
> <https://github.com/pgjdbc/pgjdbc/commit/dc1844c21efbb4a840347d5aaa991384e8883b69>
>
>
> Could someone tell me how to configure JDBC connection to use unix domain
> socket?
> I'm planning to use it with Postgres server version 9.3.8 on Suse.
>
> Thanks,
> Raj
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Alex Nordeen 2016-02-29 10:52:54 Love your content ! (And a proposal)
Previous Message Dave Cramer 2016-02-25 17:32:05 Re: support for Unix Domain socket