2 doc/src/sgml/ref/unlisten.sgml
3 PostgreSQL documentation
6 <refentry id="SQL-UNLISTEN">
8 <refentrytitle>UNLISTEN</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
14 <refname>UNLISTEN</refname>
15 <refpurpose>stop listening for a notification</refpurpose>
18 <indexterm zone="sql-unlisten">
19 <primary>UNLISTEN</primary>
24 UNLISTEN { <replaceable class="PARAMETER">channel</replaceable> | * }
29 <title>Description</title>
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 channel named <replaceable
37 class="PARAMETER">channel</replaceable>. The special wildcard
38 <literal>*</literal> cancels all listener registrations for the
43 <xref linkend="sql-notify">
44 contains a more extensive
45 discussion of the use of <command>LISTEN</command> and
46 <command>NOTIFY</command>.
51 <title>Parameters</title>
55 <term><replaceable class="PARAMETER">channel</replaceable></term>
58 Name of a notification channel (any identifier).
64 <term><literal>*</literal></term>
67 All current listen registrations for this session are cleared.
78 You can unlisten something you were not listening for; no warning or error
83 At the end of each session, <command>UNLISTEN *</command> is
84 automatically executed.
88 A transaction that has executed <command>UNLISTEN</command> cannot be
89 prepared for two-phase commit.
94 <title>Examples</title>
97 To make a registration:
102 Asynchronous notification "virtual" received from server process with PID 8448.
107 Once <command>UNLISTEN</> has been executed, further <command>NOTIFY</>
108 messages will be ignored:
113 -- no NOTIFY event is received
114 </programlisting></para>
118 <title>Compatibility</title>
121 There is no <command>UNLISTEN</command> command in the SQL standard.
126 <title>See Also</title>
128 <simplelist type="inline">
129 <member><xref linkend="sql-listen"></member>
130 <member><xref linkend="sql-notify"></member>