@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.289.2.2 2010/06/17 16:03:36 tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.289.2.3 2010/07/14 17:10:02 tgl Exp $ -->
<chapter id="libpq">
<chapter id="libpq">
<title><application>libpq</application> - C Library</title>
<title><application>libpq</application> - C Library</title>
@ -157,22 +157,26 @@
<para>
<para>
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 in
application to avoid a host name look-up, which might be important
applications with time constraints. However, Kerberos and GSSAPI authentication
in applications with time constraints. However, a host name is
requires the host name. The following therefore applies: If
required for Kerberos, GSSAPI, or SSPI authentication, as well as
<literal>host</> is specified without <literal>hostaddr</>, a host name
for full SSL certificate verification. The following rules are
lookup occurs. If <literal>hostaddr</> is specified without
used:
<literal>host</>, the value for <literal>hostaddr</> gives the remote
If <literal>host</> is specified without <literal>hostaddr</>,
address. When Kerberos is used, a reverse name query occurs to obtain
a host name lookup occurs.
the host name for Kerberos. If both
If <literal>hostaddr</> is specified without <literal>host</>,
<literal>host</> and <literal>hostaddr</> are specified, the value for
the value for <literal>hostaddr</> gives the server address.
<literal>hostaddr</> gives the remote address; the value for
The connection attempt will fail in any of the cases where a
<literal>host</> is ignored, unless Kerberos is used, in which case that
host name is required.
value is used for Kerberos authentication. (Note that authentication is
If both <literal>host</> and <literal>hostaddr</> are specified,
likely to fail if <application>libpq</application> is passed a host name
the value for <literal>hostaddr</> gives the server address.
that is not the name of the machine at <literal>hostaddr</>.) Also,
The value for <literal>host</> is ignored unless needed for
<literal>host</> rather than <literal>hostaddr</> is used to identify
authentication or verification purposes, in which case it will be
the connection in <filename>~/.pgpass</> (see
used as the host name. Note that authentication is likely to fail
if <literal>host</> is not the name of the machine at
<literal>hostaddr</>.
Also, note that <literal>host</> rather than <literal>hostaddr</>
is used to identify the connection in <filename>~/.pgpass</> (see
<xref linkend="libpq-pgpass">).
<xref linkend="libpq-pgpass">).
</para>
</para>