Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / doc / src / sgml / ref / unlisten.sgml
bloba822b836bff1c16a3338b8e79a74971b90aecdae
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-UNLISTEN">
7 <refmeta>
8 <refentrytitle id="SQL-UNLISTEN-TITLE">UNLISTEN</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>UNLISTEN</refname>
15 <refpurpose>stop listening for a notification</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-unlisten">
19 <primary>UNLISTEN</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 UNLISTEN { <replaceable class="PARAMETER">name</replaceable> | * }
25 </synopsis>
26 </refsynopsisdiv>
28 <refsect1>
29 <title>Description</title>
31 <para>
32 <command>UNLISTEN</command> is used to remove an existing
33 registration for <command>NOTIFY</command> events.
34 <command>UNLISTEN</command> cancels any existing registration of
35 the current <productname>PostgreSQL</productname> session as a
36 listener on the notification <replaceable
37 class="PARAMETER">name</replaceable>. The special wildcard
38 <literal>*</literal> cancels all listener registrations for the
39 current session.
40 </para>
42 <para>
43 <xref endterm="sql-notify-title" linkend="sql-notify">
44 contains a more extensive
45 discussion of the use of <command>LISTEN</command> and
46 <command>NOTIFY</command>.
47 </para>
48 </refsect1>
50 <refsect1>
51 <title>Parameters</title>
53 <variablelist>
54 <varlistentry>
55 <term><replaceable class="PARAMETER">name</replaceable></term>
56 <listitem>
57 <para>
58 Name of a notification (any identifier).
59 </para>
60 </listitem>
61 </varlistentry>
63 <varlistentry>
64 <term><literal>*</literal></term>
65 <listitem>
66 <para>
67 All current listen registrations for this session are cleared.
68 </para>
69 </listitem>
70 </varlistentry>
71 </variablelist>
72 </refsect1>
74 <refsect1>
75 <title>Notes</title>
77 <para>
78 You can unlisten something you were not listening for; no warning or error
79 will appear.
80 </para>
82 <para>
83 At the end of each session, <command>UNLISTEN *</command> is
84 automatically executed.
85 </para>
86 </refsect1>
88 <refsect1>
89 <title>Examples</title>
91 <para>
92 To make a registration:
94 <programlisting>
95 LISTEN virtual;
96 NOTIFY virtual;
97 Asynchronous notification "virtual" received from server process with PID 8448.
98 </programlisting>
99 </para>
101 <para>
102 Once <command>UNLISTEN</> has been executed, further <command>NOTIFY</>
103 commands will be ignored:
105 <programlisting>
106 UNLISTEN virtual;
107 NOTIFY virtual;
108 -- no NOTIFY event is received
109 </programlisting>
110 </para>
111 </refsect1>
113 <refsect1>
114 <title>Compatibility</title>
116 <para>
117 There is no <command>UNLISTEN</command> command in the SQL standard.
118 </para>
119 </refsect1>
121 <refsect1>
122 <title>See Also</title>
124 <simplelist type="inline">
125 <member><xref linkend="sql-listen" endterm="sql-listen-title"></member>
126 <member><xref linkend="sql-notify" endterm="sql-notify-title"></member>
127 </simplelist>
128 </refsect1>
129 </refentry>