From: Robert Haas Date: Fri, 6 Nov 2015 05:31:03 +0000 (-0500) Subject: Document interaction of bgworkers with LISTEN/NOTIFY. X-Git-Tag: REL9_6_BETA1~1134 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dde5f09fad3ac188a155e21667f76825f43a28c8;p=thirdparty%2Fpostgresql.git Document interaction of bgworkers with LISTEN/NOTIFY. Thomas Munro and Robert Haas, reviewed by Haribabu Kommi --- diff --git a/doc/src/sgml/bgworker.sgml b/doc/src/sgml/bgworker.sgml index 505e362879a..5570ed045db 100644 --- a/doc/src/sgml/bgworker.sgml +++ b/doc/src/sgml/bgworker.sgml @@ -277,6 +277,18 @@ typedef struct BackgroundWorker BGWH_POSTMASTER_DIED. + + If a background worker sends asynchronous notifications with the + NOTIFY command via the Server Programming Interface + (SPI), it should call + ProcessCompletedNotifies explicitly after committing + the enclosing transaction so that any notifications can be delivered. If a + background worker registers to receive asynchronous notifications with + the LISTEN through SPI, the worker + will log those notifications, but there is no programmatic way for the + worker to intercept and respond to those notifications. + + The worker_spi contrib module contains a working example, which demonstrates some useful techniques.