~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-updates

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
'\" t
.\"     Title: UNLISTEN
.\"    Author: The PostgreSQL Global Development Group
.\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
.\"      Date: 2011-09-08
.\"    Manual: PostgreSQL 9.1.0 Documentation
.\"    Source: PostgreSQL 9.1.0
.\"  Language: English
.\"
.TH "UNLISTEN" "7" "2011-09-08" "PostgreSQL 9.1.0" "PostgreSQL 9.1.0 Documentation"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
UNLISTEN \- stop listening for a notification
.\" UNLISTEN
.SH "SYNOPSIS"
.sp
.nf
UNLISTEN { \fIchannel\fR | * }
.fi
.SH "DESCRIPTION"
.PP

UNLISTEN
is used to remove an existing registration for
NOTIFY
events\&.
UNLISTEN
cancels any existing registration of the current
PostgreSQL
session as a listener on the notification channel named
\fIchannel\fR\&. The special wildcard
*
cancels all listener registrations for the current session\&.
.PP

\fBNOTIFY\fR(7)
contains a more extensive discussion of the use of
LISTEN
and
NOTIFY\&.
.SH "PARAMETERS"
.PP
\fIchannel\fR
.RS 4
Name of a notification channel (any identifier)\&.
.RE
.PP
*
.RS 4
All current listen registrations for this session are cleared\&.
.RE
.SH "NOTES"
.PP
You can unlisten something you were not listening for; no warning or error will appear\&.
.PP
At the end of each session,
UNLISTEN *
is automatically executed\&.
.PP
A transaction that has executed
UNLISTEN
cannot be prepared for two\-phase commit\&.
.SH "EXAMPLES"
.PP
To make a registration:
.sp
.if n \{\
.RS 4
.\}
.nf
LISTEN virtual;
NOTIFY virtual;
Asynchronous notification "virtual" received from server process with PID 8448\&.
.fi
.if n \{\
.RE
.\}
.PP
Once
UNLISTEN
has been executed, further
NOTIFY
messages will be ignored:
.sp
.if n \{\
.RS 4
.\}
.nf
UNLISTEN virtual;
NOTIFY virtual;
\-\- no NOTIFY event is received
.fi
.if n \{\
.RE
.\}
.SH "COMPATIBILITY"
.PP
There is no
UNLISTEN
command in the SQL standard\&.
.SH "SEE ALSO"
\fBLISTEN\fR(7), \fBNOTIFY\fR(7)