GNU/Linux |
RedHat 5.2(Apollo) |
|
![]() |
listen(l) |
![]() |
listen - listen for notification on a relation
listen class_name
listen is used to register the current backend as a listener on the relation class_name. When the command notify class_name is called either from within a rule or at the query level, the frontend applications corresponding to the listening backends are notified. When the backend process exits, this registration is cleared.
This event notification is performed through the Libpq protocol and frontend application interface. The application program must explicitly poll a Libpq global variable, PQAsyncNotifyWaiting, and call the routine PQnotifies in order to find out the name of the class to which a given notification corresponds. If this code is not included in the application, the event notification will be queued and never be processed.
create rule(l), notify(l), select(l), libpq.
There is no way to un-listen except to drop the connection (i.e., restart the backend server).
The monitor(1) command does not poll for asynchronous events.
![]() |
listen(l) | ![]() |