Table of Contents

NAME

notify -- signal all frontends and backends listening on a class

SYNOPSIS

notify class_name

DESCRIPTION

notify is used to awaken all backends and consequently all frontends that have executed listen(l) on class_name. This can be used either within an instance-level rule as part of the action body or from a normal query. When used from within a normal query, this can be thought of as interprocess communication (IPC). When used from within a rule, this can be thought of as an alerter mechanism.

Notice that the mere fact that a notify has been executed does not imply anything in particular about the state of the class (e.g., that it has been updated), nor does the notification protocol transmit any useful information other than the class name. Therefore, all notify does is indicate that some backend wishes its peers to examine class_name in some application-specific way.

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.

SEE ALSO

define rule(l) , listen(l) , libpq.


Table of Contents