listen.7
来自「PostgreSQL 8.2中增加了很多企业用户所需要的功能和性能上的提高,其开」· 7 代码 · 共 66 行
7
66 行
.\\" auto-generated by docbook2man-spec $Revision: 1.1.1.1 $.TH "LISTEN" "" "2008-01-03" "SQL - Language Statements" "SQL Commands".SH NAMELISTEN \- listen for a notification.SH SYNOPSIS.sp.nfLISTEN \fIname\fR.sp.fi.SH "DESCRIPTION".PP\fBLISTEN\fR registers the current session as alistener on the notification condition \fIname\fR.If the current session is already registered as a listener forthis notification condition, nothing is done..PPWhenever the command \fBNOTIFY \fIname\fB\fR is invoked, eitherby this session or another one connected to the same database, allthe sessions currently listening on that notification condition arenotified, and each will in turn notify its connected clientapplication. See the discussion of \fBNOTIFY\fR formore information..PPA session can be unregistered for a given notify condition with the\fBUNLISTEN\fR command. A session's listenregistrations are automatically cleared when the session ends..PPThe method a client application must use to detect notification events depends onwhich PostgreSQL application programming interface ituses. With the \fBlibpq\fR library, the application issues\fBLISTEN\fR as an ordinary SQL command, and then mustperiodically call the function \fBPQnotifies\fR to find outwhether any notification events have been received. Other interfaces such as\fBlibpgtcl\fR provide higher-level methods for handling notify events; indeed,with \fBlibpgtcl\fR the application programmer should not even issue\fBLISTEN\fR or \fBUNLISTEN\fR directly. See thedocumentation for the interface you are using for more details..PPNOTIFY [\fBnotify\fR(7)]contains a more extensivediscussion of the use of \fBLISTEN\fR and\fBNOTIFY\fR..SH "PARAMETERS".TP\fB\fIname\fB\fRName of a notify condition (any identifier)..SH "EXAMPLES".PPConfigure and execute a listen/notify sequence from\fBpsql\fR:.sp.nfLISTEN virtual;NOTIFY virtual;Asynchronous notification "virtual" received from server process with PID 8448..sp.fi.SH "COMPATIBILITY".PPThere is no \fBLISTEN\fR statement in the SQLstandard..SH "SEE ALSO"NOTIFY [\fBnotify\fR(7)], UNLISTEN [\fBunlisten\fR(l)]
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?