Re: Problem connecting to postgres

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "solo" <solo(at)zoot(dot)dnsalias(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem connecting to postgres
Date: 2001-04-26 22:18:47
Message-ID: 25654.988323527@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"solo" <solo(at)zoot(dot)dnsalias(dot)net> writes:
> If i use the -h option to specify the hostname it always fails to connect.

> [solo(at)zoot /root]$ psql -h localhost
> Connection to database 'solo' failed.
> connectDB() -- unknown hostname: localhost

> My localhost is configured properly

> [root(at)zoot /root]# ping -c 1 localhost
> PING localhost.dnsalias.net (127.0.0.1) from 127.0.0.1 : 56(84) bytes of
> data.
> 64 bytes from localhost (127.0.0.1): icmp_seq=0 ttl=255 time=0.3 ms

Hm. It would seem that your psql is linked with a broken resolver
library (or at least a different one than ping is using --- it might
be looking at /etc/hosts instead of DNS, or vice versa).

Since you haven't told us anything about your platform or how you
built/obtained psql, it's impossible to say more than that.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-04-26 22:24:10 Re: status after 7.1 and pgcrypto update / crypt(table.field) ?
Previous Message Tom Lane 2001-04-26 22:15:15 Re: No JOINs in UPDATE ... FROM?