Обсуждение: Re: [HACKERS] Postgres 6.4.2 connection problem solved

Поиск
Список
Период
Сортировка

Re: [HACKERS] Postgres 6.4.2 connection problem solved

От
Andy Farrell
Дата:
Reply to:   Re: [HACKERS] Postgres 6.4.2 connection problem solved
FYI,
 The machine we tried to run postgres on had the 'localhost' entry in its hosts file spelled incorrectly (i.e.,
'localhosts'). After updating the hosts file, postgres ran fine.
 
 I would have thought we would have recieved an error other than 'getprotobyname failed'.  I would have expected an
errormore like the error messages you recieve when trying to connect to postgres from a remote client without adding
theclient's IP in the pg_hba.conf file.  In any case, the problem has been solved, now I can go play golf....
 

Thanks to those who replied-





Re: [HACKERS] Postgres 6.4.2 connection problem solved

От
Tom Lane
Дата:
Andy Farrell <andy_farrell@itd.sterling.com> writes:
>   The machine we tried to run postgres on had the 'localhost' entry in
>   its hosts file spelled incorrectly (i.e., 'localhosts').  After
>   updating the hosts file, postgres ran fine.

That makes sense, if you were using TCP connection protocol rather
than a Unix-domain socket...

>   I would have thought we would have recieved an error other than
>   'getprotobyname failed'.

I'll say.  How the heck did it manage to get through gethostbyname()
and connect(), which are the routines that *should* have failed, and
then spit up at getprotobyname() (which should be nothing more than a
simple scan of /etc/protocols, and should certainly not care what is
in /etc/hosts)?

There is more than meets the eye here.  If you have time, would you
restore /etc/hosts to its broken condition and trace through connectDB
a little more carefully?  I would like to know what *really* went
wrong.
        regards, tom lane