Re: A question about libpgxx - Mailing list pgsql-interfaces

From jtv@xs4all.nl
Subject Re: A question about libpgxx
Date
Msg-id 13279.202.47.227.16.1107146061.squirrel@202.47.227.16
Whole thread Raw
In response to Re: A question about libpgxx  (Randy Yates <yates@ieee.org>)
List pgsql-interfaces
> I am finding it is not. Either that or I'm setting it up incorrectly.
>
> 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 xyz.org to address".

Here's the documentation on how to specify the parameters of the
connection.  This is from the libpq documentation:

http://www.postgresql.org/docs/7.3/static/libpq-connect.html

> host
>
>    Name of host to connect to. If this begins with a slash, it specifies
Unix-domain communication rather than TCP/IP communication; the value
is the name of the directory in which the socket file is stored. The
default is to connect to a Unix-domain socket in /tmp.
>
> hostaddr
>
>    IP address of host to connect to. This should be in standard
numbers-and-dots form, as used by the BSD functions inet_aton et al.
If a nonzero-length string is specified, TCP/IP communication is
used.

Therefore, using a hostname like xyz.org (is that a preconfigured "please
edit me" default?) with hostaddr is clearly wrong--the option is meant for
numeric IP addresses only, for the specific case that you don't wish to
allow hostname lookups.  Using "host" instead of "hostaddr" (or simply
setting the PGHOST environment variable instead) is going to fix at least
that side of the problem.


Jeroen




pgsql-interfaces by date:

Previous
From: jtv@xs4all.nl
Date:
Subject: Re: A question about libpgxx
Next
From: "Satheesh Mani"
Date:
Subject: Re: PGXML