Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WUoqW-00054x-7W for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Apr 2014 02:54:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WUoqV-0001Bb-Kz for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Apr 2014 02:54:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WUoqT-0001BQ-PA for pgsql-bugs@postgresql.org; Tue, 01 Apr 2014 02:54:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WUopw-0008KX-F6 for pgsql-bugs@postgresql.org; Tue, 01 Apr 2014 02:54:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s312s0fu000853; Mon, 31 Mar 2014 22:54:00 -0400 From: Tom Lane To: Alvaro Herrera cc: Mike Blackwell , pgsql-bugs@postgresql.org Subject: Re: BUG #9518: temporary login failure - "missing pg_hba entry" In-reply-to: <20140401021720.GC9567@eldon.alvh.no-ip.org> References: <20140310145444.1230.51833@wrigleys.postgresql.org> <20140310145859.GK4759@eldon.alvh.no-ip.org> <20140401021720.GC9567@eldon.alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Mon, 31 Mar 2014 23:17:21 -0300" Date: Mon, 31 Mar 2014 22:54:00 -0400 Message-ID: <852.1396320840@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Alvaro Herrera writes: > Mike Blackwell wrote: >>​This particular host is listed in pg_hba.conf by host name rather than by >> IP address. Is it possible this error is due to an intermittent DNS >> failure?​ > Doesn't look like it; that code has this: > ret = getaddrinfo(port->remote_hostname, NULL, NULL, &gai_result); > if (ret != 0) > ereport(ERROR, > (errmsg("could not translate host name \"%s\" to address: %s", > port->remote_hostname, gai_strerror(ret)))); Don't think that proves a lot. Before we do that, we attempt to do a reverse IP-to-name lookup, and AFAICS if that fails we just return silently. The code you're quoting complains if the later cross-check on the name's forward DNS resolution fails --- but we might never get to that. IOW, it looks to me like intermittent failures in the reverse DNS lookup could disable matching by hostname, and nothing would be said in the postmaster log. Why is there no complaint if check_hostname's call to pg_getnameinfo_all (line 600 in HEAD) fails? regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs