]> begriffs open source - ai-pg/blob - full-docs/txt/sql-unlisten.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-unlisten.txt
1
2 UNLISTEN
3
4    UNLISTEN — stop listening for a notification
5
6 Synopsis
7
8 UNLISTEN { channel | * }
9
10 Description
11
12    UNLISTEN is used to remove an existing registration for NOTIFY events.
13    UNLISTEN cancels any existing registration of the current PostgreSQL
14    session as a listener on the notification channel named channel. The
15    special wildcard * cancels all listener registrations for the current
16    session.
17
18    NOTIFY contains a more extensive discussion of the use of LISTEN and
19    NOTIFY.
20
21 Parameters
22
23    channel
24           Name of a notification channel (any identifier).
25
26    *
27           All current listen registrations for this session are cleared.
28
29 Notes
30
31    You can unlisten something you were not listening for; no warning or
32    error will appear.
33
34    At the end of each session, UNLISTEN * is automatically executed.
35
36    A transaction that has executed UNLISTEN cannot be prepared for
37    two-phase commit.
38
39 Examples
40
41    To make a registration:
42 LISTEN virtual;
43 NOTIFY virtual;
44 Asynchronous notification "virtual" received from server process with PID 8448.
45
46    Once UNLISTEN has been executed, further NOTIFY messages will be
47    ignored:
48 UNLISTEN virtual;
49 NOTIFY virtual;
50 -- no NOTIFY event is received
51
52 Compatibility
53
54    There is no UNLISTEN command in the SQL standard.
55
56 See Also
57
58    LISTEN, NOTIFY