aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2019-06-14 18:02:26 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2019-06-14 18:02:26 -0400
commit313f56ce2d1b9dfd3483e4f39611baa27852835a (patch)
treeb2c9aa2846217496234412dbb3927d783ade79f6 /doc/src
parent3da73d6839dc47f1f47ca57974bf28e5abd9b572 (diff)
downloadpostgresql-313f56ce2d1b9dfd3483e4f39611baa27852835a.tar.gz
postgresql-313f56ce2d1b9dfd3483e4f39611baa27852835a.zip
Tweak libpq's PQhost, PQhostaddr, and psql's \connect
Fixes some problems introduced by 6e5f8d489acc: * When reusing conninfo data from the previous connection in \connect, the host address should only be reused if it was specified as hostaddr; if it wasn't, then 'host' is resolved afresh. We were reusing the same IP address, which ignores a possible DNS change as well as any other addresses that the name resolves to than the one that was used in the original connection. * PQhost, PQhostaddr: Don't present user-specified hostaddr when we have an inet_net_ntop-produced equivalent address. The latter has been put in canonical format, which is cleaner (so it produces "127.0.0.1" when given "host=2130706433", for example). * Document the hostaddr-reusing aspect of \connect. * Fix some code comments Author: Fabien Coelho Reported-by: Noah Misch Discussion: https://postgr.es/m/20190527203713.GA58392@gust.leadboat.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/psql-ref.sgml3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index b86764003d3..c6c20de2434 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -911,6 +911,9 @@ testdb=&gt;
<replaceable class="parameter">host</replaceable> or
<replaceable class="parameter">port</replaceable>
as <literal>-</literal> is equivalent to omitting that parameter.
+ If <literal>hostaddr</literal> was specified in the original
+ connection's <structname>conninfo</structname>, that address is reused
+ for the new connection (disregarding any other host specification).
</para>
<para>