Re: [COMMITTERS] pgsql: Give a better error message on invalid hostaddr option.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Give a better error message on invalid hostaddr option.
Date: 2018-07-19 14:07:26
Message-ID: CA+TgmoapFQA30NomGKEaZCu3iN7mF7fux8fbbk9SouVOT2JP7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, Jun 9, 2017 at 6:06 AM, Heikki Linnakangas
<heikki(dot)linnakangas(at)iki(dot)fi> 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.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
fix-could-not-parse-messsage-v1.patch application/octet-stream 529 bytes

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2018-07-19 17:26:11 pgsql: Fix error message when a hostaddr cannot be parsed.
Previous Message Heikki Linnakangas 2018-07-19 13:13:18 Re: pgsql: Fix parallel index and index-only scans to fall back to serial.

Browse pgsql-hackers by date

  From Date Subject
Next Message Jesper Pedersen 2018-07-19 14:18:51 Re: partition tree inspection functions
Previous Message Amit Kapila 2018-07-19 13:53:36 Re: Possible performance regression in version 10.1 with pgbench read-write tests.