1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Code review for recently-added network functions. Get it to work when

log_hostname is enabled, clean up documentation.
This commit is contained in:
Tom Lane
2004-06-13 19:56:52 +00:00
parent 88961fc45d
commit ba0f9ff3ba
4 changed files with 192 additions and 135 deletions

View File

@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.206 2004/06/02 21:34:49 momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.207 2004/06/13 19:56:49 tgl Exp $
PostgreSQL documentation
-->
@ -6609,25 +6609,25 @@ SELECT NULLIF(value, '(none)') ...
</row>
<row>
<entry><function>inet_client_addr</function></entry>
<entry><function>inet_client_addr()</function></entry>
<entry><type>inet</type></entry>
<entry>address of the remote connection</entry>
</row>
<row>
<entry><function>inet_client_port</function></entry>
<entry><function>inet_client_port()</function></entry>
<entry><type>int4</type></entry>
<entry>port of the remote connection</entry>
</row>
<row>
<entry><function>inet_server_addr</function></entry>
<entry><function>inet_server_addr()</function></entry>
<entry><type>inet</type></entry>
<entry>address of the local connection</entry>
</row>
<row>
<entry><function>inet_server_port</function></entry>
<entry><function>inet_server_port()</function></entry>
<entry><type>int4</type></entry>
<entry>port of the local connection</entry>
</row>
@ -6687,17 +6687,6 @@ SELECT NULLIF(value, '(none)') ...
</para>
</note>
<para>
<function>inet_client_addr</function> and
<function>inet_server_addr</function> return the IPv4 or IPv6 (if
configured) address of the remote or local host connecting to the
database, respectively. <function>inet_client_port</function>
and <function>inet_server_port</function> return the port number
of the remote or local host connecting to the database,
respectively. If the connection is not a network connection,
these functions will return <literal>NULL</literal>.
</para>
<para>
<function>current_schema</function> returns the name of the schema that is
at the front of the search path (or a null value if the search path is
@ -6718,6 +6707,33 @@ SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, ..
</para>
</note>
<indexterm zone="functions-misc">
<primary>inet_client_addr</primary>
</indexterm>
<indexterm zone="functions-misc">
<primary>inet_client_port</primary>
</indexterm>
<indexterm zone="functions-misc">
<primary>inet_server_addr</primary>
</indexterm>
<indexterm zone="functions-misc">
<primary>inet_server_port</primary>
</indexterm>
<para>
<function>inet_client_addr</function> returns the IP address of the
current client, and <function>inet_client_port</function> returns the
port number.
<function>inet_server_addr</function> returns the IP address on which
the server accepted the current connection, and
<function>inet_server_port</function> returns the port number.
All these functions return NULL if the connection is via a Unix-domain
socket.
</para>
<indexterm zone="functions-misc">
<primary>version</primary>
</indexterm>