Skip site navigation (1) Skip section navigation (2)

Re: PQhost() Returns NULL on Connection

From: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
To: Keary Suska <hierophant(at)pcisys(dot)net>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: PQhost() Returns NULL on Connection
Date: 2006-04-27 15:34:33
Message-ID: 20060427153433.GA197@alamut (view raw or flat)
Thread:
Lists: pgsql-interfaces
On Apr 26 02:08, Keary Suska wrote:
> If so, is there a way to get the domain socket used?

Below is some source code snippet I thought can help you.

src/interfaces/libpq/fe-connect.c
777 #ifdef HAVE_UNIX_SOCKETS
778         /* pghostaddr and pghost are NULL, so use Unix domain socket */
779         node = NULL;
780         hint.ai_family = AF_UNIX;
781         UNIXSOCK_PATH(portstr, portnum, conn->pgunixsocket);
782 #else

src/include/libpq/pqcomm.h
77 /* Configure the UNIX socket location for the well known port. */
78 
79 #define UNIXSOCK_PATH(path,port,defpath) \
80         snprintf(path, sizeof(path), "%s/.s.PGSQL.%d", \
81                 ((defpath) && *(defpath) != '\0') ? (defpath) : \
82                 DEFAULT_PGSOCKET_DIR, \
83                 (port))


Regards.

In response to

pgsql-interfaces by date

Next:From: Keary SuskaDate: 2006-04-27 16:25:57
Subject: Re: PQhost() Returns NULL on Connection
Previous:From: Tom LaneDate: 2006-04-26 23:59:38
Subject: Re: PQhost() Returns NULL on Connection

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group