Re: ECPG could not connect to the database.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ECPG could not connect to the database.
Дата
Msg-id 9826.978897127@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: ECPG could not connect to the database.  (Michael Meskes <meskes@postgresql.org>)
Ответы Re: ECPG could not connect to the database.
Список pgsql-general
Michael Meskes <meskes@postgresql.org> writes:
> Anyone willing to spend some time digging the hostname problem? That is why
> ecpg programs need to specify a hostname and not an IP number to connect,
> while psql for instance works with both?

I do not see how that can be ecpg's fault --- it just does

    this->connection = PQsetdbLogin(NULL, NULL, NULL, NULL, dbname, user, passwd);

which means that any specification of the host must come from the PGHOST
environment variable and will be handled entirely inside libpq.

If ecpg behaves differently from psql (for the same PGHOST setting)
I would imagine that this means different versions of libpq are being
used in the two cases.  It might be worth checking shared library
search paths and so forth to try to identify the difference.

Within recent versions of libpq, the given PGHOST string is simply
passed to gethostbyname().  On the machines I've used, gethostbyname()
will accept numeric IP addresses as well as domain names ... but I
suppose there might be C libraries out there that are pickier.  What
is the platform showing this problem?

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Outer Joins
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Index on Date_Trunc