> I would instead queue messages (or suitable information about them) in> a table, and have a process outside PostgreSQL periodically poll for them
Why poll when you can wait?
http://stream.boxwatch.ru/docs/8.2/interactive/sql-notify.html