Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fgCjL-0005QU-68 for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Jul 2018 17:28:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fgCjJ-0004Mq-K7 for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Jul 2018 17:28:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fgCjJ-0004Mi-DG for pgsql-hackers@lists.postgresql.org; Thu, 19 Jul 2018 17:28:41 +0000 Received: from mail-lj1-f193.google.com ([209.85.208.193]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fgCjH-0004Ft-AG for pgsql-hackers@postgresql.org; Thu, 19 Jul 2018 17:28:40 +0000 Received: by mail-lj1-f193.google.com with SMTP id s12-v6so8667619ljj.0 for ; Thu, 19 Jul 2018 10:28:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5MmBO9yhKefQBpnVbeD9UDFaRixf0Bz3pyxPsVvbR5s=; b=sW0l4sRqHNMcY4Q+YIWmCHPdiCz78GSi7SLS8mDSCqvmTN9bUFraCSDoWGrL87RU2p HRl0tsm8QsW/h/zSpcROim+WOhmskvdgfEgdzpcb2a+YYCKgCDlUsIHowGbD3qLCIrv3 ur0DVYVj+pD5YrVsHThd+bE+fcWo3CwSZQ0eMtazrOINRWnDj/CwpnYv7FrscXQRHEUj 29UqO5Yoe/lZXpddvb5LKzalfmunVSEqoBJNXciyMKBQarOowE6Bt2dpQGRy/wLFzu/4 JmLrvfLSkFZkPEm0trnKwG1mU1XcbrLMiK4qa/Nzfl2K5nLZ8uMwtlGBTdZyNPmWR1QG A0hw== X-Gm-Message-State: AOUpUlHrsUmMRAK/FEhj+NsLTU7urAxrWbtGl0xS4GCKa4KfXTTZzYJ1 lGBNqzeZ1Fn3uehbwkBN7c+eHATq X-Google-Smtp-Source: AAOMgpctgu2UoKCsRYJyTUwf7Yxr9n4JOIOE4qp6i8hj6wksU7tpXIRj1NjZcR7VdH21H7kHOTEP5w== X-Received: by 2002:a2e:47c8:: with SMTP id u191-v6mr8184547lja.58.1532021317780; Thu, 19 Jul 2018 10:28:37 -0700 (PDT) Received: from [192.168.1.11] (dsl-hkibng32-54fbf8-78.dhcp.inet.fi. [84.251.248.78]) by smtp.gmail.com with ESMTPSA id b87-v6sm1035560lfh.33.2018.07.19.10.28.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jul 2018 10:28:36 -0700 (PDT) Subject: Re: [COMMITTERS] pgsql: Give a better error message on invalid hostaddr option. To: Robert Haas , Heikki Linnakangas Cc: "pgsql-hackers@postgresql.org" References: From: Heikki Linnakangas Message-ID: <771d7899-9013-64fc-51db-78c3ea1eb940@iki.fi> Date: Thu, 19 Jul 2018 20:28:36 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 19/07/18 17:07, Robert Haas wrote: > On Fri, Jun 9, 2017 at 6:06 AM, Heikki Linnakangas > wrote: >> Give a better error message on invalid hostaddr option. >> >> If you accidentally pass a host name in the hostaddr option, e.g. >> hostaddr=localhost, you get an error like: >> >> psql: could not translate host name "localhost" to address: Name or service not known >> >> That's a bit confusing, because it implies that we tried to look up >> "localhost" in DNS, but it failed. To make it more clear that we tried to >> parse "localhost" as a numeric network address, change the message to: >> >> psql: could not parse network address "localhost": Name or service not known > > This commit doesn't seem to deliver the behavior described in the > commit message. Instead, I get: > > [rhaas pgsql]$ psql 'hostaddr=localhost' > psql: could not parse network address "(null)": nodename nor servname > provided, or not known > > Proposed patch attached. Seems that I broke this shortly afterwards, by commit 7b02ba62e9. Pushed, thanks! - Heikki