php-doc-en/reference/pgsql/functions/pg-version.xml
2011-08-16 11:38:58 +00:00

111 lines
2.8 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.pg-version" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>pg_version</refname>
<refpurpose>
Returns an array with client, protocol and server version (when available)
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>pg_version</methodname>
<methodparam choice="opt"><type>resource</type><parameter>connection</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_version</function> returns an array with the client, protocol
and server version. Protocol and server versions are only available if PHP
was compiled with PostgreSQL 7.4 or later.
</para>
<para>
For more detailed server information, use <function>pg_parameter_status</function>.
</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>
Returns an array with <literal>client</literal>, <literal>protocol</literal>
and <literal>server</literal> keys and values (if available). Returns
&false; on error or invalid connection.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>pg_version</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$dbconn = pg_connect("host=localhost port=5432 dbname=mary")
or die("Could not connect");
$v = pg_version($dbconn);
echo $v['client'];
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
7.4
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>pg_parameter_status</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->