pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Volkan YAZICI <yazicivo@ttnet.net.tr>
To: Keary Suska <hierophant@pcisys.net>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: PQhost() Returns NULL on Connection
Date: Thu, 27 Apr 2006 18:34:33 +0300
Message-ID: <20060427153433.GA197@alamut> (raw)
In-Reply-To: <C0752F68.29071%hierophant@pcisys.net>
References: <C0752F68.29071%hierophant@pcisys.net>

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.



view thread (4+ messages)  latest in thread

Message-ID: <20060427153433.GA197@alamut>
Permalink:  ../20060427153433.GA197@alamut/
Also on:    postgresql.org/message-id/20060427153433.GA197@alamut

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: yazicivo@ttnet.net.tr, hierophant@pcisys.net
  Subject: Re: PQhost() Returns NULL on Connection
  In-Reply-To: <20060427153433.GA197@alamut>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox