- Overhaul another bunch of pgsql extension manual pages

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@184384 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christopher Kings-Lynne 2005-04-15 08:40:12 +00:00
parent 7fac11363b
commit f30ce366b6
9 changed files with 414 additions and 46 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- $Revision: 1.13 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.82 -->
<refentry id="function.pg-close">
<refnamediv>
@ -31,7 +31,7 @@
</para>
</refsect1>
<refsect1 role="parameters">
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
<refentry id="function.pg-dbname">
<refnamediv>
@ -11,16 +11,42 @@
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>pg_dbname</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_dbname</function> returns the name of the database
that the given PostgreSQL <parameter>connection</parameter>
resource. It returns &false;, if <parameter>connection</parameter>
is not a valid PostgreSQL connection resource.
resource.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
PostgreSQL database connection resource. When
<parameter>connection</parameter> is not present, the default connection
is used. The default connection is the last connection made by
<function>pg_connect</function> or <function>pg_pconnect</function>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
A <type>string</type> containing the name of the database the
<parameter>connection</parameter> is to, or &false; on error.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
<refentry id="function.pg-host">
<refnamediv>
@ -13,7 +13,7 @@
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>pg_host</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_host</function> returns the host name of the given
@ -22,6 +22,56 @@
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
PostgreSQL database connection resource. When
<parameter>connection</parameter> is not present, the default connection
is used. The default connection is the last connection made by
<function>pg_connect</function> or <function>pg_pconnect</function>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
A <type>string</type> containing the name of the host the
<parameter>connection</parameter> is to, or &false; on error.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>pg_host</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$pgsql_conn = pg_connect("dbname=mark host=localhost");
if ($pgsql_conn) {
print "Successfully connected to: " . pg_host($pgsql_conn) . "<br/>\n";
} else {
print pg_last_error($pgsql_conn);
exit;
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
<refentry id="function.pg-options">
<refnamediv>
@ -11,7 +11,7 @@
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>pg_options</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_options</function> will return a string containing
@ -19,6 +19,59 @@
<parameter>connection</parameter> resource.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
PostgreSQL database connection resource. When
<parameter>connection</parameter> is not present, the default connection
is used. The default connection is the last connection made by
<function>pg_connect</function> or <function>pg_pconnect</function>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
A <type>string</type> containing the <parameter>connection</parameter>
options, or &false; on error.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>pg_options</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$pgsql_conn = pg_connect("dbname=mark host=localhost");
echo pg_options($pgsql_conn);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>pg_connect</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
<refentry id="function.pg-ping">
<refnamediv>
@ -11,15 +11,40 @@
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>pg_ping</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_ping</function> ping database connection, try to
reconnect if it is broken. It returns &true; if connection is
alive, otherwise &false;.
<function>pg_ping</function> pings a database connection and tries to
reconnect it if it is broken.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
PostgreSQL database connection resource. When
<parameter>connection</parameter> is not present, the default connection
is used. The default connection is the last connection made by
<function>pg_connect</function> or <function>pg_pconnect</function>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.20 -->
<refentry id="function.pg-port">
<refnamediv>
@ -13,7 +13,7 @@
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>pg_port</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_port</function> returns the port number that the
@ -21,6 +21,57 @@
connected to.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
PostgreSQL database connection resource. When
<parameter>connection</parameter> is not present, the default connection
is used. The default connection is the last connection made by
<function>pg_connect</function> or <function>pg_pconnect</function>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
An <type>int</type> containing the port number of the database
server the <parameter>connection</parameter> is to,
or &false; on error.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>pg_port</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$pgsql_conn = pg_connect("dbname=mark host=localhost");
if ($pgsql_conn) {
print "Successfully connected to port: " . pg_port($pgsql_conn) . "<br/>\n";
} else {
print pg_last_error($pgsql_conn);
exit;
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.7 -->
<refentry id="function.pg-trace">
<refnamediv>
@ -17,30 +17,89 @@
</methodsynopsis>
<para>
<function>pg_trace</function> enables tracing of the PostgreSQL
frontend/backend communication to a debugging file specified as
<parameter>pathname</parameter>. To fully understand the results,
frontend/backend communication to a file. To fully understand the results,
one needs to be familiar with the internals of PostgreSQL
communication protocol. For those who are not, it can still be
communication protocol.
</para>
<para>For those who are not, it can still be
useful for tracing errors in queries sent to the server, you
could do for example <command>grep '^To backend'
trace.log</command> and see what query actually were sent to the
PostgreSQL server. For more information, refer to PostgreSQL
manual.
</para>
<para>
<parameter>pathname</parameter> and <parameter>mode</parameter>
are the same as in <function>fopen</function>
(<parameter>mode</parameter> defaults to 'w'),
<parameter>connection</parameter> specifies the connection to
trace and defaults to the last one opened.
</para>
<para>
<function>pg_trace</function> returns &true; if
<parameter>pathname</parameter> could be opened for logging,
&false; otherwise.
trace.log</command> and see what queries actually were sent to the
PostgreSQL server. For more information, refer to the
<ulink url="&url.pgsql.manual;">PostgreSQL Documentation</ulink>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>pathname</parameter></term>
<listitem>
<para>
The full path and file name of the file in which to write the
trace log. Same as in <function>fopen</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>pathname</parameter></term>
<listitem>
<para>
An optional file access mode, same as for <function>fopen</function>.
Defaults to "w".
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
PostgreSQL database connection resource. When
<parameter>connection</parameter> is not present, the default connection
is used. The default connection is the last connection made by
<function>pg_connect</function> or <function>pg_pconnect</function>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>pg_trace</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$pgsql_conn = pg_connect("dbname=mark host=localhost");
if ($pgsql_conn) {
pg_trace('/tmp/trace.log', 'w', $pgsql_conn);
pg_query("SELECT 1");
pg_untrace($pgsql_conn);
// Now /tmp/trace.log will contain backend communication
} else {
print pg_last_error($pgsql_conn);
exit;
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.82 -->
<refentry id="function.pg-tty">
<refnamediv>
<refname>pg_tty</refname>
<refpurpose>
Return the tty name associated with the connection
Return the TTY name associated with the connection
</refpurpose>
</refnamediv>
@ -13,13 +13,70 @@
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>pg_tty</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_tty</function> returns the tty name that server
<function>pg_tty</function> returns the TTY name that server
side debugging output is sent to on the given PostgreSQL
<parameter>connection</parameter> resource.
</para>
<note>
<para>
<function>pg_tty</function> is obsolete, since the server no longer pays
attention to the TTY setting, but the function remains for backwards
compatibility.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
PostgreSQL database connection resource. When
<parameter>connection</parameter> is not present, the default connection
is used. The default connection is the last connection made by
<function>pg_connect</function> or <function>pg_pconnect</function>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
A <type>string</type> containing the the debug TTY of
the <parameter>connection</parameter>, or &false; on error.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>pg_tty</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$pgsql_conn = pg_connect("dbname=mark host=localhost");
if ($pgsql_conn) {
print "Server debug TTY is: " . pg_tty($pgsql_conn) . "<br/>\n";
} else {
print pg_last_error($pgsql_conn);
exit;
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.58 -->
<refentry id="function.pg-untrace">
<refnamediv>
@ -15,14 +15,61 @@
</methodsynopsis>
<para>
Stop tracing started by <function>pg_trace</function>.
<parameter>connection</parameter> specifies the connection that was
traced and defaults to the last one opened.
</para>
<para>
Returns always &true;.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
PostgreSQL database connection resource. When
<parameter>connection</parameter> is not present, the default connection
is used. The default connection is the last connection made by
<function>pg_connect</function> or <function>pg_pconnect</function>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Always returns &true;.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>pg_untrace</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$pgsql_conn = pg_connect("dbname=mark host=localhost");
if ($pgsql_conn) {
pg_trace('/tmp/trace.log', 'w', $pgsql_conn);
pg_query("SELECT 1");
pg_untrace($pgsql_conn);
// Now /tmp/trace.log will contain backend communication
} else {
print pg_last_error($pgsql_conn);
exit;
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>