Re: Specification of "/" in the host name (for Unix socket support)

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Specification of "/" in the host name (for Unix socket support)
Дата
Msg-id 20030913000501.GC11696@opencloud.com
обсуждение исходный текст
Ответ на Specification of "/" in the host name (for Unix socket support)  (Deepak Bhole <dbhole@redhat.com>)
Ответы Re: Specification of "/" in the host name (for Unix socket
Список pgsql-jdbc
On Fri, Sep 12, 2003 at 03:20:49PM -0400, Deepak Bhole wrote:
>
> Hi,
>
>     We are trying to add support for Unix sockets to the current jdbc (for
> our own release for now). The support is added via gnu classpath,located
> at: http://www.nfrese.net/software/gnu_net_local/overview.html
>
>     Since Unix sockets require specification of path to the socket, the url
> would be something like: jdbc:postgresql:///tmp:5432/template1...
>
>     However, since the path starts with a "/" which is a token separator,
> parseURL in Driver.java cannot handle it, and sets the host to "/". To
> find possible solutions, we referred to the URL RFC located at:
> http://www.w3.org/Addressing/rfc1738.txt
>
>     Section 5, the BNF mentions that "% <hex> <hex>" is an escaped
> character. We are thinking of implementing a similar idea for the jdbc
> url. i.e. the URL jdbc:postgresql:///tmp:5432/template1... would have to
> be specified as jdbc:postgresql://%2Ftmp:5432/template1... , 2F being
> the ascii code for "/" in hex. This would of course necessitate the
> addition of an extra function for parsing tokens but it would be fairly
> simple to implement.
>
>     Does the above mentioned approach seem reasonable or is there another
> format that should be followed?

Have you considered using something like "jdbc:postgresql-unix:...." and
having the parser handle the two cases separately? It's a different
communication path, after all .. "host" and "port" doesn't make much sense
for unix sockets. i.e. use something like:

  jdbc:postgresql-unix:///var/run/postgresql/.s.PGSQL.5432/template1

In fact, since this isn't a network protocol at all, how about dropping the
"common internet scheme syntax" altogether in favour of clarity:

  jdbc:postgresql-unix:/var/run/postgresql/.s.PGSQL.5432:template1

-O

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Specification of "/" in the host name (for Unix socket support)
Следующее
От: Barry Lind
Дата:
Сообщение: Re: Bug #814