Re: enabling tcpip_socket by default

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: enabling tcpip_socket by default
Дата
Msg-id 873c5yiugx.fsf@asmodeus.mcnaught.org
обсуждение исходный текст
Ответ на Re: enabling tcpip_socket by default  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:

> Doug McNaught <doug@mcnaught.org> writes:
>
>> Java doesn't support Unix domain sockets.  If you want to use JDBC,
>> you have to use TCP sockets.
>
> That doesn't follow. That just means you can't implement a unix domain socket
> driver using only Java. Is there some reason the driver has to be pure a Java
> driver?

Well, no.  But then you get into the horror that is JNI, and the need
to maintain that glue layer (there's a substantial impedance mismatch
between libpq and the JDBC API) on all platforms.

> I had always assumed the JDBC driver isn't currently pure java and is just an
> API wrapper around libpq. Writing and maintaining a pure java driver would be
> much more work and be much slower for no practical gain.

The JDBC driver is and always has been pure Java, and I'm damn glad.
If your app is all Java, all you have to do is add the driver jar to
the classpath and you're done--no libpq, no .so version mismatches,
etc.  AFAIK (I'm not one of the developers) there are no plans to
write a JNI layer just for Unix sockets.

And I doubt very much that it's that much slower in most cases,
especially with modern JIT compilers.  You'll take a bit of a hit from
the TCP overhead, but in practice for most apps it won't be an issue.

-Doug


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: enabling tcpip_socket by default
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: Call for 7.5 feature completion