aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/psql/command.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index d4274887484..a30a5f8ea0a 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -596,25 +596,7 @@ exec_command_conninfo(PsqlScanState scan_state, bool active_branch)
printf(_("You are currently not connected to a database.\n"));
else
{
- char *host;
- PQconninfoOption *connOptions;
- PQconninfoOption *option;
-
- host = PQhost(pset.db);
- /* A usable "hostaddr" overrides the basic sense of host. */
- connOptions = PQconninfo(pset.db);
- if (connOptions == NULL)
- {
- psql_error("out of memory\n");
- exit(EXIT_FAILURE);
- }
- for (option = connOptions; option && option->keyword; option++)
- if (strcmp(option->keyword, "hostaddr") == 0)
- {
- if (option->val != NULL && option->val[0] != '\0')
- host = option->val;
- break;
- }
+ char *host = PQhost(pset.db);
/* If the host is an absolute path, the connection is via socket */
if (is_absolute_path(host))
@@ -624,8 +606,6 @@ exec_command_conninfo(PsqlScanState scan_state, bool active_branch)
printf(_("You are connected to database \"%s\" as user \"%s\" on host \"%s\" at port \"%s\".\n"),
db, PQuser(pset.db), host, PQport(pset.db));
printSSLInfo();
-
- PQconninfoFree(connOptions);
}
}