pgsql: Add libpq function PQhostaddr().

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add libpq function PQhostaddr().
Date: 2014-01-23 17:32:48
Message-ID: E1W6O92-0005eo-UU@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add libpq function PQhostaddr().

There was a bug in the psql's meta command \conninfo. When the
IP address was specified in the hostaddr and psql used it to create
a connection (i.e., psql -d "hostaddr=xxx"), \conninfo could not
display that address. This is because \conninfo got the connection
information only from PQhost() which could not return hostaddr.

This patch adds PQhostaddr(), and changes \conninfo so that it
can display not only the host name that PQhost() returns but also
the IP address which PQhostaddr() returns.

The bug has existed since 9.1 where \conninfo was introduced.
But it's too late to add new libpq function into the released versions,
so no backpatch.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9f80f4835a55a1cbffcda5d23a617917f3286c14

Modified Files
--------------
doc/src/sgml/libpq.sgml | 18 ++++++++++++++++++
src/bin/psql/command.c | 2 +-
src/interfaces/libpq/exports.txt | 1 +
src/interfaces/libpq/fe-connect.c | 8 ++++++++
src/interfaces/libpq/libpq-fe.h | 1 +
5 files changed, 29 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2014-01-23 17:42:24 pgsql: Make DROP IF EXISTS more consistently not fail
Previous Message Andrew Dunstan 2014-01-23 17:20:44 pgsql: Allow case insensitive build version argument for MSVC.