Re: Notes on implementing URI syntax for libpq - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Notes on implementing URI syntax for libpq
Date
Msg-id 20111124074042.GA2413@svana.org
Whole thread Raw
In response to Re: Notes on implementing URI syntax for libpq  (Alexander Shulgin <ash@commandprompt.com>)
Responses Re: Notes on implementing URI syntax for libpq
Re: Notes on implementing URI syntax for libpq
Re: Notes on implementing URI syntax for libpq
List pgsql-hackers
On Thu, Nov 24, 2011 at 08:59:56AM +0200, Alexander Shulgin wrote:
> > How would you specifiy a local port/UNIX domain socket?
>
> Missed that in my previous reply.
>
> If host part of the URI points to localhost, the UNIX domain socket would be considered by libpq just as if you would
pass"-h localhost -p 5433". 

Uh, no it doesn't. "-h localhost" uses TCP/IP (try it). This is one
piece of mysql magic we don't copy.  If you want to use the socket you
need to specify "-h /tmp" or wherever you keep it.  Leaving out the -h
parameter also uses UNIX domain sockets.

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.

How about the "service" option, that's a nice way of handling
non-default socket options.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.  -- Arthur Schopenhauer

pgsql-hackers by date:

Previous
From: Alexander Shulgin
Date:
Subject: Re: Notes on implementing URI syntax for libpq
Next
From: Dmitriy Igrishin
Date:
Subject: Re: Notes on implementing URI syntax for libpq