yohgaki         Fri Oct 18 06:25:55 2002 EDT

  Added files:                 
    /phpdoc/en/reference/pgsql/functions        pg-get-notify.xml 
                                                pg-get-pid.xml 
  Log:
  Added new functions
  
  

Index: phpdoc/en/reference/pgsql/functions/pg-get-notify.xml
+++ phpdoc/en/reference/pgsql/functions/pg-get-notify.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
  <refentry id="function.pg-get-notify">
   <refnamediv>
    <refname>pg_get_notify</refname>
    <refpurpose>Ping database connection</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>pg_get_notify</methodname>
      <methodparam><type>resource</type><parameter>connection</parameter></methodparam>
      <methodparam 
choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
     </methodsynopsis>
    <para>
     <function>pg_get_notify</function> gets notify message sent by
     <literal>NOTIFY</literal> SQL command. To recieve nofigy
     messages, <literal>LISTEN</literal> SQL command must be
     issued. If there is notify message on the connection, array
     contains message name and backend PID is returned. If there is no
     message, &false; is returned.
    </para>
    <para>
     See also <function>pg_get_pid</function>
    </para>
    <para>
     <example>
      <title>PostgreSQL NOTIFY message</title>
      <programlisting role="php">
<![CDATA[
<?php 
$conn = pg_pconnect ("dbname=publisher");
if (!$conn) {
    echo "An error occured.\n";
    exit;
}

// Listen 'author_updated' message from other processes
pq_query($conn, 'LISTEN author_updated;');
$notify = pg_get_notify($conn);
if (!$notify)
    print("No messages\n");
else
    print_r($notify);
?>
]]>
      </programlisting>
     </example>
    </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:"../../../../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
-->

Index: phpdoc/en/reference/pgsql/functions/pg-get-pid.xml
+++ phpdoc/en/reference/pgsql/functions/pg-get-pid.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
  <refentry id="function.pg-get-pid">
   <refnamediv>
    <refname>pg_get_pid</refname>
    <refpurpose>Ping database connection</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>pg_get_pid</methodname>
      <methodparam><type>resource</type><parameter>connection</parameter></methodparam>
     </methodsynopsis>
    <para>
     <function>pg_get_pid</function> gets backend (database server
     process) PID. PID is useful to check if <literal>NOTIFY</literal>
     message is sent from other process or not.
    </para>
    <para>
     See also <function>pg_get_notify</function>
    </para>
    <para>
     <example>
      <title>PostgreSQL backend PID</title>
      <programlisting role="php">
<![CDATA[
<?php 
$conn = pg_pconnect ("dbname=publisher");
if (!$conn) {
    echo "An error occured.\n";
    exit;
}

// Backend process PID. Use PID with pg_get_notify()
$pid = pg_get_pid($conn);
?>
]]>
      </programlisting>
     </example>
    </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:"../../../../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
-->



-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to