Re: location of Unix socket

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Oliver Elphick <olly(at)lfix(dot)co(dot)uk>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: location of Unix socket
Date: 2000-11-27 21:06:50
Message-ID: 200011272106.QAA22218@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> 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.
>
> It's probably cleanest to do that the way you are doing it. However,
> one could argue we should make PQhost() return
> pghost ? pghost : pgunixsocket
> which'd make the external behavior compatible with the way one specifies
> the connection.
>
> Basically, the idea was to *not* have a distinct unixsocket spec
> anywhere in libpq's external API, so that existing apps wouldn't need
> a rewrite to support this feature. Keeping unixsocket separate inside
> the library is a good idea, but it's independent of the API.

Done. New code:

return conn->pghost ? conn->pghost : conn->pgunixsocket;

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-11-27 21:09:46 Re: Initdb not running on beos
Previous Message Tom Lane 2000-11-27 21:04:28 Re: location of Unix socket