aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 49f389071a1..f498cdfee76 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -300,7 +300,7 @@ exec_command(const char *cmd,
else if (strcmp(cmd, "conninfo") == 0)
{
char *db = PQdb(pset.db);
- char *host = PQhost(pset.db);
+ char *host = (PQhostaddr(pset.db) != NULL) ? PQhostaddr(pset.db) : PQhost(pset.db);
if (db == NULL)
printf(_("You are currently not connected to a database.\n"));