Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b90d97e

Browse files
committed
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 7b02ba6). Report and fix by Robert Haas. Discussion: https://www.postgresql.org/message-id/CA+TgmoapFQA30NomGKEaZCu3iN7mF7fux8fbbk9SouVOT2JP7w@mail.gmail.com
1 parent 99fdeba commit b90d97e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ connectDBStart(PGconn *conn)
17511751
if (ret || !ch->addrlist)
17521752
appendPQExpBuffer(&conn->errorMessage,
17531753
libpq_gettext("could not parse network address \"%s\": %s\n"),
1754-
ch->host, gai_strerror(ret));
1754+
ch->hostaddr, gai_strerror(ret));
17551755
break;
17561756

17571757
case CHT_UNIX_SOCKET:

0 commit comments

Comments
 (0)