Excerpts from Alexander Shulgin's message of jue nov 24 05:58:57 -0300 2011:

> Excerpts from Martijn van Oosterhout's message of Thu Nov 24 09:40:42 +0200 
> 2011:

> > Which does raise the valid question of how to represent that in URI
> > syntax. SQLAlchemy (for example) doesn't try with it's URL syntax, to
> > connect to a non-default UNIX socket, you need to create the URL object
> > directly.
> 
> Well, whatever syntax we're going to invent here: it is not supported by the 
> JDBC driver.
> 
>  "Because Java does not support using unix sockets the PostgreSQL™ server 
> must be configured to allow TCP/IP connections."
> 
>   http://jdbc.postgresql.org/documentation/head/prepare.html
> 
> Or, this has to be done not in the URI syntax itself, but with the use of 
> some external option.
> 
> Or maybe we can just add &unixsocket=... and hope that JDBC simply ignores 
> that?

I think this is misguided.  We don't need to have a URL that specifies a
Unix socket to work on JDBC, because it's obviously not going to work;
if you just have it "ignore" the &unixsocket bit, then the URI is no
longer the same and you could have it connecting to a completely
different server.

I think we should just propose something that will not work in JDBC.
Surely if the user wants an URL that works both in JDBC and libpq, they
should just not use a Unix-domain-socket specifying URI in the first
place.

What about something like
postgresql://<path-to-dir>:port/database

where the < > are present, i.e. if you want to specify a different
socket directory,

postgresql://</var/run/postgresql>:5433/database

and if you just want to use the default location,

postgresql://<>:5433/database


A coworker also suggested using a different designator:

postgresqli:///path/to/socket:5433/database
postgresqli://:5433/database


> > How about the "service" option, that's a nice way of handling
> > non-default socket options.
> 
> The service handling isn't going to be affected with the proposed approach.  
> So, if PGSERVICE is given, the options from the service file are applied 
> after the URI is parsed, filling any parameters not set using previous 
> methods.

I think the question is allowing the URI to specify a service.

-- 
Álvaro Herrera <alvhe...@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to