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 21:34:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Vincent Predoehl <vpredoehl(at)phoenixwebgroup(dot)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

The 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 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  Or you could
tell the postmaster to use /var/run/postgresql --- there's a
configuration parameter for that somewhere, IIRC.

			regards, tom lane

In response to


pgsql-interfaces by date

Next:From: Alvaro HerreraDate: 2008-07-11 21:48:47
Subject: Re: connecting with libpq interface
Previous:From: Vincent PredoehlDate: 2008-07-11 20:20:48
Subject: Re: connecting with libpq interface

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