Commit 5ed45ac0 authored by Bruce Momjian's avatar Bruce Momjian

Adjust libpq docs to be clearer about 'hostaddr' usage by rewording and

using an itemized list.
parent 97116ca4
...@@ -164,22 +164,36 @@ PGconn *PQconnectdbParams(const char **keywords, const char **values, int expand ...@@ -164,22 +164,36 @@ PGconn *PQconnectdbParams(const char **keywords, const char **values, int expand
Using <literal>hostaddr</> instead of <literal>host</> allows the Using <literal>hostaddr</> instead of <literal>host</> allows the
application to avoid a host name look-up, which might be important application to avoid a host name look-up, which might be important
in applications with time constraints. However, a host name is in applications with time constraints. However, a host name is
required for Kerberos, GSSAPI, or SSPI authentication, as well as required for Kerberos, GSSAPI, or SSPI authentication
for full SSL certificate verification. The following rules are methods, as well as for <literal>verify-full</> SSL
used: certificate verification. The following rules are used:
If <literal>host</> is specified without <literal>hostaddr</>, <itemizedlist>
a host name lookup occurs. <listitem>
If <literal>hostaddr</> is specified without <literal>host</>, <para>
the value for <literal>hostaddr</> gives the server network address. If <literal>host</> is specified without <literal>hostaddr</>,
The connection attempt will fail in any of the cases where a a host name lookup occurs.
host name is required. </para>
If both <literal>host</> and <literal>hostaddr</> are specified, </listitem>
the value for <literal>hostaddr</> gives the server network address. <listitem>
The value for <literal>host</> is ignored unless needed for <para>
authentication or verification purposes, in which case it will be If <literal>hostaddr</> is specified without <literal>host</>,
used as the host name. Note that authentication is likely to fail the value for <literal>hostaddr</> gives the server network address.
if <literal>host</> is not the name of the machine at The connection attempt will fail if the authentication
<literal>hostaddr</>. method requires a host name.
</para>
</listitem>
<listitem>
<para>
If both <literal>host</> and <literal>hostaddr</> are specified,
the value for <literal>hostaddr</> gives the server network address.
The value for <literal>host</> is ignored unless the
authentication method requires it, in which case it will be
used as the host name.
</para>
</listitem>
</itemizedlist>
Note that authentication is likely to fail if <literal>host</>
is not the name of the server at network address <literal>hostaddr</>.
Also, note that <literal>host</> rather than <literal>hostaddr</> Also, note that <literal>host</> rather than <literal>hostaddr</>
is used to identify the connection in <filename>~/.pgpass</> (see is used to identify the connection in <filename>~/.pgpass</> (see
<xref linkend="libpq-pgpass">). <xref linkend="libpq-pgpass">).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment