postgres.git / summary / log / commit / refs

commit    ff4fb4cc1bde61a536a30834d19be088828a350e
Author:   Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:     Thu Jul 19 17:24:29 2018 +0000
First released in: 12.0, 10.5, 11.0

    Fix error message when a hostaddr cannot be parsed.
    
    We were incorrectly passing hostname, not hostaddr, in the error message,
    and because of that, you got:
    
    $ psql 'hostaddr=foo'
    psql: could not parse network address "(null)": Name or service not known
    
    Backpatch to v10, where this was broken (by commit 7b02ba62e9).
    
    Report and fix by Robert Haas.
    
    Discussion: https://www.postgresql.org/message-id/CA+TgmoapFQA30NomGKEaZCu3iN7mF7fux8fbbk9SouVOT2JP7w@mail.gmail.com


src/interfaces/libpq/fe-connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 92e91c4895a..67033b75b7b 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -1744,7 +1744,7 @@ connectDBStart(PGconn *conn) if (ret || !ch->addrlist) appendPQExpBuffer(&conn->errorMessage, libpq_gettext("could not parse network address \"%s\": %s\n"), - ch->host, gai_strerror(ret)); + ch->hostaddr, gai_strerror(ret)); break; case CHT_UNIX_SOCKET: [parent: a1dc4ea02044]