Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 80D246505E4 for ; Fri, 11 Jul 2008 17:06:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 62265-03-2 for ; Fri, 11 Jul 2008 17:06:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 91DDF65054C for ; Fri, 11 Jul 2008 17:05:29 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m6BK5PlQ019690; Fri, 11 Jul 2008 16:05:25 -0400 (EDT) To: Vincent Predoehl cc: pgsql-interfaces@postgresql.org Subject: Re: connecting with libpq interface In-reply-to: <8EAB9EDC-BC0E-4C5F-BE0F-20F6DBAE1660@phoenixwebgroup.com> References: <8EAB9EDC-BC0E-4C5F-BE0F-20F6DBAE1660@phoenixwebgroup.com> Comments: In-reply-to Vincent Predoehl message dated "Fri, 11 Jul 2008 11:53:00 -0500" Date: Fri, 11 Jul 2008 16:05:25 -0400 Message-ID: <19689.1215806725@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/8 X-Sequence-Number: 6766 Vincent Predoehl writes: > I am using libpqxx, which is built on libpq and it gives me this > detailed message, so I ran the above test program to determine if it > was libpqxx or libpq. Apparently, libpq is not connecting for some > reason: > terminate called after throwing an instance of 'pqxx::broken_connection' > what(): could not connect to server: No such file or directory > Is the server running locally and accepting > connections on Unix domain socket "/var/run/ > postgresql/.s.PGSQL.5432"? PQerrorMessage() should give you the same info in your standalone libpq program. What I'd wonder is whether the postmaster is using that socket location or not. The more common location is /tmp/.s.PGSQL.5432. You might have a problem with having a copy of libpq that has a different default socket path compiled into it than the postmaster does. regards, tom lane