Re: location of Unix socket - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: location of Unix socket
Date
Msg-id 200011272009.PAA15334@candle.pha.pa.us
Whole thread Raw
In response to Re: location of Unix socket  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: location of Unix socket  (Peter Eisentraut <peter_e@gmx.net>)
Re: location of Unix socket  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Bruce Momjian writes:
> 
> > Done.  I did not change PQunixsocket or the unixsocket PQconnectdb
> > connection option.  Should they be changed too?
> 
> They should be removed because PQhost does this now.

I assume you mean PQunixsocket.  As part of the database connection, if
pghost begins with a slash, the value is assigned to pgunixsocket and
pghost is cleared.  Here is the code:
   /* ----------    * Allow unix socket specification in the host name    * ----------    */   if (conn->pghost &&
conn->pghost[0]== '/')    {       if (conn->pgunixsocket)           free(conn->pgunixsocket);       conn->pgunixsocket
=conn->pghost;         conn->pghost = NULL;   }
 

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.

--  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
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Indexing for geographic objects?
Next
From: Cyril VELTER
Date:
Subject: Re: Initdb not running on beos