1999-07-22 17:09:15 +02:00
|
|
|
<!--
|
2001-09-13 17:55:24 +02:00
|
|
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/unlisten.sgml,v 1.16 2001/09/13 15:55:24 petere Exp $
|
1999-07-22 17:09:15 +02:00
|
|
|
Postgres documentation
|
|
|
|
-->
|
|
|
|
|
1999-07-14 22:32:59 +02:00
|
|
|
<refentry id="SQL-UNLISTEN">
|
|
|
|
<refmeta>
|
|
|
|
<refentrytitle>
|
|
|
|
UNLISTEN
|
|
|
|
</refentrytitle>
|
|
|
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
|
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
|
|
|
<refname>
|
|
|
|
UNLISTEN
|
|
|
|
</refname>
|
|
|
|
<refpurpose>
|
2001-09-03 14:57:50 +02:00
|
|
|
stop listening for a notification
|
1999-07-14 22:32:59 +02:00
|
|
|
</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<refsynopsisdivinfo>
|
|
|
|
<date>1998-10-19</date>
|
|
|
|
</refsynopsisdivinfo>
|
|
|
|
<synopsis>
|
|
|
|
UNLISTEN { <replaceable class="PARAMETER">notifyname</replaceable> | * }
|
|
|
|
</synopsis>
|
|
|
|
|
|
|
|
<refsect2 id="R2-SQL-UNLISTEN-1">
|
|
|
|
<refsect2info>
|
|
|
|
<date>1998-10-19</date>
|
|
|
|
</refsect2info>
|
|
|
|
<title>
|
|
|
|
Inputs
|
|
|
|
</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="PARAMETER">notifyname</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Name of previously registered notify condition.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><literal>*</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
All current listen registrations for this backend are cleared.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect2>
|
|
|
|
|
|
|
|
<refsect2 id="R2-SQL-UNLISTEN-2">
|
|
|
|
<refsect2info>
|
|
|
|
<date>1998-10-19</date>
|
|
|
|
</refsect2info>
|
|
|
|
<title>
|
|
|
|
Outputs
|
|
|
|
</title>
|
|
|
|
<para>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><computeroutput>
|
1998-10-08 02:19:13 +02:00
|
|
|
<returnvalue>UNLISTEN</returnvalue>
|
1999-07-14 22:32:59 +02:00
|
|
|
</computeroutput></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2000-10-05 21:48:34 +02:00
|
|
|
Acknowledgment that statement has executed.
|
1999-07-14 22:32:59 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect2>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1 id="R1-SQL-UNLISTEN-1">
|
|
|
|
<refsect1info>
|
|
|
|
<date>1998-10-19</date>
|
|
|
|
</refsect1info>
|
|
|
|
<title>
|
|
|
|
Description
|
|
|
|
</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<command>UNLISTEN</command>
|
|
|
|
is used to remove an existing <command>NOTIFY</command> registration.
|
|
|
|
UNLISTEN cancels any existing registration of the current
|
|
|
|
<productname>Postgres</productname> session as a listener on the notify
|
|
|
|
condition <replaceable class="PARAMETER">notifyname</replaceable>.
|
2001-09-13 17:55:24 +02:00
|
|
|
The special condition wildcard <literal>*</literal> cancels all listener registrations
|
1999-07-14 22:32:59 +02:00
|
|
|
for the current session.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2000-12-26 00:15:27 +01:00
|
|
|
<xref endterm="sql-notify-title" linkend="sql-notify">
|
1999-07-14 22:32:59 +02:00
|
|
|
contains a more extensive
|
|
|
|
discussion of the use of <command>LISTEN</command> and
|
|
|
|
<command>NOTIFY</command>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<refsect2 id="R2-SQL-UNLISTEN-3">
|
|
|
|
<refsect2info>
|
|
|
|
<date>1998-10-19</date>
|
|
|
|
</refsect2info>
|
|
|
|
<title>
|
|
|
|
Notes
|
|
|
|
</title>
|
|
|
|
<para>
|
2001-01-14 00:58:55 +01:00
|
|
|
<replaceable class="PARAMETER">notifyname</replaceable>
|
2000-10-05 21:48:34 +02:00
|
|
|
need not be a valid class name but can be any string valid
|
1999-07-14 22:32:59 +02:00
|
|
|
as a name up to 32 characters long.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The backend does not complain if you UNLISTEN something you were not
|
|
|
|
listening for.
|
|
|
|
Each backend will automatically execute <command>UNLISTEN *</command> when
|
|
|
|
exiting.
|
|
|
|
</para>
|
|
|
|
</refsect2>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 id="R1-SQL-UNLISTEN-2">
|
|
|
|
<title>
|
|
|
|
Usage
|
|
|
|
</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
To subscribe to an existing registration:
|
|
|
|
|
2000-03-26 20:32:30 +02:00
|
|
|
<programlisting>
|
2000-07-21 06:49:23 +02:00
|
|
|
LISTEN virtual;
|
1998-10-08 02:19:13 +02:00
|
|
|
LISTEN
|
2000-07-21 06:49:23 +02:00
|
|
|
NOTIFY virtual;
|
1998-10-08 02:19:13 +02:00
|
|
|
NOTIFY
|
2000-03-26 20:32:30 +02:00
|
|
|
Asynchronous NOTIFY 'virtual' from backend with pid '8448' received
|
|
|
|
</programlisting>
|
1999-07-14 22:32:59 +02:00
|
|
|
</para>
|
1998-10-21 07:34:12 +02:00
|
|
|
|
1999-07-14 22:32:59 +02:00
|
|
|
<para>
|
|
|
|
Once UNLISTEN has been executed, further NOTIFY commands will be
|
|
|
|
ignored:
|
|
|
|
|
2000-03-26 20:32:30 +02:00
|
|
|
<programlisting>
|
2000-07-21 06:48:33 +02:00
|
|
|
UNLISTEN virtual;
|
1998-10-08 02:19:13 +02:00
|
|
|
UNLISTEN
|
2000-07-21 06:48:33 +02:00
|
|
|
NOTIFY virtual;
|
1998-10-08 02:19:13 +02:00
|
|
|
NOTIFY
|
|
|
|
-- notice no NOTIFY event is received
|
2000-03-26 20:32:30 +02:00
|
|
|
</programlisting>
|
1999-07-14 22:32:59 +02:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 id="R1-SQL-UNLISTEN-3">
|
|
|
|
<title>
|
|
|
|
Compatibility
|
|
|
|
</title>
|
|
|
|
|
|
|
|
<refsect2 id="R2-SQL-UNLISTEN-4">
|
|
|
|
<refsect2info>
|
|
|
|
<date>1998-10-19</date>
|
|
|
|
</refsect2info>
|
|
|
|
<title>
|
|
|
|
SQL92
|
|
|
|
</title>
|
|
|
|
<para>
|
|
|
|
There is no <command>UNLISTEN</command> in <acronym>SQL92</acronym>.
|
|
|
|
</para>
|
|
|
|
</refsect2>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:nil
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../reference.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
-->
|