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

Re: connecting with libpq interface

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vincent Predoehl <vpredoehl(at)phoenixwebgroup(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: connecting with libpq interface
Date: 2008-07-11 20:05:25
Message-ID: 19689.1215806725@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
Vincent Predoehl <vpredoehl(at)phoenixwebgroup(dot)com> 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

In response to

Responses

pgsql-interfaces by date

Next:From: Vincent PredoehlDate: 2008-07-11 20:20:48
Subject: Re: connecting with libpq interface
Previous:From: Vincent PredoehlDate: 2008-07-11 16:53:00
Subject: connecting with libpq interface

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