pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Phil Clay <pilf_b@yahoo.com>
To: pgsql-jdbc@postgresql.org, Florian Weimer <fweimer@bfk.de>
To: pierce@hogranch.com
Subject: Re: Connecting over UNIX domain sockets
Date: Mon, 27 Jun 2011 12:02:19 -0700 (PDT)
Message-ID: <852104.71586.qm@web65506.mail.ac4.yahoo.com> (raw)

On 02/08/11 6:55 AM, Florian Weimer wrote:

>I would like to have the option to connect to the database over UNIX
>domain sockets (sidestepping the question of password management).
>
>Even though the JVM knows about UNIX domain sockets, this
>functionality is not exposed to user code, so we'd have to add some
>JNI code.  Would you like to integrate this in some way?  If yes,
>would you prefer a socket-based or libpq-based approach?
>
>-- 
>Florian Weimer                <fweimer(at)bfk(dot)de>
>BFK edv-consulting GmbH       http://www.bfk.de/
>Kriegsstraße 100              tel: +49-721-96201-1
>D-76133 Karlsruhe             fax: +49-721-96201-99



Apologies for resurrecting an old thread, but I'm also interested in using 
domain sockets with postgres' jdbc driver.

To any potential implementors, I wanted to point out something that might be 
useful...

The junixsocket project (http://code.google.com/p/junixsocket/) provides an 
implementation of java.net.Socket that uses domain sockets.  It also provides a 
mysql SocketFactory so that mysql's jdbc driver can be used with domain 
sockets.  
However, contrary to mysql's jdbc driver, postgres' jdbc driver does not appear 
to be designed in a way that a different Socket implementation could be easily 
"plugged in".


If the postgres jdbc project does not want the full burden of managing the 
native code required for domain socket connectivity, perhaps one approach to 
take would be to refactor the postgres jdbc driver in such a way that a 
different mechanism for constructing sockets could be plugged in.  Then an 
implementation could be provided by junixsocket, which already has the native 
distribution mechanism.

Just a thought.

Phil



view thread (7+ messages)  latest in thread

Message-ID: <852104.71586.qm@web65506.mail.ac4.yahoo.com>
Permalink:  ../852104.71586.qm@web65506.mail.ac4.yahoo.com/
Also on:    postgresql.org/message-id/852104.71586.qm@web65506.mail.ac4.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: pilf_b@yahoo.com, fweimer@bfk.de, pierce@hogranch.com
  Subject: Re: Connecting over UNIX domain sockets
  In-Reply-To: <852104.71586.qm@web65506.mail.ac4.yahoo.com>
  References: <852104.71586.qm@web65506.mail.ac4.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox