Re: connecting with libpq interface - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: connecting with libpq interface
Date
Msg-id 28361.1215812085@sss.pgh.pa.us
Whole thread Raw
In response to Re: connecting with libpq interface  (Vincent Predoehl <vpredoehl@phoenixwebgroup.com>)
Responses Re: connecting with libpq interface  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-interfaces
Vincent Predoehl <vpredoehl@phoenixwebgroup.com> writes:
> On Jul 11, 2008, at 3:05 PM, Tom Lane wrote:
>>> 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"?
>> 
>> 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.

> Do you know where can I find that in the source code?  I used the  
> 8.3.3 source from postgresql.org.

The postgresql.org sources will most certainly default to using /tmp.
What I suspect now is that you have a postmaster that you built from
source, and it's using /tmp (did you look for the socket file to
verify?), but your client program is linking to an Ubuntu-supplied
version of libpq.so that has a nonstandard socket location built in.
You'll need to fool with ldconfig or local equivalent to get the
dynamic linker to select the right copy of libpq.so.  Or you could
tell the postmaster to use /var/run/postgresql --- there's a
configuration parameter for that somewhere, IIRC.
        regards, tom lane


pgsql-interfaces by date:

Previous
From: Vincent Predoehl
Date:
Subject: Re: connecting with libpq interface
Next
From: Alvaro Herrera
Date:
Subject: Re: connecting with libpq interface