Well, actually, unixsocket can be specified by PQconnectdb. Sounds like
it is a big mess. Care to tame it? I am heading to Japan tomorrow and
don't want to leave it 1/2 done.
> Bruce Momjian writes:
>
> > Am I handling this properly? I hate to be dragging around the unix
> > socket directory name in pghost for too long and hate to be propogating
> > the slash test throughout the code.
>
> ISTM that you could just do this in connectDBStart() where it actually
> decides on AF_UNIX. It's just a different place to do it and you don't
> have to maintain it in two different places (PQconnectdb-style and
> PQsetdbLogin-style).
>
> For symmetry PQhost() should return what was put in as host. Since you
> cannot put in a unix socket as a separate connection parameter there
> cannot be a function PQunixsocket to get one out. In fact, ISTM there
> should not be anything that's explicitly called 'unixsocket'.
>
> I don't like the code in fe-connect.c one bit, it's way messed up.
> Evidently there's even some code in there that allows you to do this:
>
> $ psql tcp:postgresql://localhost:5432/peter
>
> which is certainly a cool idea, only that it ends up with
>
> psql: connectDBStart() -- unknown hostname: J"J"@st
>
> Eventually I think the URL-style is the way to go, especially with SSL
> becoming mainline, so I'd hate to publish too many new functions of
> questionable value for a feature which is not very well thought out yet.
>
> --
> Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/
>
>
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026