Skip to content

Commit 2cda889

Browse files
committed
Revert "Add libpq function PQhostaddr()."
This reverts commit 9f80f48. The function returned the raw value of a connection parameter, a task served by PQconninfo(). The next commit will reimplement the psql \conninfo change that way. Back-patch to 9.4, where that commit first appeared.
1 parent 816e10d commit 2cda889

File tree

5 files changed

+1
-29
lines changed

5 files changed

+1
-29
lines changed

doc/src/sgml/libpq.sgml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,24 +1467,6 @@ char *PQhost(const PGconn *conn);
14671467
</listitem>
14681468
</varlistentry>
14691469

1470-
<varlistentry id="libpq-pqhostaddr">
1471-
<term>
1472-
<function>PQhostaddr</function>
1473-
<indexterm>
1474-
<primary>PQhostaddr</primary>
1475-
</indexterm>
1476-
</term>
1477-
1478-
<listitem>
1479-
<para>
1480-
Returns the server numeric IP address of the connection.
1481-
<synopsis>
1482-
char *PQhostaddr(const PGconn *conn);
1483-
</synopsis>
1484-
</para>
1485-
</listitem>
1486-
</varlistentry>
1487-
14881470
<varlistentry id="libpq-pqport">
14891471
<term>
14901472
<function>PQport</function>

src/bin/psql/command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ exec_command(const char *cmd,
302302
else if (strcmp(cmd, "conninfo") == 0)
303303
{
304304
char *db = PQdb(pset.db);
305-
char *host = (PQhostaddr(pset.db) != NULL) ? PQhostaddr(pset.db) : PQhost(pset.db);
305+
char *host = PQhost(pset.db);
306306

307307
if (db == NULL)
308308
printf(_("You are currently not connected to a database.\n"));

src/interfaces/libpq/exports.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,3 @@ lo_lseek64 162
165165
lo_tell64 163
166166
lo_truncate64 164
167167
PQconninfo 165
168-
PQhostaddr 166

src/interfaces/libpq/fe-connect.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5340,14 +5340,6 @@ PQhost(const PGconn *conn)
53405340
}
53415341
}
53425342

5343-
char *
5344-
PQhostaddr(const PGconn *conn)
5345-
{
5346-
if (!conn)
5347-
return NULL;
5348-
return conn->pghostaddr;
5349-
}
5350-
53515343
char *
53525344
PQport(const PGconn *conn)
53535345
{

src/interfaces/libpq/libpq-fe.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ extern char *PQdb(const PGconn *conn);
301301
extern char *PQuser(const PGconn *conn);
302302
extern char *PQpass(const PGconn *conn);
303303
extern char *PQhost(const PGconn *conn);
304-
extern char *PQhostaddr(const PGconn *conn);
305304
extern char *PQport(const PGconn *conn);
306305
extern char *PQtty(const PGconn *conn);
307306
extern char *PQoptions(const PGconn *conn);

0 commit comments

Comments
 (0)