michaelpq/pg_workers — pull request #1 by legendetm (2013-11-30 11:10:26+00:00)
Title: An example of how to send out notifications in pg_worker

I wanted to build pg_worker that will send out notifications based on your examples and it took me a long time to figure it out, why my notifications were not sent out to clients. So I made an example.

If your query generates notifications, you need to call **ProcessCompletedNotifies()** after the transaction to send them out.

Another issue I faced, was that NOW() always returned the start time of pg_worker, not the start time of transaction, to fix that you need to call **SetCurrentStatementStartTimestamp()** before **StartTransactionCommand()**