pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: libpq: PQhost to return active connected host or hostaddr
Date: Tue, 27 Mar 2018 16:34:08 +0000
Message-ID: <E1f0rY0-0004Yv-MX@gemulon.postgresql.org> (raw)

libpq: PQhost to return active connected host or hostaddr

Previously, PQhost didn't return the connected host details when the
connection type was CHT_HOST_ADDRESS (i.e., via hostaddr).  Instead, it
returned the complete host connection parameter (which could contain
multiple hosts) or the default host details, which was confusing and
arguably incorrect.

Change this to return the actually connected host or hostaddr
irrespective of the connection type.  When hostaddr but no host was
specified, hostaddr is now returned.  Never return the original host
connection parameter, and document that PQhost cannot be relied on
before the connection is established.

PQport is similarly changed to always return the active connection port
and never the original connection parameter.

Author: Hari Babu <kommi.haribabu@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Reviewed-by: David G. Johnston <david.g.johnston@gmail.com>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1944cdc98273dbb8439ad9b387ca2858531afcf0

Modified Files
--------------
doc/src/sgml/libpq.sgml           | 48 +++++++++++++++++++++++++++++++++++++--
src/interfaces/libpq/fe-connect.c | 25 ++++++++++----------
2 files changed, 59 insertions(+), 14 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1f0rY0-0004Yv-MX@gemulon.postgresql.org>
Permalink:  ../E1f0rY0-0004Yv-MX@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1f0rY0-0004Yv-MX@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter_e@gmx.net
  Subject: Re: pgsql: libpq: PQhost to return active connected host or hostaddr
  In-Reply-To: <E1f0rY0-0004Yv-MX@gemulon.postgresql.org>
  References: <E1f0rY0-0004Yv-MX@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox