Re: BUG #1110: psql -h localhost consults the nameservice - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: BUG #1110: psql -h localhost consults the nameservice
Date
Msg-id 200403191328.i2JDSVb27611@candle.pha.pa.us
Whole thread Raw
In response to BUG #1110: psql -h localhost consults the nameservice  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
List pgsql-bugs
PostgreSQL Bugs List wrote:
>
> The following bug has been logged online:
>
> Bug reference:      1110
> Logged by:          Michael Enke
>
> Email address:      michael.enke@wincor-nixdorf.com
>
> PostgreSQL version: 7.4
>
> Operating system:   Linux
>
> Description:        psql -h localhost consults the nameservice
>
> Details:
>
> If I call "psql -h localhost" it is very slow
> compared to "psql -h 127.0.0.1" since for "localhost"
> the nameservice is consulted.
>
> It is reproducable best in a loop. Call 50 times:
> "psql -h localhost" takes 6 seconds
> "psql -h 127.0.0.1" takes 0.6 seconds
> This was not the case for psql from version 7.3
> May be this has something to do with changes for IP v6.

Odds are your nameserver is messed up.  Try:

    host localhost

and see if that is slow.  I bet it is.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-bugs by date:

Previous
From: "Dave Page"
Date:
Subject: BUG #1108: Just testing...
Next
From: Tom Lane
Date:
Subject: Re: BUG #1110: psql -h localhost consults the nameservice