"PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org> writes:
> 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.
This is not a bug; it's supposed to do that. If you don't like it,
reconfigure your name service (see /etc/nsswitch.conf and /etc/resolv.conf).
regards, tom lane