X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 02E6E11F61E8 for ; Thu, 27 Apr 2006 12:37:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 49074-03 for ; Thu, 27 Apr 2006 12:37:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from fep07.ttnet.net.tr (mail.ttnet.net.tr [212.175.13.129]) by postgresql.org (Postfix) with ESMTP id 7178711F61EE for ; Thu, 27 Apr 2006 12:37:08 -0300 (ADT) Received: from alamut ([88.233.66.191]) by fep07.ttnet.net.tr with ESMTP id <20060427153707.BGKR25116.fep07.ttnet.net.tr@alamut>; Thu, 27 Apr 2006 18:37:07 +0300 Date: Thu, 27 Apr 2006 18:34:33 +0300 From: Volkan YAZICI To: Keary Suska Cc: pgsql-interfaces@postgresql.org Subject: Re: PQhost() Returns NULL on Connection Message-ID: <20060427153433.GA197@alamut> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-NAI-Spam-Rules: 1 Rules triggered BAYES_30=-0.3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/29 X-Sequence-Number: 6120 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.