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

Re: A question about libpgxx

From: jtv(at)xs4all(dot)nl
To: "Randy Yates" <yates(at)ieee(dot)org>
Cc: "H(dot) Hodzic" <hodzicsh(at)bih(dot)net(dot)ba>,pgsql-interfaces(at)postgresql(dot)org
Subject: Re: A question about libpgxx
Date: 2005-01-31 04:09:05
Message-ID: 15363. (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
> I am finding it is not. Either that or I'm setting it up incorrectly.

Thankfully I'm pretty sure it's the latter!  Otherwise you'd see test000
failing.  If the problems start at test001 and everything fails after
that, that's a near-certain indicator that the connection to the database
is failing.  Read on below.

> I've tried to run the test suite by executing "make check" and test001
> is bombing with different types of errors - timeout connection errors
> and "could not translate to address".

This just means that your connection to the database isn't set up
correctly.  It really doesn't have anything to do with libpqxx; the
underlying C library handles this part, and it needs to know which
database you wish to connect to.  For the self-test the best choice is an
empty throwaway database that the test suite can play with.

As documented in the libpqxx README, you must make sure that there is a
database to connect to, and such that the test programs can log into it
using the default settings.  That typically means your own username and no
password, but you can set the documented environment variables to change
these parameters.

In your case the problem appears to be the definition of the host that the
client library wants to connect to.  On Unix, this would be fixed by
setting the environment variable PGHOST to either the IP address of the
database server, or an absolute filesystem path to a local server's
socket.  The latter is likely to be different under Windows, so you may
have to do some documentation digging there.

Once you get the test running, beware that we've just run into a serious
bug in Visual C++ which causes test failures in large-object support.  So
expect a few test cases to fail if you use any version of Visual C++. 
This is a longstanding and particularly nasty compiler bug that has bitten
us before; the vendor appears to be unwilling to fix it.  A workaround has
just been checked into CVS, so if you need large object support on
Windows, either use a different compiler or wait a few days for the 2.4.3


In response to

pgsql-interfaces by date

Next:From: jtvDate: 2005-01-31 04:34:21
Subject: Re: A question about libpgxx
Previous:From: Randy YatesDate: 2005-01-30 11:54:44
Subject: Re: A question about libpgxx

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