
> > I don't know if the problem is isolated to just me, but I wanted to 
> > suggest that we use a parameter for that, which can be configured in the 
> > postgresql.conf, with a default value if it's not set, set to 
> > localhost.
> 
> I think you should first trace down what the problem really is --- is
> your system just misconfigured or is there some fundamental issue that
> we really ought to answer to?

The trouble on AIX is, that getaddrinfo only does a nameservice lookup,
no /etc/hosts. So if your nameservice does not have localhost ...
Same for `hostname`, if nameservice does not resolve `hostname` ...

Andreas

Tue, 20 Jul 2004 09:31:56 +0200
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>
Re: localhost redux
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:
>> I think you should first trace down what the problem really is --- is
>> your system just misconfigured or is there some fundamental issue that
>> we really ought to answer to?

> The trouble on AIX is, that getaddrinfo only does a nameservice lookup,
> no /etc/hosts.

Wouldn't that break many other programs besides Postgres?  But in any
case if your nameserver doesn't resolve localhost, I'd say you'd better
fix your nameserver.  See eg, http://www.faqs.org/rfcs/rfc2606.html

      The ".localhost" TLD has traditionally been statically defined in
      host DNS implementations as having an A record pointing to the
      loop back IP address and is reserved for such use.  Any other use
      would conflict with widely deployed code which assumes this use.

			regards, tom lane

Tue, 20 Jul 2004 08:32:00 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: localhost redux 


Tom Lane wrote:

>"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:
>  
>
>>>I think you should first trace down what the problem really is --- is
>>>your system just misconfigured or is there some fundamental issue that
>>>we really ought to answer to?
>>>      
>>>
>
>  
>
>>The trouble on AIX is, that getaddrinfo only does a nameservice lookup,
>>no /etc/hosts.
>>    
>>
>
>Wouldn't that break many other programs besides Postgres?  
>

Maybe not many use getaddrinfo()

>But in any
>case if your nameserver doesn't resolve localhost, I'd say you'd better
>fix your nameserver.  See eg, http://www.faqs.org/rfcs/rfc2606.html
>
>      The ".localhost" TLD has traditionally been statically defined in
>      host DNS implementations as having an A record pointing to the
>      loop back IP address and is reserved for such use.  Any other use
>      would conflict with widely deployed code which assumes this use.
>  
>

If localhost isn't being resolved correctly are you seeing error 
messages like this on the server log (from pqcomm.c)?

   "could not translate host name \"%s\", service \"%s\" to address: %s"

Of course, using -i or -h "*" on the postmaster would inhibit that, but 
you would expect it in the default setup if localhost resolution fails.


cheers

andrew

Tue, 20 Jul 2004 09:24:57 -0400
Andrew Dunstan <andrew@dunslane.net>
Re: localhost redux
On Tue, Jul 20, 2004 at 08:32:00AM -0400, Tom Lane wrote:
> "Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:
> >> I think you should first trace down what the problem really is --- is
> >> your system just misconfigured or is there some fundamental issue that
> >> we really ought to answer to?
> 
> > The trouble on AIX is, that getaddrinfo only does a nameservice lookup,
> > no /etc/hosts.
> 
> Wouldn't that break many other programs besides Postgres?  But in any
> case if your nameserver doesn't resolve localhost, I'd say you'd better
> fix your nameserver.  See eg, http://www.faqs.org/rfcs/rfc2606.html
> 
>       The ".localhost" TLD has traditionally been statically defined in
>       host DNS implementations as having an A record pointing to the
>       loop back IP address and is reserved for such use.  Any other use
>       would conflict with widely deployed code which assumes this use.

There is no requirement for a recursive resolver (local nameserver) to
have localhost hardwired to return 127.0.0.1. It's not even clearly a
good idea in all cases. If, though, the resolver returns anything for
localhost it must be 127.0.0.1 (or, presumably, ::127.0.0.1).

While many recursive resolvers do have localhost hardwired (to avoid
this sort of issue) relying on it may be overly brave.

It would be nice if the OP could check their recursive resolver to see
what it is returning for a query for localhost ('dig @<nameserver> localhost', 
where <nameserver> is the nameserver listed in /etc/resolv.conf), just to
check whether the DNS vs non-DNS localhost thing is an issue at all. Also
whether they have /etc/netsvc.conf (IIRC) configured to use /etc/hosts
or not.

getaddrinfo() has had strange and unusual bugs on some older versions of
AIX, anyway, so it may not be a DNS issue at all.

Cheers,
  Steve

Tue, 20 Jul 2004 09:25:28 -0700
Steve Atkins <steve@blighty.com>
Re: localhost redux